Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.105/admin/js/components/share-form/openShareFormModal.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/modal","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react","liferay!frontend-js-react-web$react-dom","../../util/submitEmailContent.es","./ShareFormModalBody.es"],(function(e,t,r){var a;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=b,t.openShareFormModal=function(t){let{spritemap:r}=t,a=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(t,["spritemap"]);e&&g();e=document.createElement("div"),document.body.appendChild(e),(0,u.render)(d.default.createElement(o.ClayIconSpriteContext.Provider,{value:r},d.default.createElement(b,p({onClose:g},a))),a,e),Liferay.once("destroyPortlet",g)};var n=(a=r("@frontend-taglib-clay$clayui/button"))&&a.__esModule?a:{default:a},o=r("@frontend-taglib-clay$clayui/icon"),l=y(r("@frontend-taglib-clay$clayui/modal")),u=r("@liferay/frontend-js-react-web"),c=r("frontend-js-web"),d=y(r("liferay!frontend-js-react-web$react")),i=r("liferay!frontend-js-react-web$react-dom"),f=r("../../util/submitEmailContent.es"),s=r("./ShareFormModalBody.es");function m(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return m=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=m();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function b({autocompleteUserURL:e,localizedName:t,onClose:r,portletNamespace:a,shareFormInstanceURL:o,url:u}){const{observer:i}=(0,l.useModal)({onClose:r}),m=(0,d.useRef)({addresses:[],message:(0,c.sub)(Liferay.Language.get("please-fill-out-this-form-x"),u),subject:t[themeDisplay.getLanguageId()]});return i.mutation?d.default.createElement(l.default,{observer:i},d.default.createElement(l.default.Header,null,Liferay.Language.get("share")),d.default.createElement(l.default.Body,null,d.default.createElement(s.ShareFormModalBody,{autocompleteUserURL:e,emailContent:m,localizedName:t,url:u})),d.default.createElement(l.default.Footer,{last:d.default.createElement(n.default.Group,{spaced:!0},d.default.createElement(n.default,{displayType:"secondary",onClick:()=>r()},Liferay.Language.get("cancel")),d.default.createElement(n.default,{displayType:"primary",onClick:()=>{(0,f.submitEmailContent)({addresses:m.current.addresses,message:m.current.message,portletNamespace:a,shareFormInstanceURL:o,subject:m.current.subject}),r()}},Liferay.Language.get("done")))})):null}let e;function g(){e&&((0,i.unmountComponentAtNode)(e),document.body.removeChild(e),e=null)}}}));
//# sourceMappingURL=openShareFormModal.es.js.map