tocco-admin 1.0.249 → 1.0.251

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[141],{75896:(e,t,n)=>{n.d(t,{$6:()=>g,BH:()=>a,BX:()=>l,Cz:()=>i,HM:()=>d,K2:()=>c,L1:()=>p,YS:()=>h,YZ:()=>x,_5:()=>b,a7:()=>r,cL:()=>y,dY:()=>f,fq:()=>v,mf:()=>u,nm:()=>s,sR:()=>o,vo:()=>m});var r="entityTemplate/UNLOAD_VIEW",a="entityTemplate/FETCH_ENTITY_TEMPLATES",i="entityTemplate/SET_ENTITY_TEMPLATES",o="entityTemplate/SET_ACTIVE_ENTITY_TEMPLATE",c="entityTemplate/FETCH_TEMPLATE_VALUES",s="entityTemplate/SET_ACTIVE_TEMPLATE_DEFAULT_VALUES",l="entityTemplate/SET_FORM_VALUES",u="entityTemplate/CREATE_ENTITY_TEMPLATE",p="entityTemplate/DELETE_ENTITY_TEMPLATE",d=function(){return{type:r}},f=function(e){return{type:a,payload:{entityName:e}}},m=function(e,t){return{type:i,payload:{entityName:e,entityTemplates:t}}},y=function(e){return{type:o,payload:{activeEntityTemplate:e}}},h=function(e,t){return{type:c,payload:{entityName:e,templateId:t}}},v=function(e){return{type:s,payload:{activeTemplateDefaultValues:e}}},g=function(e){return{type:l,payload:{formValues:e}}},b=function(e,t,n,r){return{type:u,payload:{entityName:e,label:t,formValues:n,onSuccess:r}}},x=function(e,t,n){return{type:p,payload:{templateKey:e,entityName:t,navigationStrategy:n}}}},24040:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Lr});var r=n(15857),a=n(74806),i=n(50558),o=n(54675),c=n(1024),s=n.n(c),l=n(56746),u=n(19743),p=n(5303),d=n(59713),f=n.n(d),m=n(27361),y=n.n(m),h=n(70696),v=n(75354),g=n(87467),b=n(90169),x=n(96801),w=function(e){var t=x.Z.extractParamsFromPath("/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?",e),n=x.Z.extractParamsFromPath("/e/action/:actionId",e);return t||n},j=n(46054),P=n(85893);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=function(e){var t=e.history,n=e.match,r=e.setCurrentViewTitle,a=e.currentViewInfo,i=e.intl,o=t.location;if((0,c.useEffect)((function(){return a&&r(i.formatMessage({id:"client.actions.".concat(a.actionId,".title")})),function(){r(null)}}),[a,r,i]),!a)return null;var s=v.Z.fromQueryString(o.search),l=y()(o,"state.selection",s.selection),u=y()(o,"state.definition.properties",s.actionProperties),p=function(){var e=w(n.url).key?(0,g.H)(n.url):(0,g.H)(n.url,2);t.replace(e)};return(0,P.jsx)(j.Z,Z(Z({history:t,match:n,appId:a.actionId},s),{},{selection:l,actionProperties:u,navigationStrategy:(0,b.ZP)(t,n),onSuccess:p,onError:p,onCancel:p}))},k=function(e,t){return 0===Object.keys(h.Z.difference(e,t)).length};const T=s().memo(E,k);var N={setCurrentViewTitle:o.Wk};const C=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),N)((0,a.ZP)(T));var S=n(50600),R=n(91073),D=n(29785),V=n(88757),A=n(75896),I=function(e,t){return void 0===e.entities.entityTemplate.entityTemplates[t]},L=function(e){return Boolean(e.entities.entityTemplate.activeEntityTemplate)&&!e.entities.entityTemplate.activeTemplateDefaultValues},_=n(319),F=n.n(_),M=n(63038),W=n.n(M),z=n(28655),U=n.n(z),B=n(30314),K=n(38205),Y=n(33773),H=n(11467),q=n(44834),$=n(88601),G=n(7281),X=n(74406),J=n(19917),Q=n(84286),ee=n(2913),te=n(35728),ne=n(24688);const re=function(e){var t=e.when,n=e.message;return(0,c.useEffect)((function(){return t&&ne.Z.activatePreventFromLeaving(),function(){ne.Z.deactivatePreventFromLeaving()}}),[t]),(0,P.jsx)(l.NL,{when:t,message:n})};var ae=n(50628),ie={"entity-template-create":(0,c.lazy)((function(){return Promise.all([n.e(130),n.e(802),n.e(896),n.e(860),n.e(834),n.e(467),n.e(85),n.e(280),n.e(107)]).then(n.bind(n,69745))}))};const oe=ae.Z.actionFactory(ie);var ce,se,le=n(44012),ue=n(93235),pe=n(34206),de=n(24291),fe=n(5399),me=n(87686);const ye=function(e){var t=e.navigationStrategy,n=e.deleteEntityTemplate,r=e.templateKey;return(0,P.jsxs)(fe.Z,{buttonProps:{icon:"ellipsis-v","data-cy":"btn-entity-template-ballmenu"},children:[(0,P.jsx)(me.Z,{onClick:function(){return t.openDetail("Entity_template",r)},"data-cy":"entity-template-edit",children:ce||(ce=(0,P.jsx)(le.Z,{id:"client.admin.entities.create.entityTemplate.settings.edit"}))}),(0,P.jsx)(me.Z,{onClick:n,"data-cy":"entity-template-delete",children:se||(se=(0,P.jsx)(le.Z,{id:"client.admin.entities.create.entityTemplate.settings.delete"}))})]})};var he,ve,ge,be,xe,we=K.ZP.div.withConfig({displayName:"StyledButtonWrapper"})(he||(he=U()(["\n margin-top: 0.4rem;\n margin-bottom: 0.4rem;\n"]))),je=K.ZP.div.withConfig({displayName:"StyledMessageWrapper"})(ve||(ve=U()(["\n padding-left: 8px;\n"]))),Pe=K.ZP.div.withConfig({displayName:"StyledLoaderWrapper"})(ge||(ge=U()(["\n padding-left: 8px;\n text-align: center;\n display: flex;\n flex-direction: column;\n"])));const Oe=function(e){var t=e.entityName,n=e.isLoadingEntityTemplates,r=e.activeEntityTemplate,a=e.setActiveEntityTemplate,i=e.fetchEntityTemplates,o=e.deleteEntityTemplate,s=e.entityTemplates,l=e.navigationStrategy;return(0,c.useEffect)((function(){i(t)}),[i,t]),n?be||(be=(0,P.jsxs)(Pe,{children:[(0,P.jsx)(ue.Z,{size:"1.8rem"}),(0,P.jsx)(pe.ZP.Span,{children:(0,P.jsx)(le.Z,{id:"client.admin.entities.create.entityTemplatesLoading"})})]})):0===s.length?xe||(xe=(0,P.jsx)(je,{"data-cy":"entity-template-empty",children:(0,P.jsx)(pe.ZP.I,{children:(0,P.jsx)(le.Z,{id:"client.admin.entities.create.noEntityTemplates"})})})):(0,P.jsx)(we,{"data-cy":"entity-template-list",children:s.map((function(e){return(0,P.jsx)(de.Z,{primaryKey:e.key,label:e.paths.label.value,description:e.paths.description.value,active:(null==r?void 0:r.key)===e.key,setActive:function(t){return a(t?e:null)},showAddRemoveBtn:!1,menuElement:(0,P.jsx)(ye,{templateKey:e.key,navigationStrategy:l,deleteEntityTemplate:function(){return o(e.key,t,l)}})},e.key)}))})};var Ze={fetchEntityTemplates:A.dY,setActiveEntityTemplate:A.cL,deleteEntityTemplate:A.YZ};const Ee=(0,i.connect)((function(e,t){return{isLoadingEntityTemplates:I(e,t.entityName),entityTemplates:e.entities.entityTemplate.entityTemplates[t.entityName]||[],activeEntityTemplate:e.entities.entityTemplate.activeEntityTemplate}}),Ze)((0,a.ZP)(Oe));var ke=n(87757),Te=n.n(ke),Ne=n(122),Ce=Te().mark(Se);function Se(e,t){var n;return Te().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={id:"entity-template-create",appId:"entity-template-create",label:t.formatMessage({id:"client.admin.entities.action.createEntityTemplate.label"}),componentType:"action",children:[],actionType:"custom",useLabel:"YES",buttonType:"REGULAR",canExecuteOnPendingChanges:!0},r.abrupt("return",Ne.Z.addAction(e,n,["save"]));case 2:case"end":return r.stop()}}),Ce)}var Re,De,Ve,Ae=n(24875),Ie=K.ZP.div.withConfig({displayName:"StyledSidepanelWrapper"})(Re||(Re=U()(["\n background-color: ",";\n padding: "," "," 0 ",";\n position: relative;\n"])),Ae.FS.color("paper"),G.Z.space(-1.1),G.Z.space(-.375),G.Z.space(0)),Le=K.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(De||(De=U()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n height: calc(100dvh - 75px); // ~75px the height of header and breadcrumbs\n width: 100%;\n"])),$.Z.color("paper"),G.Z.space(0));const _e=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,i=e.chooseDocument,o=e.dispatchEmittedAction,s=e.setPendingChanges,l=e.setFormValues,u=e.unloadView,p=e.isLoadingTemplateValues,d=e.activeTemplateDefaultValues,f=e.setEntityTemplateSidepanelCollapsed,m=e.entityTemplateSidepanelCollapsed,h=n.location,v=y()(h,"state.defaultValues",[]),g=(0,c.useState)(!1),x=W()(g,2),w=x[0],j=x[1];if((0,c.useEffect)((function(){return function(){s(!1),u()}}),[s,u]),!t)return null;var O=t.model,Z=t.reverseRelation,E=t.parentKey,k=O.name,T=y()(O,"paths.".concat(Z,".multi"),!1),N=[].concat(F()(Z&&E?[{id:Z,value:T?[E]:E}]:[]),F()(v)),C=function(e){return a.formatMessage({id:e})},S=d?[].concat(F()(d),F()(N)):N;return(0,P.jsxs)(X.Z,{sidepanelPosition:"left",scrollBehaviour:"inline",setSidepanelCollapsed:f,sidepanelCollapsed:m,children:[(0,P.jsxs)(J.Z,{children:[Ve||(Ve=(0,P.jsx)(Q.Z,{})),(0,P.jsx)(Ie,{children:(0,P.jsx)(Ee,{entityName:k,navigationStrategy:(0,b.ZP)(n,r)})})]}),(0,P.jsx)(ee.Z,{children:(0,P.jsx)(Le,{children:(0,P.jsxs)(te.Z,{required:[!p],loadingText:C("client.admin.entities.create.entityTemplateLoading"),children:[(0,P.jsx)(re,{when:w,message:C("client.admin.entities.confirmTouchedFormLeave")}),(0,P.jsx)(H.ZP,{entityName:k,formName:k,mode:"create",defaultValues:S,ignoreFormDefaultValues:Boolean(d),emitAction:function(e){o(e)},navigationStrategy:(0,b.ZP)(n,r),chooseDocument:i,onEntityCreated:function(e){var t=e.id,a=e.followUp;(0,B.flushSync)((function(){j(!1)})),n.push({pathname:r.url.replace(/create$/,t)+"/detail",search:null!=a&&a.action?"?action=".concat(null==a?void 0:a.action):""})},onTouchedChange:function(e){var t=e.touched;j(t),s(t)},onFormValuesChange:function(e){var t=e.formValues;l(t)},listApp:q.ZP,docsApp:Y.default,actionAppComponent:oe,modifyFormDefinition:function(e){return Se(e,a)}})]})})})]})};var Fe={chooseDocument:R.Z.actions.chooseDocument,dispatchEmittedAction:S.Z.dispatchEmittedAction,setPendingChanges:V.c0,setFormValues:A.$6,unloadView:A.HM,setEntityTemplateSidepanelCollapsed:function(e){return(0,D.RK)({"admin.create.entityTemplateSidepanelCollapsed":e})}};const Me=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],activeTemplateDefaultValues:e.entities.entityTemplate.activeTemplateDefaultValues,isLoadingTemplateValues:L(e),entityTemplateSidepanelCollapsed:y()(e.preferences.userPreferences,"admin.create.entityTemplateSidepanelCollapsed",!1)}}),Fe)((0,a.ZP)(_e));var We=n(17563),ze=n(29441),Ue=n(48926),Be=n.n(Ue),Ke=n(81719);function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const qe=function(e){var t=e.entityName,n=e.entityKey,r=e.showActions,a=e.noLeftPadding,i=e.openResource,o=e.initialLocation,s=e.sortable,l=(0,c.useState)(null),u=W()(l,2),p=u[0],d=u[1],f=(0,c.useCallback)(Be()(Te().mark((function e(){return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ke.Z.simpleRequest("entities/2.0/"+t+"/"+n+"/entitydocs/folder").then((function(e){d(e.body.key)}));case 1:case"end":return e.stop()}}),e)}))),[t,n]);return(0,c.useEffect)((function(){f()}),[f]),p&&(0,P.jsx)(Y.default,He(He(He({routerType:"routerless",initialLocation:o,noLeftPadding:a,sortable:s,searchFormType:"none",rootNodes:[{key:p,entityName:"Folder"}],embedded:!0,showActions:r},!1===r?{selectionStyle:"none"}:{}),{},{disableViewPersistor:!0},i?{openResource:i}:{}),{},{scrollBehaviour:"inline"}))};const $e=function(e){var t=e.currentViewInfo,n=e.initialLocation;return(0,P.jsx)(qe,{noLeftPadding:!1,entityName:t.parentModel.name,entityKey:t.parentKey,showActions:!0,initialLocation:n})};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Je=function(e){var t=e.match,n=e.history,r=e.currentViewInfo,a=e.emitAction,i=e.searchFormCollapsed,o=e.saveUserPreferences;if(!r)return null;var c=We.parse(n.location.search),s=n.location.hash?n.location.hash.substring(1):null;return"Resource"===r.model.name?(0,P.jsx)($e,{currentViewInfo:r,initialLocation:s}):(0,P.jsx)(q.ZP,Xe(Xe({emitAction:a,limit:25,id:"".concat(r.model.name,"_list"),entityName:r.model.name,formName:c.formName||r.model.name,onRowClick:function(e){var r=e.id;n.push(t.url.replace(/list$/,"")+r)}},r.reverseRelation&&{parent:{key:r.parentKey,reverseRelationName:r.reverseRelation,model:r.parentModel.name}}),{},{showLink:!0,navigationStrategy:(0,b.ZP)(n,t),searchFormPosition:"left",searchFormType:"admin",scrollBehaviour:"inline",store:ze.Z.viewInfoSelector(n.location.pathname).store,onStoreCreate:function(e){ze.Z.persistViewInfo(n.location.pathname,{store:e},r.level)},actionAppComponent:j.Z,tql:c.tql,searchFormCollapsed:i,onSearchFormCollapsedChange:function(e){var t=e.collapsed;o({"admin.list.searchFormCollapsed":t})},detailApp:H.ZP}))};var Qe={emitAction:function(e){return S.Z.dispatchEmittedAction(e)},saveUserPreferences:D.RK};const et=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],searchFormCollapsed:y()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",!1)}}),Qe)((0,a.ZP)(Je));var tt,nt=n(4975);function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var it=K.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(tt||(tt=U()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),$.Z.color("paper"),G.Z.space(0));const ot=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,i=e.chooseDocument,o=e.emitAction,s=e.propagateRefresh,l=e.invalidateLastBreadcrumb,u=e.setPendingChanges,p=We.parse(location.search),d=p.action,f=p.formName,m=(0,c.useState)(!1),y=W()(m,2),h=y[0],v=y[1];if((0,c.useEffect)((function(){return function(){return u(!1)}}),[u]),!t||t.pathname!==n.location.pathname)return null;var x=t.model.name;return(0,P.jsxs)(it,{children:[(0,P.jsx)(re,{when:h,message:function(e){return n.location.pathname!==e.pathname&&(t="client.admin.entities.confirmTouchedFormLeave",a.formatMessage({id:t}));var t}}),(0,P.jsx)(H.ZP,{entityName:x,entityId:t.key,formName:f||x,mode:"update",emitAction:o,onTouchedChange:function(e){var t=e.touched;v(t),u(t)},navigationStrategy:at(at({},(0,b.ZP)(n,r)),{},{navigateToCreateRelative:function(e,t){if(e){var a=(0,g.H)(r.url,1);n.push({pathname:"".concat(a,"/").concat(e,"/create"),state:t})}else{var i=(0,g.H)(r.url,2);n.push({pathname:i+"/create",state:t})}}}),chooseDocument:i,onEntityDeleted:function(){var e=(0,g.H)(r.url,2);n.push(e)},onEntityUpdated:function(){var e=n.location;l(e)},onRefresh:function(){var e=n.location;s(e)},actionAppComponent:j.Z,onSubGridRowClick:function(e){var t=e.id,a=e.relationName,i=(0,g.H)(r.url);n.push("".concat(i,"/").concat(a,"/").concat(t))},listApp:q.ZP,docsApp:Y.default,initialAction:d})]})};var ct={chooseDocument:R.Z.actions.chooseDocument,emitAction:function(e){return S.Z.dispatchEmittedAction(e)},propagateRefresh:o.Ld,invalidateLastBreadcrumb:o._m,setPendingChanges:V.c0};const st=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),ct)((0,a.ZP)(ot));var lt=n(88162),ut={};const pt=function(e){var t=e.currentViewInfo,n=e.history,r=e.selectedRelation,a=e.sortable;return(0,P.jsx)(qe,{entityName:t.model.name,entityKey:t.key,showActions:!1,noLeftPadding:!0,history:n,openResource:function(e){n.push("".concat(r.relationName,"/list#").concat(e))},sortable:a})};var dt=function(e){var t=e.selectedRelation,n=e.currentViewInfo,r=e.match,a=e.history,i=e.emitAction,o="".concat(t.reverseRelationName).concat(t.relationName);return(0,P.jsx)(q.ZP,{id:"preview"+t.reverseRelationName+t.targetEntity,entityName:t.targetEntity,formName:t.targetEntity,parent:{key:n.key,reverseRelationName:t.reverseRelationName,model:n.model.name,relationName:t.relationName},showLink:!0,navigationStrategy:(0,b.ZP)(a,r),onRowClick:function(e){var n=e.id,i=r.url.replace(/detail$/,"");a.push("".concat(i).concat(t.relationName,"/").concat(n))},onNavigateToCreate:function(){var e=(0,g.H)(r.url);a.push(e+"/"+t.relationName+"/create")},searchFormType:"fulltext",selectionStyle:"none",store:ze.Z.viewInfoSelector(a.location.pathname)["store-".concat(o)],onStoreCreate:function(e){ze.Z.persistViewInfo(n.pathname,f()({},"store-".concat(o),e),n.level)},showActions:!1,limit:15,emitAction:i,scrollBehaviour:"inline",detailApp:H.ZP},t.reverseRelationName+t.targetEntity)};const ft=s().memo(dt);var mt,yt,ht,vt,gt,bt,xt,wt,jt,Pt,Ot,Zt,Et,kt,Tt=n(6699),Nt=n(65035),Ct=n(84647),St=n(69829),Rt=n(30759),Dt=K.ZP.div.withConfig({displayName:"StyledRelationsViewWrapper"})(mt||(mt=U()(["\n display: ",";\n height: 100%;\n flex-direction: column;\n"])),(function(e){return e.isRightPaneCollapsed?"none":"flex"})),Vt=K.ZP.div.withConfig({displayName:"StyledPlaceHolder"})(yt||(yt=U()(["\n display: ",";\n flex: 1;\n height: 100%;\n width: 25px;\n background: ",";\n padding-top: ",";\n padding-left: ",";\n align-items: flex-start;\n\n &:hover {\n cursor: pointer;\n }\n"])),(function(e){return e.isRightPaneCollapsed?"flex":"none"}),$.Z.color("paper"),G.Z.space(-1.5),G.Z.space(-2.5)),At=K.ZP.div.withConfig({displayName:"StyledToggleCollapse"})(ht||(ht=U()(["\n display: flex;\n background-color: ",";\n padding-top: ",";\n padding-bottom: ",";\n"])),$.Z.color("paper"),G.Z.space(-1.5),G.Z.space(-1.5)),It=(0,K.ZP)(Nt.Z).withConfig({displayName:"StyledToggleCollapseButton"})(vt||(vt=U()(["\n font-size: ",";\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ",":hover & {\n background-color: transparent;\n color: ",";\n }\n"])),G.Z.font(0),Vt,$.Z.color("secondaryLight")),Lt=K.ZP.div.withConfig({displayName:"StyledPreviewBox"})(gt||(gt=U()(["\n background-color: ",";\n padding: ",";\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"])),$.Z.color("paper"),G.Z.space(-1)),_t=K.ZP.div.withConfig({displayName:"StyledRelationBoxes"})(bt||(bt=U()(["\n background-color: ",";\n padding: ",";\n display: grid;\n grid-template-columns: repeat(auto-fit, 170px);\n grid-gap: ",";\n justify-content: space-between;\n overflow-y: auto;\n align-content: flex-start;\n height: fit-content;\n min-height: 150px;\n max-height: 20%;\n"])),$.Z.color("paper"),G.Z.space(-1),G.Z.space(-2)),Ft=(0,K.ZP)(Tt.Z).withConfig({displayName:"StyledPreviewLink"})(xt||(xt=U()(["\n padding-left: ",";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n"])),G.Z.space(-.5)),Mt=K.ZP.div.withConfig({displayName:"StyledRelationLinks"})(wt||(wt=U()(["\n display: none;\n margin-left: auto;\n\n * {\n color: ",";\n padding-left: ",";\n }\n"])),$.Z.color("text"),G.Z.space(-4.5)),Wt=K.ZP.div.withConfig({displayName:"StyledRelationBox"})(jt||(jt=U()(["\n border-radius: ",";\n padding: "," ",";\n display: flex;\n background-color: ",";\n height: fit-content;\n\n &&& {\n * {\n color: ",";\n box-sizing: initial;\n }\n }\n ",";\n\n /* allow hover styles only on non-touch devices */\n ","\n"])),$.Z.radii("button"),G.Z.space(-2.7),G.Z.space(-1),(function(e){return e.selected&&$.Z.color("secondary")}),(function(e){return e.selected&&$.Z.color("paper")}),(function(e){return e.selected&&"\n ".concat(Mt," {\n display: flex;\n }\n ")}),!Ct.b&&(0,K.iv)(Pt||(Pt=U()(["\n &:hover "," {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ",";\n\n * {\n color: ",";\n }\n cursor: pointer;\n }\n }\n\n ",":hover * {\n color: ",";\n }\n "])),Mt,$.Z.color("secondaryLight"),$.Z.color("paper"),Tt.Z,$.Z.color("secondary"))),zt=(0,K.ZP)(St.Fe).withConfig({displayName:"StyledRelationLabel"})(Ot||(Ot=U()(["\n && {\n max-width: 110px;\n }\n"]))),Ut=K.ZP.span.withConfig({displayName:"StyledCountLabel"})(Zt||(Zt=U()(["\n ","\n"])),(0,Rt.Z)());const Bt=function(e){var t,n,r=e.relation,a=e.history,i=e.match,o=e.relationsInfo,c=e.selectRelation,s=e.selectedRelation,l=e.intl,u=e.entityName,p=r.relationName,d=r.targetEntity,f=r.relationDisplay,m=function(e){return l.formatMessage({id:e})},y=i.url.replace(/(relations|detail)$/,p),h=i.url.replace(/(relations|detail)$/,p)+"/create";return(0,P.jsxs)(Wt,{selected:(null==s?void 0:s.relationName)===p,onClick:function(){c(r),a.replace({search:"?relation=".concat(p)}),function(e,t){ut[e]=t}(u,p)},children:[(0,P.jsx)(zt,{title:f.label,children:f.label}),(null===(n=o[p])||void 0===n?void 0:n.count)>0?(0,P.jsxs)(Ut,{children:[" (",o[p].count,")"]}):null,(0,P.jsxs)(Mt,{children:[(0,P.jsx)(Tt.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkView"),to:y,children:Et||(Et=(0,P.jsx)(lt.Z,{icon:"arrow-right"}))}),(null===(t=o[p])||void 0===t?void 0:t.createPermission)&&"Resource"!==d&&(0,P.jsx)(Tt.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkCreate"),to:h,children:kt||(kt=(0,P.jsx)(lt.Z,{icon:"plus"}))})]})]})};var Kt,Yt,Ht;function qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var $t=function(e){var t=e.history,n=e.match,r=e.currentViewInfo,a=e.relations,i=e.relationsInfo,o=e.emitAction,l=e.intl,u=e.isRightPaneCollapsed,p=e.toggleCollapse,d=e.selectedRelation,m=e.selectRelation,h=y()(r,"model.name"),v=(0,c.useCallback)((function(){if((null==a?void 0:a.length)>0){var e=We.parse(t.location.search).relation;if(e)m(a.find((function(t){return t.relationName===e})));else{var n=ut[h];m(n?a.find((function(e){return e.relationName===n})):a[0])}}}),[a,h,t.location.search,m]);if((0,c.useEffect)(v,[v]),(0,c.useEffect)((function(){d||v()}),[d,v]),!a||0===a.length||!r)return null;var g,b,x=function(e){return l.formatMessage({id:e})},w=d?"Resource"===d.targetEntity?pt:ft:function(){return Kt||(Kt=(0,P.jsx)(s().Fragment,{}))},j=a.map((function(t){return(0,P.jsx)(Bt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({relation:t,entityName:h},e),"relation-".concat(t.relationName))}));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(Dt,{isRightPaneCollapsed:u,children:[(0,P.jsx)(At,{children:(0,P.jsx)(It,{icon:"chevron-right",onClick:p})}),(0,P.jsx)(_t,{children:j}),d&&(0,P.jsxs)(Lt,{children:[(0,P.jsxs)(pe.ZP.H4,{children:[d.relationDisplay.label,(0,P.jsx)(Ft,{"aria-label":x("client.admin.entities.relationsView.relationLinkView"),to:n.url.replace(/(relations|detail)$/,d.relationName),children:Yt||(Yt=(0,P.jsx)(lt.Z,{icon:"arrow-right"}))}),(g=d.relationName,(null===(b=i[g])||void 0===b?void 0:b.createPermission)&&"Resource"!==d.targetEntity&&(0,P.jsx)(Ft,{"aria-label":x("client.admin.entities.relationsView.relationLinkCreate"),to:n.url.replace(/(relations|detail)$/,d.relationName)+"/create",children:Ht||(Ht=(0,P.jsx)(lt.Z,{icon:"plus"}))}))]}),(0,P.jsx)(w,{selectedRelation:d,match:n,history:t,currentViewInfo:r,emitAction:o,sortable:!0})]})]}),(0,P.jsx)(Vt,{onClick:p,isRightPaneCollapsed:u,children:(0,P.jsx)(It,{icon:"chevron-left",isRightPaneCollapsed:u})})]})},Gt=function(e,t){return 0===Object.keys(h.Z.difference(e,t)).length};const Xt=s().memo($t,Gt);var Jt={emitAction:function(e){return S.Z.dispatchEmittedAction(e)},selectRelation:o.lM};const Qt=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relations:e.entities.path.relations,relationsInfo:e.entities.path.relationsInfo,selectedRelation:e.entities.path.selectedRelation}}),Jt)((0,a.ZP)(Xt));var en,tn,nn,rn=K.ZP.div.withConfig({displayName:"StyledDetailViewContainer"})(en||(en=U()(["\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n"]))),an=K.ZP.div.withConfig({displayName:"StyledDetailViewLeft"})(tn||(tn=U()(["\n flex: 1;\n margin-right: 1rem;\n /* Only show one panel at a time on screens <= 500px */\n display: ",";\n"])),(function(e){var t=e.windowWidth,n=e.isRightPaneCollapsed;return t<=500&&!n&&"none"})),on=K.ZP.div.withConfig({displayName:"StyledDetailViewRight"})(nn||(nn=U()(["\n flex: ",";\n"])),(function(e){return e.isRightPaneCollapsed?"0":"1"}));const cn=function(e){var t=e.match,n=e.history,r=(e.currentViewInfo,e.relationViewCollapsed),a=e.saveUserPreferences,i=(0,nt.K)(r,(function(e){a({"admin.detail.relationViewCollapsed":e})})),o=i.isCollapsed,c=i.toggleCollapse;return(0,P.jsxs)(rn,{children:[(0,P.jsx)(an,{isRightPaneCollapsed:o,windowWidth:window.innerWidth,children:(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(st,{match:t,history:n})})}),(0,P.jsx)(on,{isRightPaneCollapsed:o,children:(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(Qt,{match:t,history:n,isRightPaneCollapsed:o,toggleCollapse:c})})})]})};var sn={saveUserPreferences:D.RK};const ln=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relationViewCollapsed:y()(e.preferences.userPreferences,"admin.detail.relationViewCollapsed",!1)}}),sn)((0,a.ZP)(cn));const un=function(e){var t,n,r=e.match,a=(t=r.path,n=":relation",t.split(n).length-1);return(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{exact:!0,path:"".concat(r.url),render:function(e){return(0,P.jsx)(l.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/detail")})}}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/detail"),component:ln}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/edit"),component:st}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/relations"),component:Qt}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/action"),component:C}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/:relation_").concat(a),component:pn})]})};const pn=function(e){var t=e.match;return(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{exact:!0,path:t.url,render:function(e){return(0,P.jsx)(l.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/list")})}}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/action/:id"),component:C}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/list"),component:et}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/create"),component:Me}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/:key"),component:un})]})};var dn=n(54680);const fn=(0,i.connect)((function(e,t){return{pathPrefix:"/e",breadcrumbsInfo:e.entities.path.breadcrumbsInfo,currentView:e.entities.path.currentViewTitle?{display:e.entities.path.currentViewTitle,title:e.entities.path.currentViewTitle}:null}}),{})((0,a.ZP)(dn.Z));var mn=n(39233);const yn=function(e){var t=e.currentViewInfo,n="client.admin.entity.errorView.",r="detail"===t.type?"detailTitle":"defaultTitle",a="listDescription";return"detail"===t.type?a="detailDescription":"list"===t.type&&t.error.relationName&&(a="relationDescription"),(0,P.jsx)(mn.Z,{title:(0,P.jsx)(le.Z,{id:n+r}),message:(0,P.jsx)(le.Z,{id:n+a,values:t.error})})};const hn=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}))((0,a.ZP)(yn));var vn,gn,bn,xn,wn=K.ZP.div.withConfig({displayName:"StyledWrapper"})(vn||(vn=U()(["\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n"]))),jn=K.ZP.div.withConfig({displayName:"StyledContent"})(gn||(gn=U()(["\n grid-area: content;\n overflow: hidden;\n"]))),Pn=K.ZP.div.withConfig({displayName:"StyledBreadcrumbs"})(bn||(bn=U()(["\n grid-area: breadcrumbs;\n"])));const On=function(e){var t=e.match,n=e.history,r=e.loadCurrentRoute,a=e.currentViewInfo,i=n.location;(0,c.useEffect)((function(){r(i)}),[i,r]);var o=null!=a&&a.error?(0,P.jsx)(hn,{history:n}):(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{path:"".concat(t.url,"/action/:actionId"),component:C}),(0,P.jsx)(l.AW,{path:"".concat(t.url,"/:entity"),component:pn}),(0,P.jsx)(l.AW,{exact:!0,path:t.url,component:p.Z})]});return(0,P.jsxs)(wn,{children:[xn||(xn=(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(Pn,{children:(0,P.jsx)(fn,{})})})),(0,P.jsx)(jn,{children:o})]})};var Zn={loadCurrentRoute:o.jw};const En=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),Zn)((0,a.ZP)(On));var kn,Tn=n(34857),Nn=n(81770);function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cn(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rn=(kn={},f()(kn,A.Cz,(function(e,t){var n=t.payload,r=n.entityName,a=n.entityTemplates;return Sn(Sn({},e),{},{entityTemplates:Sn(Sn({},e.entityTemplates),{},f()({},r,a))})})),f()(kn,A.sR,Nn.Z.singleTransferReducer("activeEntityTemplate")),f()(kn,A.nm,Nn.Z.singleTransferReducer("activeTemplateDefaultValues")),f()(kn,A.BX,Nn.Z.singleTransferReducer("formValues")),kn),Dn={entityTemplates:{},activeEntityTemplate:null,activeTemplateDefaultValues:null,formValues:null};var Vn=n(44422),An=n(30604),In=n(94736);function Ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ln(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ln(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fn=function(e){return Object.keys(e.paths).filter((function(t){return!["document","binary","image","named-upload","upload"].includes(e.paths[t].type)})).map((function(t){return{id:t,value:function(e){var t=e.type,n=e.value;return"entity"===t?n.key:"entity-list"===t&&Array.isArray(n)?n.map((function(e){return e.key})):n}(e.paths[t])}}))},Mn=function(e){return{paths:Object.keys(e).filter((function(e){return!Object.values(In.Z.metaFields).includes(e)})).reduce((function(t,n){return _n(_n({},t),{},f()({},n,null!=(r=e[n])&&r.key?{key:r.key}:Array.isArray(r)?r.map((function(e){return{key:e.key}})):r));var r}),{})}},Wn=Te().mark(Kn),zn=Te().mark($n),Un=function(e){return e.entities.entityTemplate.entityTemplates},Bn=function(e){return e.intl.messages};function Kn(){return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Tn.$6)([(0,Tn.Fm)(A.BH,Yn),(0,Tn.Fm)(A.sR,Hn),(0,Tn.Fm)(A.K2,qn),(0,Tn.Fm)(A.a7,$n),(0,Tn.Fm)(A.mf,Gn),(0,Tn.Fm)(A.L1,Xn)]);case 2:case"end":return e.stop()}}),Wn)}function Yn(e){var t=e.payload;return Te().mark((function e(){var n,r;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,e.next=3,(0,Tn.gz)(A.vo(n,void 0));case 3:return e.next=5,(0,Tn.RE)(Ke.Z.fetchAllEntities,"Entity_template",{where:'base_model=="'.concat(n,'" and (relUser.pk==:currentUser or not exists(relUser))'),sorting:[{field:"sorting",order:"asc"}],paths:["label","description","base_model","unique_id"]},{method:"GET"});case 5:return r=e.sent,e.next=8,(0,Tn.gz)(A.vo(n,r));case 8:case"end":return e.stop()}}),e)}))()}function Hn(e){var t=e.payload.activeEntityTemplate;return Te().mark((function e(){var n,r;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Tn.gz)(A.fq(null));case 2:if(!t){e.next=7;break}return n=t.paths.base_model.value,r=t.paths.unique_id.value,e.next=7,(0,Tn.gz)(A.YS(n,r));case 7:case"end":return e.stop()}}),e)}))()}function qn(e){var t=e.payload;return Te().mark((function e(){var n,r,a,i,o;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,r=t.templateId,e.next=3,(0,Tn.RE)(Ke.Z.requestSaga,"entities/2.0/templates/".concat(n,"/").concat(encodeURIComponent(r)),{method:"GET"});case 3:return a=e.sent,i=a.body,o=Fn(i),e.next=8,(0,Tn.gz)(A.fq(o));case 8:case"end":return e.stop()}}),e)}))()}function $n(){return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Tn.gz)(A.cL(null));case 2:return e.next=4,(0,Tn.gz)(A.$6(null));case 4:case"end":return e.stop()}}),zn)}function Gn(e){var t=e.payload;return Te().mark((function e(){var n,r,a,i,o,c,s,l,u,p,d,f;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,r=t.label,a=t.formValues,i=t.onSuccess,o={method:"POST",body:{label:r,entity:Mn(a)}},e.next=4,(0,Tn.RE)(Ke.Z.requestSaga,"entities/2.0/templates/".concat(n),o);case 4:return c=e.sent,s=c.headers.get("location"),e.next=8,(0,Tn.gz)(A.dY(n));case 8:return e.next=10,(0,Tn.qn)(A.Cz);case 10:return e.next=12,(0,Tn.qn)(A.Cz);case 12:return e.next=14,(0,Tn.Ys)(Un);case 14:return l=e.sent,u=l[n],p=s.split("/").slice(-1)[0],d=u.find((function(e){return e.key===p})),e.next=20,(0,Tn.gz)(A.cL(d));case 20:return e.next=22,(0,Tn.Ys)(Bn);case 22:return f=e.sent,e.next=25,(0,Tn.RE)(i,{message:f["client.admin.entities.action.createEntityTemplate.success"]});case 25:case"end":return e.stop()}}),e)}))()}function Xn(e){var t=e.payload;return Te().mark((function e(){var n,r,a,i;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,r=t.templateKey,a=t.navigationStrategy,e.next=3,(0,Tn.RE)(Vn.CE);case 3:return i=e.sent,e.next=6,(0,Tn.gz)(An.Z.modal("entity-template-delete","client.admin.entities.action.deleteEntityTemplate.title",null,(function(e){var t=e.close;return(0,P.jsx)(j.Z,{appId:"delete",selection:{entityName:"Entity_template",ids:[r],type:"ID"},navigationStrategy:a,onSuccess:function(){i.put(!0),t()},onCancel:function(){i.put(!1),t()}})}),!0));case 6:return e.next=8,(0,Tn.qn)(i);case 8:if(!e.sent){e.next=12;break}return e.next=12,(0,Tn.gz)(A.dY(n));case 12:case"end":return e.stop()}}),e)}))()}const Jn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dn,t=arguments.length>1?arguments[1]:void 0,n=Rn[t.type];return n?n(e,t):e};var Qn;function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?er(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nr=(Qn={},f()(Qn,o.p3,(function(e){return tr(tr({},e),{},{currentViewInfos:{},breadcrumbsInfo:[]})})),f()(Qn,o.Xk,(function(e,t){var n=t.payload,r=n.location,a=n.currentViewInfo;return tr(tr({},e),{},{currentViewInfos:tr(tr({},e.currentViewInfos),{},f()({},r,tr(tr({},e.currentViewInfos[r]),a)))})})),f()(Qn,o.CM,Nn.Z.singleTransferReducer("breadcrumbsInfo")),f()(Qn,o.PF,(function(e,t){var n=t.payload,r=n.path,a=n.breadcrumbsInfo;return tr(tr({},e),{},{breadcrumbsInfo:e.breadcrumbsInfo.map((function(e){return e.path===r?tr(tr({},e),a):e}))})})),f()(Qn,o.oO,Nn.Z.singleTransferReducer("relations")),f()(Qn,o.dF,Nn.Z.singleTransferReducer("relationsInfo")),f()(Qn,o.l3,Nn.Z.singleTransferReducer("currentViewTitle")),f()(Qn,o.OJ,Nn.Z.singleTransferReducer("selectedRelation")),Qn),rr={currentViewInfos:{},breadcrumbsInfo:[],relations:null,relationsInfo:{},selectedRelation:null};var ar=n(57557),ir=n.n(ar),or=n(78718),cr=n.n(or),sr=n(35937),lr=n.n(sr),ur=n(44759);function pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fr=Te().mark(Pr),mr=Te().mark(Zr),yr=Te().mark(Er),hr=Te().mark(kr),vr=Te().mark(Cr),gr=Te().mark(Dr),br=Te().mark(Vr),xr=Te().mark(Ar),wr=function(e){return e.entities.path},jr=/[^/]+\/?[^/]+/g;function Pr(){return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Tn.$6)([(0,Tn.Fm)(o.hc,Or),(0,Tn.Fm)(o.eZ,Sr),(0,Tn.Fm)(o.Mu,Rr)]);case 2:case"end":return e.stop()}}),fr)}function Or(e){var t=e.payload.location;return Te().mark((function e(){var n,r,a;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,Tn.RE)(kr,n);case 3:if(!((r=e.sent).length>0)){e.next=15;break}return e.next=7,(0,Tn.RE)(Zr,n,r);case 7:if("detail"!==(a=e.sent).type||a.error){e.next=11;break}return e.next=11,(0,Tn.RE)(Cr,a.model,a.key);case 11:return e.next=13,(0,Tn.RE)(Er,r);case 13:return e.next=15,(0,Tn.RE)(ze.Z.clearPersistedViews,a.level+1);case 15:case"end":return e.stop()}}),e)}))()}function Zr(e,t){var n;return Te().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,Tn.RE)(Tr,e,t);case 2:return n=r.sent,r.next=5,(0,Tn.gz)(o.Hn(e,n));case 5:return r.abrupt("return",n);case 6:case"end":return r.stop()}}),mr)}function Er(e){var t;return Te().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Tn.RE)(Nr,e);case 2:return t=n.sent,n.next=5,(0,Tn.gz)(o.rt(t));case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),yr)}function kr(e){var t,n,r,a,i,o,c,s,l,u,p,d,f,m,y,h,v;return Te().wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,(0,Tn.RE)(w,e);case 2:if(t=g.sent,n=[],null!==t){g.next=6;break}return g.abrupt("return",n);case 6:if(!t.entity){g.next=70;break}return g.prev=7,g.next=10,(0,Tn.RE)(Ke.Z.fetchModel,t.entity);case 10:r=g.sent,n.push({type:"list",model:r}),g.next=18;break;case 14:return g.prev=14,g.t0=g.catch(7),n.push({type:"list",error:{entityName:t.entity}}),g.abrupt("return",n);case 18:if(!t.key){g.next=67;break}return g.next=21,(0,Tn.RE)(Ke.Z.entityExists,r.name,t.key);case 21:if(!g.sent){g.next=29;break}return g.next=25,(0,Tn.RE)(Ke.Z.fetchDisplay,r.name,t.key);case 25:a=g.sent,n.push({type:"detail",key:t.key,model:r,display:a}),g.next=31;break;case 29:return n.push({type:"detail",error:{entityName:r.label,key:t.key}}),g.abrupt("return",n);case 31:if(!t.relation){g.next=67;break}i=t.relation.split("/"),o=0;case 34:if(!(o<i.length)){g.next=67;break}if(c=i[o],s=n[n.length-1],o%2!=0){g.next=50;break}if(l=c,u=s.model.paths[l]){g.next=43;break}return n.push({type:"list",error:{relationName:l,entityName:s.model.name}}),g.abrupt("return",n);case 43:return p=u.targetEntity,g.next=46,(0,Tn.RE)(Ke.Z.fetchModel,p);case 46:d=g.sent,n.push({type:"list",model:d,relationName:l,parent:s}),g.next=64;break;case 50:return f=c,m=s.model,g.next=54,(0,Tn.RE)(Ke.Z.entityExists,m.name,f);case 54:if(!g.sent){g.next=62;break}return g.next=58,(0,Tn.RE)(Ke.Z.fetchDisplay,m.name,f);case 58:y=g.sent,n.push({type:"detail",model:m,key:f,display:y,relationName:s.relationName,parent:s.parent}),g.next=64;break;case 62:return n.push({type:"detail",error:{entityName:m.name,key:f}}),g.abrupt("return",n);case 64:o++,g.next=34;break;case 67:"create"===t.view?(h=n[n.length-1],v=n[n.length-2],n.push({type:"create",model:h.model,parent:v,relationName:h.relationName})):t.actionId&&n.push({type:"action",actionId:t.actionId}),g.next=71;break;case 70:t.actionId&&n.push({type:"action",actionId:t.actionId});case 71:return g.abrupt("return",n);case 72:case"end":return g.stop()}}),hr,null,[[7,14]])}var Tr=function(e,t){var n=t[t.length-1],r=n.parent;return dr(dr({},ir()(n,["parent"])),{},{pathname:e,level:t.length-1},r&&n.relationName&&{parentKey:r.key,reverseRelation:r.model.paths[n.relationName].reverseRelationName,parentModel:r.model})},Nr=function(e){var t="";return e.map((function(e){return e.error?{type:"error"}:"action"===e.type?null:(t=(t?t+"/":"")+(e.key?e.key:e.relationName||e.model.name),{type:e.type,display:e.display||e.model.label,path:t+"/"+e.type})})).filter((function(e){return e}))};function Cr(e,t){var n,r;return Te().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n=lr()(e.paths,(function(e){return e.relationDisplay&&e.relationDisplay.show})),r=Object.keys(n).map((function(e){return cr()(n[e],["relationName","reverseRelationName","targetEntity","relationDisplay.label","relationDisplay.order"])})).sort((function(e,t){return e.relationDisplay.order>t.relationDisplay.order?1:-1})),a.next=4,(0,Tn.gz)(o.lM(null));case 4:return a.next=6,(0,Tn.gz)(o.zB(r));case 6:return a.next=8,(0,Tn.RE)(Ar,e.name,t);case 8:case"end":return a.stop()}}),vr)}function Sr(e){var t=e.payload.location;return Te().mark((function e(){var n,r,a,i;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,Tn.Ys)(wr);case 3:if(r=e.sent,a=r.currentViewInfos,"detail"!==(i=a[n]).type||i.error){e.next=11;break}return e.next=9,(0,Tn.Cs)(Ar,i.model.name,i.key);case 9:return e.next=11,(0,Tn.gz)(o.lM(null));case 11:case"end":return e.stop()}}),e)}))()}function Rr(e){var t=e.payload.location;return Te().mark((function e(){var n,r,a,i,c,s,l;return Te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,Tn.RE)(w,n);case 3:if(null==(r=e.sent)||!r.entity||null==r||!r.key){e.next=28;break}return e.prev=5,e.next=8,(0,Tn.RE)(Vr,r);case 8:if(!(a=e.sent)){e.next=23;break}return i=a.entityName,c=a.key,e.next=13,(0,Tn.RE)(Ke.Z.invalidateDisplay,i,c);case 13:return e.next=15,(0,Tn.RE)(Ke.Z.fetchDisplay,i,c);case 15:return s=e.sent,e.next=18,(0,Tn.gz)(o.Hn(n,{display:s}));case 18:return e.next=20,(0,Tn.RE)(Dr,n);case 20:return l=e.sent,e.next=23,(0,Tn.gz)(o.Ss(l,{display:s}));case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(5),ur.Z.logError("breadcrumbs invalidation failed",e.t0);case 28:case"end":return e.stop()}}),e,null,[[5,25]])}))()}function Dr(e){var t;return Te().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Tn.RE)(w,e);case 2:if(null!==(t=n.sent)&&t.entity){n.next=5;break}return n.abrupt("return","");case 5:return n.abrupt("return",[t.entity,t.key,t.relation,t.view].filter(Boolean).join("/"));case 6:case"end":return n.stop()}}),gr)}function Vr(e){var t,n,r,a,i,o,c,s,l,u;return Te().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(e&&e.entity&&e.key&&"action"!==e.view){p.next=2;break}return p.abrupt("return",null);case 2:return p.next=4,(0,Tn.RE)(Ke.Z.fetchModel,e.entity);case 4:if(t=p.sent,e.relation){p.next=7;break}return p.abrupt("return",{entityName:t.name,key:e.key});case 7:if(!((n=e.relation.match(jr)).length<1)){p.next=10;break}return p.abrupt("return",null);case 10:r=t,a=null,i=0;case 13:if(!(i<n.length)){p.next=25;break}if(o=n[i].split("/"),c=W()(o,2),s=c[0],l=c[1],(u=r.paths[s])&&l){p.next=18;break}return p.abrupt("return",null);case 18:return p.next=20,(0,Tn.RE)(Ke.Z.fetchModel,u.targetEntity);case 20:r=p.sent,a={entityName:r.name,key:l};case 22:i++,p.next=13;break;case 25:return p.abrupt("return",a);case 26:case"end":return p.stop()}}),br)}function Ar(e,t){var n,r,a;return Te().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return n="client/entities/".concat(e,"/").concat(t,"/relations"),i.next=3,(0,Tn.RE)(Ke.Z.requestSaga,n);case 3:return r=i.sent,a=r.body.relations,i.next=7,(0,Tn.gz)(o.Fp(a));case 7:case"end":return i.stop()}}),xr)}const Ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rr,t=arguments.length>1?arguments[1]:void 0,n=nr[t.type];return n?n(e,t):e},Lr={container:En,reducers:{entities:(0,r.UY)({path:Ir,entityTemplate:Jn})},sagas:[Pr,Kn]}},67210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(74806),a=n(11467),i=n(44834),o=n(33773),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const p=(0,l.U)((0,r.ZP)((function(e){var t=e.path,n=e.context,r=e.onSuccess,l=e.intl,p=e.locale,d=e.emitAction,f=(0,s.Z)(t),m=f?[{id:"rel".concat(f.model),value:f.key}]:[],y=(0,c.Z)(n,"Domain");return(0,u.jsx)(a.ZP,{entityName:"Domain",formName:y,mode:"create",defaultValues:m,locale:p,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Domain/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createDomainSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:i.ZP,docsApp:o.default})})))},36340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(74806),a=n(11467),i=n(44834),o=n(33773),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const p=(0,l.U)((0,r.ZP)((function(e){var t=e.context,n=e.path,r=e.onSuccess,l=e.intl,p=e.locale,d=e.emitAction,f=(0,s.Z)(n),m=f?[{id:"rel".concat(f.model),value:f.key}]:[],y=(0,c.Z)(t,"Folder");return(0,u.jsx)(a.ZP,{entityName:"Folder",formName:y,mode:"create",defaultValues:m,locale:p,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Folder/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createFolderSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:i.ZP,docsApp:o.default})})))},96954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(59713),a=n.n(r),i=n(78788),o=n(85893);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const l=function(e){return(0,o.jsx)(i.Z,s(s({},e),{},{customDeleteEndpoint:"documents/delete"}))}},90100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(63038),a=n.n(r),i=n(11467),o=n(44834),c=n(33773),s=n(25660),l=n(20247),u=n(85893);const p=(0,l.U)((function(e){var t=e.selection,n=e.onSuccess,r=e.onCancel,l=e.locale,p=e.context,d=e.emitAction,f=e.navigate,m=t.ids[0].split("/"),y=a()(m,2),h=y[0],v=y[1];"Resource"===h&&(f("/docs/doc/".concat(v,"/detail")),r());var g=(0,s.Z)(p,h);return(0,u.jsx)(i.ZP,{entityName:h,formName:g,entityId:v,mode:"update",locale:l,onEntityUpdated:function(){var e=[{type:"entity-update-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},onEntityDeleted:function(){var e=[{type:"entity-delete-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:o.ZP,docsApp:c.default})}))},4505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var r,a,i,o=n(74806),c=n(50558),s=n(30081),l=n(20247),u=n(63038),p=n.n(u),d=n(28655),f=n.n(d),m=n(18446),y=n.n(m),h=n(1024),v=n(44012),g=n(38205),b=n(36589),x=n(35728),w=n(65035),j=n(33773),P=n(80722),O=n(85893),Z=g.ZP.div.withConfig({displayName:"StyledButtonsWrapper"})(r||(r=f()(["\n display: flex;\n justify-content: flex-end;\n\n "," {\n margin-right: 0;\n }\n"])),b.Z),E=(0,g.ZP)(x.Z).withConfig({displayName:"StyledLoadMask"})(a||(a=f()(["\n height: auto;\n"]))),k=function(e,t){return null!==e?"Move_docs_list_item":null!==t?"Move_root_docs_list_item_specific":"Move_root_docs_list_item"},T={initialize:s.j2,moveElements:s.w6};const N=(0,l.U)((0,c.connect)((function(e){return{isWaiting:e.docs.move.isWaiting,domainTypes:e.input.domainTypes,rootNodes:e.input.rootNodes,businessUnit:e.input.businessUnit,locale:e.intl.locale}}),T)((0,o.ZP)((function(e){var t=e.selection,n=e.onSuccess,r=e.onError,a=e.path,o=e.initialize,c=e.moveElements,s=e.isWaiting,l=e.domainTypes,u=e.rootNodes,d=e.businessUnit,f=e.locale,m=e.emitAction,g=(0,P.Z)(a),b={model:"Docs_list_item",key:"".concat(g.model,"/").concat(g.key)},x=(0,h.useState)(b),T=p()(x,2),N=T[0],C=T[1];(0,h.useEffect)((function(){o(t,n,r)}),[]);var S=function(e,t){switch(e){case"Domain":return"/docs/domain/".concat(t,"/list");case"Folder":return"/docs/folder/".concat(t,"/list");case"Resource":return;default:throw new Error("Unexpected model: ".concat(e))}};return(0,O.jsxs)(E,{required:[!s],children:[(0,O.jsx)(j.default,{routerType:"routerless",initialLocation:function(){if(null===N)return null;var e=N.key.split("/"),t=p()(e,2),n=t[0],r=t[1];return S(n,r)}(),listLimit:10,selectionStyle:"none",searchFormType:"none",disableViewPersistor:!0,getListFormName:k,onListParentChange:C,getCustomLocation:S,navigationStrategy:{},embedded:!0,emitAction:m,noLeftPadding:!0,domainTypes:l,rootNodes:u,businessUnit:d,sortable:!1,scrollBehaviour:"none",locale:f}),(0,O.jsx)(Z,{children:(0,O.jsx)(w.Z,{onClick:function(){return c(N.key,t.ids)},look:"raised",ink:"primary",disabled:null===N||y()(N,b),children:i||(i=(0,O.jsx)(v.Z,{id:"client.actions.dms-move.button"}))})})]})}))))},82445:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(59713),a=n.n(r),i=n(11467),o=n(44834),c=n(33773),s=n(85893);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const p=function(e){return(0,s.jsx)(i.ZP,u(u({},e),{},{listApp:o.ZP,docsApp:c.default}))}},25660:(e,t,n)=>{n.d(t,{Z:()=>r});const r=function(e,t){return e.detailFormNames&&e.detailFormNames[t]?e.detailFormNames[t]:"Dms".concat(t)}},44049:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(14892);const a=(i=r.Z,o=i.getIn,function(e,t){return function(n){var r=t||function(e){return o(e,"form")};return o(r(n),e+".initial")}});var i,o}}]);
package/dist/index.js CHANGED
@@ -46,4 +46,4 @@ e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,ge
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */var r=n(1024),o=n(61688);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,c=r.useRef,s=r.useEffect,u=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var f=c(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=u((function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return c=t}return c=e}if(t=c,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(a=e,c=n)}var a,c,s=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var p=a(e,f[0],f[1]);return s((function(){d.hasValue=!0,d.value=p}),[p]),l(p),p}},61688:(e,t,n)=>{"use strict";e.exports=n(53250)},52798:(e,t,n)=>{"use strict";e.exports=n(50139)},28721:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let o;const i=new Uint8Array(16);function a(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(i)}const c=[];for(let e=0;e<256;++e)c.push((e+256).toString(16).slice(1));function s(e,t=0){return(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase()}const u=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();const o=(e=e||{}).random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return s(o)}},1024:t=>{"use strict";t.exports=e},30314:e=>{"use strict";e.exports=t},71298:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},38088:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},87462:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,{Z:()=>r})},86:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,{Z:()=>r})},31955:(e,t,n)=>{"use strict";
48
48
  /*! js-cookie v3.0.5 | MIT */
49
- function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}n.d(t,{Z:()=>o});var o=function e(t,n){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=r({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var c=decodeURIComponent(i[0]);if(r[c]=t.read(a,c),e===c)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){o(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},31599:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{Z:()=>r})},28549:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},2717:(e,t,n)=>{"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,{Z:()=>r})},33417:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(28549);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},32924:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{Z:()=>r})},1972:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78001);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||(0,r.Z)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},62360:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,{Z:()=>r})},78001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(31599);function o(e,t){if(e){if("string"==typeof e)return(0,r.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(e,t):void 0}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,a.amdD=function(){throw new Error("define cannot be used indirect")},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>"chunk-"+({85:"code-editor",107:"actions",141:"docs-actions",198:"vendor-fontawesome",802:"html-editor",877:"vendor-libphonenumber-js"}[e]||e)+"."+{85:"20caf6999da927934858",107:"732f8e81ecbbc7a731ec",130:"2b45a3f384e3c81f8600",141:"bea4d1e0cdc4ed4fd062",198:"18f139b7f063c331b37f",280:"b0df5ee7b5063fb8e7ac",467:"265d01f0099d23636b86",531:"3ddb3f9b0ddcdbe7f00e",560:"fd96eb53cd58eb8f09d8",608:"df86d2dc5c79754c38cd",631:"d37e9be460560f1872d9",802:"9587bcf32761abbcf391",834:"6b13905a28688beb32cb",860:"4af1ca8729c42539a9f8",877:"8574a7f488e7a8a26c5a",896:"5fa4268f01f679e80643"}[e]+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="tocco-admin:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var c,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){c=f;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,a.nc&&c.setAttribute("nonce",a.nc),c.setAttribute("data-webpack",r+o),c.src=e),n[e]=[t];var d=(t,r)=>{c.onerror=c.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),s&&document.head.appendChild(c)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={179:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=a.p+a.u(t),c=new Error;a.l(i,(n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,c,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)s(a)}for(t&&t(n);u<i.length;u++)o=i[u],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunktocco_admin=self.webpackChunktocco_admin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),a.nc=void 0;var c={};return(()=>{"use strict";a.r(c),a.d(c,{default:()=>vt});var e,t=a(45697),n=a.n(t),r=a(1024),o=a.n(r),i=a(30314),s=a.n(i),u=a(50600),l=a(18882),f=a(50628),d=a(19743),p=a(19241),h=a(75139),m=a(28542),v=a(30604),g=a(91073),y=a(87757),b=a.n(y),w=a(34857),O=a(59713),x=a.n(O),E=a(81770),k=a(23887);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=(e={},x()(e,k.wI,E.Z.singleTransferReducer("menuOpen")),x()(e,k.E6,E.Z.singleTransferReducer("modulesMenuTree")),x()(e,k.XU,E.Z.singleTransferReducer("settingsMenuTree")),x()(e,k.yE,E.Z.singleTransferReducer("systemMenuTree")),x()(e,k.Lt,E.Z.singleTransferReducer("completeMenuTree")),x()(e,k.hE,(function(e){return S(S({},e),{},{menuOpen:!e.menuOpen})})),x()(e,k.Cf,E.Z.singleTransferReducer("activeMenuTab")),x()(e,k.zw,(function(e,t){var n=t.payload.activeMenuTab;return S(S({},e),{},{menuOpen:e.activeMenuTab!==n||!e.menuOpen})})),e),T={menuOpen:!1,entities:[],activeMenuTab:"modules"};var C=a(81719),_=a(20534),A=a(29785),R=b().mark(L),N=b().mark(F),Z=b().mark(B),D=b().mark(z),I=function(e){return e.navigation},M="admin.activeMenu";function L(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(C.Z.requestSaga,"client/menus/".concat(e));case 2:return t=n.sent,n.abrupt("return",t.body.menuItems);case 4:case"end":return n.stop()}}),R)}function F(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.RE)(L,"modules");case 2:return e=o.sent,o.next=5,(0,w.gz)(k.NO(e));case 5:return o.next=7,(0,w.RE)(L,"settings");case 7:return t=o.sent,o.next=10,(0,w.gz)(k.qo(t));case 10:return o.next=12,(0,w.RE)(L,"system");case 12:return n=o.sent,o.next=15,(0,w.gz)(k.e2(n));case 15:return o.next=17,(0,w.RE)(L,"all");case 17:return r=o.sent,o.next=20,(0,w.gz)(k.sM(r));case 20:case"end":return o.stop()}}),N)}function H(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[M])){e.next=4;break}return e.next=4,(0,w.gz)(k.il(n));case 4:case"end":return e.stop()}}),e)}))()}function U(e){var t=e.payload.activeMenuTab;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.gz)((0,A.RK)(x()({},M,t)));case 2:case"end":return e.stop()}}),e)}))()}function B(e){var t,n,r,o,i;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,w.Ys)(I);case 2:if(t=a.sent,n=t.settingsMenuTree,r=t.modulesMenuTree,o=t.systemMenuTree,i=t.completeMenuTree,e!==_.LG.MODULES){a.next=9;break}return a.abrupt("return",r);case 9:if(e!==_.LG.SETTINGS){a.next=11;break}return a.abrupt("return",n);case 11:if(e!==_.LG.SYSTEM){a.next=13;break}return a.abrupt("return",o);case 13:if(e!==_.LG.COMPLETE){a.next=15;break}return a.abrupt("return",i);case 15:return a.abrupt("return",null);case 16:case"end":return a.stop()}}),Z)}function W(e){var t=e.payload.menuTab;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(B,t);case 2:if(n=e.sent,!((null==n?void 0:n.length)>0)){e.next=9;break}return e.next=7,(0,w.gz)(k.dz(t));case 7:return e.next=9,(0,w.gz)(k.il(t));case 9:case"end":return e.stop()}}),e)}))()}function z(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(k.gX,F),(0,w.Ds)(500,k.Cf,U),(0,w.Fm)(A.xG,H),(0,w.Fm)(k.Ai,W)]);case 2:case"end":return e.stop()}}),D)}var G=b().mark(q);function q(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(z)]);case 2:case"end":return e.stop()}}),G)}const V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments.length>1?arguments[1]:void 0,n=j[t.type];return n?n(e,t):e};var Y;function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var K=(Y={},x()(Y,A.Oq,E.Z.singleTransferReducer("serverSettings")),x()(Y,A.xG,E.Z.singleTransferReducer("userPreferences")),x()(Y,A.CO,(function(e,t){var n=t.payload;return X(X({},e),{},{userPreferences:X(X({},e.userPreferences),n.preferences)})})),Y),J={serverSettings:{},userPreferences:{}};var Q=a(63038),ee=a.n(Q);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var re=function(e){return Object.entries(e).reduce((function(e,t){var n=ee()(t,2),r=n[0],o=n[1];return ne(ne({},e),{},x()({},r,function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(o)))}),{})},oe=b().mark(se),ie=b().mark(le);function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(){var e,t,n,r,o;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,w.RE)(C.Z.fetchServerSettings);case 2:return e=i.sent,i.next=5,(0,w.gz)(A.C_(e));case 5:return i.next=7,(0,w.RE)(C.Z.fetchUserPreferences,"admin.*");case 7:return t=i.sent,i.next=10,(0,w.RE)(re,t);case 10:return n=i.sent,i.next=13,(0,w.RE)(C.Z.fetchUserPreferences,"admintree.*");case 13:return r=i.sent,i.next=16,(0,w.RE)(re,r);case 16:return o=i.sent,i.next=19,(0,w.gz)(A.yu(ce(ce({},o),n)));case 19:case"end":return i.stop()}}),oe)}function ue(e){var t=e.payload.preferences;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(C.Z.savePreferences,t);case 2:case"end":return e.stop()}}),e)}))()}function le(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(A.c2,se),(0,w.Fm)(A.CO,ue)]);case 2:case"end":return e.stop()}}),ie)}var fe=b().mark(de);function de(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(le)]);case 2:case"end":return e.stop()}}),fe)}const pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0,n=K[t.type];return n?n(e,t):e};var he,me=a(88757),ve=(he={},x()(he,me.Wt,E.Z.singleTransferReducer("username")),x()(he,me.i$,E.Z.singleTransferReducer("currentBusinessUnit")),x()(he,me.H7,E.Z.singleTransferReducer("businessUnits")),x()(he,me.bZ,E.Z.singleTransferReducer("ssoAvailable")),x()(he,me.jr,E.Z.singleTransferReducer("pendingChanges")),he),ge={username:"",currentBusinessUnit:{label:"",id:""},businessUnits:[],ssoAvailable:!1,pendingChanges:!1};var ye=a(31955),be=a(44422),we=a(21913),Oe=b().mark(Ee),xe=b().mark(ke);function Ee(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(C.Z.requestSaga,"modules");case 2:if(e=n.sent,e.body.modules.includes("nice.optional.sso")){n.next=6;break}return n.abrupt("return",!1);case 6:return n.next=8,(0,w.RE)(C.Z.fetchEntityCount,"Openid_provider",{where:"active == true"});case 8:return t=n.sent,n.abrupt("return",t>0);case 10:case"end":return n.stop()}}),Oe)}function ke(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===(e=we.Z.getLongTerm("server","ssoAvailable"))){n.next=5;break}return n.abrupt("return",e);case 5:return n.next=7,(0,w.RE)(Ee);case 7:return t=n.sent,we.Z.addLongTerm("server","ssoAvailable",t),n.abrupt("return",t);case 10:case"end":return n.stop()}}),xe)}var Pe=a(84455),Se=a(2100),je=a(85893),Te=b().mark(Be),Ce=b().mark(We),_e=b().mark(ze),Ae=b().mark(Ge),Re=b().mark(qe),Ne=b().mark(Ye),Ze=b().mark(Xe),De=b().mark(Ke),Ie=b().mark(Je),Me=b().mark(et),Le=b().mark(tt),Fe=function(e){return e.session},He=function(e){return e.input},Ue=function(e){return e.app};function Be(e){var t,n,r,o;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e/2*60*1e3,i.next=3,(0,w.RE)(m.Z.doSessionRequest);case 3:return n=i.sent,r=n.success,o=n.adminAllowed,i.next=8,(0,w.gz)(m.Z.setLoggedIn(r));case 8:return i.next=10,(0,w.gz)(m.Z.setAdminAllowed(o));case 10:return i.next=12,(0,w.RE)(We,t);case 12:return i.next=14,(0,w.RE)(Be,e);case 14:case"end":return i.stop()}}),Te)}function We(e){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.gw)(e);case 2:case"end":return t.stop()}}),Ce)}function ze(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(m.Z.doRequest,"logout",{method:"POST"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),_e)}function Ge(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.Ys)(He);case 2:e=n.sent,t=e.baseRoute,window.location.href=t||"/";case 5:case"end":return n.stop()}}),Ae)}function qe(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.Ys)(Ue);case 2:return e=o.sent,t=e.textResourceModules,o.next=6,(0,w.RE)(Se.Z.getUserLocale);case 6:return n=o.sent,o.next=9,(0,w.RE)(Se.Z.getChangeLocaleAction,t,n);case 9:return r=o.sent,o.next=12,(0,w.gz)(r);case 12:case"end":return o.stop()}}),Re)}function Ve(e){var t=e.payload;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sessionTimeout,e.next=3,(0,w.RE)(qe);case 3:return e.next=5,(0,w.gz)(m.Z.setAdminAllowed(void 0));case 5:return e.next=7,(0,w.gz)(m.Z.setLoggedIn(!0));case 7:return e.next=9,(0,w.gz)(v.Z.connectSocket());case 9:return e.next=11,(0,w.RE)(Be,n);case 11:case"end":return e.stop()}}),e)}))()}function Ye(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(be.CE);case 2:return t=n.sent,n.next=5,(0,w.gz)(v.Z.modal("navigation-pending-changes","client.admin.confirmTouchedFormTitle",e,(function(e){var n=e.close;return(0,je.jsx)(Pe.Z,{onYes:function(){n(),t.put("yes")},onNo:function(){n(),t.put("no")}})}),!0,(function(){return t.put("no")})));case 5:return n.next=7,(0,w.qn)(t);case 7:return n.abrupt("return",n.sent);case 8:case"end":return n.stop()}}),Ne)}function $e(e){var t=e.payload;return b().mark((function e(){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.message,r=t.confirmCallback,e.next=3,(0,w.RE)(Ye,n);case 3:if("yes"!==e.sent){e.next=9;break}return e.next=7,(0,w.RE)(r,!0);case 7:e.next=11;break;case 9:return e.next=11,(0,w.RE)(r,!1);case 11:case"end":return e.stop()}}),e)}))()}function Xe(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.Ys)(Fe);case 2:if(e=t.sent,!e.pendingChanges){t.next=10;break}return t.next=7,(0,w.RE)(Ye,"client.admin.confirmTouchedFormLogout");case 7:if("yes"===t.sent){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,(0,w.RE)(ye.Z.remove,"sso-autologin");case 12:return t.next=14,(0,w.RE)(ze);case 14:return t.next=16,(0,w.gz)(m.Z.setLoggedIn(!1));case 16:return t.next=18,(0,w.gz)(v.Z.closeSocket());case 18:return t.next=20,(0,w.RE)(Ge);case 20:case"end":return t.stop()}}),Ze)}function Ke(){var e,t,n;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,w.RE)(C.Z.fetchPrincipal);case 2:return e=r.sent,t=e.username,n=e.currentBusinessUnit,r.next=7,(0,w.gz)(me.b6(t));case 7:return r.next=9,(0,w.gz)(me.OZ(n));case 9:case"end":return r.stop()}}),De)}function Je(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.RE)(C.Z.requestSaga,"principals/businessunits");case 2:return e=t.sent,t.next=5,(0,w.gz)(me.PV(e.body.data));case 5:case"end":return t.stop()}}),Ie)}function Qe(e){var t=e.payload.businessUnitId;return b().mark((function e(){var n,r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Ys)(Fe);case 2:return n=e.sent,r=n.username,o="principals/".concat(r,"/businessunit"),e.next=7,(0,w.RE)(C.Z.requestSaga,o,{method:"PUT",body:{businessUnit:t}});case 7:return e.next=9,(0,w.RE)(l.Z.reinitialiseCache);case 9:location.reload();case 10:case"end":return e.stop()}}),e)}))()}function et(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.RE)(ke);case 2:return e=t.sent,t.next=5,(0,w.gz)(me.$M(e));case 5:case"end":return t.stop()}}),Me)}function tt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(me.qn,Ve),(0,w.Fm)(me.O8,Xe),(0,w.Fm)(me.Em,Ke),(0,w.Fm)(me.Np,Je),(0,w.Fm)(me.hu,Qe),(0,w.Fm)(me.sr,et),(0,w.Fm)(me.b0,$e)]);case 2:case"end":return e.stop()}}),Le)}var nt=b().mark(rt);function rt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(tt)]);case 2:case"end":return e.stop()}}),nt)}const ot={session:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge,t=arguments.length>1?arguments[1]:void 0,n=ve[t.type];return n?n(e,t):e},navigation:V,preferences:pe};var it=[rt,q,de],at=a(46054),ct=a(90169);const st=[{ctrl:!0,alt:!0,code:"KeyM",actions:[(0,k.lQ)("modules")],global:!0},{ctrl:!0,alt:!0,code:"KeyN",actions:[(0,k.lQ)("settings")],global:!0},{ctrl:!0,alt:!0,code:"KeyO",actions:[(0,k.lQ)("complete")],global:!0},{ctrl:!0,alt:!0,code:"KeyK",actions:[(0,k.lQ)("system")],global:!0}];var ut,lt,ft="admin",dt=o().lazy((function(){return Promise.all([a.e(130),a.e(802),a.e(896),a.e(834),a.e(85),a.e(280),a.e(531)]).then(a.bind(a,88531))})),pt=function(){return(0,je.jsx)(je.Fragment,{children:ut||(ut=(0,je.jsx)(r.Suspense,{fallback:"",children:(0,je.jsx)(dt,{})}))})},ht=function(e,t,n,r){window.reactRegistry&&window.reactRegistry.setReact&&window.reactRegistry.setReact(o(),s());var i=lt||(lt=(0,je.jsx)(pt,{})),a=l.Z.createStore(ot,it,t,ft);return p.Z.addToStore(a,(function(){return{}})),u.Z.addToStore(a),f.Z.addToStore(a,(function(){return{appComponent:at.Z,navigationStrategy:ct.ZP}})),f.Z.dynamicActionsAddToStore(a),d.Z.addToStore(a,!0,["console","remote","notification"]),v.Z.addToStore(a,!0,{withNotificationCenter:!0}),m.Z.addToStore(a),h.Z.addToStore(a,st),g.Z.addToStore(a),l.Z.createApp(ft,i,a,{input:t,events:n,actions:[],publicPath:r,textResourceModules:["component","common","actions","login","sso-login","entity-browser","entity-list","entity-detail","dashboard","docs-browser",ft]})};l.Z.registerAppInRegistry(ft,ht);var mt=function(e){return l.Z.useApp({initApp:ht,props:e,packageName:ft}).component};mt.propTypes={baseRoute:n().string};const vt=mt})(),c})()));
49
+ function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}n.d(t,{Z:()=>o});var o=function e(t,n){function o(e,o,i){if("undefined"!=typeof document){"number"==typeof(i=r({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var c=decodeURIComponent(i[0]);if(r[c]=t.read(a,c),e===c)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){o(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},31599:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{Z:()=>r})},28549:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},2717:(e,t,n)=>{"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,{Z:()=>r})},33417:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(28549);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},32924:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.d(t,{Z:()=>r})},1972:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78001);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}(e,t)||(0,r.Z)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},62360:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,{Z:()=>r})},78001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(31599);function o(e,t){if(e){if("string"==typeof e)return(0,r.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(e,t):void 0}}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=o,a.amdD=function(){throw new Error("define cannot be used indirect")},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>"chunk-"+({85:"code-editor",107:"actions",141:"docs-actions",198:"vendor-fontawesome",802:"html-editor",877:"vendor-libphonenumber-js"}[e]||e)+"."+{85:"20caf6999da927934858",107:"97aa7a6d7e85b06f45bc",130:"2b45a3f384e3c81f8600",141:"74103210db187d2e89af",198:"18f139b7f063c331b37f",280:"b0df5ee7b5063fb8e7ac",467:"265d01f0099d23636b86",531:"6efb9993d64cbb783438",560:"fd96eb53cd58eb8f09d8",608:"df86d2dc5c79754c38cd",631:"d37e9be460560f1872d9",802:"9587bcf32761abbcf391",834:"1a872258a8daf79cd765",860:"4af1ca8729c42539a9f8",877:"8574a7f488e7a8a26c5a",896:"1024ddd00ee532ef3387"}[e]+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="tocco-admin:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var c,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==r+o){c=f;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,a.nc&&c.setAttribute("nonce",a.nc),c.setAttribute("data-webpack",r+o),c.src=e),n[e]=[t];var d=(t,r)=>{c.onerror=c.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),s&&document.head.appendChild(c)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.p="/",(()=>{var e={179:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=a.p+a.u(t),c=new Error;a.l(i,(n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,r[1](c)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,c,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)s(a)}for(t&&t(n);u<i.length;u++)o=i[u],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunktocco_admin=self.webpackChunktocco_admin||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),a.nc=void 0;var c={};return(()=>{"use strict";a.r(c),a.d(c,{default:()=>vt});var e,t=a(45697),n=a.n(t),r=a(1024),o=a.n(r),i=a(30314),s=a.n(i),u=a(50600),l=a(18882),f=a(50628),d=a(19743),p=a(19241),h=a(75139),m=a(28542),v=a(30604),g=a(91073),y=a(87757),b=a.n(y),w=a(34857),O=a(59713),x=a.n(O),E=a(81770),k=a(23887);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var j=(e={},x()(e,k.wI,E.Z.singleTransferReducer("menuOpen")),x()(e,k.E6,E.Z.singleTransferReducer("modulesMenuTree")),x()(e,k.XU,E.Z.singleTransferReducer("settingsMenuTree")),x()(e,k.yE,E.Z.singleTransferReducer("systemMenuTree")),x()(e,k.Lt,E.Z.singleTransferReducer("completeMenuTree")),x()(e,k.hE,(function(e){return S(S({},e),{},{menuOpen:!e.menuOpen})})),x()(e,k.Cf,E.Z.singleTransferReducer("activeMenuTab")),x()(e,k.zw,(function(e,t){var n=t.payload.activeMenuTab;return S(S({},e),{},{menuOpen:e.activeMenuTab!==n||!e.menuOpen})})),e),T={menuOpen:!1,entities:[],activeMenuTab:"modules"};var C=a(81719),_=a(20534),A=a(29785),R=b().mark(L),N=b().mark(F),Z=b().mark(B),D=b().mark(z),I=function(e){return e.navigation},M="admin.activeMenu";function L(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(C.Z.requestSaga,"client/menus/".concat(e));case 2:return t=n.sent,n.abrupt("return",t.body.menuItems);case 4:case"end":return n.stop()}}),R)}function F(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.RE)(L,"modules");case 2:return e=o.sent,o.next=5,(0,w.gz)(k.NO(e));case 5:return o.next=7,(0,w.RE)(L,"settings");case 7:return t=o.sent,o.next=10,(0,w.gz)(k.qo(t));case 10:return o.next=12,(0,w.RE)(L,"system");case 12:return n=o.sent,o.next=15,(0,w.gz)(k.e2(n));case 15:return o.next=17,(0,w.RE)(L,"all");case 17:return r=o.sent,o.next=20,(0,w.gz)(k.sM(r));case 20:case"end":return o.stop()}}),N)}function H(e){var t=e.payload.userPreferences;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t[M])){e.next=4;break}return e.next=4,(0,w.gz)(k.il(n));case 4:case"end":return e.stop()}}),e)}))()}function U(e){var t=e.payload.activeMenuTab;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.gz)((0,A.RK)(x()({},M,t)));case 2:case"end":return e.stop()}}),e)}))()}function B(e){var t,n,r,o,i;return b().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,w.Ys)(I);case 2:if(t=a.sent,n=t.settingsMenuTree,r=t.modulesMenuTree,o=t.systemMenuTree,i=t.completeMenuTree,e!==_.LG.MODULES){a.next=9;break}return a.abrupt("return",r);case 9:if(e!==_.LG.SETTINGS){a.next=11;break}return a.abrupt("return",n);case 11:if(e!==_.LG.SYSTEM){a.next=13;break}return a.abrupt("return",o);case 13:if(e!==_.LG.COMPLETE){a.next=15;break}return a.abrupt("return",i);case 15:return a.abrupt("return",null);case 16:case"end":return a.stop()}}),Z)}function W(e){var t=e.payload.menuTab;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(B,t);case 2:if(n=e.sent,!((null==n?void 0:n.length)>0)){e.next=9;break}return e.next=7,(0,w.gz)(k.dz(t));case 7:return e.next=9,(0,w.gz)(k.il(t));case 9:case"end":return e.stop()}}),e)}))()}function z(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(k.gX,F),(0,w.Ds)(500,k.Cf,U),(0,w.Fm)(A.xG,H),(0,w.Fm)(k.Ai,W)]);case 2:case"end":return e.stop()}}),D)}var G=b().mark(q);function q(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(z)]);case 2:case"end":return e.stop()}}),G)}const V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T,t=arguments.length>1?arguments[1]:void 0,n=j[t.type];return n?n(e,t):e};var Y;function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var K=(Y={},x()(Y,A.Oq,E.Z.singleTransferReducer("serverSettings")),x()(Y,A.xG,E.Z.singleTransferReducer("userPreferences")),x()(Y,A.CO,(function(e,t){var n=t.payload;return X(X({},e),{},{userPreferences:X(X({},e.userPreferences),n.preferences)})})),Y),J={serverSettings:{},userPreferences:{}};var Q=a(63038),ee=a.n(Q);function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var re=function(e){return Object.entries(e).reduce((function(e,t){var n=ee()(t,2),r=n[0],o=n[1];return ne(ne({},e),{},x()({},r,function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(o)))}),{})},oe=b().mark(se),ie=b().mark(le);function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){x()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(){var e,t,n,r,o;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,w.RE)(C.Z.fetchServerSettings);case 2:return e=i.sent,i.next=5,(0,w.gz)(A.C_(e));case 5:return i.next=7,(0,w.RE)(C.Z.fetchUserPreferences,"admin.*");case 7:return t=i.sent,i.next=10,(0,w.RE)(re,t);case 10:return n=i.sent,i.next=13,(0,w.RE)(C.Z.fetchUserPreferences,"admintree.*");case 13:return r=i.sent,i.next=16,(0,w.RE)(re,r);case 16:return o=i.sent,i.next=19,(0,w.gz)(A.yu(ce(ce({},o),n)));case 19:case"end":return i.stop()}}),oe)}function ue(e){var t=e.payload.preferences;return b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(C.Z.savePreferences,t);case 2:case"end":return e.stop()}}),e)}))()}function le(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(A.c2,se),(0,w.Fm)(A.CO,ue)]);case 2:case"end":return e.stop()}}),ie)}var fe=b().mark(de);function de(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(le)]);case 2:case"end":return e.stop()}}),fe)}const pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0,n=K[t.type];return n?n(e,t):e};var he,me=a(88757),ve=(he={},x()(he,me.Wt,E.Z.singleTransferReducer("username")),x()(he,me.i$,E.Z.singleTransferReducer("currentBusinessUnit")),x()(he,me.H7,E.Z.singleTransferReducer("businessUnits")),x()(he,me.bZ,E.Z.singleTransferReducer("ssoAvailable")),x()(he,me.jr,E.Z.singleTransferReducer("pendingChanges")),he),ge={username:"",currentBusinessUnit:{label:"",id:""},businessUnits:[],ssoAvailable:!1,pendingChanges:!1};var ye=a(31955),be=a(44422),we=a(21913),Oe=b().mark(Ee),xe=b().mark(ke);function Ee(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(C.Z.requestSaga,"modules");case 2:if(e=n.sent,e.body.modules.includes("nice.optional.sso")){n.next=6;break}return n.abrupt("return",!1);case 6:return n.next=8,(0,w.RE)(C.Z.fetchEntityCount,"Openid_provider",{where:"active == true"});case 8:return t=n.sent,n.abrupt("return",t>0);case 10:case"end":return n.stop()}}),Oe)}function ke(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===(e=we.Z.getLongTerm("server","ssoAvailable"))){n.next=5;break}return n.abrupt("return",e);case 5:return n.next=7,(0,w.RE)(Ee);case 7:return t=n.sent,we.Z.addLongTerm("server","ssoAvailable",t),n.abrupt("return",t);case 10:case"end":return n.stop()}}),xe)}var Pe=a(84455),Se=a(2100),je=a(85893),Te=b().mark(Be),Ce=b().mark(We),_e=b().mark(ze),Ae=b().mark(Ge),Re=b().mark(qe),Ne=b().mark(Ye),Ze=b().mark(Xe),De=b().mark(Ke),Ie=b().mark(Je),Me=b().mark(et),Le=b().mark(tt),Fe=function(e){return e.session},He=function(e){return e.input},Ue=function(e){return e.app};function Be(e){var t,n,r,o;return b().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e/2*60*1e3,i.next=3,(0,w.RE)(m.Z.doSessionRequest);case 3:return n=i.sent,r=n.success,o=n.adminAllowed,i.next=8,(0,w.gz)(m.Z.setLoggedIn(r));case 8:return i.next=10,(0,w.gz)(m.Z.setAdminAllowed(o));case 10:return i.next=12,(0,w.RE)(We,t);case 12:return i.next=14,(0,w.RE)(Be,e);case 14:case"end":return i.stop()}}),Te)}function We(e){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.gw)(e);case 2:case"end":return t.stop()}}),Ce)}function ze(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.RE)(m.Z.doRequest,"logout",{method:"POST"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),_e)}function Ge(){var e,t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.Ys)(He);case 2:e=n.sent,t=e.baseRoute,window.location.href=t||"/";case 5:case"end":return n.stop()}}),Ae)}function qe(){var e,t,n,r;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,w.Ys)(Ue);case 2:return e=o.sent,t=e.textResourceModules,o.next=6,(0,w.RE)(Se.Z.getUserLocale);case 6:return n=o.sent,o.next=9,(0,w.RE)(Se.Z.getChangeLocaleAction,t,n);case 9:return r=o.sent,o.next=12,(0,w.gz)(r);case 12:case"end":return o.stop()}}),Re)}function Ve(e){var t=e.payload;return b().mark((function e(){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sessionTimeout,e.next=3,(0,w.RE)(qe);case 3:return e.next=5,(0,w.gz)(m.Z.setAdminAllowed(void 0));case 5:return e.next=7,(0,w.gz)(m.Z.setLoggedIn(!0));case 7:return e.next=9,(0,w.gz)(v.Z.connectSocket());case 9:return e.next=11,(0,w.RE)(Be,n);case 11:case"end":return e.stop()}}),e)}))()}function Ye(e){var t;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.RE)(be.CE);case 2:return t=n.sent,n.next=5,(0,w.gz)(v.Z.modal("navigation-pending-changes","client.admin.confirmTouchedFormTitle",e,(function(e){var n=e.close;return(0,je.jsx)(Pe.Z,{onYes:function(){n(),t.put("yes")},onNo:function(){n(),t.put("no")}})}),!0,(function(){return t.put("no")})));case 5:return n.next=7,(0,w.qn)(t);case 7:return n.abrupt("return",n.sent);case 8:case"end":return n.stop()}}),Ne)}function $e(e){var t=e.payload;return b().mark((function e(){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.message,r=t.confirmCallback,e.next=3,(0,w.RE)(Ye,n);case 3:if("yes"!==e.sent){e.next=9;break}return e.next=7,(0,w.RE)(r,!0);case 7:e.next=11;break;case 9:return e.next=11,(0,w.RE)(r,!1);case 11:case"end":return e.stop()}}),e)}))()}function Xe(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.Ys)(Fe);case 2:if(e=t.sent,!e.pendingChanges){t.next=10;break}return t.next=7,(0,w.RE)(Ye,"client.admin.confirmTouchedFormLogout");case 7:if("yes"===t.sent){t.next=10;break}return t.abrupt("return");case 10:return t.next=12,(0,w.RE)(ye.Z.remove,"sso-autologin");case 12:return t.next=14,(0,w.RE)(ze);case 14:return t.next=16,(0,w.gz)(m.Z.setLoggedIn(!1));case 16:return t.next=18,(0,w.gz)(v.Z.closeSocket());case 18:return t.next=20,(0,w.RE)(Ge);case 20:case"end":return t.stop()}}),Ze)}function Ke(){var e,t,n;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,w.RE)(C.Z.fetchPrincipal);case 2:return e=r.sent,t=e.username,n=e.currentBusinessUnit,r.next=7,(0,w.gz)(me.b6(t));case 7:return r.next=9,(0,w.gz)(me.OZ(n));case 9:case"end":return r.stop()}}),De)}function Je(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.RE)(C.Z.requestSaga,"principals/businessunits");case 2:return e=t.sent,t.next=5,(0,w.gz)(me.PV(e.body.data));case 5:case"end":return t.stop()}}),Ie)}function Qe(e){var t=e.payload.businessUnitId;return b().mark((function e(){var n,r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.Ys)(Fe);case 2:return n=e.sent,r=n.username,o="principals/".concat(r,"/businessunit"),e.next=7,(0,w.RE)(C.Z.requestSaga,o,{method:"PUT",body:{businessUnit:t}});case 7:return e.next=9,(0,w.RE)(l.Z.reinitialiseCache);case 9:location.reload();case 10:case"end":return e.stop()}}),e)}))()}function et(){var e;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,w.RE)(ke);case 2:return e=t.sent,t.next=5,(0,w.gz)(me.$M(e));case 5:case"end":return t.stop()}}),Me)}function tt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.Fm)(me.qn,Ve),(0,w.Fm)(me.O8,Xe),(0,w.Fm)(me.Em,Ke),(0,w.Fm)(me.Np,Je),(0,w.Fm)(me.hu,Qe),(0,w.Fm)(me.sr,et),(0,w.Fm)(me.b0,$e)]);case 2:case"end":return e.stop()}}),Le)}var nt=b().mark(rt);function rt(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.$6)([(0,w.rM)(tt)]);case 2:case"end":return e.stop()}}),nt)}const ot={session:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge,t=arguments.length>1?arguments[1]:void 0,n=ve[t.type];return n?n(e,t):e},navigation:V,preferences:pe};var it=[rt,q,de],at=a(46054),ct=a(90169);const st=[{ctrl:!0,alt:!0,code:"KeyM",actions:[(0,k.lQ)("modules")],global:!0},{ctrl:!0,alt:!0,code:"KeyN",actions:[(0,k.lQ)("settings")],global:!0},{ctrl:!0,alt:!0,code:"KeyO",actions:[(0,k.lQ)("complete")],global:!0},{ctrl:!0,alt:!0,code:"KeyK",actions:[(0,k.lQ)("system")],global:!0}];var ut,lt,ft="admin",dt=o().lazy((function(){return Promise.all([a.e(130),a.e(802),a.e(896),a.e(834),a.e(85),a.e(280),a.e(531)]).then(a.bind(a,88531))})),pt=function(){return(0,je.jsx)(je.Fragment,{children:ut||(ut=(0,je.jsx)(r.Suspense,{fallback:"",children:(0,je.jsx)(dt,{})}))})},ht=function(e,t,n,r){window.reactRegistry&&window.reactRegistry.setReact&&window.reactRegistry.setReact(o(),s());var i=lt||(lt=(0,je.jsx)(pt,{})),a=l.Z.createStore(ot,it,t,ft);return p.Z.addToStore(a,(function(){return{}})),u.Z.addToStore(a),f.Z.addToStore(a,(function(){return{appComponent:at.Z,navigationStrategy:ct.ZP}})),f.Z.dynamicActionsAddToStore(a),d.Z.addToStore(a,!0,["console","remote","notification"]),v.Z.addToStore(a,!0,{withNotificationCenter:!0}),m.Z.addToStore(a),h.Z.addToStore(a,st),g.Z.addToStore(a),l.Z.createApp(ft,i,a,{input:t,events:n,actions:[],publicPath:r,textResourceModules:["component","common","actions","login","sso-login","entity-browser","entity-list","entity-detail","dashboard","docs-browser",ft]})};l.Z.registerAppInRegistry(ft,ht);var mt=function(e){return l.Z.useApp({initApp:ht,props:e,packageName:ft}).component};mt.propTypes={baseRoute:n().string};const vt=mt})(),c})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tocco-admin",
3
- "version": "1.0.249",
3
+ "version": "1.0.251",
4
4
  "description": "Alpha version of new tocco admin.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,6 +0,0 @@
