Liferay.Loader.define("@liferay/search-experiences-web@3.0.30/sxp_blueprint_admin/js/edit_sxp_element/index",["module","exports","require","liferay!frontend-js-react-web$react","../hooks/useClipboardJS","../shared/ErrorBoundary","../shared/ThemeContext","../utils/constants","../utils/fetch/fetch_data","../utils/language/format_locale_with_underscores","../utils/language/rename_keys","../utils/language/transform_locale","../utils/toasts","./EditSXPElementForm"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({defaultLocale:e,learnMessages:t,locale:a,namespace:s,redirectURL:d,sxpElementId:c}){const[_,m]=(0,r.useState)(null),[h,g]=(0,r.useState)(null);if((0,n.default)("."+u.COPY_BUTTON_CSS_CLASS),(0,r.useEffect)((()=>{(0,f.openInitialSuccessToast)(),(0,o.default)("/o/search-experiences-rest/v1.0/sxp-elements/".concat(c)).then((e=>g(e))).catch((()=>g({}))),(0,o.default)("/o/search-experiences-rest/v1.0/sxp-parameter-contributor-definitions").then((e=>m(e.items))).catch((()=>m([])))}),[]),!h||!_)return null;return r.default.createElement(i.default.Provider,{value:{availableLanguages:Liferay.Language.available,defaultLocale:e,learnMessages:t,locale:a,namespace:s,redirectURL:d}},r.default.createElement("div",{className:"edit-sxp-element-root"},r.default.createElement(l.default,null,r.default.createElement(p.default,{initialElementJSONEditorValue:transformToSXPElementExportFormat(h,e),predefinedVariables:_,readOnly:h.readOnly,sxpElementId:c,type:h.type}))))};var r=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]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),n=_interopRequireDefault(a("../hooks/useClipboardJS")),l=_interopRequireDefault(a("../shared/ErrorBoundary")),i=_interopRequireDefault(a("../shared/ThemeContext")),u=a("../utils/constants"),o=_interopRequireDefault(a("../utils/fetch/fetch_data")),s=_interopRequireDefault(a("../utils/language/format_locale_with_underscores")),d=_interopRequireDefault(a("../utils/language/rename_keys")),c=_interopRequireDefault(a("../utils/language/transform_locale")),f=a("../utils/toasts"),p=_interopRequireDefault(a("./EditSXPElementForm"));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}const getDescriptionI18n=(e,t)=>{let a=(0,d.default)(e.description_i18n,c.default);return Object.keys(a).length||(a={[t]:""}),(0,d.default)(a,s.default)},getTitleI18n=e=>{const t=(0,d.default)(e.title_i18n,c.default);return(0,d.default)(t,s.default)},transformToSXPElementExportFormat=(e,t)=>({description_i18n:getDescriptionI18n(e,t),elementDefinition:e.elementDefinition,title_i18n:getTitleI18n(e),type:e.type})}}));
//# sourceMappingURL=index.js.map