Liferay.Loader.define("translation-web@2.0.69/js/import-translation/ImportTranslation",["module","exports","require","@frontend-taglib-clay$clayui/alert","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/list","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","./Toolbar"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({errorMessage:t="",portletNamespace:a,portletResource:f,publishButtonLabel:c,redirect:d,saveButtonLabel:s,title:p,workflowActionPublish:y,workflowActionSaveDraft:m,workflowPending:g=!1}){const[b,v]=(0,o.useState)([]),[E,L]=(0,o.useState)(t),[w,h]=(0,o.useState)(g),[j,$]=(0,o.useState)(),[k,N]=(0,o.useState)(y),O=(0,o.useRef)();return(0,o.useEffect)((()=>{$(!b.length),h(g||!b.length)}),[b,g]),o.default.createElement(o.default.Fragment,null,o.default.createElement(i.default,{cancelURL:d,onSave:()=>{N(m)},publishButtonDisabled:w,publishButtonLabel:c,saveButtonDisabled:j,saveButtonLabel:s,title:p}),o.default.createElement(r.default.ContainerFluid,{className:"container-view"},o.default.createElement(r.default.Sheet,{className:"translation-import-body-form",size:"lg"},o.default.createElement("input",{defaultValue:d,name:"".concat(a,"redirect"),type:"hidden"}),o.default.createElement("input",{defaultValue:f,name:"".concat(a,"portletResource"),type:"hidden"}),o.default.createElement("input",{name:"".concat(a,"workflowAction"),type:"hidden",value:k}),E&&o.default.createElement(l.default,{displayType:"danger",hideCloseIcon:!1,onClose:()=>{L("")},title:"".concat(Liferay.Language.get("error"),":")},E),o.default.createElement("div",null,o.default.createElement("p",{className:"h3"},Liferay.Language.get("import-files")),o.default.createElement("p",{className:"text-secondary"},Liferay.Language.get("please-upload-your-translation-files")),o.default.createElement("div",{className:"mt-4"},o.default.createElement("p",{className:"h5"},Liferay.Language.get("file-upload")),o.default.createElement("input",{accept:e,className:"d-none","data-testid":"filesInput",multiple:!0,name:"file",onChange:e=>{var t;v(Array.from((null===(t=e.target)||void 0===t?void 0:t.files)||[]))},ref:O,type:"file"}),o.default.createElement(n.default.Group,{spaced:!0},o.default.createElement(n.default,{displayType:"secondary",onClick:()=>{O.current.click()},small:!0},b.length?Liferay.Language.get("replace-files"):Liferay.Language.get("select-files")),Boolean(b.length)&&o.default.createElement(n.default,{displayType:"secondary",onClick:()=>{v([]),O.current.value=""},small:!0},Liferay.Language.get("remove-files"))),b.length?o.default.createElement(u.default,{className:"list-group-no-bordered mt-3"},b.map((({name:e})=>o.default.createElement(u.default.Item,{key:e},o.default.createElement(u.default.ItemTitle,null,e))))):null)))))};var l=c(a("@frontend-taglib-clay$clayui/alert")),n=c(a("@frontend-taglib-clay$clayui/button")),r=c(a("@frontend-taglib-clay$clayui/layout")),u=c(a("@frontend-taglib-clay$clayui/list")),o=(c(a("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),i=c(a("./Toolbar"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}const e=".xliff,.xlf,.zip"}}));
//# sourceMappingURL=ImportTranslation.js.map