1
- (self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[896],{78788:(e,t,n)=>{"use strict";n.d(t,{Z:()=>mt});var r,o=n(45697),i=n.n(o),a=n(50600),s=n(18882),c=n(19241),l=n(30604),u=n(73665),d=n(74806),f=n(50558),p="root/LOAD_DIALOG_INFO",h="delete/SET_DELETE_DIALOG_INFO",m="delete/DO_DELETE",y="delete/SET_DELETING_IN_PROGRESS",g="delete/ON_CANCEL",v="delete/SET_ENTITIES_TO_DELETE",b=function(e){return{type:h,payload:{dialogInfo:e}}},E=function(){return{type:m}},w=function(e){return{type:v,payload:{entitiesToDelete:e}}},O=n(1024),x=n.n(O),C=n(35728),_=n(44012),N=n(93235),I=n(34206),k=n(319),S=n.n(k),R=n(63038),P=n.n(R),j=n(28655),M=n.n(j),T=n(38205),L=n(76791),A=n(85893);const D=function(e){var t=e.relatedEntity,n=e.children,o=e.maxCountLink;if(t.keys.length<o&&0===t.keysOtherBu.length)return n;var i=(0,A.jsxs)(A.Fragment,{children:[t.keys.length>o&&(r||(r=(0,A.jsx)(I.ZP.P,{children:(0,A.jsx)(_.Z,{id:"client.delete.tooManyRecords"})}))),t.keysOtherBu.length>0&&(0,A.jsx)(I.ZP.P,{children:(0,A.jsx)(_.Z,{id:"client.delete.recordInOtherBU",values:{count:t.keysOtherBu.length}})})]});return(0,A.jsx)(L.Z,{content:i,placement:"top",children:n})};var B,Z,F=T.ZP.span.withConfig({displayName:"NonBreakingText"})(B||(B=M()(["\n white-space: nowrap;\n"])));const U=function(e){var t=e.rootEntities,n=e.relatedEntities,r=e.maxCountLink,o=e.navigationStrategy;return(0,A.jsxs)(I.ZP.Span,{children:[(0,A.jsx)(I.ZP.B,{children:Object.entries(t).map((function(e){var t=P()(e,2),n=t[0],r=t[1];return(0,A.jsxs)("span",{children:[r.entityLabel," (",r.keys.length>0&&o.ListLink?(0,A.jsx)(o.ListLink,{entityName:n,entityKeys:r.keys,children:r.keys.length}):(0,A.jsx)(I.ZP.Span,{children:r.keys.length}),")"]},"root-entity-".concat(n))})).reduce((function(e,t){return[e,", ",t]}))}),Object.keys(n).length>0&&(0,A.jsxs)(A.Fragment,{children:[Z||(Z=(0,A.jsx)("span",{children:" / "})),Object.keys(n).map((function(e){var t=n[e],i=[].concat(S()(t.keys),S()(t.keysOtherBu)).length,a=t.keys.length>0&&o.ListLink?(0,A.jsx)(o.ListLink,{entityName:e,entityKeys:t.keys.slice(0,r),children:i}):(0,A.jsx)(I.ZP.Span,{children:i}),s=(0,A.jsx)(D,{relatedEntity:t,maxCountLink:r,children:a});return(0,A.jsx)(x().Fragment,{children:(0,A.jsxs)(F,{children:[t.entityLabel," (",s,")"]})},"entity-info-"+e)})).reduce((function(e,t){return[e,", ",t]}))]})]})};var z,H,W,Y=n(7281),q=T.ZP.div.withConfig({displayName:"StyledIconWrapper"})(z||(z=M()(["\n margin-bottom: ",";\n"])),Y.Z.space(.2));const Q=function(e){var t=e.dialogInfo,n=e.navigationStrategy;return(0,A.jsxs)(A.Fragment,{children:[H||(H=(0,A.jsx)(q,{children:(0,A.jsx)(N.Z,{size:"30px"})})),W||(W=(0,A.jsx)(I.ZP.P,{children:(0,A.jsx)(_.Z,{id:"client.delete.deleteInProgress"})})),(0,A.jsx)(U,{rootEntities:t.rootEntitiesDeletable,relatedEntities:t.relatedDeletable,maxCountLink:100,navigationStrategy:n},"infopart-deletable")]})};var $={doDelete:E};const V=(0,f.connect)((function(e,t){return{dialogInfo:e.del.dialogInfo,navigationStrategy:e.input.navigationStrategy}}),$)((0,d.ZP)(Q));var G,K,X=n(83324),J=n(23427),ee=n(59713),te=n.n(ee),ne=n(24875),re=[J.Z.condition.INFO,J.Z.condition.DANGER,J.Z.condition.SUCCESS,J.Z.condition.WARNING],oe=(G={},te()(G,J.Z.condition.DANGER,ne.FS.color("signal.danger")),te()(G,J.Z.condition.SUCCESS,ne.FS.color("signal.success")),te()(G,J.Z.condition.WARNING,ne.FS.color("signal.warning")),te()(G,J.Z.condition.INFO,ne.FS.color("signal.info")),G),ie=T.ZP.div.withConfig({displayName:"StyledSignalBox"})(K||(K=M()(["\n && {\n background-color: ",";\n padding: ",";\n margin-bottom: ",";\n\n * {\n color: ",";\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n"])),(function(e){return function(e){return oe[e.condition]||oe[J.Z.condition.INFO]}(e)}),Y.Z.space(-1),Y.Z.space(-1),ne.FS.color("paper"));ie.propTypes={condition:J.Z.oneOfPropTypeAndCompletelyMapped(re,oe)};var ae=function(e){var t=e.condition,n=e.title,r=e.children,o=e.meta;return(0,A.jsxs)(ie,{condition:t,children:[n&&(0,A.jsx)(I.ZP.H5,{children:n}),x().Children.map(r,(function(e){return x().cloneElement(e)})),o&&(0,A.jsx)(I.ZP.Small,{children:o})]})};ae.defaultProps={condition:J.Z.condition.BASE};const se=ae;var ce,le,ue,de,fe,pe,he,me=n(65035),ye=n(36589),ge=T.ZP.div.withConfig({displayName:"StyledSectionWrapper"})(ce||(ce=M()(["\n padding-top: ",";\n"])),Y.Z.space(.6)),ve=T.ZP.div.withConfig({displayName:"StyledButtonsWrapper"})(le||(le=M()(["\n display: flex;\n justify-content: flex-end;\n\n "," {\n margin-right: 0;\n }\n"])),ye.Z);const be=function(e){var t=e.dialogInfo,n=t.rootEntitiesDeletable,r=t.rootEntitiesNotDeletable,o=t.relatedDeletable,i=t.relatedNotDeletable,a=t.hasUnreadableEntities,s=e.doDelete,c=e.onCancel,l=e.navigationStrategy;return(0,X.z)(c),(0,A.jsxs)(A.Fragment,{children:[ue||(ue=(0,A.jsx)(I.ZP.P,{children:(0,A.jsx)(_.Z,{id:"client.delete.confirmText"})})),(0,A.jsx)(U,{rootEntities:n,relatedEntities:o,maxCountLink:100,navigationStrategy:l},"infopart-deletable"),Object.keys(r).length>0&&(0,A.jsxs)(ge,{children:[de||(de=(0,A.jsx)(I.ZP.P,{children:(0,A.jsx)(_.Z,{id:"client.delete.textNotDeletable"})})),(0,A.jsx)(U,{rootEntities:r,relatedEntities:i,maxCountLink:100,navigationStrategy:l},"infopart-notdeletable")]}),a&&(fe||(fe=(0,A.jsx)(ge,{children:(0,A.jsx)(se,{condition:"warning",children:(0,A.jsx)(I.ZP.Span,{children:(0,A.jsx)(_.Z,{id:"client.delete.unreadableEntities"})})})}))),(0,A.jsx)(ge,{children:(0,A.jsxs)(ve,{children:[(0,A.jsx)(me.Z,{onClick:s,disabled:Object.keys(n).every((function(e){return 0===n[e].keys.length})),children:pe||(pe=(0,A.jsx)(_.Z,{id:"client.delete.deleteButton"}))}),(0,A.jsx)(me.Z,{ink:"primary",look:"raised",onClick:c,children:he||(he=(0,A.jsx)(_.Z,{id:"client.delete.cancelButton"}))})]})})]})};var Ee={doDelete:E,onCancel:function(){return{type:g}}};const we=(0,f.connect)((function(e,t){return{dialogInfo:e.del.dialogInfo,navigationStrategy:e.input.navigationStrategy}}),Ee)((0,d.ZP)(be));var Oe,xe;const Ce=function(e){var t=e.loadDialogInfo,n=e.dialogInfo,r=e.deletingInProgress,o=e.intl;(0,O.useEffect)((function(){t()}),[t]);var i;return r?Oe||(Oe=(0,A.jsx)(V,{})):(0,A.jsx)(C.Z,{required:[n],loadingText:(i="client.delete.loadingText",o.formatMessage({id:i})),children:n&&(xe||(xe=(0,A.jsx)(we,{})))})};var _e={loadDialogInfo:function(){return{type:p}}};const Ne=(0,f.connect)((function(e,t){return{dialogInfo:e.del.dialogInfo,deletingInProgress:e.del.deletingInProgress}}),_e)((0,d.ZP)(Ce));var Ie,ke=n(81770),Se=(Ie={},te()(Ie,h,ke.Z.singleTransferReducer("dialogInfo")),te()(Ie,v,ke.Z.singleTransferReducer("entitiesToDelete")),te()(Ie,y,ke.Z.singleTransferReducer("deletingInProgress")),Ie),Re={dialogInfo:null,entitiesToDelete:null,deletingInProgress:!1};var Pe=n(87757),je=n.n(Pe),Me=n(34857),Te=n(81719),Le=n(5422);const Ae=function(e){var t=e.errors.map((function(e){var t=e.entityValidatorErrors;return Object.keys(t).map((function(e){return(0,A.jsx)(Le.Z.List,{children:t[e].map((function(t,n){return(0,A.jsx)(Le.Z.Item,{label:t},"entity-".concat(e,"-").concat(n))}))},e)}))}));return(0,A.jsx)(A.Fragment,{children:t})};var De=n(27361),Be=n.n(De);function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){te()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ue="DELETABLE",ze=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.rootEntity,o=r.entityName,i=r.entityLabel,a=r.key;if(a.includes("/")){var s=a.split("/"),c=P()(s,2),l=c[0],u=c[1];return Fe(Fe({},e),{},te()({},l,{entityLabel:i,keys:[].concat(S()(Be()(e,[l,"keys"],[])),S()(n?[u]:[]))}))}return Fe(Fe({},e),{},te()({},o,{entityLabel:i,keys:[].concat(S()(Be()(e,[o,"keys"],[])),S()(n?[a]:[]))}))},He=function(e){return e.rootEntity.deleteStatus===Ue&&!e.affectedEntities.find((function(e){return e.deleteStatus!==Ue}))},We=function(e,t){var n=e.entitiesToDelete;return n.reduce((function(e,n){var r=He(n),o=r?"relatedDeletable":"relatedNotDeletable";return Fe(Fe(Fe({},e),{},{rootEntitiesDeletable:ze(e.rootEntitiesDeletable,n,r)},!r&&{rootEntitiesNotDeletable:ze(e.rootEntitiesNotDeletable,n)}),{},te()({},o,function(e,t,n,r){return Fe({},t.affectedEntities.reduce((function(e,t){return Fe(Fe({},e),n||t.deleteStatus!==Ue?te()({},t.entityName,Fe(Fe({},Be()(e,t.entityName,{keys:[],keysOtherBu:[],entityLabel:t.entityLabel})),null===t.businessUnitId||t.businessUnitId===r?{keys:Array.from(new Set([].concat(S()(Be()(e,[t.entityName,"keys"],[])),[t.key])))}:{keysOtherBu:Array.from(new Set([].concat(S()(Be()(e,[t.entityName,"keysOtherBu"],[])),[t.key])))})):{})}),Fe({},e)))}(e[o],n,r,t)))}),{rootEntitiesDeletable:{},rootEntitiesNotDeletable:{},relatedDeletable:{},relatedNotDeletable:{},hasUnreadableEntities:!!n.find((function(e){return e.unreadableEntities}))})},Ye=function(e){var t=e.entitiesToDelete;return{entityName:Be()(t,"[0].rootEntity.entityName"),keys:t.reduce((function(e,t){return[].concat(S()(e),S()(He(t)?[t.rootEntity.key]:[]))}),[])}},qe=i().shape({entityLabel:i().string,keys:i().arrayOf(i().string),keysOtherBu:i().arrayOf(i().string)}),Qe=(i().shape({rootEntitiesDeletable:i().objectOf(qe).isRequired,rootEntitiesNotDeletable:i().objectOf(qe).isRequired,relatedDeletable:i().objectOf(qe).isRequired,relatedNotDeletable:i().objectOf(qe).isRequired,hasUnreadableEntities:i().bool}),je().mark(nt)),$e=je().mark(rt),Ve=je().mark(ot),Ge=je().mark(it),Ke=je().mark(at),Xe=je().mark(st),Je=function(e){return e.input},et=function(e){return e.intl.messages},tt=function(e){return e.del.entitiesToDelete};function nt(){var e,t,n;return je().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,Me.Ys)(Je);case 2:return e=r.sent,t=e.selection,r.next=6,(0,Me.RE)(u.Z.getEntities,t,Te.Z.fetchAllEntities);case 6:return n=r.sent,r.abrupt("return",{entityModel:n.entityName,keys:n.keys});case 8:case"end":return r.stop()}}),Qe)}function rt(){var e,t;return je().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Me.Ys)(Je);case 2:return e=n.sent,t=e.customDeleteEndpoint,n.abrupt("return",t||"client/delete");case 5:case"end":return n.stop()}}),$e)}function ot(){var e,t,n,r,o,i,a,s;return je().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,Me.RE)(nt);case 2:return e=c.sent,c.next=5,(0,Me.RE)(rt);case 5:return t=c.sent,c.next=8,(0,Me.$6)([(0,Me.RE)(Te.Z.requestSaga,"".concat(t,"/dialog"),{method:"POST",body:e}),(0,Me.RE)(Te.Z.fetchPrincipal)]);case 8:return n=c.sent,r=P()(n,2),o=r[0],i=r[1],c.next=14,(0,Me.RE)(We,o.body,i.currentBusinessUnit.id);case 14:return a=c.sent,c.next=17,(0,Me.gz)(b(a));case 17:return c.next=19,(0,Me.RE)(Ye,o.body);case 19:return s=c.sent,c.next=22,(0,Me.gz)(w(s));case 22:case"end":return c.stop()}}),Ve)}function it(){var e,t,n,r,o,i,a,s;return je().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,(0,Me.Ys)(tt);case 2:return e=l.sent,l.next=5,(0,Me.gz)({type:y,payload:{deletingInProgress:!0}});case 5:return l.next=7,(0,Me.RE)(rt);case 7:return t=l.sent,l.next=10,(0,Me.RE)(Te.Z.requestSaga,t,{method:"POST",body:{entityModel:e.entityName,keys:e.keys},acceptedErrorCodes:["VALIDATION_FAILED"],acceptedStatusCodes:[500,400,409]});case 10:return n=l.sent,l.next=13,(0,Me.Ys)(et);case 13:if(r=l.sent,!n.ok){l.next=22;break}return o=n.body,i=Object.keys(o.deletedEntities).reduce((function(e,t){return[].concat(S()(e),S()(o.deletedEntities[t].map((function(e){return{entityName:t,key:e}}))))}),[]),a=[{type:"entity-delete-event",payload:{entities:i}}],l.next=20,(0,Me.gz)(c.Z.fireExternalEvent("onSuccess",{message:r["client.delete.successfullyMessage"],remoteEvents:a}));case 20:l.next=35;break;case 22:if(409!==n.status||!n.body.information){l.next=27;break}return l.next=25,(0,Me.gz)(c.Z.fireExternalEvent("onError",{message:n.body.information}));case 25:l.next=35;break;case 27:if(400!==n.status||"VALIDATION_FAILED"!==n.body.errorCode){l.next=33;break}return s=function(){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{children:r["client.delete.validationErrorMessage"]}),(0,A.jsx)(Ae,{errors:n.body.errors})]})},l.next=31,(0,Me.gz)(c.Z.fireExternalEvent("onError",{message:s}));case 31:l.next=35;break;case 33:return l.next=35,(0,Me.gz)(c.Z.fireExternalEvent("onError",{message:r["client.delete.errorMessage"]}));case 35:case"end":return l.stop()}}),Ge)}function at(){return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Me.gz)(c.Z.fireExternalEvent("onCancel"));case 2:case"end":return e.stop()}}),Ke)}function st(){return je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Me.$6)([(0,Me.Fm)(p,ot),(0,Me.Fm)(m,it),(0,Me.Fm)(g,at)]);case 2:case"end":return e.stop()}}),Xe)}const ct={del:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Re,t=arguments.length>1?arguments[1]:void 0,n=Se[t.type];return n?n(e,t):e}};var lt,ut=[st],dt="delete",ft=["onSuccess","onCancel","onError","emitAction"],pt=function(e,t,n,r){var o=lt||(lt=(0,A.jsx)(Ne,{})),i=s.Z.createStore(ct,ut,t,dt);a.Z.addToStore(i,(function(e){return e.input.emitAction}));var u=!n.emitAction;return l.Z.addToStore(i,u),c.Z.addToStore(i,(function(e){return s.Z.getEvents(ft,e.input)})),s.Z.createApp(dt,o,i,{input:t,events:n,actions:[],publicPath:r,textResourceModules:["component","common",dt]})};s.Z.registerAppInRegistry(dt,pt);var ht=function(e){return s.Z.useApp({initApp:pt,props:e,packageName:dt,externalEvents:ft}).component};ht.propTypes={selection:u.Z.propType.isRequired,customDeleteEndpoint:i().string};const mt=ht;s.Z.createBundleableApp(dt,pt,ht)},73665:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var r=n(45697),o=n.n(r);const i={ID:"ID",QUERY:"QUERY"},a=o().shape({entityName:o().string.isRequired,ids:function(e,t,n){if(e.selection&&e.selection.type===i.ID&&!e.selection[t])return new Error("Selection.ids prop not defined. Component: ".concat(n,"'."))},query:function(e,t,n){if(e.selection&&e.selection.type===i.QUERY&&!e.selection[t])return new Error("Selection.query prop not defined. Component: ".concat(n,"'."))},type:o().oneOf(Object.keys(i)).isRequired,count:o().number});var s=n(59713),c=n.n(s),l=n(87757),u=n.n(l),d=n(34857),f=u().mark(m);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t){var n,r;return u().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n=e.entityName,e.type!==i.QUERY){o.next=6;break}return o.next=4,(0,d.RE)(t,e.entityName,h({},e.query));case 4:return r=o.sent,o.abrupt("return",{entityName:n,keys:r.map((function(e){return e.key}))});case 6:return o.abrupt("return",{entityName:n,keys:e.ids});case 7:case"end":return o.stop()}}),f)}const y={getEntities:m,getSingleKey:function(e,t){if(e.entityName!==t)throw new Error("Only selection of ".concat(t," supported"));if("ID"!==e.type)throw new Error("Only ID selection type supported");if(!e.ids||1!==e.ids.length)throw new Error("Exactly one ".concat(t," must be selected"));return e.ids[0]},propType:a,selectionTypes:i}},36392:(e,t,n)=>{"use strict";n.d(t,{lX:()=>k});var r=n(30670),o=n.n(r),i=n(41143),a=n.n(i),s=n(14149),c=(n(54545),function(e){return"/"===e.charAt(0)?e:"/"+e}),l=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)},u=function(e,t){return l(e,t)?e.substr(t.length):e},d=function(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e},f=function(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o},p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h=function(e,t,n,r){var o=void 0;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=p({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=(0,s.default)(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o};const m=function(){var e=null,t=[];return{setPrompt:function(t){return o()(null==e,"A history supports only one prompt at a time"),e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,i):(o()(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==a)}else i(!0)},appendListener:function(e){var n=!0,r=function(){n&&e.apply(void 0,arguments)};return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}};var y=!("undefined"==typeof window||!window.document||!window.document.createElement),g=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},v=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},b=function(e,t){return t(window.confirm(e))},E=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},w=function(){return-1===window.navigator.userAgent.indexOf("Trident")},O=function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")},x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_="popstate",N="hashchange",I=function(){try{return window.history.state||{}}catch(e){return{}}};const k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(y,"Browser history needs a DOM");var t=window.history,n=E(),r=!w(),i=e.forceRefresh,s=void 0!==i&&i,p=e.getUserConfirmation,k=void 0===p?b:p,S=e.keyLength,R=void 0===S?6:S,P=e.basename?d(c(e.basename)):"",j=function(e){var t=e||{},n=t.key,r=t.state,i=window.location,a=i.pathname+i.search+i.hash;return o()(!P||l(a,P),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+P+'".'),P&&(a=u(a,P)),h(a,r,n)},M=function(){return Math.random().toString(36).substr(2,R)},T=m(),L=function(e){C(ee,e),ee.length=t.length,T.notifyListeners(ee.location,ee.action)},A=function(e){O(e)||Z(j(e.state))},D=function(){Z(j(I()))},B=!1,Z=function(e){if(B)B=!1,L();else{T.confirmTransitionTo(e,"POP",k,(function(t){t?L({action:"POP",location:e}):F(e)}))}},F=function(e){var t=ee.location,n=z.indexOf(t.key);-1===n&&(n=0);var r=z.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(B=!0,q(o))},U=j(I()),z=[U.key],H=function(e){return P+f(e)},W=function(e,r){o()(!("object"===(void 0===e?"undefined":x(e))&&void 0!==e.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i="PUSH",a=h(e,r,M(),ee.location);T.confirmTransitionTo(a,i,k,(function(e){if(e){var r=H(a),c=a.key,l=a.state;if(n)if(t.pushState({key:c,state:l},null,r),s)window.location.href=r;else{var u=z.indexOf(ee.location.key),d=z.slice(0,-1===u?0:u+1);d.push(a.key),z=d,L({action:i,location:a})}else o()(void 0===l,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=r}}))},Y=function(e,r){o()(!("object"===(void 0===e?"undefined":x(e))&&void 0!==e.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i="REPLACE",a=h(e,r,M(),ee.location);T.confirmTransitionTo(a,i,k,(function(e){if(e){var r=H(a),c=a.key,l=a.state;if(n)if(t.replaceState({key:c,state:l},null,r),s)window.location.replace(r);else{var u=z.indexOf(ee.location.key);-1!==u&&(z[u]=a.key),L({action:i,location:a})}else o()(void 0===l,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(r)}}))},q=function(e){t.go(e)},Q=function(){return q(-1)},$=function(){return q(1)},V=0,G=function(e){1===(V+=e)?(g(window,_,A),r&&g(window,N,D)):0===V&&(v(window,_,A),r&&v(window,N,D))},K=!1,X=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=T.setPrompt(e);return K||(G(1),K=!0),function(){return K&&(K=!1,G(-1)),t()}},J=function(e){var t=T.appendListener(e);return G(1),function(){G(-1),t()}},ee={length:t.length,action:"POP",location:U,createHref:H,push:W,replace:Y,go:q,goBack:Q,goForward:$,block:X,listen:J};return ee};Object.assign;"function"==typeof Symbol&&Symbol.iterator,Object.assign},96425:(e,t,n)=>{var r=n(3118),o=n(9435);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},7548:(e,t,n)=>{var r=n(3118),o=n(9435);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},9435:e=>{e.exports=function(){}},28045:e=>{e.exports=function(e){return e}},52157:e=>{var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=r.length,c=-1,l=n.length,u=t(a-s,0),d=Array(l+u),f=!o;++c<l;)d[c]=n[c];for(;++i<s;)(f||i<a)&&(d[r[i]]=e[i]);for(;u--;)d[c++]=e[i++];return d}},14054:e=>{var t=Math.max;e.exports=function(e,n,r,o){for(var i=-1,a=e.length,s=-1,c=r.length,l=-1,u=n.length,d=t(a-c,0),f=Array(d+u),p=!o;++i<d;)f[i]=e[i];for(var h=i;++l<u;)f[h+l]=n[l];for(;++s<c;)(p||i<a)&&(f[h+r[s]]=e[i++]);return f}},97991:e=>{e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},22402:(e,t,n)=>{var r=n(71774),o=n(55639);e.exports=function(e,t,n){var i=1&t,a=r(e);return function t(){var r=this&&this!==o&&this instanceof t?a:e;return r.apply(i?n:this,arguments)}}},71774:(e,t,n)=>{var r=n(3118),o=n(13218);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),i=e.apply(n,t);return o(i)?i:n}}},46347:(e,t,n)=>{var r=n(96874),o=n(71774),i=n(86935),a=n(94487),s=n(20893),c=n(46460),l=n(55639);e.exports=function(e,t,n){var u=o(e);return function o(){for(var d=arguments.length,f=Array(d),p=d,h=s(o);p--;)f[p]=arguments[p];var m=d<3&&f[0]!==h&&f[d-1]!==h?[]:c(f,h);if((d-=m.length)<n)return a(e,t,i,o.placeholder,void 0,f,m,void 0,void 0,n-d);var y=this&&this!==l&&this instanceof o?u:e;return r(y,this,f)}}},23468:(e,t,n)=>{var r=n(7548),o=n(99021),i=n(66833),a=n(97658),s=n(1469),c=n(86528);e.exports=function(e){return o((function(t){var n=t.length,o=n,l=r.prototype.thru;for(e&&t.reverse();o--;){var u=t[o];if("function"!=typeof u)throw new TypeError("Expected a function");if(l&&!d&&"wrapper"==a(u))var d=new r([],!0)}for(o=d?o:n;++o<n;){u=t[o];var f=a(u),p="wrapper"==f?i(u):void 0;d=p&&c(p[0])&&424==p[1]&&!p[4].length&&1==p[9]?d[a(p[0])].apply(d,p[3]):1==u.length&&c(u)?d[f]():d.thru(u)}return function(){var e=arguments,r=e[0];if(d&&1==e.length&&s(r))return d.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}},86935:(e,t,n)=>{var r=n(52157),o=n(14054),i=n(97991),a=n(71774),s=n(94487),c=n(20893),l=n(90451),u=n(46460),d=n(55639);e.exports=function e(t,n,f,p,h,m,y,g,v,b){var E=128&n,w=1&n,O=2&n,x=24&n,C=512&n,_=O?void 0:a(t);return function N(){for(var I=arguments.length,k=Array(I),S=I;S--;)k[S]=arguments[S];if(x)var R=c(N),P=i(k,R);if(p&&(k=r(k,p,h,x)),m&&(k=o(k,m,y,x)),I-=P,x&&I<b){var j=u(k,R);return s(t,n,e,N.placeholder,f,k,j,g,v,b-I)}var M=w?f:this,T=O?M[t]:t;return I=k.length,g?k=l(k,g):C&&I>1&&k.reverse(),E&&v<I&&(k.length=v),this&&this!==d&&this instanceof N&&(T=_||a(T)),T.apply(M,k)}}},84375:(e,t,n)=>{var r=n(96874),o=n(71774),i=n(55639);e.exports=function(e,t,n,a){var s=1&t,c=o(e);return function t(){for(var o=-1,l=arguments.length,u=-1,d=a.length,f=Array(d+l),p=this&&this!==i&&this instanceof t?c:e;++u<d;)f[u]=a[u];for(;l--;)f[u++]=arguments[++o];return r(p,s?n:this,f)}}},94487:(e,t,n)=>{var r=n(86528),o=n(258),i=n(69255);e.exports=function(e,t,n,a,s,c,l,u,d,f){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var h=[e,t,s,p?c:void 0,p?l:void 0,p?void 0:c,p?void 0:l,u,d,f],m=n.apply(void 0,h);return r(e)&&o(m,h),m.placeholder=a,i(m,e,t)}},97727:(e,t,n)=>{var r=n(28045),o=n(22402),i=n(46347),a=n(86935),s=n(84375),c=n(66833),l=n(63833),u=n(258),d=n(69255),f=n(40554),p=Math.max;e.exports=function(e,t,n,h,m,y,g,v){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var E=h?h.length:0;if(E||(t&=-97,h=m=void 0),g=void 0===g?g:p(f(g),0),v=void 0===v?v:f(v),E-=m?m.length:0,64&t){var w=h,O=m;h=m=void 0}var x=b?void 0:c(e),C=[e,t,n,h,m,w,O,y,g,v];if(x&&l(C,x),e=C[0],t=C[1],n=C[2],h=C[3],m=C[4],!(v=C[9]=void 0===C[9]?b?0:e.length:p(C[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?i(e,t,v):32!=t&&33!=t||m.length?a.apply(void 0,C):s(e,t,n,h);else var _=o(e,t,n);return d((x?r:u)(_,C),e,t)}},66833:e=>{e.exports=function(){}},97658:(e,t,n)=>{var r=n(52060),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],i=o.call(r,t)?n.length:0;i--;){var a=n[i],s=a.func;if(null==s||s==e)return a.name}return t}},20893:e=>{e.exports=function(){}},86528:(e,t,n)=>{var r=n(96425),o=n(66833),i=n(97658),a=n(8111);e.exports=function(e){var t=i(e),n=a[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var s=o(n);return!!s&&e===s[0]}},63833:e=>{e.exports=function(e){return e}},52060:e=>{e.exports={}},90451:(e,t,n)=>{var r=n(278),o=n(65776),i=Math.min;e.exports=function(e,t){for(var n=e.length,a=i(t.length,n),s=r(e);a--;){var c=t[a];e[a]=o(c,n)?s[c]:void 0}return e}},46460:e=>{e.exports=function(){return[]}},258:e=>{e.exports=function(e){return e}},69255:e=>{e.exports=function(e){return e}},60169:(e,t,n)=>{var r=n(96425),o=n(7548),i=n(278);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},40087:(e,t,n)=>{var r=n(97727);function o(e,t,n){var i=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return i.placeholder=o.placeholder,i}o.placeholder={},e.exports=o},59242:(e,t,n)=>{var r=n(23468)();e.exports=r},8111:(e,t,n)=>{var r=n(96425),o=n(7548),i=n(9435),a=n(1469),s=n(37005),c=n(60169),l=Object.prototype.hasOwnProperty;function u(e){if(s(e)&&!a(e)&&!(e instanceof r)){if(e instanceof o)return e;if(l.call(e,"__wrapped__"))return c(e)}return new o(e)}u.prototype=i.prototype,u.prototype.constructor=u,e.exports=u},84059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>N});var r,o=n(1024),i=n.n(o),a=Object.defineProperty,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&u(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&u(e,n,t[n]);return e},f=(e,t)=>{var n={};for(var r in e)c.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))t.indexOf(r)<0&&l.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e<this.size;e++)a.push(!1);for(let e=0;e<this.size;e++)this.modules.push(a.slice()),this.isFunction.push(a.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,a=40,c=-1,l=!0){if(!(t.MIN_VERSION<=o&&o<=a&&a<=t.MAX_VERSION)||c<-1||c>7)throw new RangeError("Invalid value");let u,d;for(u=o;;u++){const r=8*t.getNumDataCodewords(u,n),o=s.getTotalBits(e,u);if(o<=r){d=o;break}if(u>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=8*t.getNumDataCodewords(u,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(u),f);for(const e of t.getData())f.push(e)}i(f.length==d);const p=8*t.getNumDataCodewords(u,n);i(f.length<=p),r(0,Math.min(4,p-f.length),f),r(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)r(e,8,f);let h=[];for(;8*h.length<f.length;)h.push(0);return f.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(u,n,h,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],a=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=o-s%o,l=Math.floor(s/o);let u=[];const d=t.reedSolomonComputeDivisor(a);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+l-a+(n<c?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,d);n<c&&o.push(0),u.push(o.concat(i))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach(((t,n)=>{(e!=l-a||n>=c)&&f.push(t[e])}));return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=t-i,s=0==(t+1&2)?this.size-1-r:r;!this.isFunction[s][a]&&n<8*e.length&&(this.modules[s][a]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[n][a]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][a],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[a][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const a=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new a(a.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new a(a.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new a(a.Mode.ECI,0,t)}static isNumeric(e){return a.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return a.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=a;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(r||(r={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(r||(r={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(r||(r={}));var p=r,h={L:p.QrCode.Ecc.LOW,M:p.QrCode.Ecc.MEDIUM,Q:p.QrCode.Ecc.QUARTILE,H:p.QrCode.Ecc.HIGH},m=128,y="L",g="#FFFFFF",v="#000000",b=!1;
2
- /**
3
- * @license qrcode.react
4
- * Copyright (c) Paul O'Shannessy
5
- * SPDX-License-Identifier: ISC
6
- */function E(e,t=0){const n=[];return e.forEach((function(e,r){let o=null;e.forEach((function(i,a){if(!i&&null!==o)return n.push(`M${o+t} ${r+t}h${a-o}v1H${o+t}z`),void(o=null);if(a!==e.length-1)i&&null===o&&(o=a);else{if(!i)return;null===o?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${o+t},${r+t} h${a+1-o}v1H${o+t}z`)}}))})),n.join("")}function w(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function O(e,t,n,r){if(null==r)return null;const o=n?4:0,i=e.length+2*o,a=Math.floor(.1*t),s=i/t,c=(r.width||a)*s,l=(r.height||a)*s,u=null==r.x?e.length/2-c/2:r.x*s,d=null==r.y?e.length/2-l/2:r.y*s;let f=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);f={x:e,y:t,w:Math.ceil(c+u-e),h:Math.ceil(l+d-t)}}return{x:u,y:d,h:l,w:c,excavation:f}}var x=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function C(e){const t=e,{value:n,size:r=m,level:a=y,bgColor:s=g,fgColor:c=v,includeMargin:l=b,style:u,imageSettings:C}=t,_=f(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),N=null==C?void 0:C.src,I=(0,o.useRef)(null),k=(0,o.useRef)(null),[S,R]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(null!=I.current){const e=I.current,t=e.getContext("2d");if(!t)return;let o=p.QrCode.encodeText(n,h[a]).getModules();const i=l?4:0,u=o.length+2*i,d=O(o,r,l,C),f=k.current,m=null!=d&&null!==f&&f.complete&&0!==f.naturalHeight&&0!==f.naturalWidth;m&&null!=d.excavation&&(o=w(o,d.excavation));const y=window.devicePixelRatio||1;e.height=e.width=r*y;const g=r/u*y;t.scale(g,g),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=c,x?t.fill(new Path2D(E(o,i))):o.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+i,n+i,1,1)}))})),m&&t.drawImage(f,d.x+i,d.y+i,d.w,d.h)}})),(0,o.useEffect)((()=>{R(!1)}),[N]);const P=d({height:r,width:r},u);let j=null;return null!=N&&(j=i().createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{R(!0)},ref:k})),i().createElement(i().Fragment,null,i().createElement("canvas",d({style:P,height:r,width:r,ref:I},_)),j)}function _(e){const t=e,{value:n,size:r=m,level:o=y,bgColor:a=g,fgColor:s=v,includeMargin:c=b,imageSettings:l}=t,u=f(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let x=p.QrCode.encodeText(n,h[o]).getModules();const C=c?4:0,_=x.length+2*C,N=O(x,r,c,l);let I=null;null!=l&&null!=N&&(null!=N.excavation&&(x=w(x,N.excavation)),I=i().createElement("image",{xlinkHref:l.src,height:N.h,width:N.w,x:N.x+C,y:N.y+C,preserveAspectRatio:"none"}));const k=E(x,C);return i().createElement("svg",d({height:r,width:r,viewBox:`0 0 ${_} ${_}`},u),i().createElement("path",{fill:a,d:`M0,0 h${_}v${_}H0z`,shapeRendering:"crispEdges"}),i().createElement("path",{fill:s,d:k,shapeRendering:"crispEdges"}),I)}var N=e=>{const t=e,{renderAs:n}=t,r=f(t,["renderAs"]);return"svg"===n?i().createElement(_,d({},r)):i().createElement(C,d({},r))}},36104:(e,t,n)=>{"use strict";var r=n(82637);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},9657:(e,t,n)=>{e.exports=n(36104)()},82637:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},14510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=n(1024),s=i(a),c=i(n(59479)),l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var c=s.get;if(void 0===c)return;return c.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return;e=l,t=i,n=a,r=!0,s=l=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={hover:!1}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"getLineStyle",value:function(e){return r({position:"absolute",height:"20%",left:0,right:0,top:2*e*20+"%",opacity:this.state.hover?.6:1},this.state.hover&&this.props.styles.bmBurgerBarsHover)}},{key:"render",value:function(){var e=this,t=void 0;if(this.props.customIcon){var n={className:("bm-icon "+(this.props.customIcon.props.className||"")).trim(),style:r({width:"100%",height:"100%"},this.props.styles.bmIcon)};t=s.default.cloneElement(this.props.customIcon,n)}else t=s.default.createElement("span",null,[0,1,2].map((function(t){return s.default.createElement("span",{key:t,className:("bm-burger-bars "+e.props.barClassName+" "+(e.state.hover?"bm-burger-bars-hover":"")).trim(),style:r({},e.getLineStyle(t),e.props.styles.bmBurgerBars)})})));return s.default.createElement("div",{className:("bm-burger-button "+this.props.className).trim(),style:r({zIndex:1e3},this.props.styles.bmBurgerButton)},s.default.createElement("button",{type:"button",id:"react-burger-menu-btn",onClick:this.props.onClick,onMouseOver:function(){e.setState({hover:!0}),e.props.onIconHoverChange&&e.props.onIconHoverChange({isMouseIn:!0})},onMouseOut:function(){e.setState({hover:!1}),e.props.onIconHoverChange&&e.props.onIconHoverChange({isMouseIn:!1})},style:{position:"absolute",left:0,top:0,zIndex:1,width:"100%",height:"100%",margin:0,padding:0,border:"none",fontSize:0,background:"transparent",cursor:"pointer"}},"Open Menu"),t)}}]),t}(a.Component);t.default=l,l.propTypes={barClassName:c.default.string,customIcon:c.default.element,styles:c.default.object},l.defaultProps={barClassName:"",className:"",styles:{}},e.exports=t.default},75430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e,t,n){for(var r=!0;r;){var o=e,i=t,a=n;r=!1,null===o&&(o=Function.prototype);var s=Object.getOwnPropertyDescriptor(o,i);if(void 0!==s){if("value"in s)return s.value;var c=s.get;if(void 0===c)return;return c.call(a)}var l=Object.getPrototypeOf(o);if(null===l)return;e=l,t=i,n=a,r=!0,s=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c=n(1024),l=a(c),u=a(n(59479)),d=function(e){function t(){s(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"getCrossStyle",value:function(e){return{position:"absolute",width:3,height:14,transform:"before"===e?"rotate(45deg)":"rotate(-45deg)"}}},{key:"render",value:function(){var e,t=this;if(this.props.customIcon){var n={className:("bm-cross "+(this.props.customIcon.props.className||"")).trim(),style:r({width:"100%",height:"100%"},this.props.styles.bmCross)};e=l.default.cloneElement(this.props.customIcon,n)}else e=l.default.createElement("span",{style:{position:"absolute",top:"6px",right:"14px"}},["before","after"].map((function(e,n){return l.default.createElement("span",{key:n,className:("bm-cross "+t.props.crossClassName).trim(),style:r({},t.getCrossStyle(e),t.props.styles.bmCross)})})));return l.default.createElement("div",{className:("bm-cross-button "+this.props.className).trim(),style:r({},{position:"absolute",width:24,height:24,right:8,top:8},this.props.styles.bmCrossButton)},l.default.createElement("button",r({type:"button",id:"react-burger-cross-btn",onClick:this.props.onClick,style:{position:"absolute",left:0,top:0,zIndex:1,width:"100%",height:"100%",margin:0,padding:0,border:"none",fontSize:0,background:"transparent",cursor:"pointer"}},!this.props.isOpen&&{tabIndex:-1}),"Close Menu"),e)}}]),t}(c.Component);t.default=d,d.propTypes={crossClassName:u.default.string,customIcon:u.default.element,isOpen:u.default.bool,styles:u.default.object},d.defaultProps={crossClassName:"",className:"",styles:{},isOpen:!1},e.exports=t.default},86661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={overlay:function(e){return{position:"fixed",zIndex:1e3,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.3)",opacity:e?1:0,MozTransform:e?"":"translate3d(100%, 0, 0)",MsTransform:e?"":"translate3d(100%, 0, 0)",OTransform:e?"":"translate3d(100%, 0, 0)",WebkitTransform:e?"":"translate3d(100%, 0, 0)",transform:e?"":"translate3d(100%, 0, 0)",transition:e?"opacity 0.3s":"opacity 0.3s, transform 0s 0.3s"}},menuWrap:function(e,t,n){return{position:"fixed",right:n?0:"inherit",zIndex:1100,width:t,height:"100%",MozTransform:e?"":n?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",MsTransform:e?"":n?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",OTransform:e?"":n?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",WebkitTransform:e?"":n?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transform:e?"":n?"translate3d(100%, 0, 0)":"translate3d(-100%, 0, 0)",transition:"all 0.5s"}},menu:function(){return{height:"100%",boxSizing:"border-box",overflow:"auto"}},itemList:function(){return{height:"100%"}},item:function(){return{display:"block"}}},e.exports=t.default},74660:(e,t)=>{"use strict";function n(){var e=Array.from(document.getElementsByClassName("bm-item")).shift();e&&e.focus()}function r(){var e=Array.from(document.getElementsByClassName("bm-item")).pop();e&&e.focus()}function o(){var e=document.getElementById("react-burger-cross-btn");e&&e.focus()}function i(e){if(document.activeElement.className.includes("bm-item")){var t=document.activeElement[e];t?t.focus():o()}else"previousElementSibling"===e?r():n()}Object.defineProperty(t,"__esModule",{value:!0}),t.focusOnFirstMenuItem=n,t.focusOnLastMenuItem=r,t.focusOnCrossButton=o,t.focusOnMenuButton=function(){var e=document.getElementById("react-burger-menu-btn");e&&e.focus()},t.focusOnMenuItem=i,t.focusOnNextMenuItem=function(){i("nextElementSibling")},t.focusOnPreviousMenuItem=function(){i("previousElementSibling")}},14126:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function i(e){return e&&e.__esModule?e:{default:e}}var a=i(n(1024)),s=(i(n(30314)),i(n(59479))),c=i(n(86661)),l=n(74660),u=i(n(14510)),d=i(n(75430));t.default=function(e){if(!e)throw new Error("No styles supplied");var t="ArrowDown",n="ArrowUp";var i=function(i){var s,f,p=a.default.useState(!1),h=r(p,2),m=h[0],y=h[1],g=a.default.useRef(),v=a.default.useRef({}),b=(s=i.isOpen,f=a.default.useRef(s),a.default.useEffect((function(){f.current=s})),f.current);function E(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];v.current=e,_(),setTimeout((function(){y((function(t){return void 0!==e.isOpen?e.isOpen:!t}))}))}function w(){"function"==typeof i.onClose?i.onClose():E()}function O(e,t){var n=i.width,r=i.right;return e(m,"string"!=typeof n?n+"px":n,r,t)}function x(t,n,r){var a="bm"+t.replace(t.charAt(0),t.charAt(0).toUpperCase()),s=c.default[t]?O(c.default[t]):{};return e[t]&&(s=o({},s,O(e[t],n+1))),i.styles[a]&&(s=o({},s,i.styles[a])),r&&(s=o({},s,r)),i.noTransition&&delete s.transition,s}function C(e,t,n){var r=document.getElementById(e);if(r){var o=O(t);for(var a in o)o.hasOwnProperty(a)&&(r.style[a]=n?o[a]:"");var s=function(e){return e.style["overflow-x"]=n?"hidden":""};i.htmlClassName||s(document.querySelector("html")),i.bodyClassName||s(document.querySelector("body"))}else console.error("Element with ID '"+e+"' not found")}function _(){var t=arguments.length<=0||void 0===arguments[0]||arguments[0],n=function(e,n){return e.classList[t?"add":"remove"](n)};i.htmlClassName&&n(document.querySelector("html"),i.htmlClassName),i.bodyClassName&&n(document.querySelector("body"),i.bodyClassName),e.pageWrap&&i.pageWrapId&&C(i.pageWrapId,e.pageWrap,t),e.outerContainer&&i.outerContainerId&&C(i.outerContainerId,e.outerContainer,t);var r=document.querySelector(".bm-menu-wrap");r&&(t?r.removeAttribute("hidden"):r.setAttribute("hidden",!0))}function N(){g.current&&clearTimeout(g.current)}function I(e){switch((e=e||window.event).key){case"Escape":i.disableCloseOnEsc||(w(),(0,l.focusOnMenuButton)());break;case t:(0,l.focusOnNextMenuItem)();break;case n:(0,l.focusOnPreviousMenuItem)();break;case"Home":(0,l.focusOnFirstMenuItem)();break;case"End":(0,l.focusOnLastMenuItem)()}}function k(e){if((e=e||window.event).target===document.getElementById("react-burger-menu-btn"))switch(e.key){case t:case" ":E();break;case n:E({focusOnLastItem:!0})}}return a.default.useEffect((function(){return i.isOpen&&E({isOpen:!0,noStateChange:!0}),function(){_(!1),N()}}),[]),a.default.useEffect((function(){var t,n;void 0!==i.isOpen&&i.isOpen!==m&&i.isOpen!==b?E():e.svg&&(t=document.getElementById("bm-morph-shape"),n=e.svg.lib(t).select("path"),m?e.svg.animate(n):setTimeout((function(){n.attr("d",e.svg.pathInitial)}),300))})),a.default.useEffect((function(){var e=v.current,t=e.noStateChange,n=e.focusOnLastItem;t||i.onStateChange({isOpen:m}),i.disableAutoFocus||(m?n?(0,l.focusOnLastMenuItem)():(0,l.focusOnFirstMenuItem)():document.activeElement?document.activeElement.blur():document.body.blur()),N(),g.current=setTimeout((function(){g.current=null,m||_(!1)}),500);var r=m?I:k,o=i.customOnKeyDown||r;return window.addEventListener("keydown",o),function(){window.removeEventListener("keydown",o)}}),[m]),a.default.createElement("div",null,!i.noOverlay&&a.default.createElement("div",{className:("bm-overlay "+i.overlayClassName).trim(),onClick:function(){!0===i.disableOverlayClick||"function"==typeof i.disableOverlayClick&&i.disableOverlayClick()||w()},style:x("overlay")}),!1!==i.customBurgerIcon&&a.default.createElement("div",{style:x("burgerIcon")},a.default.createElement(u.default,{onClick:function(){"function"==typeof i.onOpen?i.onOpen():E()},styles:i.styles,customIcon:i.customBurgerIcon,className:i.burgerButtonClassName,barClassName:i.burgerBarClassName,onIconStateChange:i.onIconStateChange})),a.default.createElement("div",{id:i.id,className:("bm-menu-wrap "+i.className).trim(),style:x("menuWrap"),"aria-hidden":!m},e.svg&&a.default.createElement("div",{id:"bm-morph-shape",className:("bm-morph-shape "+i.morphShapeClassName).trim(),style:x("morphShape")},a.default.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 100 800",preserveAspectRatio:"none"},a.default.createElement("path",{d:e.svg.pathInitial}))),a.default.createElement("div",{className:("bm-menu "+i.menuClassName).trim(),style:x("menu")},a.default.createElement(i.itemListElement,{className:("bm-item-list "+i.itemListClassName).trim(),style:x("itemList")},a.default.Children.map(i.children,(function(e,t){if(e){var n=["bm-item",i.itemClassName,e.props.className].filter((function(e){return!!e})).join(" "),r=o({key:t,className:n,style:x("item",t,e.props.style)},!m&&{tabIndex:-1});return a.default.cloneElement(e,r)}})))),!1!==i.customCrossIcon&&a.default.createElement("div",{style:x("closeButton")},a.default.createElement(d.default,{onClick:w,styles:i.styles,customIcon:i.customCrossIcon,className:i.crossButtonClassName,crossClassName:i.crossClassName,isOpen:m}))))};return i.propTypes={bodyClassName:s.default.string,burgerBarClassName:s.default.string,burgerButtonClassName:s.default.string,className:s.default.string,crossButtonClassName:s.default.string,crossClassName:s.default.string,customBurgerIcon:s.default.oneOfType([s.default.element,s.default.oneOf([!1])]),customCrossIcon:s.default.oneOfType([s.default.element,s.default.oneOf([!1])]),customOnKeyDown:s.default.func,disableAutoFocus:s.default.bool,disableCloseOnEsc:s.default.bool,disableOverlayClick:s.default.oneOfType([s.default.bool,s.default.func]),htmlClassName:s.default.string,id:s.default.string,isOpen:s.default.bool,itemClassName:s.default.string,itemListClassName:s.default.string,itemListElement:s.default.oneOf(["div","nav"]),menuClassName:s.default.string,morphShapeClassName:s.default.string,noOverlay:s.default.bool,noTransition:s.default.bool,onClose:s.default.func,onIconHoverChange:s.default.func,onOpen:s.default.func,onStateChange:s.default.func,outerContainerId:e&&e.outerContainer?s.default.string.isRequired:s.default.string,overlayClassName:s.default.string,pageWrapId:e&&e.pageWrap?s.default.string.isRequired:s.default.string,right:s.default.bool,styles:s.default.object,width:s.default.oneOfType([s.default.number,s.default.string])},i.defaultProps={bodyClassName:"",burgerBarClassName:"",burgerButtonClassName:"",className:"",crossButtonClassName:"",crossClassName:"",disableAutoFocus:!1,disableCloseOnEsc:!1,htmlClassName:"",id:"",itemClassName:"",itemListClassName:"",menuClassName:"",morphShapeClassName:"",noOverlay:!1,noTransition:!1,onStateChange:function(){},outerContainerId:"",overlayClassName:"",pageWrapId:"",styles:{},width:300,onIconHoverChange:function(){},itemListElement:"nav"},i},e.exports=t.default},66432:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(14126),i=(r=o)&&r.__esModule?r:{default:r};t.default=(0,i.default)({}),e.exports=t.default},6830:(e,t,n)=>{"use strict";var r=n(41838);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},59479:(e,t,n)=>{e.exports=n(6830)()},41838:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},77678:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(1024),o=n.n(r),i=n(99860),a=n.n(i);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var l=function(e){var t,n;function r(){var t;return(t=e.call(this)||this).handleExpired=t.handleExpired.bind(c(t)),t.handleErrored=t.handleErrored.bind(c(t)),t.handleChange=t.handleChange.bind(c(t)),t.handleRecaptchaRef=t.handleRecaptchaRef.bind(c(t)),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.getValue=function(){return this.props.grecaptcha&&void 0!==this._widgetId?this.props.grecaptcha.getResponse(this._widgetId):null},i.getWidgetId=function(){return this.props.grecaptcha&&void 0!==this._widgetId?this._widgetId:null},i.execute=function(){var e=this.props.grecaptcha;if(e&&void 0!==this._widgetId)return e.execute(this._widgetId);this._executeRequested=!0},i.executeAsync=function(){var e=this;return new Promise((function(t,n){e.executionResolve=t,e.executionReject=n,e.execute()}))},i.reset=function(){this.props.grecaptcha&&void 0!==this._widgetId&&this.props.grecaptcha.reset(this._widgetId)},i.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},i.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},i.handleChange=function(e){this.props.onChange&&this.props.onChange(e),this.executionResolve&&(this.executionResolve(e),delete this.executionReject,delete this.executionResolve)},i.explicitRender=function(){if(this.props.grecaptcha&&this.props.grecaptcha.render&&void 0===this._widgetId){var e=document.createElement("div");this._widgetId=this.props.grecaptcha.render(e,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge}),this.captcha.appendChild(e)}this._executeRequested&&this.props.grecaptcha&&void 0!==this._widgetId&&(this._executeRequested=!1,this.execute())},i.componentDidMount=function(){this.explicitRender()},i.componentDidUpdate=function(){this.explicitRender()},i.componentWillUnmount=function(){void 0!==this._widgetId&&(this.delayOfCaptchaIframeRemoving(),this.reset())},i.delayOfCaptchaIframeRemoving=function(){var e=document.createElement("div");for(document.body.appendChild(e),e.style.display="none";this.captcha.firstChild;)e.appendChild(this.captcha.firstChild);setTimeout((function(){document.body.removeChild(e)}),5e3)},i.handleRecaptchaRef=function(e){this.captcha=e},i.render=function(){var e=this.props,t=(e.sitekey,e.onChange,e.theme,e.type,e.tabindex,e.onExpired,e.onErrored,e.size,e.stoken,e.grecaptcha,e.badge,e.hl,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl"]));return o().createElement("div",s({},t,{ref:this.handleRecaptchaRef}))},r}(o().Component);l.displayName="ReCAPTCHA",l.propTypes={sitekey:a().string.isRequired,onChange:a().func,grecaptcha:a().object,theme:a().oneOf(["dark","light"]),type:a().oneOf(["image","audio"]),tabindex:a().number,onExpired:a().func,onErrored:a().func,size:a().oneOf(["compact","normal","invisible"]),stoken:a().string,hl:a().string,badge:a().oneOf(["bottomright","bottomleft","inline"])},l.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var u=n(9657),d=n.n(u),f=n(8679),p=n.n(f);function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var m={},y=0;var g="onloadcallback";var v,b;const E=(v=function(){return"https://"+(("undefined"!=typeof window&&window.recaptchaOptions||{}).useRecaptchaNet?"recaptcha.net":"www.google.com")+"/recaptcha/api.js?onload="+g+"&render=explicit"},b=(b={callbackName:g,globalName:"grecaptcha"})||{},function(e){var t=e.displayName||e.name||"Component",n=function(t){var n,o;function i(e,n){var r;return(r=t.call(this,e,n)||this).state={},r.__scriptURL="",r}o=t,(n=i).prototype=Object.create(o.prototype),n.prototype.constructor=n,n.__proto__=o;var a=i.prototype;return a.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+y++),this.__scriptLoaderID},a.setupScriptURL=function(){return this.__scriptURL="function"==typeof v?v():v,this.__scriptURL},a.asyncScriptLoaderHandleLoad=function(e){var t=this;this.setState(e,(function(){return t.props.asyncScriptOnLoad&&t.props.asyncScriptOnLoad(t.state)}))},a.asyncScriptLoaderTriggerOnScriptLoaded=function(){var e=m[this.__scriptURL];if(!e||!e.loaded)throw new Error("Script is not loaded.");for(var t in e.observers)e.observers[t](e);delete window[b.callbackName]},a.componentDidMount=function(){var e=this,t=this.setupScriptURL(),n=this.asyncScriptLoaderGetScriptLoaderID(),r=b,o=r.globalName,i=r.callbackName,a=r.scriptId;if(o&&void 0!==window[o]&&(m[t]={loaded:!0,observers:{}}),m[t]){var s=m[t];return s&&(s.loaded||s.errored)?void this.asyncScriptLoaderHandleLoad(s):void(s.observers[n]=function(t){return e.asyncScriptLoaderHandleLoad(t)})}var c={};c[n]=function(t){return e.asyncScriptLoaderHandleLoad(t)},m[t]={loaded:!1,observers:c};var l=document.createElement("script");for(var u in l.src=t,l.async=!0,b.attributes)l.setAttribute(u,b.attributes[u]);a&&(l.id=a);var d=function(e){if(m[t]){var n=m[t].observers;for(var r in n)e(n[r])&&delete n[r]}};i&&"undefined"!=typeof window&&(window[i]=function(){return e.asyncScriptLoaderTriggerOnScriptLoaded()}),l.onload=function(){var e=m[t];e&&(e.loaded=!0,d((function(t){return!i&&(t(e),!0)})))},l.onerror=function(){var e=m[t];e&&(e.errored=!0,d((function(t){return t(e),!0})))},document.body.appendChild(l)},a.componentWillUnmount=function(){var e=this.__scriptURL;if(!0===b.removeOnUnmount)for(var t=document.getElementsByTagName("script"),n=0;n<t.length;n+=1)t[n].src.indexOf(e)>-1&&t[n].parentNode&&t[n].parentNode.removeChild(t[n]);var r=m[e];r&&(delete r.observers[this.asyncScriptLoaderGetScriptLoaderID()],!0===b.removeOnUnmount&&delete m[e])},a.render=function(){var t=b.globalName,n=this.props,o=(n.asyncScriptOnLoad,n.forwardedRef),i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["asyncScriptOnLoad","forwardedRef"]);return t&&"undefined"!=typeof window&&(i[t]=void 0!==window[t]?window[t]:void 0),i.ref=o,(0,r.createElement)(e,i)},i}(r.Component),o=(0,r.forwardRef)((function(e,t){return(0,r.createElement)(n,h({},e,{forwardedRef:t}))}));return o.displayName="AsyncScriptLoader("+t+")",o.propTypes={asyncScriptOnLoad:d().func},p()(o,e)})(l)},93485:(e,t,n)=>{"use strict";var r=n(34072);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},99860:(e,t,n)=>{e.exports=n(93485)()},34072:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[141],{75896:(e,t,n)=>{n.d(t,{$6:()=>v,BH:()=>a,BX:()=>l,Cz:()=>i,HM:()=>p,K2:()=>c,YS:()=>y,_5:()=>g,a7:()=>r,cL:()=>m,dY:()=>d,fq:()=>h,mf:()=>u,nm:()=>s,sR:()=>o,vo:()=>f});var r="entityTemplate/UNLOAD_VIEW",a="entityTemplate/FETCH_ENTITY_TEMPLATES",i="entityTemplate/SET_ENTITY_TEMPLATES",o="entityTemplate/SET_ACTIVE_ENTITY_TEMPLATE",c="entityTemplate/FETCH_TEMPLATE_VALUES",s="entityTemplate/SET_ACTIVE_TEMPLATE_DEFAULT_VALUES",l="entityTemplate/SET_FORM_VALUES",u="entityTemplate/CREATE_ENTITY_TEMPLATE",p=function(){return{type:r}},d=function(e){return{type:a,payload:{entityName:e}}},f=function(e,t){return{type:i,payload:{entityName:e,entityTemplates:t}}},m=function(e){return{type:o,payload:{activeEntityTemplate:e}}},y=function(e,t){return{type:c,payload:{entityName:e,templateId:t}}},h=function(e){return{type:s,payload:{activeTemplateDefaultValues:e}}},v=function(e){return{type:l,payload:{formValues:e}}},g=function(e,t,n,r){return{type:u,payload:{entityName:e,label:t,formValues:n,onSuccess:r}}}},97027:(e,t,n)=>{n.r(t),n.d(t,{default:()=>br});var r=n(15857),a=n(74806),i=n(50558),o=n(54675),c=n(1024),s=n.n(c),l=n(56746),u=n(19743),p=n(5303),d=n(59713),f=n.n(d),m=n(27361),y=n.n(m),h=n(70696),v=n(75354),g=n(87467),b=n(90169),w=n(96801),x=function(e){var t=w.Z.extractParamsFromPath("/e/:entity/:key?/:relation*/:view(list|detail|edit|create|relations|action)/:actionId?",e),n=w.Z.extractParamsFromPath("/e/action/:actionId",e);return t||n},j=n(46054),P=n(85893);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=function(e){var t=e.history,n=e.match,r=e.setCurrentViewTitle,a=e.currentViewInfo,i=e.intl,o=t.location;if((0,c.useEffect)((function(){return a&&r(i.formatMessage({id:"client.actions.".concat(a.actionId,".title")})),function(){r(null)}}),[a,r,i]),!a)return null;var s=v.Z.fromQueryString(o.search),l=y()(o,"state.selection",s.selection),u=y()(o,"state.definition.properties",s.actionProperties),p=function(){var e=x(n.url).key?(0,g.H)(n.url):(0,g.H)(n.url,2);t.replace(e)};return(0,P.jsx)(j.Z,Z(Z({history:t,match:n,appId:a.actionId},s),{},{selection:l,actionProperties:u,navigationStrategy:(0,b.ZP)(t,n),onSuccess:p,onError:p,onCancel:p}))},E=function(e,t){return 0===Object.keys(h.Z.difference(e,t)).length};const T=s().memo(k,E);var N={setCurrentViewTitle:o.Wk};const R=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),N)((0,a.ZP)(T));var C=n(50600),D=n(91073),S=n(88757),V=n(75896),A=function(e){return Boolean(e.entities.entityTemplate.activeEntityTemplate)&&!e.entities.entityTemplate.activeTemplateDefaultValues},I=n(319),L=n.n(I),_=n(63038),F=n.n(_),M=n(28655),U=n.n(M),W=n(30314),B=n(38205),z=n(33773),H=n(11467),q=n(44834),Y=n(88601),$=n(7281),K=n(74406),G=n(19917),X=n(84286),J=n(2913),Q=n(35728),ee=n(24688);const te=function(e){var t=e.when,n=e.message;return(0,c.useEffect)((function(){return t&&ee.Z.activatePreventFromLeaving(),function(){ee.Z.deactivatePreventFromLeaving()}}),[t]),(0,P.jsx)(l.NL,{when:t,message:n})};var ne=n(50628),re={"entity-template-create":(0,c.lazy)((function(){return Promise.all([n.e(130),n.e(802),n.e(896),n.e(860),n.e(834),n.e(467),n.e(85),n.e(280),n.e(107)]).then(n.bind(n,69745))}))};const ae=ne.Z.actionFactory(re);var ie,oe=n(24291),ce=n(24875),se=B.ZP.div.withConfig({displayName:"Box"})(ie||(ie=U()(["\n margin-top: 0.4rem;\n margin-bottom: 0.4rem;\n background-color: ",";\n padding: "," "," 0 ",";\n position: relative;\n"])),ce.FS.color("paper"),$.Z.space(-1.1),$.Z.space(-.375),$.Z.space(0));const le=function(e){var t=e.entityName,n=e.activeEntityTemplate,r=e.setActiveEntityTemplate,a=e.fetchEntityTemplates,i=e.entityTemplates;return(0,c.useEffect)((function(){a(t)}),[a,t]),(0,P.jsx)(se,{children:i.map((function(e){return(0,P.jsx)(oe.Z,{primaryKey:e.key,label:e.paths.label.value,description:e.paths.description.value,active:(null==n?void 0:n.key)===e.key,setActive:function(t){return r(t?e:null)},showAddRemoveBtn:!1},e.key)}))})};var ue={fetchEntityTemplates:V.dY,setActiveEntityTemplate:V.cL};const pe=(0,i.connect)((function(e,t){return{entityTemplates:e.entities.entityTemplate.entityTemplates[t.entityName]||[],activeEntityTemplate:e.entities.entityTemplate.activeEntityTemplate}}),ue)((0,a.ZP)(le));var de,fe,me=n(87757),ye=n.n(me),he=n(122),ve=ye().mark(ge);function ge(e,t){var n;return ye().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={id:"entity-template-create",appId:"entity-template-create",label:t.formatMessage({id:"client.admin.entities.action.createEntityTemplate.label"}),componentType:"action",children:[],actionType:"custom",useLabel:"YES",buttonType:"REGULAR",canExecuteOnPendingChanges:!0},r.abrupt("return",he.Z.addAction(e,n,["save"]));case 2:case"end":return r.stop()}}),ve)}var be=B.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(de||(de=U()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n height: calc(100dvh - 75px); // ~75px the height of header and breadcrumbs\n width: 100%;\n"])),Y.Z.color("paper"),$.Z.space(0));const we=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,i=e.chooseDocument,o=e.dispatchEmittedAction,s=e.setPendingChanges,l=e.setFormValues,u=e.unloadView,p=e.isLoadingTemplateValues,d=e.activeTemplateDefaultValues,f=n.location,m=y()(f,"state.defaultValues",[]),h=(0,c.useState)(!1),v=F()(h,2),g=v[0],w=v[1];if((0,c.useEffect)((function(){return function(){s(!1),u()}}),[s,u]),!t)return null;var x=t.model,j=t.reverseRelation,O=t.parentKey,Z=x.name,k=y()(x,"paths.".concat(j,".multi"),!1),E=[].concat(L()(j&&O?[{id:j,value:k?[O]:O}]:[]),L()(m)),T=function(e){return a.formatMessage({id:e})},N=d?[].concat(L()(d),L()(E)):E;return(0,P.jsxs)(K.Z,{sidepanelPosition:"left",scrollBehaviour:"inline",children:[(0,P.jsxs)(G.Z,{children:[fe||(fe=(0,P.jsx)(X.Z,{})),(0,P.jsx)(pe,{entityName:Z})]}),(0,P.jsx)(J.Z,{children:(0,P.jsx)(be,{children:(0,P.jsxs)(Q.Z,{required:[!p],loadingText:T("client.admin.entities.create.entityTemplateLoading"),children:[(0,P.jsx)(te,{when:g,message:T("client.admin.entities.confirmTouchedFormLeave")}),(0,P.jsx)(H.ZP,{entityName:Z,formName:Z,mode:"create",defaultValues:N,ignoreFormDefaultValues:Boolean(d),emitAction:function(e){o(e)},navigationStrategy:(0,b.ZP)(n,r),chooseDocument:i,onEntityCreated:function(e){var t=e.id,a=e.followUp;(0,W.flushSync)((function(){w(!1)})),n.push({pathname:r.url.replace(/create$/,t)+"/detail",search:null!=a&&a.action?"?action=".concat(null==a?void 0:a.action):""})},onTouchedChange:function(e){var t=e.touched;w(t),s(t)},onFormValuesChange:function(e){var t=e.formValues;l(t)},listApp:q.ZP,docsApp:z.default,actionAppComponent:ae,modifyFormDefinition:function(e){return ge(e,a)}})]})})})]})};var xe={chooseDocument:D.Z.actions.chooseDocument,dispatchEmittedAction:C.Z.dispatchEmittedAction,setPendingChanges:S.c0,setFormValues:V.$6,unloadView:V.HM};const je=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],activeTemplateDefaultValues:e.entities.entityTemplate.activeTemplateDefaultValues,isLoadingTemplateValues:A(e)}}),xe)((0,a.ZP)(we));var Pe=n(29785),Oe=n(17563),Ze=n(29441),ke=n(48926),Ee=n.n(ke),Te=n(81719);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ce=function(e){var t=e.entityName,n=e.entityKey,r=e.showActions,a=e.noLeftPadding,i=e.openResource,o=e.initialLocation,s=e.sortable,l=(0,c.useState)(null),u=F()(l,2),p=u[0],d=u[1],f=(0,c.useCallback)(Ee()(ye().mark((function e(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Te.Z.simpleRequest("entities/2.0/"+t+"/"+n+"/entitydocs/folder").then((function(e){d(e.body.key)}));case 1:case"end":return e.stop()}}),e)}))),[t,n]);return(0,c.useEffect)((function(){f()}),[f]),p&&(0,P.jsx)(z.default,Re(Re(Re({routerType:"routerless",initialLocation:o,noLeftPadding:a,sortable:s,searchFormType:"none",rootNodes:[{key:p,entityName:"Folder"}],embedded:!0,showActions:r},!1===r?{selectionStyle:"none"}:{}),{},{disableViewPersistor:!0},i?{openResource:i}:{}),{},{scrollBehaviour:"inline"}))};const De=function(e){var t=e.currentViewInfo,n=e.initialLocation;return(0,P.jsx)(Ce,{noLeftPadding:!1,entityName:t.parentModel.name,entityKey:t.parentKey,showActions:!0,initialLocation:n})};function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ae=function(e){var t=e.match,n=e.history,r=e.currentViewInfo,a=e.emitAction,i=e.searchFormCollapsed,o=e.saveUserPreferences;if(!r)return null;var c=Oe.parse(n.location.search),s=n.location.hash?n.location.hash.substring(1):null;return"Resource"===r.model.name?(0,P.jsx)(De,{currentViewInfo:r,initialLocation:s}):(0,P.jsx)(q.ZP,Ve(Ve({emitAction:a,limit:25,id:"".concat(r.model.name,"_list"),entityName:r.model.name,formName:c.formName||r.model.name,onRowClick:function(e){var r=e.id;n.push(t.url.replace(/list$/,"")+r)}},r.reverseRelation&&{parent:{key:r.parentKey,reverseRelationName:r.reverseRelation,model:r.parentModel.name}}),{},{showLink:!0,navigationStrategy:(0,b.ZP)(n,t),searchFormPosition:"left",searchFormType:"admin",scrollBehaviour:"inline",store:Ze.Z.viewInfoSelector(n.location.pathname).store,onStoreCreate:function(e){Ze.Z.persistViewInfo(n.location.pathname,{store:e},r.level)},actionAppComponent:j.Z,tql:c.tql,searchFormCollapsed:i,onSearchFormCollapsedChange:function(e){var t=e.collapsed;o({"admin.list.searchFormCollapsed":t})},detailApp:H.ZP}))};var Ie={emitAction:function(e){return C.Z.dispatchEmittedAction(e)},saveUserPreferences:Pe.RK};const Le=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],searchFormCollapsed:y()(e.preferences.userPreferences,"admin.list.searchFormCollapsed",!1)}}),Ie)((0,a.ZP)(Ae));var _e,Fe=n(4975);function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var We=B.ZP.div.withConfig({displayName:"StyledEntityDetailAppWrapper"})(_e||(_e=U()(["\n margin: 0;\n background-color: ",";\n padding: 0 0 0 ",";\n overflow: hidden;\n height: 100%;\n"])),Y.Z.color("paper"),$.Z.space(0));const Be=function(e){var t=e.currentViewInfo,n=e.history,r=e.match,a=e.intl,i=e.chooseDocument,o=e.emitAction,s=e.propagateRefresh,l=e.invalidateLastBreadcrumb,u=e.setPendingChanges,p=Oe.parse(location.search),d=p.action,f=p.formName,m=(0,c.useState)(!1),y=F()(m,2),h=y[0],v=y[1];if((0,c.useEffect)((function(){return function(){return u(!1)}}),[u]),!t||t.pathname!==n.location.pathname)return null;var w=t.model.name;return(0,P.jsxs)(We,{children:[(0,P.jsx)(te,{when:h,message:function(e){return n.location.pathname!==e.pathname&&(t="client.admin.entities.confirmTouchedFormLeave",a.formatMessage({id:t}));var t}}),(0,P.jsx)(H.ZP,{entityName:w,entityId:t.key,formName:f||w,mode:"update",emitAction:o,onTouchedChange:function(e){var t=e.touched;v(t),u(t)},navigationStrategy:Ue(Ue({},(0,b.ZP)(n,r)),{},{navigateToCreateRelative:function(e,t){if(e){var a=(0,g.H)(r.url,1);n.push({pathname:"".concat(a,"/").concat(e,"/create"),state:t})}else{var i=(0,g.H)(r.url,2);n.push({pathname:i+"/create",state:t})}}}),chooseDocument:i,onEntityDeleted:function(){var e=(0,g.H)(r.url,2);n.push(e)},onEntityUpdated:function(){var e=n.location;l(e)},onRefresh:function(){var e=n.location;s(e)},actionAppComponent:j.Z,onSubGridRowClick:function(e){var t=e.id,a=e.relationName,i=(0,g.H)(r.url);n.push("".concat(i,"/").concat(a,"/").concat(t))},listApp:q.ZP,docsApp:z.default,initialAction:d})]})};var ze={chooseDocument:D.Z.actions.chooseDocument,emitAction:function(e){return C.Z.dispatchEmittedAction(e)},propagateRefresh:o.Ld,invalidateLastBreadcrumb:o._m,setPendingChanges:S.c0};const He=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),ze)((0,a.ZP)(Be));var qe=n(34206),Ye=n(88162),$e={};const Ke=function(e){var t=e.currentViewInfo,n=e.history,r=e.selectedRelation,a=e.sortable;return(0,P.jsx)(Ce,{entityName:t.model.name,entityKey:t.key,showActions:!1,noLeftPadding:!0,history:n,openResource:function(e){n.push("".concat(r.relationName,"/list#").concat(e))},sortable:a})};var Ge=function(e){var t=e.selectedRelation,n=e.currentViewInfo,r=e.match,a=e.history,i=e.emitAction,o="".concat(t.reverseRelationName).concat(t.relationName);return(0,P.jsx)(q.ZP,{id:"preview"+t.reverseRelationName+t.targetEntity,entityName:t.targetEntity,formName:t.targetEntity,parent:{key:n.key,reverseRelationName:t.reverseRelationName,model:n.model.name,relationName:t.relationName},showLink:!0,navigationStrategy:(0,b.ZP)(a,r),onRowClick:function(e){var n=e.id,i=r.url.replace(/detail$/,"");a.push("".concat(i).concat(t.relationName,"/").concat(n))},onNavigateToCreate:function(){var e=(0,g.H)(r.url);a.push(e+"/"+t.relationName+"/create")},searchFormType:"fulltext",selectionStyle:"none",store:Ze.Z.viewInfoSelector(a.location.pathname)["store-".concat(o)],onStoreCreate:function(e){Ze.Z.persistViewInfo(n.pathname,f()({},"store-".concat(o),e),n.level)},showActions:!1,limit:15,emitAction:i,scrollBehaviour:"inline",detailApp:H.ZP},t.reverseRelationName+t.targetEntity)};const Xe=s().memo(Ge);var Je,Qe,et,tt,nt,rt,at,it,ot,ct,st,lt,ut,pt,dt=n(6699),ft=n(65035),mt=n(84647),yt=n(69829),ht=n(30759),vt=B.ZP.div.withConfig({displayName:"StyledRelationsViewWrapper"})(Je||(Je=U()(["\n display: ",";\n height: 100%;\n flex-direction: column;\n"])),(function(e){return e.isRightPaneCollapsed?"none":"flex"})),gt=B.ZP.div.withConfig({displayName:"StyledPlaceHolder"})(Qe||(Qe=U()(["\n display: ",";\n flex: 1;\n height: 100%;\n width: 25px;\n background: ",";\n padding-top: ",";\n padding-left: ",";\n align-items: flex-start;\n\n &:hover {\n cursor: pointer;\n }\n"])),(function(e){return e.isRightPaneCollapsed?"flex":"none"}),Y.Z.color("paper"),$.Z.space(-1.5),$.Z.space(-2.5)),bt=B.ZP.div.withConfig({displayName:"StyledToggleCollapse"})(et||(et=U()(["\n display: flex;\n background-color: ",";\n padding-top: ",";\n padding-bottom: ",";\n"])),Y.Z.color("paper"),$.Z.space(-1.5),$.Z.space(-1.5)),wt=(0,B.ZP)(ft.Z).withConfig({displayName:"StyledToggleCollapseButton"})(tt||(tt=U()(["\n font-size: ",";\n padding: 0;\n margin-left: auto;\n\n &:hover,\n ",":hover & {\n background-color: transparent;\n color: ",";\n }\n"])),$.Z.font(0),gt,Y.Z.color("secondaryLight")),xt=B.ZP.div.withConfig({displayName:"StyledPreviewBox"})(nt||(nt=U()(["\n background-color: ",";\n padding: ",";\n margin-top: 3px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"])),Y.Z.color("paper"),$.Z.space(-1)),jt=B.ZP.div.withConfig({displayName:"StyledRelationBoxes"})(rt||(rt=U()(["\n background-color: ",";\n padding: ",";\n display: grid;\n grid-template-columns: repeat(auto-fit, 170px);\n grid-gap: ",";\n justify-content: space-between;\n overflow-y: auto;\n align-content: flex-start;\n height: fit-content;\n min-height: 150px;\n max-height: 20%;\n"])),Y.Z.color("paper"),$.Z.space(-1),$.Z.space(-2)),Pt=(0,B.ZP)(dt.Z).withConfig({displayName:"StyledPreviewLink"})(at||(at=U()(["\n padding-left: ",";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n"])),$.Z.space(-.5)),Ot=B.ZP.div.withConfig({displayName:"StyledRelationLinks"})(it||(it=U()(["\n display: none;\n margin-left: auto;\n\n * {\n color: ",";\n padding-left: ",";\n }\n"])),Y.Z.color("text"),$.Z.space(-4.5)),Zt=B.ZP.div.withConfig({displayName:"StyledRelationBox"})(ot||(ot=U()(["\n border-radius: ",";\n padding: "," ",";\n display: flex;\n background-color: ",";\n height: fit-content;\n\n &&& {\n * {\n color: ",";\n box-sizing: initial;\n }\n }\n ",";\n\n /* allow hover styles only on non-touch devices */\n ","\n"])),Y.Z.radii("button"),$.Z.space(-2.7),$.Z.space(-1),(function(e){return e.selected&&Y.Z.color("secondary")}),(function(e){return e.selected&&Y.Z.color("paper")}),(function(e){return e.selected&&"\n ".concat(Ot," {\n display: flex;\n }\n ")}),!mt.b&&(0,B.iv)(ct||(ct=U()(["\n &:hover "," {\n display: flex;\n }\n\n && {\n :hover {\n background-color: ",";\n\n * {\n color: ",";\n }\n cursor: pointer;\n }\n }\n\n ",":hover * {\n color: ",";\n }\n "])),Ot,Y.Z.color("secondaryLight"),Y.Z.color("paper"),dt.Z,Y.Z.color("secondary"))),kt=(0,B.ZP)(yt.Fe).withConfig({displayName:"StyledRelationLabel"})(st||(st=U()(["\n && {\n max-width: 110px;\n }\n"]))),Et=B.ZP.span.withConfig({displayName:"StyledCountLabel"})(lt||(lt=U()(["\n ","\n"])),(0,ht.Z)());const Tt=function(e){var t,n,r=e.relation,a=e.history,i=e.match,o=e.relationsInfo,c=e.selectRelation,s=e.selectedRelation,l=e.intl,u=e.entityName,p=r.relationName,d=r.targetEntity,f=r.relationDisplay,m=function(e){return l.formatMessage({id:e})},y=i.url.replace(/(relations|detail)$/,p),h=i.url.replace(/(relations|detail)$/,p)+"/create";return(0,P.jsxs)(Zt,{selected:(null==s?void 0:s.relationName)===p,onClick:function(){c(r),a.replace({search:"?relation=".concat(p)}),function(e,t){$e[e]=t}(u,p)},children:[(0,P.jsx)(kt,{title:f.label,children:f.label}),(null===(n=o[p])||void 0===n?void 0:n.count)>0?(0,P.jsxs)(Et,{children:[" (",o[p].count,")"]}):null,(0,P.jsxs)(Ot,{children:[(0,P.jsx)(dt.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkView"),to:y,children:ut||(ut=(0,P.jsx)(Ye.Z,{icon:"arrow-right"}))}),(null===(t=o[p])||void 0===t?void 0:t.createPermission)&&"Resource"!==d&&(0,P.jsx)(dt.Z,{"aria-label":m("client.admin.entities.relationsView.relationLinkCreate"),to:h,children:pt||(pt=(0,P.jsx)(Ye.Z,{icon:"plus"}))})]})]})};var Nt,Rt,Ct;function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var St=function(e){var t=e.history,n=e.match,r=e.currentViewInfo,a=e.relations,i=e.relationsInfo,o=e.emitAction,l=e.intl,u=e.isRightPaneCollapsed,p=e.toggleCollapse,d=e.selectedRelation,m=e.selectRelation,h=y()(r,"model.name"),v=(0,c.useCallback)((function(){if((null==a?void 0:a.length)>0){var e=Oe.parse(t.location.search).relation;if(e)m(a.find((function(t){return t.relationName===e})));else{var n=$e[h];m(n?a.find((function(e){return e.relationName===n})):a[0])}}}),[a,h,t.location.search,m]);if((0,c.useEffect)(v,[v]),(0,c.useEffect)((function(){d||v()}),[d,v]),!a||0===a.length||!r)return null;var g,b,w=function(e){return l.formatMessage({id:e})},x=d?"Resource"===d.targetEntity?Ke:Xe:function(){return Nt||(Nt=(0,P.jsx)(s().Fragment,{}))},j=a.map((function(t){return(0,P.jsx)(Tt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({relation:t,entityName:h},e),"relation-".concat(t.relationName))}));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(vt,{isRightPaneCollapsed:u,children:[(0,P.jsx)(bt,{children:(0,P.jsx)(wt,{icon:"chevron-right",onClick:p})}),(0,P.jsx)(jt,{children:j}),d&&(0,P.jsxs)(xt,{children:[(0,P.jsxs)(qe.ZP.H4,{children:[d.relationDisplay.label,(0,P.jsx)(Pt,{"aria-label":w("client.admin.entities.relationsView.relationLinkView"),to:n.url.replace(/(relations|detail)$/,d.relationName),children:Rt||(Rt=(0,P.jsx)(Ye.Z,{icon:"arrow-right"}))}),(g=d.relationName,(null===(b=i[g])||void 0===b?void 0:b.createPermission)&&"Resource"!==d.targetEntity&&(0,P.jsx)(Pt,{"aria-label":w("client.admin.entities.relationsView.relationLinkCreate"),to:n.url.replace(/(relations|detail)$/,d.relationName)+"/create",children:Ct||(Ct=(0,P.jsx)(Ye.Z,{icon:"plus"}))}))]}),(0,P.jsx)(x,{selectedRelation:d,match:n,history:t,currentViewInfo:r,emitAction:o,sortable:!0})]})]}),(0,P.jsx)(gt,{onClick:p,isRightPaneCollapsed:u,children:(0,P.jsx)(wt,{icon:"chevron-left",isRightPaneCollapsed:u})})]})},Vt=function(e,t){return 0===Object.keys(h.Z.difference(e,t)).length};const At=s().memo(St,Vt);var It={emitAction:function(e){return C.Z.dispatchEmittedAction(e)},selectRelation:o.lM};const Lt=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relations:e.entities.path.relations,relationsInfo:e.entities.path.relationsInfo,selectedRelation:e.entities.path.selectedRelation}}),It)((0,a.ZP)(At));var _t,Ft,Mt,Ut=B.ZP.div.withConfig({displayName:"StyledDetailViewContainer"})(_t||(_t=U()(["\n display: flex;\n flex-direction: row;\n height: 100%;\n\n .react-bs-container-body {\n height: auto !important;\n }\n"]))),Wt=B.ZP.div.withConfig({displayName:"StyledDetailViewLeft"})(Ft||(Ft=U()(["\n flex: 1;\n margin-right: 1rem;\n /* Only show one panel at a time on screens <= 500px */\n display: ",";\n"])),(function(e){var t=e.windowWidth,n=e.isRightPaneCollapsed;return t<=500&&!n&&"none"})),Bt=B.ZP.div.withConfig({displayName:"StyledDetailViewRight"})(Mt||(Mt=U()(["\n flex: ",";\n"])),(function(e){return e.isRightPaneCollapsed?"0":"1"}));const zt=function(e){var t=e.match,n=e.history,r=(e.currentViewInfo,e.relationViewCollapsed),a=e.saveUserPreferences,i=(0,Fe.K)(r,(function(e){a({"admin.detail.relationViewCollapsed":e})})),o=i.isCollapsed,c=i.toggleCollapse;return(0,P.jsxs)(Ut,{children:[(0,P.jsx)(Wt,{isRightPaneCollapsed:o,windowWidth:window.innerWidth,children:(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(He,{match:t,history:n})})}),(0,P.jsx)(Bt,{isRightPaneCollapsed:o,children:(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(Lt,{match:t,history:n,isRightPaneCollapsed:o,toggleCollapse:c})})})]})};var Ht={saveUserPreferences:Pe.RK};const qt=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname],relationViewCollapsed:y()(e.preferences.userPreferences,"admin.detail.relationViewCollapsed",!1)}}),Ht)((0,a.ZP)(zt));const Yt=function(e){var t,n,r=e.match,a=(t=r.path,n=":relation",t.split(n).length-1);return(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{exact:!0,path:"".concat(r.url),render:function(e){return(0,P.jsx)(l.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/detail")})}}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/detail"),component:qt}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/edit"),component:He}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/relations"),component:Lt}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/action"),component:R}),(0,P.jsx)(l.AW,{path:"".concat(r.path,"/:relation_").concat(a),component:$t})]})};const $t=function(e){var t=e.match;return(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{exact:!0,path:t.url,render:function(e){return(0,P.jsx)(l.l_,{to:"".concat(e.match.url.replace(/\/$/,""),"/list")})}}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/action/:id"),component:R}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/list"),component:Le}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/create"),component:je}),(0,P.jsx)(l.AW,{path:"".concat(t.path,"/:key"),component:Yt})]})};var Kt=n(54680);const Gt=(0,i.connect)((function(e,t){return{pathPrefix:"/e",breadcrumbsInfo:e.entities.path.breadcrumbsInfo,currentView:e.entities.path.currentViewTitle?{display:e.entities.path.currentViewTitle,title:e.entities.path.currentViewTitle}:null}}),{})((0,a.ZP)(Kt.Z));var Xt=n(44012),Jt=n(39233);const Qt=function(e){var t=e.currentViewInfo,n="client.admin.entity.errorView.",r="detail"===t.type?"detailTitle":"defaultTitle",a="listDescription";return"detail"===t.type?a="detailDescription":"list"===t.type&&t.error.relationName&&(a="relationDescription"),(0,P.jsx)(Jt.Z,{title:(0,P.jsx)(Xt.Z,{id:n+r}),message:(0,P.jsx)(Xt.Z,{id:n+a,values:t.error})})};const en=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}))((0,a.ZP)(Qt));var tn,nn,rn,an,on=B.ZP.div.withConfig({displayName:"StyledWrapper"})(tn||(tn=U()(["\n display: grid;\n grid-template-rows: auto 1fr;\n grid-template-areas:\n 'breadcrumbs'\n 'content';\n height: 100%;\n width: 100%;\n"]))),cn=B.ZP.div.withConfig({displayName:"StyledContent"})(nn||(nn=U()(["\n grid-area: content;\n overflow: hidden;\n"]))),sn=B.ZP.div.withConfig({displayName:"StyledBreadcrumbs"})(rn||(rn=U()(["\n grid-area: breadcrumbs;\n"])));const ln=function(e){var t=e.match,n=e.history,r=e.loadCurrentRoute,a=e.currentViewInfo,i=n.location;(0,c.useEffect)((function(){r(i)}),[i,r]);var o=null!=a&&a.error?(0,P.jsx)(en,{history:n}):(0,P.jsxs)(l.rs,{children:[(0,P.jsx)(l.AW,{path:"".concat(t.url,"/action/:actionId"),component:R}),(0,P.jsx)(l.AW,{path:"".concat(t.url,"/:entity"),component:$t}),(0,P.jsx)(l.AW,{exact:!0,path:t.url,component:p.Z})]});return(0,P.jsxs)(on,{children:[an||(an=(0,P.jsx)(u.Z.ErrorBoundary,{children:(0,P.jsx)(sn,{children:(0,P.jsx)(Gt,{})})})),(0,P.jsx)(cn,{children:o})]})};var un={loadCurrentRoute:o.jw};const pn=(0,i.connect)((function(e,t){return{currentViewInfo:e.entities.path.currentViewInfos[t.history.location.pathname]}}),un)((0,a.ZP)(ln));var dn,fn=n(34857),mn=n(81770);function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vn=(dn={},f()(dn,V.Cz,(function(e,t){var n=t.payload,r=n.entityName,a=n.entityTemplates;return hn(hn({},e),{},{entityTemplates:hn(hn({},e.entityTemplates),{},f()({},r,a))})})),f()(dn,V.sR,mn.Z.singleTransferReducer("activeEntityTemplate")),f()(dn,V.nm,mn.Z.singleTransferReducer("activeTemplateDefaultValues")),f()(dn,V.BX,mn.Z.singleTransferReducer("formValues")),dn),gn={entityTemplates:{},activeEntityTemplate:null,activeTemplateDefaultValues:null,formValues:null};var bn=n(94736);function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wn(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jn=function(e){return Object.keys(e.paths).filter((function(t){return!["document","binary","image","named-upload","upload"].includes(e.paths[t].type)})).map((function(t){return{id:t,value:function(e){var t=e.type,n=e.value;return"entity"===t?n.key:"entity-list"===t&&Array.isArray(n)?n.map((function(e){return e.key})):n}(e.paths[t])}}))},Pn=function(e){return{paths:Object.keys(e).filter((function(e){return!Object.values(bn.Z.metaFields).includes(e)})).reduce((function(t,n){return xn(xn({},t),{},f()({},n,null!=(r=e[n])&&r.key?{key:r.key}:Array.isArray(r)?r.map((function(e){return{key:e.key}})):r));var r}),{})}},On=ye().mark(Tn),Zn=ye().mark(Dn),kn=function(e){return e.entities.entityTemplate.entityTemplates},En=function(e){return e.intl.messages};function Tn(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,fn.$6)([(0,fn.Fm)(V.BH,Nn),(0,fn.Fm)(V.sR,Rn),(0,fn.Fm)(V.K2,Cn),(0,fn.Fm)(V.a7,Dn),(0,fn.Fm)(V.mf,Sn)]);case 2:case"end":return e.stop()}}),On)}function Nn(e){var t=e.payload;return ye().mark((function e(){var n,r;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,e.next=3,(0,fn.RE)(Te.Z.fetchAllEntities,"Entity_template",{where:'base_model=="'.concat(n,'" and (relUser.pk==:currentUser or not exists(relUser))'),sorting:[{field:"sorting",order:"asc"}],paths:["label","description","base_model","unique_id"]},{method:"GET"});case 3:return r=e.sent,e.next=6,(0,fn.gz)(V.vo(n,r));case 6:case"end":return e.stop()}}),e)}))()}function Rn(e){var t=e.payload.activeEntityTemplate;return ye().mark((function e(){var n,r;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,fn.gz)(V.fq(null));case 2:if(!t){e.next=7;break}return n=t.paths.base_model.value,r=t.paths.unique_id.value,e.next=7,(0,fn.gz)(V.YS(n,r));case 7:case"end":return e.stop()}}),e)}))()}function Cn(e){var t=e.payload;return ye().mark((function e(){var n,r,a,i,o;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,r=t.templateId,e.next=3,(0,fn.RE)(Te.Z.requestSaga,"entities/2.0/templates/".concat(n,"/").concat(encodeURIComponent(r)),{method:"GET"});case 3:return a=e.sent,i=a.body,o=jn(i),e.next=8,(0,fn.gz)(V.fq(o));case 8:case"end":return e.stop()}}),e)}))()}function Dn(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,fn.gz)(V.cL(null));case 2:return e.next=4,(0,fn.gz)(V.$6(null));case 4:case"end":return e.stop()}}),Zn)}function Sn(e){var t=e.payload;return ye().mark((function e(){var n,r,a,i,o,c,s,l,u,p,d,f;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.entityName,r=t.label,a=t.formValues,i=t.onSuccess,o={method:"POST",body:{label:r,entity:Pn(a)}},e.next=4,(0,fn.RE)(Te.Z.requestSaga,"entities/2.0/templates/".concat(n),o);case 4:return c=e.sent,s=c.headers.get("location"),e.next=8,(0,fn.gz)(V.dY(n));case 8:return e.next=10,(0,fn.qn)(V.Cz);case 10:return e.next=12,(0,fn.Ys)(kn);case 12:return l=e.sent,u=l[n],p=s.split("/").slice(-1)[0],d=u.find((function(e){return e.key===p})),e.next=18,(0,fn.gz)(V.cL(d));case 18:return e.next=20,(0,fn.Ys)(En);case 20:return f=e.sent,e.next=23,(0,fn.RE)(i,{message:f["client.admin.entities.action.createEntityTemplate.success"]});case 23:case"end":return e.stop()}}),e)}))()}const Vn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gn,t=arguments.length>1?arguments[1]:void 0,n=vn[t.type];return n?n(e,t):e};var An;function In(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _n=(An={},f()(An,o.p3,(function(e){return Ln(Ln({},e),{},{currentViewInfos:{},breadcrumbsInfo:[]})})),f()(An,o.Xk,(function(e,t){var n=t.payload,r=n.location,a=n.currentViewInfo;return Ln(Ln({},e),{},{currentViewInfos:Ln(Ln({},e.currentViewInfos),{},f()({},r,Ln(Ln({},e.currentViewInfos[r]),a)))})})),f()(An,o.CM,mn.Z.singleTransferReducer("breadcrumbsInfo")),f()(An,o.PF,(function(e,t){var n=t.payload,r=n.path,a=n.breadcrumbsInfo;return Ln(Ln({},e),{},{breadcrumbsInfo:e.breadcrumbsInfo.map((function(e){return e.path===r?Ln(Ln({},e),a):e}))})})),f()(An,o.oO,mn.Z.singleTransferReducer("relations")),f()(An,o.dF,mn.Z.singleTransferReducer("relationsInfo")),f()(An,o.l3,mn.Z.singleTransferReducer("currentViewTitle")),f()(An,o.OJ,mn.Z.singleTransferReducer("selectedRelation")),An),Fn={currentViewInfos:{},breadcrumbsInfo:[],relations:null,relationsInfo:{},selectedRelation:null};var Mn=n(57557),Un=n.n(Mn),Wn=n(78718),Bn=n.n(Wn),zn=n(35937),Hn=n.n(zn),qn=n(44759);function Yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yn(Object(n),!0).forEach((function(t){f()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kn=ye().mark(ir),Gn=ye().mark(cr),Xn=ye().mark(sr),Jn=ye().mark(lr),Qn=ye().mark(dr),er=ye().mark(yr),tr=ye().mark(hr),nr=ye().mark(vr),rr=function(e){return e.entities.path},ar=/[^/]+\/?[^/]+/g;function ir(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,fn.$6)([(0,fn.Fm)(o.hc,or),(0,fn.Fm)(o.eZ,fr),(0,fn.Fm)(o.Mu,mr)]);case 2:case"end":return e.stop()}}),Kn)}function or(e){var t=e.payload.location;return ye().mark((function e(){var n,r,a;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,fn.RE)(lr,n);case 3:if(!((r=e.sent).length>0)){e.next=15;break}return e.next=7,(0,fn.RE)(cr,n,r);case 7:if("detail"!==(a=e.sent).type||a.error){e.next=11;break}return e.next=11,(0,fn.RE)(dr,a.model,a.key);case 11:return e.next=13,(0,fn.RE)(sr,r);case 13:return e.next=15,(0,fn.RE)(Ze.Z.clearPersistedViews,a.level+1);case 15:case"end":return e.stop()}}),e)}))()}function cr(e,t){var n;return ye().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,fn.RE)(ur,e,t);case 2:return n=r.sent,r.next=5,(0,fn.gz)(o.Hn(e,n));case 5:return r.abrupt("return",n);case 6:case"end":return r.stop()}}),Gn)}function sr(e){var t;return ye().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,fn.RE)(pr,e);case 2:return t=n.sent,n.next=5,(0,fn.gz)(o.rt(t));case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),Xn)}function lr(e){var t,n,r,a,i,o,c,s,l,u,p,d,f,m,y,h,v;return ye().wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,(0,fn.RE)(x,e);case 2:if(t=g.sent,n=[],null!==t){g.next=6;break}return g.abrupt("return",n);case 6:if(!t.entity){g.next=70;break}return g.prev=7,g.next=10,(0,fn.RE)(Te.Z.fetchModel,t.entity);case 10:r=g.sent,n.push({type:"list",model:r}),g.next=18;break;case 14:return g.prev=14,g.t0=g.catch(7),n.push({type:"list",error:{entityName:t.entity}}),g.abrupt("return",n);case 18:if(!t.key){g.next=67;break}return g.next=21,(0,fn.RE)(Te.Z.entityExists,r.name,t.key);case 21:if(!g.sent){g.next=29;break}return g.next=25,(0,fn.RE)(Te.Z.fetchDisplay,r.name,t.key);case 25:a=g.sent,n.push({type:"detail",key:t.key,model:r,display:a}),g.next=31;break;case 29:return n.push({type:"detail",error:{entityName:r.label,key:t.key}}),g.abrupt("return",n);case 31:if(!t.relation){g.next=67;break}i=t.relation.split("/"),o=0;case 34:if(!(o<i.length)){g.next=67;break}if(c=i[o],s=n[n.length-1],o%2!=0){g.next=50;break}if(l=c,u=s.model.paths[l]){g.next=43;break}return n.push({type:"list",error:{relationName:l,entityName:s.model.name}}),g.abrupt("return",n);case 43:return p=u.targetEntity,g.next=46,(0,fn.RE)(Te.Z.fetchModel,p);case 46:d=g.sent,n.push({type:"list",model:d,relationName:l,parent:s}),g.next=64;break;case 50:return f=c,m=s.model,g.next=54,(0,fn.RE)(Te.Z.entityExists,m.name,f);case 54:if(!g.sent){g.next=62;break}return g.next=58,(0,fn.RE)(Te.Z.fetchDisplay,m.name,f);case 58:y=g.sent,n.push({type:"detail",model:m,key:f,display:y,relationName:s.relationName,parent:s.parent}),g.next=64;break;case 62:return n.push({type:"detail",error:{entityName:m.name,key:f}}),g.abrupt("return",n);case 64:o++,g.next=34;break;case 67:"create"===t.view?(h=n[n.length-1],v=n[n.length-2],n.push({type:"create",model:h.model,parent:v,relationName:h.relationName})):t.actionId&&n.push({type:"action",actionId:t.actionId}),g.next=71;break;case 70:t.actionId&&n.push({type:"action",actionId:t.actionId});case 71:return g.abrupt("return",n);case 72:case"end":return g.stop()}}),Jn,null,[[7,14]])}var ur=function(e,t){var n=t[t.length-1],r=n.parent;return $n($n({},Un()(n,["parent"])),{},{pathname:e,level:t.length-1},r&&n.relationName&&{parentKey:r.key,reverseRelation:r.model.paths[n.relationName].reverseRelationName,parentModel:r.model})},pr=function(e){var t="";return e.map((function(e){return e.error?{type:"error"}:"action"===e.type?null:(t=(t?t+"/":"")+(e.key?e.key:e.relationName||e.model.name),{type:e.type,display:e.display||e.model.label,path:t+"/"+e.type})})).filter((function(e){return e}))};function dr(e,t){var n,r;return ye().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n=Hn()(e.paths,(function(e){return e.relationDisplay&&e.relationDisplay.show})),r=Object.keys(n).map((function(e){return Bn()(n[e],["relationName","reverseRelationName","targetEntity","relationDisplay.label","relationDisplay.order"])})).sort((function(e,t){return e.relationDisplay.order>t.relationDisplay.order?1:-1})),a.next=4,(0,fn.gz)(o.lM(null));case 4:return a.next=6,(0,fn.gz)(o.zB(r));case 6:return a.next=8,(0,fn.RE)(vr,e.name,t);case 8:case"end":return a.stop()}}),Qn)}function fr(e){var t=e.payload.location;return ye().mark((function e(){var n,r,a,i;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,fn.Ys)(rr);case 3:if(r=e.sent,a=r.currentViewInfos,"detail"!==(i=a[n]).type||i.error){e.next=11;break}return e.next=9,(0,fn.Cs)(vr,i.model.name,i.key);case 9:return e.next=11,(0,fn.gz)(o.lM(null));case 11:case"end":return e.stop()}}),e)}))()}function mr(e){var t=e.payload.location;return ye().mark((function e(){var n,r,a,i,c,s,l;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.pathname,e.next=3,(0,fn.RE)(x,n);case 3:if(null==(r=e.sent)||!r.entity||null==r||!r.key){e.next=28;break}return e.prev=5,e.next=8,(0,fn.RE)(hr,r);case 8:if(!(a=e.sent)){e.next=23;break}return i=a.entityName,c=a.key,e.next=13,(0,fn.RE)(Te.Z.invalidateDisplay,i,c);case 13:return e.next=15,(0,fn.RE)(Te.Z.fetchDisplay,i,c);case 15:return s=e.sent,e.next=18,(0,fn.gz)(o.Hn(n,{display:s}));case 18:return e.next=20,(0,fn.RE)(yr,n);case 20:return l=e.sent,e.next=23,(0,fn.gz)(o.Ss(l,{display:s}));case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(5),qn.Z.logError("breadcrumbs invalidation failed",e.t0);case 28:case"end":return e.stop()}}),e,null,[[5,25]])}))()}function yr(e){var t;return ye().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,fn.RE)(x,e);case 2:if(null!==(t=n.sent)&&t.entity){n.next=5;break}return n.abrupt("return","");case 5:return n.abrupt("return",[t.entity,t.key,t.relation,t.view].filter(Boolean).join("/"));case 6:case"end":return n.stop()}}),er)}function hr(e){var t,n,r,a,i,o,c,s,l,u;return ye().wrap((function(p){for(;;)switch(p.prev=p.next){case 0:if(e&&e.entity&&e.key&&"action"!==e.view){p.next=2;break}return p.abrupt("return",null);case 2:return p.next=4,(0,fn.RE)(Te.Z.fetchModel,e.entity);case 4:if(t=p.sent,e.relation){p.next=7;break}return p.abrupt("return",{entityName:t.name,key:e.key});case 7:if(!((n=e.relation.match(ar)).length<1)){p.next=10;break}return p.abrupt("return",null);case 10:r=t,a=null,i=0;case 13:if(!(i<n.length)){p.next=25;break}if(o=n[i].split("/"),c=F()(o,2),s=c[0],l=c[1],(u=r.paths[s])&&l){p.next=18;break}return p.abrupt("return",null);case 18:return p.next=20,(0,fn.RE)(Te.Z.fetchModel,u.targetEntity);case 20:r=p.sent,a={entityName:r.name,key:l};case 22:i++,p.next=13;break;case 25:return p.abrupt("return",a);case 26:case"end":return p.stop()}}),tr)}function vr(e,t){var n,r,a;return ye().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return n="client/entities/".concat(e,"/").concat(t,"/relations"),i.next=3,(0,fn.RE)(Te.Z.requestSaga,n);case 3:return r=i.sent,a=r.body.relations,i.next=7,(0,fn.gz)(o.Fp(a));case 7:case"end":return i.stop()}}),nr)}const gr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fn,t=arguments.length>1?arguments[1]:void 0,n=_n[t.type];return n?n(e,t):e},br={container:pn,reducers:{entities:(0,r.UY)({path:gr,entityTemplate:Vn})},sagas:[ir,Tn]}},67210:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(74806),a=n(11467),i=n(44834),o=n(33773),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const p=(0,l.U)((0,r.ZP)((function(e){var t=e.path,n=e.context,r=e.onSuccess,l=e.intl,p=e.locale,d=e.emitAction,f=(0,s.Z)(t),m=f?[{id:"rel".concat(f.model),value:f.key}]:[],y=(0,c.Z)(n,"Domain");return(0,u.jsx)(a.ZP,{entityName:"Domain",formName:y,mode:"create",defaultValues:m,locale:p,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Domain/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createDomainSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:i.ZP,docsApp:o.default})})))},36340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(74806),a=n(11467),i=n(44834),o=n(33773),c=n(25660),s=n(80722),l=n(20247),u=n(85893);const p=(0,l.U)((0,r.ZP)((function(e){var t=e.context,n=e.path,r=e.onSuccess,l=e.intl,p=e.locale,d=e.emitAction,f=(0,s.Z)(n),m=f?[{id:"rel".concat(f.model),value:f.key}]:[],y=(0,c.Z)(t,"Folder");return(0,u.jsx)(a.ZP,{entityName:"Folder",formName:y,mode:"create",defaultValues:m,locale:p,onEntityCreated:function(e){var t=e.id,n=[{type:"entity-create-event",payload:{entities:[{entityName:"Docs_list_item",key:"Folder/".concat(t)}]}}];r({title:l.formatMessage({id:"client.docs-browser.createFolderSuccessful"}),remoteEvents:n})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:i.ZP,docsApp:o.default})})))},96954:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var r=n(59713),a=n.n(r),i=n(78788),o=n(85893);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const l=function(e){return(0,o.jsx)(i.Z,s(s({},e),{},{customDeleteEndpoint:"documents/delete"}))}},90100:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(63038),a=n.n(r),i=n(11467),o=n(44834),c=n(33773),s=n(25660),l=n(20247),u=n(85893);const p=(0,l.U)((function(e){var t=e.selection,n=e.onSuccess,r=e.onCancel,l=e.locale,p=e.context,d=e.emitAction,f=e.navigate,m=t.ids[0].split("/"),y=a()(m,2),h=y[0],v=y[1];"Resource"===h&&(f("/docs/doc/".concat(v,"/detail")),r());var g=(0,s.Z)(p,h);return(0,u.jsx)(i.ZP,{entityName:h,formName:g,entityId:v,mode:"update",locale:l,onEntityUpdated:function(){var e=[{type:"entity-update-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},onEntityDeleted:function(){var e=[{type:"entity-delete-event",payload:{entities:[{entityName:"Docs_list_item",key:t.ids[0]}]}}];n({title:null,remoteEvents:e})},emitAction:function(e){(function(e){var t,n;return"client.entity-detail.createSuccessfulTitle"===(null===(t=e.payload)||void 0===t||null===(n=t.toaster)||void 0===n?void 0:n.title)})(e)||d(e)},listApp:o.ZP,docsApp:c.default})}))},4505:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var r,a,i,o=n(74806),c=n(50558),s=n(30081),l=n(20247),u=n(63038),p=n.n(u),d=n(28655),f=n.n(d),m=n(18446),y=n.n(m),h=n(1024),v=n(44012),g=n(38205),b=n(36589),w=n(35728),x=n(65035),j=n(33773),P=n(80722),O=n(85893),Z=g.ZP.div.withConfig({displayName:"StyledButtonsWrapper"})(r||(r=f()(["\n display: flex;\n justify-content: flex-end;\n\n "," {\n margin-right: 0;\n }\n"])),b.Z),k=(0,g.ZP)(w.Z).withConfig({displayName:"StyledLoadMask"})(a||(a=f()(["\n height: auto;\n"]))),E=function(e,t){return null!==e?"Move_docs_list_item":null!==t?"Move_root_docs_list_item_specific":"Move_root_docs_list_item"},T={initialize:s.j2,moveElements:s.w6};const N=(0,l.U)((0,c.connect)((function(e){return{isWaiting:e.docs.move.isWaiting,domainTypes:e.input.domainTypes,rootNodes:e.input.rootNodes,businessUnit:e.input.businessUnit,locale:e.intl.locale}}),T)((0,o.ZP)((function(e){var t=e.selection,n=e.onSuccess,r=e.onError,a=e.path,o=e.initialize,c=e.moveElements,s=e.isWaiting,l=e.domainTypes,u=e.rootNodes,d=e.businessUnit,f=e.locale,m=e.emitAction,g=(0,P.Z)(a),b={model:"Docs_list_item",key:"".concat(g.model,"/").concat(g.key)},w=(0,h.useState)(b),T=p()(w,2),N=T[0],R=T[1];(0,h.useEffect)((function(){o(t,n,r)}),[]);var C=function(e,t){switch(e){case"Domain":return"/docs/domain/".concat(t,"/list");case"Folder":return"/docs/folder/".concat(t,"/list");case"Resource":return;default:throw new Error("Unexpected model: ".concat(e))}};return(0,O.jsxs)(k,{required:[!s],children:[(0,O.jsx)(j.default,{routerType:"routerless",initialLocation:function(){if(null===N)return null;var e=N.key.split("/"),t=p()(e,2),n=t[0],r=t[1];return C(n,r)}(),listLimit:10,selectionStyle:"none",searchFormType:"none",disableViewPersistor:!0,getListFormName:E,onListParentChange:R,getCustomLocation:C,navigationStrategy:{},embedded:!0,emitAction:m,noLeftPadding:!0,domainTypes:l,rootNodes:u,businessUnit:d,sortable:!1,scrollBehaviour:"none",locale:f}),(0,O.jsx)(Z,{children:(0,O.jsx)(x.Z,{onClick:function(){return c(N.key,t.ids)},look:"raised",ink:"primary",disabled:null===N||y()(N,b),children:i||(i=(0,O.jsx)(v.Z,{id:"client.actions.dms-move.button"}))})})]})}))))},82445:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(59713),a=n.n(r),i=n(11467),o=n(44834),c=n(33773),s=n(85893);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const p=function(e){return(0,s.jsx)(i.ZP,u(u({},e),{},{listApp:o.ZP,docsApp:c.default}))}},25660:(e,t,n)=>{n.d(t,{Z:()=>r});const r=function(e,t){return e.detailFormNames&&e.detailFormNames[t]?e.detailFormNames[t]:"Dms".concat(t)}},44049:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(14892);const a=(i=r.Z,o=i.getIn,function(e,t){return function(n){var r=t||function(e){return o(e,"form")};return o(r(n),e+".initial")}});var i,o}}]);