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