Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/components/ManageAllowedFragmentModal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../contexts/StoreContext","../thunks/updateItemConfig","./AllowedFragmentSelectorTree"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(a("@frontend-taglib-clay$clayui/button")),n=u(a("@frontend-taglib-clay$clayui/modal")),l=(u(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={},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]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=a("../contexts/StoreContext"),i=u(a("../thunks/updateItemConfig")),d=u(a("./AllowedFragmentSelectorTree"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function u(e){return e&&e.__esModule?e:{default:e}}var c=({item:e,observer:t,onClose:a})=>{const f=(0,o.useDispatch)(),[u,c]=(0,l.useState)(!0),[s,m]=(0,l.useState)(new Set([])),[p,g]=(0,l.useState)(),y=(0,l.useCallback)((({allowNewFragmentEntries:e,selectedFragments:t})=>{c(e),m(t)}),[]);return l.default.createElement(n.default,{className:"page-editor__allowed-fragment__modal",containerProps:{className:"cadmin"},observer:t,size:"md"},l.default.createElement(n.default.Header,null,Liferay.Language.get("allowed-fragments")),l.default.createElement(n.default.Body,{className:"p-0"},l.default.createElement("p",{className:"m-4 small text-secondary"},Liferay.Language.get("specify-which-fragments-a-page-author-is-allowed-to-use-within-the-drop-zone-when-creating-a-page-from-this-master")),l.default.createElement(d.default,{dropZoneConfig:e.config,onSelectedFragment:y})),l.default.createElement(n.default.Footer,{last:l.default.createElement(r.default.Group,{spaced:!0},l.default.createElement(r.default,{displayType:"secondary",onClick:a},Liferay.Language.get("cancel")),l.default.createElement(r.default,{displayType:"primary",onClick:()=>{g(!0),f((0,i.default)({itemConfig:{allowNewFragmentEntries:u,fragmentEntryKeys:[...s]},itemId:e.itemId})).then((()=>{g(!1),a()}))}},p&&l.default.createElement("span",{className:"inline-item inline-item-before"},l.default.createElement("span",{"aria-hidden":"true",className:"loading-animation"})),Liferay.Language.get("save")))}))};t.default=c}}));
//# sourceMappingURL=ManageAllowedFragmentModal.js.map