@luigi-project/core-modular 0.0.1-dev.202601120832 → 0.0.1-dev.202601130035
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.
- package/luigi.js +1 -1
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/services/navigation.service.d.ts +4 -2
package/luigi.js
CHANGED
|
@@ -3,7 +3,7 @@ Static and dynamic nodes cannot be used together on the same level. Static node
|
|
|
3
3
|
Remove the static node from the configuration to resolve this warning.
|
|
4
4
|
Affected pathSegment:`,e,"Children:",t),t=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":"))),s>1)){console.error(`Invalid node setup detected.
|
|
5
5
|
Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
|
|
6
|
-
Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.label&&(a.label=this.luigi.i18n().getTranslation(a.label),a.tooltip=this.resolveTooltipText(a,a.label)),a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t})}else s.push({node:a,selected:a===t})}),s}shouldRedirect(e,t){var r;const n=t??this.getPathData(e);if(e=="")return n.rootNodes[0].pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((r=n.selectedNode.children)!=null&&r.length))return e+"/"+n.selectedNode.children[0].pathSegment}getCurrentNode(e){var r;const t=this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}getPathParams(e){return this.getPathData(e).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let g=0;g<((f=a.category)==null?void 0:f.nodes.length);g++){const p=(h=a.category)==null?void 0:h.nodes[g];if(p.node&&!p.node.hideFromNav&&p.node.label||(u=p.category)!=null&&u.nodes&&p.category.nodes.filter(S=>{var T,R;return!((T=S.node)!=null&&T.hideFromNav)&&((R=S.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}getLeftNavData(e,t){var h,u,g;const n=t??this.getPathData(e);let r=[];const s=[];let a="";(h=n.nodesInPath)==null||h.forEach(p=>{p.children&&(p.tabNav||(a+="/"+(p.pathSegment||"")),s.push(p))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop()),c&&c.children&&n.rootNodes.includes(c)?r=this.buildNavItems(c.children,void 0,n):c&&c.tabNav?r=l!=null&&l.children?this.buildNavItems(l.children,c,n):[]:r=this.buildNavItems(((u=[...s].pop())==null?void 0:u.children)||[],c,n);const f=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(g=this.luigi.getConfig().settings)==null?void 0:g.sideNavFooterText,navClick:p=>this.navItemClick(p,f)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}getTopNavData(e,t){var u,g,p,S,T,R,$,N,z,G,K,J,B,x,P,I,_,te,Q,U,re,d,le,y,O,ge,pt,mt;const n=this.luigi.getConfig(),r=t??this.getPathData(e),s=this.prepareRootNodes((u=n.navigation)==null?void 0:u.nodes,((g=n.navigation)==null?void 0:g.globalContext)||{}),a=(T=(S=(p=n.navigation)==null?void 0:p.profile)==null?void 0:S.items)!=null&&T.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],o=((R=n.navigation)==null?void 0:R.appSwitcher)&&this.getAppSwitcherData(($=n.navigation)==null?void 0:$.appSwitcher,(N=n.settings)==null?void 0:N.header),l=M.updateHeaderTitle(o,r);a!=null&&a.length&&a.map(k=>({...k,label:this.luigi.i18n().getTranslation(k.label||"")}));const c=this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.label)||it.logout.label,f=k=>{var Le;k.link?this.luigi.navigation().navigate(k.link):(Le=k.externalLink)!=null&&Le.url&&(k.externalLink.sameWindow?window.location.href=k.externalLink.url:window.open(k.externalLink.url,"_blank","noopener noreferrer"))},h={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&ce.isLoggedIn(),items:a,itemClick:f,logout:{altText:this.luigi.i18n().getTranslation((x=(B=(J=n.navigation)==null?void 0:J.profile)==null?void 0:B.logout)==null?void 0:x.altText)||it.logout.label,label:c,icon:((_=(I=(P=n.navigation)==null?void 0:P.profile)==null?void 0:I.logout)==null?void 0:_.icon)||it.logout.icon,testId:((U=(Q=(te=n.navigation)==null?void 0:te.profile)==null?void 0:Q.logout)==null?void 0:U.testId)||M.prepareForTests(c),doLogout:()=>{ve.logout()}},onUserInfoUpdate:k=>{var Le,_t,St,Et;if((_t=(Le=n.navigation)==null?void 0:Le.profile)!=null&&_t.staticUserInfoFn){const Ne=(Et=(St=n.navigation)==null?void 0:St.profile)==null?void 0:Et.staticUserInfoFn();Ne instanceof Promise?Ne.then(fi=>{k(fi)}):k(Ne)}else ve.getUserInfoStore().subscribe(Ne=>{k(Ne)})}};return{appTitle:l||((d=(re=n.settings)==null?void 0:re.header)==null?void 0:d.title),logo:(y=(le=n.settings)==null?void 0:le.header)==null?void 0:y.logo,topNodes:this.buildNavItems(s,void 0,r),productSwitcher:(O=n.navigation)==null?void 0:O.productSwitcher,profile:h,appSwitcher:((ge=n.navigation)==null?void 0:ge.appSwitcher)&&this.getAppSwitcherData((pt=n.navigation)==null?void 0:pt.appSwitcher,(mt=n.settings)==null?void 0:mt.header),navClick:k=>{this.navItemClick(k,"")}}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}getTabNavData(e,t){var f;const n=t??this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>this.navItemClick(h,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=JSON.parse(JSON.stringify(e))||[];return n.length?(n.forEach(r=>{r.isRootNode=!0}),e.forEach(r=>{var s;if((s=r==null?void 0:r.badgeCounter)!=null&&s.count){const a=n.find(o=>o.badgeCounter&&o.viewUrl===r.viewUrl);a&&(a.badgeCounter.count=r.badgeCounter.count)}}),this.getAccessibleNodes(void 0,n,t)):n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}}function ae(){}function Vt(i){return i()}function Tt(){return Object.create(null)}function qe(i){i.forEach(Vt)}function Ft(i){return typeof i=="function"}function Qt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let He,ke;function wt(i,e){return i===e||(He||(He=document.createElement("a")),He.href=e,i===He.href)}function Ai(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=be("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function ue(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function be(i){return document.createElement(i)}function Ht(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Wt(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Gt(i){Wt().$$.on_mount.push(i)}const me=[],Me=[];let Ce=[];const yt=[],Pi=Promise.resolve();let st=!1;function at(i){Ce.push(i)}const nt=new Set;let fe=0;function E(){if(fe!==0)return;const i=ke;do{try{for(;fe<me.length;){const e=me[fe];fe++,Oe(e),Ii(e.$$)}}catch(e){throw me.length=0,fe=0,e}for(Oe(null),me.length=0,fe=0;Me.length;)Me.pop()();for(let e=0;e<Ce.length;e+=1){const t=Ce[e];nt.has(t)||(nt.add(t),t())}Ce.length=0}while(me.length);for(;yt.length;)yt.pop()();st=!1,nt.clear(),Oe(i)}function Ii(i){if(i.fragment!==null){i.update(),qe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(at)}}const $i=new Set;function Li(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];Ce.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),Ce=r})(t.after_update),qe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ni(i,e){i.$$.dirty[0]===-1&&(me.push(i),st||(st=!0,Pi.then(E)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Bt(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Tt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Tt(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((g,p,...S)=>{const T=S.length?S[0]:p;return c.ctx&&r(c.ctx[g],c.ctx[g]=T)&&(!c.skip_bound&&c.bound[g]&&c.bound[g](T),f&&Ni(i,g)),p})):[],c.update(),f=!0,qe(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const g=(function(p){return Array.from(p.childNodes)})(e.target);c.fragment&&c.fragment.l(g),g.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&($i.delete(h),h.i(u)),(function(g,p,S){const{fragment:T,after_update:R}=g.$$;T&&T.m(p,S),at((()=>{const $=g.$$.on_mount.map(Vt).filter(Ft);g.$$.on_destroy?g.$$.on_destroy.push(...$):qe($),g.$$.on_mount=[]})),R.forEach(at)})(i,e.target,e.anchor),E()}var h,u;Oe(l)}let jt;function Ge(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function qt(i,e,t,n,r,s){let a=class extends jt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=Ge(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(jt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=be("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){ue(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=Ge(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=Ge(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ge(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class zt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Li(this,1),this.$destroy=ae}$on(e,t){if(!Ft(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var w;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(w||(w={}));class Ui extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const m={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ct{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new Ui(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case w.CUSTOM_MESSAGE:{const u=e.data.data,g=u.id;delete u.id,this.dispatch(m.CUSTOM_MESSAGE,t,{id:g,_metaData:{},data:u})}break;case w.GET_CONTEXT:n.postMessage({msg:w.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case w.NAVIGATION_REQUEST:this.dispatch(m.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:w.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case w.ALERT_REQUEST:this.dispatchWithPayload(m.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var g,p,S;t.notifyAlertClosed((S=(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.settings)==null?void 0:S.id,u)}));break;case w.INITIALIZED:this.dispatch(m.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case w.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(m.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case w.ADD_NODE_PARAMS_REQUEST:this.dispatch(m.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case w.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(m.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case w.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(m.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case w.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(m.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case w.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(m.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case w.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(m.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case w.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case w.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(m.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case w.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(m.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case w.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(g){console.warn(g)}this.dispatch(m.GO_BACK_REQUEST,t,u),this.dispatch(m.BACK_NAVIGATION_REQUEST,t,e)}break;case w.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(m.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var g,p;n.postMessage({msg:w.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.id,route:u}},e.origin)}));break;case w.NAVIGATION_COMPLETED_REPORT:this.dispatch(m.NAVIGATION_COMPLETED_REPORT,t,e);break;case w.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(m.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case w.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(m.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case w.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(m.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var g,p;n.postMessage({msg:w.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.id,pathExists:u}},e.origin)}));break;case w.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(m.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case w.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(m.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case w.ADD_BACKDROP_REQUEST:this.dispatch(m.ADD_BACKDROP_REQUEST,t,e);break;case w.REMOVE_BACKDROP_REQUEST:this.dispatch(m.REMOVE_BACKDROP_REQUEST,t,e);break;case w.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(m.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ct,_e=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},w.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},w.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},w.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,w.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,w.ALERT_CLOSED)}},bt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Re{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Oi extends Re{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=Kt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Di extends Re{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
|
|
6
|
+
Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.label&&(a.label=this.luigi.i18n().getTranslation(a.label),a.tooltip=this.resolveTooltipText(a,a.label)),a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t})}else s.push({node:a,selected:a===t})}),s}shouldRedirect(e,t){var r;const n=t??this.getPathData(e);if(e=="")return n.rootNodes[0].pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((r=n.selectedNode.children)!=null&&r.length))return e+"/"+n.selectedNode.children[0].pathSegment}getCurrentNode(e){var r;const t=this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}getPathParams(e){return this.getPathData(e).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let g=0;g<((f=a.category)==null?void 0:f.nodes.length);g++){const p=(h=a.category)==null?void 0:h.nodes[g];if(p.node&&!p.node.hideFromNav&&p.node.label||(u=p.category)!=null&&u.nodes&&p.category.nodes.filter(S=>{var T,R;return!((T=S.node)!=null&&T.hideFromNav)&&((R=S.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}getLeftNavData(e,t){var h,u,g;const n=t??this.getPathData(e);let r=[];const s=[];let a="";(h=n.nodesInPath)==null||h.forEach(p=>{p.children&&(p.tabNav||(a+="/"+(p.pathSegment||"")),s.push(p))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop()),c&&c.children&&n.rootNodes.includes(c)?r=this.buildNavItems(c.children,void 0,n):c&&c.tabNav?r=l!=null&&l.children?this.buildNavItems(l.children,c,n):[]:r=this.buildNavItems(((u=[...s].pop())==null?void 0:u.children)||[],c,n);const f=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(g=this.luigi.getConfig().settings)==null?void 0:g.sideNavFooterText,navClick:p=>this.navItemClick(p,f)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}getTopNavData(e,t){var u,g,p,S,T,R,$,N,z,G,K,J,B,x,P,I,_,te,Q,U,re,d,le,y,O,ge,pt,mt;const n=this.luigi.getConfig(),r=t??this.getPathData(e),s=this.prepareRootNodes((u=n.navigation)==null?void 0:u.nodes,((g=n.navigation)==null?void 0:g.globalContext)||{}),a=(T=(S=(p=n.navigation)==null?void 0:p.profile)==null?void 0:S.items)!=null&&T.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],o=((R=n.navigation)==null?void 0:R.appSwitcher)&&this.getAppSwitcherData(($=n.navigation)==null?void 0:$.appSwitcher,(N=n.settings)==null?void 0:N.header),l=M.updateHeaderTitle(o,r);a!=null&&a.length&&a.map(k=>({...k,label:this.luigi.i18n().getTranslation(k.label||"")}));const c=this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.label)||it.logout.label,f=k=>{var Le;k.link?this.luigi.navigation().navigate(k.link):(Le=k.externalLink)!=null&&Le.url&&(k.externalLink.sameWindow?window.location.href=k.externalLink.url:window.open(k.externalLink.url,"_blank","noopener noreferrer"))},h={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&ce.isLoggedIn(),items:a,itemClick:f,logout:{altText:this.luigi.i18n().getTranslation((x=(B=(J=n.navigation)==null?void 0:J.profile)==null?void 0:B.logout)==null?void 0:x.altText)||it.logout.label,label:c,icon:((_=(I=(P=n.navigation)==null?void 0:P.profile)==null?void 0:I.logout)==null?void 0:_.icon)||it.logout.icon,testId:((U=(Q=(te=n.navigation)==null?void 0:te.profile)==null?void 0:Q.logout)==null?void 0:U.testId)||M.prepareForTests(c),doLogout:()=>{ve.logout()}},onUserInfoUpdate:k=>{var Le,_t,St,Et;if((_t=(Le=n.navigation)==null?void 0:Le.profile)!=null&&_t.staticUserInfoFn){const Ne=(Et=(St=n.navigation)==null?void 0:St.profile)==null?void 0:Et.staticUserInfoFn();Ne instanceof Promise?Ne.then(fi=>{k(fi)}):k(Ne)}else ve.getUserInfoStore().subscribe(Ne=>{k(Ne)})}};return{appTitle:l||((d=(re=n.settings)==null?void 0:re.header)==null?void 0:d.title),logo:(y=(le=n.settings)==null?void 0:le.header)==null?void 0:y.logo,topNodes:this.buildNavItems(s,void 0,r),productSwitcher:(O=n.navigation)==null?void 0:O.productSwitcher,profile:h,appSwitcher:((ge=n.navigation)==null?void 0:ge.appSwitcher)&&this.getAppSwitcherData((pt=n.navigation)==null?void 0:pt.appSwitcher,(mt=n.settings)==null?void 0:mt.header),navClick:k=>{this.navItemClick(k,"")}}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}getTabNavData(e,t){var f;const n=t??this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>this.navItemClick(h,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=JSON.parse(JSON.stringify(e))||[];return n.length?(n.forEach(r=>{r.isRootNode=!0}),e.forEach(r=>{var s;if((s=r==null?void 0:r.badgeCounter)!=null&&s.count){const a=n.find(o=>o.badgeCounter&&o.viewUrl===r.viewUrl);a&&(a.badgeCounter.count=r.badgeCounter.count)}}),this.getAccessibleNodes(void 0,n,t)):n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}}function ae(){}function Vt(i){return i()}function Tt(){return Object.create(null)}function qe(i){i.forEach(Vt)}function Ft(i){return typeof i=="function"}function Qt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let He,ke;function wt(i,e){return i===e||(He||(He=document.createElement("a")),He.href=e,i===He.href)}function Ai(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=be("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function ue(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function be(i){return document.createElement(i)}function Ht(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Wt(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Gt(i){Wt().$$.on_mount.push(i)}const me=[],Me=[];let Ce=[];const yt=[],Pi=Promise.resolve();let st=!1;function at(i){Ce.push(i)}const nt=new Set;let fe=0;function E(){if(fe!==0)return;const i=ke;do{try{for(;fe<me.length;){const e=me[fe];fe++,Oe(e),Ii(e.$$)}}catch(e){throw me.length=0,fe=0,e}for(Oe(null),me.length=0,fe=0;Me.length;)Me.pop()();for(let e=0;e<Ce.length;e+=1){const t=Ce[e];nt.has(t)||(nt.add(t),t())}Ce.length=0}while(me.length);for(;yt.length;)yt.pop()();st=!1,nt.clear(),Oe(i)}function Ii(i){if(i.fragment!==null){i.update(),qe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(at)}}const $i=new Set;function Li(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];Ce.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),Ce=r})(t.after_update),qe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ni(i,e){i.$$.dirty[0]===-1&&(me.push(i),st||(st=!0,Pi.then(E)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Bt(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Tt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Tt(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((g,p,...S)=>{const T=S.length?S[0]:p;return c.ctx&&r(c.ctx[g],c.ctx[g]=T)&&(!c.skip_bound&&c.bound[g]&&c.bound[g](T),f&&Ni(i,g)),p})):[],c.update(),f=!0,qe(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const g=(function(p){return Array.from(p.childNodes)})(e.target);c.fragment&&c.fragment.l(g),g.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&($i.delete(h),h.i(u)),(function(g,p,S){const{fragment:T,after_update:R}=g.$$;T&&T.m(p,S),at((()=>{const $=g.$$.on_mount.map(Vt).filter(Ft);g.$$.on_destroy?g.$$.on_destroy.push(...$):qe($),g.$$.on_mount=[]})),R.forEach(at)})(i,e.target,e.anchor),E()}var h,u;Oe(l)}let jt;function Ge(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function qt(i,e,t,n,r,s){let a=class extends jt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=Ge(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(jt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=be("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){ue(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=Ge(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=Ge(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ge(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class zt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Li(this,1),this.$destroy=ae}$on(e,t){if(!Ft(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var w;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(w||(w={}));class Ui extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const m={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ct{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new Ui(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case w.CUSTOM_MESSAGE:{const u=e.data.data,g=u.id;delete u.id,this.dispatch(m.CUSTOM_MESSAGE,t,{id:g,_metaData:{},data:u})}break;case w.GET_CONTEXT:n.postMessage({msg:w.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case w.NAVIGATION_REQUEST:this.dispatch(m.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:w.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case w.ALERT_REQUEST:this.dispatchWithPayload(m.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var g,p,S;t.notifyAlertClosed((S=(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.settings)==null?void 0:S.id,u)}));break;case w.INITIALIZED:this.dispatch(m.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case w.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(m.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case w.ADD_NODE_PARAMS_REQUEST:this.dispatch(m.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case w.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(m.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case w.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(m.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case w.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(m.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case w.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(m.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case w.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(m.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case w.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case w.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(m.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case w.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(m.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case w.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(g){console.warn(g)}this.dispatch(m.GO_BACK_REQUEST,t,u),this.dispatch(m.BACK_NAVIGATION_REQUEST,t,e)}break;case w.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(m.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var g,p;n.postMessage({msg:w.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.id,route:u}},e.origin)}));break;case w.NAVIGATION_COMPLETED_REPORT:this.dispatch(m.NAVIGATION_COMPLETED_REPORT,t,e);break;case w.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(m.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case w.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(m.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case w.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(m.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var g,p;n.postMessage({msg:w.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(p=(g=e.data)==null?void 0:g.data)==null?void 0:p.id,pathExists:u}},e.origin)}));break;case w.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(m.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case w.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(m.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case w.ADD_BACKDROP_REQUEST:this.dispatch(m.ADD_BACKDROP_REQUEST,t,e);break;case w.REMOVE_BACKDROP_REQUEST:this.dispatch(m.REMOVE_BACKDROP_REQUEST,t,e);break;case w.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(m.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ct,_e=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},w.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},w.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},w.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,w.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,w.ALERT_CLOSED)}},bt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Re{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Oi extends Re{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=Kt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Di extends Re{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
|
|
7
7
|
.${e} {
|
|
8
8
|
grid-template-columns: ${r.columns||"auto"};
|
|
9
9
|
grid-template-rows: ${r.rows||"auto"};
|