Liferay.Loader.define("@liferay/document-library-web@6.0.111/document_library/js/FileNameInput.es",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(a("@frontend-taglib-clay$clayui/form")),n=i(a("@frontend-taglib-clay$clayui/icon")),l=i(a("liferay!frontend-js-react-web$classnames")),f=(i(a("liferay!frontend-js-react-web$prop-types")),c(a("liferay!frontend-js-react-web$react")));function i(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}const e=()=>f.default.createElement(f.default.Fragment,null,f.default.createElement("span",{className:"inline-item-after reference-mark text-warning"},f.default.createElement(n.default,{symbol:"asterisk"})),f.default.createElement("span",{className:"hide-accessible sr-only"},Liferay.Language.get("required"))),s=({message:e,warning:t})=>f.default.createElement(r.default.FeedbackGroup,null,f.default.createElement(r.default.FeedbackItem,null,t&&f.default.createElement(n.default,{className:"mr-1",symbol:"warning-full"}),e));var o=({initialValue:t,portletNamespace:a,required:n})=>{const i=a+"fileName",[u,c]=(0,f.useState)(t),o=t!==u,d=n?o&&u:o,m=n&&!u;return f.default.createElement(r.default.Group,{className:(0,l.default)({"has-error":m,"has-warning":d})},f.default.createElement("label",{htmlFor:i},Liferay.Language.get("file-name"),n&&f.default.createElement(e,null)),f.default.createElement(r.ClayInput,{className:"form-control",id:i,name:i,onChange:({target:{value:e}})=>c(e),required:n,type:"text",value:u}),m&&f.default.createElement(s,{message:Liferay.Language.get("this-field-is-required")}),d&&f.default.createElement(s,{message:Liferay.Language.get("warning-changing-file-name-will-affect-existing-links-to-this-document"),warning:!0}))};t.default=o}}));
//# sourceMappingURL=FileNameInput.es.js.map