@luigi-project/core-modular 0.0.5-dev.202604160059 → 0.0.5-dev.202604170058
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 +2 -2
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/utilities/helpers/routing-helpers.d.ts +1 -1
package/luigi.js
CHANGED
|
@@ -44,12 +44,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
44
44
|
|
|
45
45
|
main.lui-isolated {
|
|
46
46
|
line-height: 0;
|
|
47
|
-
}`,r=uc(" "),a=pr("iframe"),kl(a.src,u=i[3])||_t(a,"src",u),_t(a,"title",i[1]),_t(a,"allow",c=Wl(i[0])),_t(a,"sandbox",l=i[2]?i[2].join(" "):void 0)},m(d,p){Dn(d,n,p),Dn(d,r,p),Dn(d,a,p),i[28](a)},p(d,p){8&p[0]&&!kl(a.src,u=d[3])&&_t(a,"src",u),2&p[0]&&_t(a,"title",d[1]),1&p[0]&&c!==(c=Wl(d[0]))&&_t(a,"allow",c),4&p[0]&&l!==(l=d[2]?d[2].join(" "):void 0)&&_t(a,"sandbox",l)},d(d){d&&(dn(n),dn(r),dn(a)),i[28](null)}}}function jv(i){let n,r,a=i[5]&&Gl(i);return{c(){n=pr("main"),a&&a.c(),_t(n,"class",r=i[4]?void 0:"lui-isolated")},m(u,c){Dn(u,n,c),a&&a.m(n,null),i[29](n)},p(u,c){u[5]?a?a.p(u,c):(a=Gl(u),a.c(),a.m(n,null)):a&&(a.d(1),a=null),16&c[0]&&r!==(r=u[4]?void 0:"lui-isolated")&&_t(n,"class",r)},i:hn,o:hn,d(u){u&&dn(n),a&&a.d(),i[29](null)}}}function eS(i,n,r){let{activeFeatureToggleList:a}=n,{allowRules:u}=n,{anchor:c}=n,{authData:l}=n,{clientPermissions:d}=n,{context:p}=n,{deferInit:_}=n,{dirtyStatus:R}=n,{documentTitle:T}=n,{hasBack:E}=n,{label:y}=n,{locale:I}=n,{noShadow:N}=n,{nodeParams:H}=n,{pathParams:W}=n,{sandboxRules:ie}=n,{searchParams:Oe}=n,{skipCookieCheck:Ie}=n,{skipInitCheck:Qe}=n,{theme:xe}=n,{userSettings:Je}=n,{viewurl:ye}=n,{webcomponent:Re}=n;const ve={};let Ae,O,Zt=!1;const St=new _c,$e=L=>{if(!Zt){L.sendCustomMessage=(oe,ke)=>{ar.sendCustomMessage(oe,L.getNoShadow()?L:Ae,!!Re,ve,ke)},L.updateContext=(oe,ke)=>{if(r(8,p=oe),Re)(L.getNoShadow()?L:Ae)._luigi_mfe_webcomponent.context=oe;else{const Jt={...ke||{},activeFeatureToggleList:L.activeFeatureToggleList||[],currentLocale:L.locale,currentTheme:L.theme,userSettings:L.userSettings||null,cssVariables:L.cssVariables||{},anchor:L.anchor||"",drawer:L.drawer||!1,modal:L.modal||!1,viewStackSize:L.viewStackSize||0,isNavigateBack:L.isNavigateBack||!1};ar.updateContext(oe,Jt,ve,H,W,Oe)}},L.closeAlert=(oe,ke)=>{L.notifyAlertClosed(oe,ke)},L.notifyAlertClosed=(oe,ke)=>{L.isConnected&&(Re?St.resolveAlert(oe,ke):ar.notifyAlertClosed(oe,ke,ve))},L.notifyConfirmationModalClosed=oe=>{L.isConnected&&(Re?St.notifyConfirmationModalClosed(!!oe):ar.notifyConfirmationModalClosed(!!oe,ve))},fn.registerContainer(L),St.thisComponent=L;const ot=qr.resolveContext(p);if(L.updateViewUrl=(oe,ke)=>{oe?.length&&ar.updateViewUrl(oe,qr.resolveContext(p),ke,ve)},Re&&Re!="false"){L.getNoShadow()?L.innerHTML="":(r(7,Ae.innerHTML="",Ae),L.attachShadow({mode:"open"}).append(Ae));const oe=qr.checkWebcomponentValue(Re);St.renderWebComponent(ye,L.getNoShadow()?L:Ae,ot,typeof oe=="object"?{webcomponent:oe}:{})}else L.getNoShadow()||(L.innerHTML="",L.attachShadow({mode:"open"}).append(Ae));Qe?(L.initialized=!0,setTimeout((()=>{St.dispatchLuigiEvent(U.INITIALIZED,{})}))):Re&&(L.getNoShadow()?L:Ae).addEventListener("wc_ready",(()=>{(L.getNoShadow()?L:Ae)._luigi_mfe_webcomponent?.deferLuigiClientWCInit||(L.initialized=!0,St.dispatchLuigiEvent(U.INITIALIZED,{}))})),r(5,Zt=!0),L.containerInitialized=!0}};var En;return cc((async()=>{r(27,O=Ae.parentNode),r(27,O.iframeHandle=ve,O),r(27,O.init=()=>{$e(O)},O),!_&&ye&&$e(O)})),En=async()=>{},lc().$$.on_destroy.push(En),i.$$set=L=>{"activeFeatureToggleList"in L&&r(9,a=L.activeFeatureToggleList),"allowRules"in L&&r(0,u=L.allowRules),"anchor"in L&&r(10,c=L.anchor),"authData"in L&&r(11,l=L.authData),"clientPermissions"in L&&r(12,d=L.clientPermissions),"context"in L&&r(8,p=L.context),"deferInit"in L&&r(13,_=L.deferInit),"dirtyStatus"in L&&r(14,R=L.dirtyStatus),"documentTitle"in L&&r(15,T=L.documentTitle),"hasBack"in L&&r(16,E=L.hasBack),"label"in L&&r(1,y=L.label),"locale"in L&&r(17,I=L.locale),"noShadow"in L&&r(18,N=L.noShadow),"nodeParams"in L&&r(19,H=L.nodeParams),"pathParams"in L&&r(20,W=L.pathParams),"sandboxRules"in L&&r(2,ie=L.sandboxRules),"searchParams"in L&&r(21,Oe=L.searchParams),"skipCookieCheck"in L&&r(22,Ie=L.skipCookieCheck),"skipInitCheck"in L&&r(23,Qe=L.skipInitCheck),"theme"in L&&r(24,xe=L.theme),"userSettings"in L&&r(25,Je=L.userSettings),"viewurl"in L&&r(3,ye=L.viewurl),"webcomponent"in L&&r(4,Re=L.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!Zt&&ye&&!_&&O&&$e(O)},[u,y,ie,ye,Re,Zt,ve,Ae,p,a,c,l,d,_,R,T,E,I,N,H,W,Oe,Ie,Qe,xe,Je,()=>a&&u&&c&&l&&d&&R&&T&&E&&I&&N&&H&&W&&ie&&Oe&&Ie&&Qe&&xe&&Je,O,function(L){Xr[L?"unshift":"push"]((()=>{ve.iframe=L,r(6,ve)}))},function(L){Xr[L?"unshift":"push"]((()=>{Ae=L,r(7,Ae)}))}]}class mc extends gc{constructor(n){super(),fc(this,n,eS,jv,oc,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),q()}get allowRules(){return this.$$.ctx[0]}set allowRules(n){this.$$set({allowRules:n}),q()}get anchor(){return this.$$.ctx[10]}set anchor(n){this.$$set({anchor:n}),q()}get authData(){return this.$$.ctx[11]}set authData(n){this.$$set({authData:n}),q()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(n){this.$$set({clientPermissions:n}),q()}get context(){return this.$$.ctx[8]}set context(n){this.$$set({context:n}),q()}get deferInit(){return this.$$.ctx[13]}set deferInit(n){this.$$set({deferInit:n}),q()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),q()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(n){this.$$set({documentTitle:n}),q()}get hasBack(){return this.$$.ctx[16]}set hasBack(n){this.$$set({hasBack:n}),q()}get label(){return this.$$.ctx[1]}set label(n){this.$$set({label:n}),q()}get locale(){return this.$$.ctx[17]}set locale(n){this.$$set({locale:n}),q()}get noShadow(){return this.$$.ctx[18]}set noShadow(n){this.$$set({noShadow:n}),q()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(n){this.$$set({nodeParams:n}),q()}get pathParams(){return this.$$.ctx[20]}set pathParams(n){this.$$set({pathParams:n}),q()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(n){this.$$set({sandboxRules:n}),q()}get searchParams(){return this.$$.ctx[21]}set searchParams(n){this.$$set({searchParams:n}),q()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(n){this.$$set({skipCookieCheck:n}),q()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),q()}get theme(){return this.$$.ctx[24]}set theme(n){this.$$set({theme:n}),q()}get userSettings(){return this.$$.ctx[25]}set userSettings(n){this.$$set({userSettings:n}),q()}get viewurl(){return this.$$.ctx[3]}set viewurl(n){this.$$set({viewurl:n}),q()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(n){this.$$set({webcomponent:n}),q()}get unwarn(){return this.$$.ctx[26]}}function tS(i){Gv(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function nS(i){let n;return{c(){n=pr("main"),_t(n,"class","svelte-1buc46y")},m(r,a){Dn(r,n,a),i[21](n)},p:hn,i:hn,o:hn,d(r){r&&dn(n),i[21](null)}}}function rS(i,n,r){let a,u,{activeFeatureToggleList:c}=n,{anchor:l}=n,{clientPermissions:d}=n,{compoundConfig:p}=n,{context:_}=n,{deferInit:R}=n,{dirtyStatus:T}=n,{documentTitle:E}=n,{hasBack:y}=n,{locale:I}=n,{noShadow:N}=n,{nodeParams:H}=n,{pathParams:W}=n,{searchParams:ie}=n,{skipInitCheck:Oe}=n,{theme:Ie}=n,{userSettings:Qe}=n,{viewurl:xe}=n,{webcomponent:Je}=n,ye=!1;const Re=new Qa,ve=new _c,Ae=O=>{if(!p||ye)return;O.updateContext=($e,En)=>{const L=O.getNoShadow()?O:a;L._luigi_mfe_webcomponent.context=$e,r(1,_=$e);const ot=L._luigi_mfe_webcomponent;ot&&ot.querySelectorAll("[lui_web_component]")?.forEach((ke=>{const Jt=ke.context||{};ke.context=Object.assign(Jt,$e)}))};const Zt=qr.resolveContext(_);r(2,R=!1),O.notifyAlertClosed=($e,En)=>{O.isConnected&&ve.resolveAlert($e,En)},O.notifyConfirmationModalClosed=$e=>{O.isConnected&&ve.notifyConfirmationModalClosed(!!$e)};const St={compound:p,viewUrl:xe,webcomponent:qr.checkWebcomponentValue(Je)||!0};O.getNoShadow()?O.innerHTML="":(r(0,a.innerHTML="",a),O.attachShadow({mode:"open"}).append(a)),ve.renderWebComponentCompound(St,O.getNoShadow()?O:a,Zt).then(($e=>{u=$e,Oe||!St.viewUrl?(O.initialized=!0,setTimeout((()=>{ve.dispatchLuigiEvent(U.INITIALIZED,{})}))):u.LuigiClient&&!u.deferLuigiClientWCInit&&(O.initialized=!0,ve.dispatchLuigiEvent(U.INITIALIZED,{}))})),ye=!0,O.containerInitialized=!0};return cc((async()=>{const O=a.getRootNode()===document?a.parentNode:a.getRootNode().host;O.init=()=>{Ae(O)},R||Ae(O),Re.registerContainer(O),ve.thisComponent=O})),i.$$set=O=>{"activeFeatureToggleList"in O&&r(3,c=O.activeFeatureToggleList),"anchor"in O&&r(4,l=O.anchor),"clientPermissions"in O&&r(5,d=O.clientPermissions),"compoundConfig"in O&&r(6,p=O.compoundConfig),"context"in O&&r(1,_=O.context),"deferInit"in O&&r(2,R=O.deferInit),"dirtyStatus"in O&&r(7,T=O.dirtyStatus),"documentTitle"in O&&r(8,E=O.documentTitle),"hasBack"in O&&r(9,y=O.hasBack),"locale"in O&&r(10,I=O.locale),"noShadow"in O&&r(11,N=O.noShadow),"nodeParams"in O&&r(12,H=O.nodeParams),"pathParams"in O&&r(13,W=O.pathParams),"searchParams"in O&&r(14,ie=O.searchParams),"skipInitCheck"in O&&r(15,Oe=O.skipInitCheck),"theme"in O&&r(16,Ie=O.theme),"userSettings"in O&&r(17,Qe=O.userSettings),"viewurl"in O&&r(18,xe=O.viewurl),"webcomponent"in O&&r(19,Je=O.webcomponent)},[a,_,R,c,l,d,p,T,E,y,I,N,H,W,ie,Oe,Ie,Qe,xe,Je,()=>c&&l&&d&&T&&E&&y&&I&&N&&H&&W&&ie&&Oe&&Ie&&Qe,function(O){Xr[O?"unshift":"push"]((()=>{a=O,r(0,a)}))}]}dc(mc,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{sendCustomMessage=n("sendCustomMessage");updateContext=n("updateContext");updateViewUrl=n("updateViewUrl");closeAlert=n("closeAlert");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.error("Error in super.attributeChangedCallback",c)}this.containerInitialized&&(r==="context"&&this.updateContext(JSON.parse(u)),r==="auth-data"&&ar.updateAuthData(this.iframeHandle,JSON.parse(u)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class ql extends gc{constructor(n){super(),fc(this,n,rS,nS,oc,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},tS)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),q()}get anchor(){return this.$$.ctx[4]}set anchor(n){this.$$set({anchor:n}),q()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(n){this.$$set({clientPermissions:n}),q()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(n){this.$$set({compoundConfig:n}),q()}get context(){return this.$$.ctx[1]}set context(n){this.$$set({context:n}),q()}get deferInit(){return this.$$.ctx[2]}set deferInit(n){this.$$set({deferInit:n}),q()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),q()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(n){this.$$set({documentTitle:n}),q()}get hasBack(){return this.$$.ctx[9]}set hasBack(n){this.$$set({hasBack:n}),q()}get locale(){return this.$$.ctx[10]}set locale(n){this.$$set({locale:n}),q()}get noShadow(){return this.$$.ctx[11]}set noShadow(n){this.$$set({noShadow:n}),q()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(n){this.$$set({nodeParams:n}),q()}get pathParams(){return this.$$.ctx[13]}set pathParams(n){this.$$set({pathParams:n}),q()}get searchParams(){return this.$$.ctx[14]}set searchParams(n){this.$$set({searchParams:n}),q()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),q()}get theme(){return this.$$.ctx[16]}set theme(n){this.$$set({theme:n}),q()}get userSettings(){return this.$$.ctx[17]}set userSettings(n){this.$$set({userSettings:n}),q()}get viewurl(){return this.$$.ctx[18]}set viewurl(n){this.$$set({viewurl:n}),q()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(n){this.$$set({webcomponent:n}),q()}get unwarn(){return this.$$.ctx[20]}}dc(ql,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{updateContext=n("updateContext");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.warn("Error in attributeChangedCallback",c)}this.containerInitialized&&r==="context"&&this.updateContext(JSON.parse(u))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",mc.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",ql.element);const M={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,n,r){let a=n;const[u,c]=a.split("?"),l=new URLSearchParams(c);return this.modifySearchParams(i,l,r),a=u,l.toString()!==""&&(a+=`?${l.toString()}`),a},modifySearchParams(i,n,r){for(const[a,u]of Object.entries(i)){const c=r?`${r}${a}`:a;n.set(c,u),u===void 0&&n.delete(c)}},filterNodeParams(i,n){const r=Object.create(null),a=this.getContentViewParamPrefix(n);return i&&Object.entries(i).forEach(u=>{if(u[0].startsWith(a)){const c=u[0].substr(a.length);r[c]=u[1]}}),this.sanitizeParamsMap(r)},getContentViewParamPrefix(i){let n=i?.getConfigValue("routing.nodeParamPrefix");return n===!1?n="":n||(n=this.defaultContentViewParamPrefix),n},sanitizeParamsMap(i){return Object.entries(i).reduce((n,r)=>(n[rs.sanitizeParam(r[0])]=rs.sanitizeParam(r[1]),n),{})},prepareSearchParamsForClient(i,n){const r={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(a=>{a in n.routing().getSearchParams()&&i.clientPermissions?.urlParameters&&i.clientPermissions.urlParameters[a]?.read===!0&&(r[a]=n.routing().getSearchParams()[a])}),r},getCurrentPath(i){if(i){const n=Ce.normalizePath(location.hash),[r,a]=n.split("?");return{path:r,query:a}}else return{path:Ce.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,n){return this.getQueryParams(n)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return M.getLocation().search?M.parseParams(M.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=M.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?M.parseParams(M.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let n=i.getConfigValue("routing.modalPathParam");return n||(n=this.defaultModalViewParamName),n},parseParams(i){const n=new URLSearchParams(i),r=new Map;for(const[a,u]of n.entries())r.set(a,u);return Object.fromEntries(r)},getModalParamsFromPath(i){const n=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return n&&JSON.parse(n)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,n){const r=new URLSearchParams(i);return r.delete(n),r.delete(`${n}Params`),r.toString()},handleHistoryState(i,n){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:n},i},encodeParams(i){const n=[];for(const r in i)n.push(encodeURIComponent(r)+"="+encodeURIComponent(i[r]));return n.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,n){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const a=n.getConfigValue("navigation.validWebcomponentUrls");if(a?.length>0)for(const u of a)try{if(new RegExp(u).test(i))return!0}catch(c){console.error(c)}return!1}return!0},setFeatureToggles(i,n,r){const a=this.sanitizeParamsMap(this.parseParams(n.split("?")[1]));let u;if(a[i]&&(u=a[i]),!u)return;const c=u.split(",");c.length>0&&c[0]!==""&&c.forEach(l=>r?.setFeatureToggle(l,!0))},substituteDynamicParamsInObject(i,n,r=":",a=!1){return Object.entries(i).map(([u,c])=>{const l=a?Object.keys(n).find(d=>c&&c.indexOf(r+d)>=0):Object.keys(n).find(d=>c===r+d);return[u,l?a?c.replace(r+l,n[l]):n[l]:c]}).reduce((u,[c,l])=>Object.assign(u,{[c]:l}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,n){return this.isDynamicNode(i)&&i.pathSegment?n[i.pathSegment.substring(1)]:void 0},isExistingRoute(i,n){const r=i?.split("/")||[],a=n?.nodesInPath||[],u=(l,d)=>{let p=null;if(l?.children?.length){const _=l.children.filter(R=>R.pathSegment===d);_?.length&&(p=_[0])}return p};let c=[];if(r.length>1&&a.length===1){let l;r.forEach((d,p)=>{const _=p===0?a[0]:l;l=u(_,d),l?.pathSegment&&c.push(l.pathSegment)})}else c=a.filter(l=>l.pathSegment).map(l=>l.pathSegment||"");return!i||r.length===c.length},async pathExists(i,n){const r=D.getTrimmedUrl(i),a=await n.navigation().navService.getPathData(i),u=M.isExistingRoute(r,a);return a?u:!1},showRouteNotFoundAlert(i,n=!1,r){const a={text:r.i18n().getTranslation(n?"luigi.notExactTargetNode":"luigi.requestedRouteNotFound",{route:i}),type:"error",ttl:1};r.ux().showAlert(a)},getPageNotFoundRedirectResult(i,n=!1,r){const a=r.getConfigValue("routing.pageNotFoundHandler");if(typeof a=="function"){const u=a(i,n);if(u&&(u.redirectTo||u.ignoreLuigiErrorHandling))return{path:u.redirectTo,keepURL:u.keepURL,ignoreLuigiErrorHandling:u.ignoreLuigiErrorHandling}}return{}},async handlePageNotFoundAndRetrieveRedirectPath(i,n,r){if(n)return i;const a=r.getConfigValue("routing.pageNotFoundHandler"),u=this.getPageNotFoundRedirectResult(i,a,r)?.path;if(u!==void 0)return u;this.showRouteNotFoundAlert(i,!1,r),console.warn(`Could not find the requested route: ${i}`)},async getDefaultChildNode(i,n){if(!i)return"";const r=i.nodesInPath&&i.nodesInPath[i.nodesInPath.length-1],a=i.context,u=n?await n(r,a):await $n.getConfigValueFromObjectAsync(r,"children",a),c=u.find(l=>l.pathSegment===r.defaultChildNode);if(r.defaultChildNode&&c)return r.defaultChildNode;if(u&&u.length){if(i?.nodesInPath?.length===1){const p=u.find(_=>_.pathSegment);return p&&p.pathSegment||console.error("At least one navigation node in the root hierarchy must have a pathSegment.")}const d=u.find(p=>p.pathSegment&&(p.viewUrl||p.compound||p.externalLink&&p.externalLink.url));if(d)return d.pathSegment}return""},getNodePath(i,n){return!i||n?i?this.buildRoute(i,i.pathSegment?"/"+i.pathSegment:"",n):"":`${i.parent?this.getNodePath(i.parent):""}/${i.pathSegment}`},buildRoute(i,n,r){return i.parent?this.buildRoute(i.parent,`/${i.parent.pathSegment}${n}`,r):n+(r?"?"+r:"")},substituteViewUrl(i,n,r){return i=D.replaceVars(i,n,":",!1),i},getSubPath(i,n){return D.replaceVars(M.getNodePath(i),n,":",!1)},concatenatePath(i,n){let r=D.getPathWithoutHashOrSlash(i);return r?(n&&(r.endsWith("/")&&(r=r.substring(0,r.length-1)),n.startsWith("/")||(r+="/"),r+=n),r):n}},Ce={normalizePath:i=>{if(!i||i.length<=0)return i;let n=i;return n.startsWith("#")&&(n=n.substring(1)),n.startsWith("/")&&(n=n.substring(1)),n},segmentMatches:(i,n,r)=>!!(i===n||n.startsWith(":")&&r&&r[n.substr(1)]===i),checkMatch:(i,n,r)=>{let a=!0;return D.trimTrailingSlash(D.trimLeadingSlash(i)).split("/").forEach((u,c)=>{a&&(c+1>=n.length||!n[c+1]?.pathSegment||!Ce.segmentMatches(u,n[c+1]?.pathSegment??"",r??{}))&&(a=!1)}),a},checkVisibleForFeatureToggles:(i,n)=>{if(i?.visibleForFeatureToggles){const r=n?.getActiveFeatureToggleList()||[];for(const a of i.visibleForFeatureToggles)if(a.startsWith("!")){if(r.includes(a.slice(1)))return!1}else if(!r.includes(a))return!1}return!0},generateTooltipText:(i,n,r)=>{let a=i?.tooltipText;switch(a===void 0&&(a=r.getConfigValue("navigation.defaults.tooltipText")),a){case void 0:return n;case!1:return"";default:return r.i18n().getTranslation(a)}},isNodeAccessPermitted:(i,n,r,a)=>{if(a.auth().isAuthorizationEnabled()){const l=Un.isLoggedIn(),d=i.anonymousAccess;if(l&&d==="exclusive"||!l&&d!=="exclusive"&&d!==!0)return!1}const u=a.featureToggles();if(!Ce.checkVisibleForFeatureToggles(i,u))return!1;const c=a.getConfigValue("navigation.nodeAccessibilityResolver");return typeof c!="function"?!0:c(i,n,r)},applyContext:(i,n,r)=>{if(n)for(let a in n)i[a]=n[a];return r&&i.parentNavigationContexts&&i.parentNavigationContexts.unshift(r),i},updateHeaderTitle:(i,n)=>{const r=i?.items;if(r&&n){let a="";return[...r].sort((u,c)=>(c.link||"").localeCompare(u.link||"")).some(u=>{let c=!1;if(c=Ce.checkMatch(u.link||"",n.nodesInPath??[]),!c&&u.selectionConditions&&u.selectionConditions.route&&(c=Ce.checkMatch(u.selectionConditions.route,n.nodesInPath??[]),c&&(u.selectionConditions.contextCriteria||[]).forEach(l=>{c=c&&n?.selectedNode?.context?.[l.key]===l.value})),c)return a=u.title||"",!0}),a}},buildPath(i,n){return i.map(a=>{const u=a.pathSegment;if(u?.startsWith(":")){const c=u.slice(1),l=n?.pathParams?.[c];if(l!=null)return encodeURIComponent(String(l))}return u}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let n="";return i.forEach(r=>{r&&(n+=(n?"_":"")+encodeURIComponent(r.toLowerCase().split(" ").join("")))}),n},findVirtualTreeRootNode(i){if(i.virtualTree)return i;if(i.parent)return Ce.findVirtualTreeRootNode(i.parent)},validatePathAndGetRedirect:async(i,n)=>{const r=await M.pathExists(i,n);return await M.handlePageNotFoundAndRetrieveRedirectPath(i,r,n)||void 0}};class _n{constructor(){this.dataManagement=new Map}setChildren(n,r){this.dataManagement.set(n,r),this.navPath=""}getChildren(n){return n?this.dataManagement.get(n):{}}hasChildren(n){const r=this.getChildren(n);return!!(r&&Object.prototype.hasOwnProperty.call(r,"children"))}setRootNode(n){this.dataManagement.set("_luigiRootNode",{node:n})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(n){if(this.hasChildren(n)){const r=this.getChildren(n).children;for(let a=0;a<r.length;a++)this.deleteNodesRecursively(r[a])}this.dataManagement.delete(n)}}const Ua={logout:{label:"Sign Out",icon:"log"}};class iS{constructor(){this.services=new Map}register(n,r,a=!0){this.services.set(n,{factory:r,singleton:a})}get(n){const r=this.services.get(n);if(!r)throw new Error(`Service '${n}' is not registered.`);return r.singleton?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const te=new iS;class mn{constructor(n){this.luigi=n,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const n=[...this._modalStack];for(const{onInternalClose:r}of n)try{typeof r=="function"&&r()}catch(a){console.warn("onInternalClose threw an error",a)}this.clearModalStack()}registerModal(n){n&&this._modalStack.push(n)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(n){if(this._modalStack.length>0){const r=this._modalStack[0];r.modalsettings={...r.modalsettings,...n}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){ne.modalContainer.pop(),this._modalStack.pop()}}class vn{constructor(n){this.luigi=n}getModalService(){return this.modalService||(this.modalService=te.get(mn)),this.modalService}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=te.get(_n)),this.nodeDataManagementService}async getPathData(n){const r=this.luigi.getConfig();let a=n.split("/");a?.length>0&&a[0]===""&&(a=a.slice(1));let c=r.navigation?.globalContext||{},l;if(this.getNodeDataManagementService().hasRootNode())l=this.getNodeDataManagementService().getRootNode().node;else{const T=await this.luigi.getConfigValueAsync("navigation.nodes");typeof T=="object"&&!Array.isArray(T)?(l=T,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:T},l.children=await this.getChildren(l,c),l.children=this.prepareRootNodes(l.children||[],c),this.getNodeDataManagementService().setRootNode(l)}const d={...c||{},...l.context||{}},p={},_={context:d,selectedNodeChildren:l.children,nodesInPath:[l],rootNodes:l.children,pathParams:p,matchedPath:""};if(l.viewUrl&&a.length===0)_.selectedNode=l;else for(const T of a)if(_.selectedNodeChildren){const E=this.findMatchingNode(T,_.selectedNodeChildren||[]);if(!E){console.warn("No matching node found for segment:",T);break}const y=E.context||{},I=Ce.mergeContext(c,y);let N=I;if(E.pathSegment?.startsWith(":")&&(p[E.pathSegment.replace(":","")]=rs.sanitizeParam(T),N=M.substituteDynamicParamsInObject(I,p)),c=N,E.context=N,_.selectedNode=E,_.selectedNode&&_.nodesInPath?.push(_.selectedNode),E.virtualTree||E._virtualTree){const H=this.buildVirtualTree(E,T,p);H&&H.length>0&&(E.children=H)}_.selectedNodeChildren=await this.getChildren(E,c)}const R=_.nodesInPath?.filter(T=>T.pathSegment).map(T=>T.pathSegment)||[];return _.matchedPath=a.filter((T,E)=>R[E]&&R[E].startsWith(":")||R[E]===T).join("/")||"",_}findMatchingNode(n,r){let a;const u=r.filter(l=>!!l.pathSegment).length,c=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":")).length;if(u>1&&(c===1&&(console.warn(`Invalid node setup detected.
|
|
47
|
+
}`,r=uc(" "),a=pr("iframe"),kl(a.src,u=i[3])||_t(a,"src",u),_t(a,"title",i[1]),_t(a,"allow",c=Wl(i[0])),_t(a,"sandbox",l=i[2]?i[2].join(" "):void 0)},m(d,p){Dn(d,n,p),Dn(d,r,p),Dn(d,a,p),i[28](a)},p(d,p){8&p[0]&&!kl(a.src,u=d[3])&&_t(a,"src",u),2&p[0]&&_t(a,"title",d[1]),1&p[0]&&c!==(c=Wl(d[0]))&&_t(a,"allow",c),4&p[0]&&l!==(l=d[2]?d[2].join(" "):void 0)&&_t(a,"sandbox",l)},d(d){d&&(dn(n),dn(r),dn(a)),i[28](null)}}}function jv(i){let n,r,a=i[5]&&Gl(i);return{c(){n=pr("main"),a&&a.c(),_t(n,"class",r=i[4]?void 0:"lui-isolated")},m(u,c){Dn(u,n,c),a&&a.m(n,null),i[29](n)},p(u,c){u[5]?a?a.p(u,c):(a=Gl(u),a.c(),a.m(n,null)):a&&(a.d(1),a=null),16&c[0]&&r!==(r=u[4]?void 0:"lui-isolated")&&_t(n,"class",r)},i:hn,o:hn,d(u){u&&dn(n),a&&a.d(),i[29](null)}}}function eS(i,n,r){let{activeFeatureToggleList:a}=n,{allowRules:u}=n,{anchor:c}=n,{authData:l}=n,{clientPermissions:d}=n,{context:p}=n,{deferInit:_}=n,{dirtyStatus:R}=n,{documentTitle:T}=n,{hasBack:E}=n,{label:y}=n,{locale:I}=n,{noShadow:N}=n,{nodeParams:H}=n,{pathParams:W}=n,{sandboxRules:ie}=n,{searchParams:Oe}=n,{skipCookieCheck:Ie}=n,{skipInitCheck:Qe}=n,{theme:xe}=n,{userSettings:Je}=n,{viewurl:ye}=n,{webcomponent:Re}=n;const ve={};let Ae,O,Zt=!1;const St=new _c,$e=L=>{if(!Zt){L.sendCustomMessage=(oe,ke)=>{ar.sendCustomMessage(oe,L.getNoShadow()?L:Ae,!!Re,ve,ke)},L.updateContext=(oe,ke)=>{if(r(8,p=oe),Re)(L.getNoShadow()?L:Ae)._luigi_mfe_webcomponent.context=oe;else{const Jt={...ke||{},activeFeatureToggleList:L.activeFeatureToggleList||[],currentLocale:L.locale,currentTheme:L.theme,userSettings:L.userSettings||null,cssVariables:L.cssVariables||{},anchor:L.anchor||"",drawer:L.drawer||!1,modal:L.modal||!1,viewStackSize:L.viewStackSize||0,isNavigateBack:L.isNavigateBack||!1};ar.updateContext(oe,Jt,ve,H,W,Oe)}},L.closeAlert=(oe,ke)=>{L.notifyAlertClosed(oe,ke)},L.notifyAlertClosed=(oe,ke)=>{L.isConnected&&(Re?St.resolveAlert(oe,ke):ar.notifyAlertClosed(oe,ke,ve))},L.notifyConfirmationModalClosed=oe=>{L.isConnected&&(Re?St.notifyConfirmationModalClosed(!!oe):ar.notifyConfirmationModalClosed(!!oe,ve))},fn.registerContainer(L),St.thisComponent=L;const ot=qr.resolveContext(p);if(L.updateViewUrl=(oe,ke)=>{oe?.length&&ar.updateViewUrl(oe,qr.resolveContext(p),ke,ve)},Re&&Re!="false"){L.getNoShadow()?L.innerHTML="":(r(7,Ae.innerHTML="",Ae),L.attachShadow({mode:"open"}).append(Ae));const oe=qr.checkWebcomponentValue(Re);St.renderWebComponent(ye,L.getNoShadow()?L:Ae,ot,typeof oe=="object"?{webcomponent:oe}:{})}else L.getNoShadow()||(L.innerHTML="",L.attachShadow({mode:"open"}).append(Ae));Qe?(L.initialized=!0,setTimeout((()=>{St.dispatchLuigiEvent(U.INITIALIZED,{})}))):Re&&(L.getNoShadow()?L:Ae).addEventListener("wc_ready",(()=>{(L.getNoShadow()?L:Ae)._luigi_mfe_webcomponent?.deferLuigiClientWCInit||(L.initialized=!0,St.dispatchLuigiEvent(U.INITIALIZED,{}))})),r(5,Zt=!0),L.containerInitialized=!0}};var En;return cc((async()=>{r(27,O=Ae.parentNode),r(27,O.iframeHandle=ve,O),r(27,O.init=()=>{$e(O)},O),!_&&ye&&$e(O)})),En=async()=>{},lc().$$.on_destroy.push(En),i.$$set=L=>{"activeFeatureToggleList"in L&&r(9,a=L.activeFeatureToggleList),"allowRules"in L&&r(0,u=L.allowRules),"anchor"in L&&r(10,c=L.anchor),"authData"in L&&r(11,l=L.authData),"clientPermissions"in L&&r(12,d=L.clientPermissions),"context"in L&&r(8,p=L.context),"deferInit"in L&&r(13,_=L.deferInit),"dirtyStatus"in L&&r(14,R=L.dirtyStatus),"documentTitle"in L&&r(15,T=L.documentTitle),"hasBack"in L&&r(16,E=L.hasBack),"label"in L&&r(1,y=L.label),"locale"in L&&r(17,I=L.locale),"noShadow"in L&&r(18,N=L.noShadow),"nodeParams"in L&&r(19,H=L.nodeParams),"pathParams"in L&&r(20,W=L.pathParams),"sandboxRules"in L&&r(2,ie=L.sandboxRules),"searchParams"in L&&r(21,Oe=L.searchParams),"skipCookieCheck"in L&&r(22,Ie=L.skipCookieCheck),"skipInitCheck"in L&&r(23,Qe=L.skipInitCheck),"theme"in L&&r(24,xe=L.theme),"userSettings"in L&&r(25,Je=L.userSettings),"viewurl"in L&&r(3,ye=L.viewurl),"webcomponent"in L&&r(4,Re=L.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!Zt&&ye&&!_&&O&&$e(O)},[u,y,ie,ye,Re,Zt,ve,Ae,p,a,c,l,d,_,R,T,E,I,N,H,W,Oe,Ie,Qe,xe,Je,()=>a&&u&&c&&l&&d&&R&&T&&E&&I&&N&&H&&W&&ie&&Oe&&Ie&&Qe&&xe&&Je,O,function(L){Xr[L?"unshift":"push"]((()=>{ve.iframe=L,r(6,ve)}))},function(L){Xr[L?"unshift":"push"]((()=>{Ae=L,r(7,Ae)}))}]}class mc extends gc{constructor(n){super(),fc(this,n,eS,jv,oc,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),q()}get allowRules(){return this.$$.ctx[0]}set allowRules(n){this.$$set({allowRules:n}),q()}get anchor(){return this.$$.ctx[10]}set anchor(n){this.$$set({anchor:n}),q()}get authData(){return this.$$.ctx[11]}set authData(n){this.$$set({authData:n}),q()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(n){this.$$set({clientPermissions:n}),q()}get context(){return this.$$.ctx[8]}set context(n){this.$$set({context:n}),q()}get deferInit(){return this.$$.ctx[13]}set deferInit(n){this.$$set({deferInit:n}),q()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),q()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(n){this.$$set({documentTitle:n}),q()}get hasBack(){return this.$$.ctx[16]}set hasBack(n){this.$$set({hasBack:n}),q()}get label(){return this.$$.ctx[1]}set label(n){this.$$set({label:n}),q()}get locale(){return this.$$.ctx[17]}set locale(n){this.$$set({locale:n}),q()}get noShadow(){return this.$$.ctx[18]}set noShadow(n){this.$$set({noShadow:n}),q()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(n){this.$$set({nodeParams:n}),q()}get pathParams(){return this.$$.ctx[20]}set pathParams(n){this.$$set({pathParams:n}),q()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(n){this.$$set({sandboxRules:n}),q()}get searchParams(){return this.$$.ctx[21]}set searchParams(n){this.$$set({searchParams:n}),q()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(n){this.$$set({skipCookieCheck:n}),q()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),q()}get theme(){return this.$$.ctx[24]}set theme(n){this.$$set({theme:n}),q()}get userSettings(){return this.$$.ctx[25]}set userSettings(n){this.$$set({userSettings:n}),q()}get viewurl(){return this.$$.ctx[3]}set viewurl(n){this.$$set({viewurl:n}),q()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(n){this.$$set({webcomponent:n}),q()}get unwarn(){return this.$$.ctx[26]}}function tS(i){Gv(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function nS(i){let n;return{c(){n=pr("main"),_t(n,"class","svelte-1buc46y")},m(r,a){Dn(r,n,a),i[21](n)},p:hn,i:hn,o:hn,d(r){r&&dn(n),i[21](null)}}}function rS(i,n,r){let a,u,{activeFeatureToggleList:c}=n,{anchor:l}=n,{clientPermissions:d}=n,{compoundConfig:p}=n,{context:_}=n,{deferInit:R}=n,{dirtyStatus:T}=n,{documentTitle:E}=n,{hasBack:y}=n,{locale:I}=n,{noShadow:N}=n,{nodeParams:H}=n,{pathParams:W}=n,{searchParams:ie}=n,{skipInitCheck:Oe}=n,{theme:Ie}=n,{userSettings:Qe}=n,{viewurl:xe}=n,{webcomponent:Je}=n,ye=!1;const Re=new Qa,ve=new _c,Ae=O=>{if(!p||ye)return;O.updateContext=($e,En)=>{const L=O.getNoShadow()?O:a;L._luigi_mfe_webcomponent.context=$e,r(1,_=$e);const ot=L._luigi_mfe_webcomponent;ot&&ot.querySelectorAll("[lui_web_component]")?.forEach((ke=>{const Jt=ke.context||{};ke.context=Object.assign(Jt,$e)}))};const Zt=qr.resolveContext(_);r(2,R=!1),O.notifyAlertClosed=($e,En)=>{O.isConnected&&ve.resolveAlert($e,En)},O.notifyConfirmationModalClosed=$e=>{O.isConnected&&ve.notifyConfirmationModalClosed(!!$e)};const St={compound:p,viewUrl:xe,webcomponent:qr.checkWebcomponentValue(Je)||!0};O.getNoShadow()?O.innerHTML="":(r(0,a.innerHTML="",a),O.attachShadow({mode:"open"}).append(a)),ve.renderWebComponentCompound(St,O.getNoShadow()?O:a,Zt).then(($e=>{u=$e,Oe||!St.viewUrl?(O.initialized=!0,setTimeout((()=>{ve.dispatchLuigiEvent(U.INITIALIZED,{})}))):u.LuigiClient&&!u.deferLuigiClientWCInit&&(O.initialized=!0,ve.dispatchLuigiEvent(U.INITIALIZED,{}))})),ye=!0,O.containerInitialized=!0};return cc((async()=>{const O=a.getRootNode()===document?a.parentNode:a.getRootNode().host;O.init=()=>{Ae(O)},R||Ae(O),Re.registerContainer(O),ve.thisComponent=O})),i.$$set=O=>{"activeFeatureToggleList"in O&&r(3,c=O.activeFeatureToggleList),"anchor"in O&&r(4,l=O.anchor),"clientPermissions"in O&&r(5,d=O.clientPermissions),"compoundConfig"in O&&r(6,p=O.compoundConfig),"context"in O&&r(1,_=O.context),"deferInit"in O&&r(2,R=O.deferInit),"dirtyStatus"in O&&r(7,T=O.dirtyStatus),"documentTitle"in O&&r(8,E=O.documentTitle),"hasBack"in O&&r(9,y=O.hasBack),"locale"in O&&r(10,I=O.locale),"noShadow"in O&&r(11,N=O.noShadow),"nodeParams"in O&&r(12,H=O.nodeParams),"pathParams"in O&&r(13,W=O.pathParams),"searchParams"in O&&r(14,ie=O.searchParams),"skipInitCheck"in O&&r(15,Oe=O.skipInitCheck),"theme"in O&&r(16,Ie=O.theme),"userSettings"in O&&r(17,Qe=O.userSettings),"viewurl"in O&&r(18,xe=O.viewurl),"webcomponent"in O&&r(19,Je=O.webcomponent)},[a,_,R,c,l,d,p,T,E,y,I,N,H,W,ie,Oe,Ie,Qe,xe,Je,()=>c&&l&&d&&T&&E&&y&&I&&N&&H&&W&&ie&&Oe&&Ie&&Qe,function(O){Xr[O?"unshift":"push"]((()=>{a=O,r(0,a)}))}]}dc(mc,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{sendCustomMessage=n("sendCustomMessage");updateContext=n("updateContext");updateViewUrl=n("updateViewUrl");closeAlert=n("closeAlert");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.error("Error in super.attributeChangedCallback",c)}this.containerInitialized&&(r==="context"&&this.updateContext(JSON.parse(u)),r==="auth-data"&&ar.updateAuthData(this.iframeHandle,JSON.parse(u)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class ql extends gc{constructor(n){super(),fc(this,n,rS,nS,oc,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},tS)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),q()}get anchor(){return this.$$.ctx[4]}set anchor(n){this.$$set({anchor:n}),q()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(n){this.$$set({clientPermissions:n}),q()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(n){this.$$set({compoundConfig:n}),q()}get context(){return this.$$.ctx[1]}set context(n){this.$$set({context:n}),q()}get deferInit(){return this.$$.ctx[2]}set deferInit(n){this.$$set({deferInit:n}),q()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),q()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(n){this.$$set({documentTitle:n}),q()}get hasBack(){return this.$$.ctx[9]}set hasBack(n){this.$$set({hasBack:n}),q()}get locale(){return this.$$.ctx[10]}set locale(n){this.$$set({locale:n}),q()}get noShadow(){return this.$$.ctx[11]}set noShadow(n){this.$$set({noShadow:n}),q()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(n){this.$$set({nodeParams:n}),q()}get pathParams(){return this.$$.ctx[13]}set pathParams(n){this.$$set({pathParams:n}),q()}get searchParams(){return this.$$.ctx[14]}set searchParams(n){this.$$set({searchParams:n}),q()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),q()}get theme(){return this.$$.ctx[16]}set theme(n){this.$$set({theme:n}),q()}get userSettings(){return this.$$.ctx[17]}set userSettings(n){this.$$set({userSettings:n}),q()}get viewurl(){return this.$$.ctx[18]}set viewurl(n){this.$$set({viewurl:n}),q()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(n){this.$$set({webcomponent:n}),q()}get unwarn(){return this.$$.ctx[20]}}dc(ql,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{updateContext=n("updateContext");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.warn("Error in attributeChangedCallback",c)}this.containerInitialized&&r==="context"&&this.updateContext(JSON.parse(u))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",mc.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",ql.element);const M={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,n,r){let a=n;const[u,c]=a.split("?"),l=new URLSearchParams(c);return this.modifySearchParams(i,l,r),a=u,l.toString()!==""&&(a+=`?${l.toString()}`),a},modifySearchParams(i,n,r){for(const[a,u]of Object.entries(i)){const c=r?`${r}${a}`:a;n.set(c,u),u===void 0&&n.delete(c)}},filterNodeParams(i,n){const r=Object.create(null),a=this.getContentViewParamPrefix(n);return i&&Object.entries(i).forEach(u=>{if(u[0].startsWith(a)){const c=u[0].substr(a.length);r[c]=u[1]}}),this.sanitizeParamsMap(r)},getContentViewParamPrefix(i){let n=i?.getConfigValue("routing.nodeParamPrefix");return n===!1?n="":n||(n=this.defaultContentViewParamPrefix),n},sanitizeParamsMap(i){return Object.entries(i).reduce((n,r)=>(n[rs.sanitizeParam(r[0])]=rs.sanitizeParam(r[1]),n),{})},prepareSearchParamsForClient(i,n){const r={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(a=>{a in n.routing().getSearchParams()&&i.clientPermissions?.urlParameters&&i.clientPermissions.urlParameters[a]?.read===!0&&(r[a]=n.routing().getSearchParams()[a])}),r},getCurrentPath(i){if(i){const n=Ce.normalizePath(location.hash),[r,a]=n.split("?");return{path:r,query:a}}else return{path:Ce.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,n){return this.getQueryParams(n)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return M.getLocation().search?M.parseParams(M.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=M.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?M.parseParams(M.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let n=i.getConfigValue("routing.modalPathParam");return n||(n=this.defaultModalViewParamName),n},parseParams(i){const n=new URLSearchParams(i),r=new Map;for(const[a,u]of n.entries())r.set(a,u);return Object.fromEntries(r)},getModalParamsFromPath(i){const n=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return n&&JSON.parse(n)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,n){const r=new URLSearchParams(i);return r.delete(n),r.delete(`${n}Params`),r.toString()},handleHistoryState(i,n){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:n},i},encodeParams(i){const n=[];for(const r in i)n.push(encodeURIComponent(r)+"="+encodeURIComponent(i[r]));return n.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,n){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const a=n.getConfigValue("navigation.validWebcomponentUrls");if(a?.length>0)for(const u of a)try{if(new RegExp(u).test(i))return!0}catch(c){console.error(c)}return!1}return!0},setFeatureToggles(i,n,r){const a=this.sanitizeParamsMap(this.parseParams(n.split("?")[1]));let u;if(a[i]&&(u=a[i]),!u)return;const c=u.split(",");c.length>0&&c[0]!==""&&c.forEach(l=>r?.setFeatureToggle(l,!0))},substituteDynamicParamsInObject(i,n,r=":",a=!1){return Object.entries(i).map(([u,c])=>{const l=a?Object.keys(n).find(d=>c&&c.indexOf(r+d)>=0):Object.keys(n).find(d=>c===r+d);return[u,l?a?c.replace(r+l,n[l]):n[l]:c]}).reduce((u,[c,l])=>Object.assign(u,{[c]:l}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,n){return this.isDynamicNode(i)&&i.pathSegment?n[i.pathSegment.substring(1)]:void 0},isExistingRoute(i,n){const r=i?.split("/")||[],a=n?.nodesInPath||[],u=(l,d)=>{let p=null;if(l?.children?.length){const _=l.children.filter(R=>R.pathSegment===d);_?.length&&(p=_[0])}return p};let c=[];if(r.length>1&&a.length===1){let l;r.forEach((d,p)=>{const _=p===0?a[0]:l;l=u(_,d),l?.pathSegment&&c.push(l.pathSegment)})}else c=a.filter(l=>l.pathSegment).map(l=>l.pathSegment||"");return!i||r.length===c.length},async pathExists(i,n){const r=D.getTrimmedUrl(i),a=await n.navigation().navService.getPathData(i),u=M.isExistingRoute(r,a);return a?u:!1},showRouteNotFoundAlert(i,n=!1,r){const a={text:r.i18n().getTranslation(n?"luigi.notExactTargetNode":"luigi.requestedRouteNotFound",{route:i}),type:"error",ttl:1};r.ux().showAlert(a)},getPageNotFoundRedirectResult(i,n=!1,r){const a=r.getConfigValue("routing.pageNotFoundHandler");if(typeof a=="function"){const u=a(i,n);if(u&&(u.redirectTo||u.ignoreLuigiErrorHandling))return{path:u.redirectTo,keepURL:u.keepURL,ignoreLuigiErrorHandling:u.ignoreLuigiErrorHandling}}return{}},async handlePageNotFoundAndRetrieveRedirectPath(i,n,r){if(n)return i;const a=r.getConfigValue("routing.pageNotFoundHandler"),u=this.getPageNotFoundRedirectResult(i,a,r)?.path;if(u!==void 0)return u;this.showRouteNotFoundAlert(i,!1,r),console.warn(`Could not find the requested route: ${i}`)},async getDefaultChildNode(i,n){if(!i)return"";const r=i.nodesInPath&&i.nodesInPath[i.nodesInPath.length-1],a=i.context,u=n?await n(r,a):await $n.getConfigValueFromObjectAsync(r,"children",a),c=u.find(l=>l.pathSegment===r.defaultChildNode);if(r.defaultChildNode&&c)return r.defaultChildNode;if(u&&u.length){if(i?.nodesInPath?.length===1){const p=u.find(_=>_.pathSegment);return p&&p.pathSegment||console.error("At least one navigation node in the root hierarchy must have a pathSegment.")}const d=u.find(p=>p.pathSegment&&(p.viewUrl||p.compound||p.externalLink&&p.externalLink.url));if(d)return d.pathSegment}return""},getNodePath(i,n){return!i||n?i?this.buildRoute(i,i.pathSegment?"/"+i.pathSegment:"",n):"":`${i.parent?this.getNodePath(i.parent):""}/${i.pathSegment}`},buildRoute(i,n,r){return i.parent?this.buildRoute(i.parent,`/${i.parent.pathSegment}${n}`,r):n+(r?"?"+r:"")},substituteViewUrl(i,n,r){if(!i.viewUrl)return"";let a=i.viewUrl;return i.virtualTree&&(a=a.replace("{virtualTreePath}","")),a=D.replaceVars(a,n,":",!1),a},getSubPath(i,n){return D.replaceVars(M.getNodePath(i),n,":",!1)},concatenatePath(i,n){let r=D.getPathWithoutHashOrSlash(i);return r?(n&&(r.endsWith("/")&&(r=r.substring(0,r.length-1)),n.startsWith("/")||(r+="/"),r+=n),r):n}},Ce={normalizePath:i=>{if(!i||i.length<=0)return i;let n=i;return n.startsWith("#")&&(n=n.substring(1)),n.startsWith("/")&&(n=n.substring(1)),n},segmentMatches:(i,n,r)=>!!(i===n||n.startsWith(":")&&r&&r[n.substr(1)]===i),checkMatch:(i,n,r)=>{let a=!0;return D.trimTrailingSlash(D.trimLeadingSlash(i)).split("/").forEach((u,c)=>{a&&(c+1>=n.length||!n[c+1]?.pathSegment||!Ce.segmentMatches(u,n[c+1]?.pathSegment??"",r??{}))&&(a=!1)}),a},checkVisibleForFeatureToggles:(i,n)=>{if(i?.visibleForFeatureToggles){const r=n?.getActiveFeatureToggleList()||[];for(const a of i.visibleForFeatureToggles)if(a.startsWith("!")){if(r.includes(a.slice(1)))return!1}else if(!r.includes(a))return!1}return!0},generateTooltipText:(i,n,r)=>{let a=i?.tooltipText;switch(a===void 0&&(a=r.getConfigValue("navigation.defaults.tooltipText")),a){case void 0:return n;case!1:return"";default:return r.i18n().getTranslation(a)}},isNodeAccessPermitted:(i,n,r,a)=>{if(a.auth().isAuthorizationEnabled()){const l=Un.isLoggedIn(),d=i.anonymousAccess;if(l&&d==="exclusive"||!l&&d!=="exclusive"&&d!==!0)return!1}const u=a.featureToggles();if(!Ce.checkVisibleForFeatureToggles(i,u))return!1;const c=a.getConfigValue("navigation.nodeAccessibilityResolver");return typeof c!="function"?!0:c(i,n,r)},applyContext:(i,n,r)=>{if(n)for(let a in n)i[a]=n[a];return r&&i.parentNavigationContexts&&i.parentNavigationContexts.unshift(r),i},updateHeaderTitle:(i,n)=>{const r=i?.items;if(r&&n){let a="";return[...r].sort((u,c)=>(c.link||"").localeCompare(u.link||"")).some(u=>{let c=!1;if(c=Ce.checkMatch(u.link||"",n.nodesInPath??[]),!c&&u.selectionConditions&&u.selectionConditions.route&&(c=Ce.checkMatch(u.selectionConditions.route,n.nodesInPath??[]),c&&(u.selectionConditions.contextCriteria||[]).forEach(l=>{c=c&&n?.selectedNode?.context?.[l.key]===l.value})),c)return a=u.title||"",!0}),a}},buildPath(i,n){return i.map(a=>{const u=a.pathSegment;if(u?.startsWith(":")){const c=u.slice(1),l=n?.pathParams?.[c];if(l!=null)return encodeURIComponent(String(l))}return u}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let n="";return i.forEach(r=>{r&&(n+=(n?"_":"")+encodeURIComponent(r.toLowerCase().split(" ").join("")))}),n},findVirtualTreeRootNode(i){if(i.virtualTree)return i;if(i.parent)return Ce.findVirtualTreeRootNode(i.parent)},validatePathAndGetRedirect:async(i,n)=>{const r=await M.pathExists(i,n);return await M.handlePageNotFoundAndRetrieveRedirectPath(i,r,n)||void 0}};class _n{constructor(){this.dataManagement=new Map}setChildren(n,r){this.dataManagement.set(n,r),this.navPath=""}getChildren(n){return n?this.dataManagement.get(n):{}}hasChildren(n){const r=this.getChildren(n);return!!(r&&Object.prototype.hasOwnProperty.call(r,"children"))}setRootNode(n){this.dataManagement.set("_luigiRootNode",{node:n})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(n){if(this.hasChildren(n)){const r=this.getChildren(n).children;for(let a=0;a<r.length;a++)this.deleteNodesRecursively(r[a])}this.dataManagement.delete(n)}}const Ua={logout:{label:"Sign Out",icon:"log"}};class iS{constructor(){this.services=new Map}register(n,r,a=!0){this.services.set(n,{factory:r,singleton:a})}get(n){const r=this.services.get(n);if(!r)throw new Error(`Service '${n}' is not registered.`);return r.singleton?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const te=new iS;class mn{constructor(n){this.luigi=n,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const n=[...this._modalStack];for(const{onInternalClose:r}of n)try{typeof r=="function"&&r()}catch(a){console.warn("onInternalClose threw an error",a)}this.clearModalStack()}registerModal(n){n&&this._modalStack.push(n)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(n){if(this._modalStack.length>0){const r=this._modalStack[0];r.modalsettings={...r.modalsettings,...n}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){ne.modalContainer.pop(),this._modalStack.pop()}}class vn{constructor(n){this.luigi=n}getModalService(){return this.modalService||(this.modalService=te.get(mn)),this.modalService}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=te.get(_n)),this.nodeDataManagementService}async getPathData(n){const r=this.luigi.getConfig();let a=n.split("/");a?.length>0&&a[0]===""&&(a=a.slice(1));let c=r.navigation?.globalContext||{},l;if(this.getNodeDataManagementService().hasRootNode())l=this.getNodeDataManagementService().getRootNode().node;else{const T=await this.luigi.getConfigValueAsync("navigation.nodes");typeof T=="object"&&!Array.isArray(T)?(l=T,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:T},l.children=await this.getChildren(l,c),l.children=this.prepareRootNodes(l.children||[],c),this.getNodeDataManagementService().setRootNode(l)}const d={...c||{},...l.context||{}},p={},_={context:d,selectedNodeChildren:l.children,nodesInPath:[l],rootNodes:l.children,pathParams:p,matchedPath:""};if(l.viewUrl&&a.length===0)_.selectedNode=l;else for(const T of a)if(_.selectedNodeChildren){const E=this.findMatchingNode(T,_.selectedNodeChildren||[]);if(!E){console.warn("No matching node found for segment:",T);break}const y=E.context||{},I=Ce.mergeContext(c,y);let N=I;if(E.pathSegment?.startsWith(":")&&(p[E.pathSegment.replace(":","")]=rs.sanitizeParam(T),N=M.substituteDynamicParamsInObject(I,p)),c=N,E.context=N,_.selectedNode=E,_.selectedNode&&_.nodesInPath?.push(_.selectedNode),E.virtualTree||E._virtualTree){const H=this.buildVirtualTree(E,T,p);H&&H.length>0&&(E.children=H)}_.selectedNodeChildren=await this.getChildren(E,c)}const R=_.nodesInPath?.filter(T=>T.pathSegment).map(T=>T.pathSegment)||[];return _.matchedPath=a.filter((T,E)=>R[E]&&R[E].startsWith(":")||R[E]===T).join("/")||"",_}findMatchingNode(n,r){let a;const u=r.filter(l=>!!l.pathSegment).length,c=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":")).length;if(u>1&&(c===1&&(console.warn(`Invalid node setup detected.
|
|
48
48
|
Static and dynamic nodes cannot be used together on the same level. Static node gets cleaned up.
|
|
49
49
|
Remove the static node from the configuration to resolve this warning.
|
|
50
50
|
Affected pathSegment:`,n,"Children:",r),r=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":"))),c>1)){console.error(`Invalid node setup detected.
|
|
51
51
|
Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
|
|
52
52
|
Invalid Children:`,r);return}return r.some(l=>{if(l.pathSegment===n||l.pathSegment&&l.pathSegment.startsWith(":"))return a=l,!0}),a}buildNavItems(n,r,a){const u={},c=[];return n?.forEach(l=>{if(Ce.isNodeAccessPermitted(l,this.getParentNode(a.selectedNode,a),a?.selectedNode?.context||{},this.luigi))if(l.category){const d=l.category.id||l.category.label||l.category,p=this.luigi.i18n().getTranslation(l.category.label||l.category.id||l.category);let _=u[d];_||(_={category:{altText:l.category.altText||"",icon:l.category.icon,id:d,label:p,nodes:[],tooltip:this.resolveTooltipText(l.category,p)}},u[d]=_,c.push(_)),_.category?.nodes?.push({node:l,selected:l===r,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,altText:l.altText,icon:l.icon})}else c.push({altText:l.altText,icon:l.icon,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,node:l,selected:l===r})}),c}async getCurrentNode(n){const r=await this.getPathData(n);let a=r.selectedNode;if(!a&&r.nodesInPath?.length===1&&(a=r.nodesInPath[0]),!(!a||!Ce.isNodeAccessPermitted(a,this.getParentNode(r.selectedNode,r),r?.selectedNode?.context||{},this.luigi)))return a}async getPathParams(n){return(await this.getPathData(n)).pathParams}getTruncatedChildren(n){let r=!1,a=!1,u=[];return n.slice().reverse().forEach(c=>{(!r||c.tabNav)&&(c.tabNav===!1&&(a=!0),c.keepSelectedForChildren===!1?r=!0:(c.keepSelectedForChildren||c.tabNav&&!a)&&(r=!0,u=[])),u.push(c)}),u.reverse()}applyNavGroups(n){const r={},a=[],c=[];return n.forEach(l=>{if(l.node)c.push(l);else if(l.category){const d=l.category.id;d&&d.indexOf("::")>0?a.push(l):(l.category.isGroup,r[d]=l,c.push(l))}}),a.forEach(l=>{const d=l.category?.id.split("::")[0]||"",p=r[d];p&&p.category&&(p.category.isGroup||(p.category.isGroup=!0),p.category.nodes||(p.category.nodes=[]),p.category.nodes.push(l))}),c.filter(l=>{if(l.category?.isGroup&&l.category?.nodes&&l.category?.nodes.length>0){for(let d=0;d<l.category?.nodes.length;d++){const p=l.category?.nodes[d];if(p.node&&!p.node.hideFromNav&&p.node.label||p.category?.nodes&&p.category.nodes.filter(_=>!_.node?.hideFromNav&&_.node?.label).length>0)return!0}return!1}return!0})}async getLeftNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{items:[],basePath:"",selectedNode:{},navClick:void 0};let u=[];const c=[];let l="";a.nodesInPath?.forEach(y=>{y.children&&(y.tabNav||(l+="/"+(y.pathSegment||"")),c.push(y))});const d=this.getTruncatedChildren(a.nodesInPath??[]);let p=[...d].pop(),_=a.selectedNode;(p?.keepSelectedForChildren||p?.tabNav)&&(_=p,d.pop(),p=[...d].pop());let R,T=_;_?a.rootNodes.includes(_)?(R=_,T=void 0):_.tabNav||_.keepSelectedForChildren?R=p:R=[...c].pop():(R=[...c].pop(),T=void 0);let E=await this.getChildren(R,R?.context||{})||[];return u=this.buildNavItems(E,T,a),u=this.applyNavGroups(u),{selectedNode:_||{},items:u,basePath:l.replace(/\/\/+/g,"/"),sideNavFooterText:this.luigi.getConfig().settings?.sideNavFooterText,navClick:y=>y.node&&this.navItemClick(y.node,a)}}navItemClick(n,r){let a=M.getNodePath(n),u=r?.pathParams;if(a=D.replaceVars(a,u||{},":",!1),!a&&a!==""){console.error("Navigation error: could not build path for the node. Check if pathSegment is defined for all nodes in the path and if there are no duplicate pathSegments on the same level.");return}this.luigi.navigation().navigate(a)}async getTopNavData(n,r){const a=this.luigi.getConfig(),u=r??await this.getPathData(n),c=a.navigation?.profile?.items?.length?JSON.parse(JSON.stringify(a.navigation.profile.items)):[],l=a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),d=Ce.updateHeaderTitle(l,u);c?.length&&c.map(y=>({...y,label:this.luigi.i18n().getTranslation(y.label||"")}));const p=this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.label)||Ua.logout.label,_=y=>{if(y.openNodeInModal&&!y.externalLink?.url)this.luigi.navigation().openAsModal(y.link||"",y.openNodeInModal===!0?{}:y.openNodeInModal);else if(y.link)this.luigi.navigation().navigate(y.link);else if(y.externalLink?.url)if(y.externalLink.sameWindow)window.location.href=y.externalLink.url;else{const I=window.open(y.externalLink.url,"_blank","noopener noreferrer");I&&(I.opener=null,I.focus())}},R={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&Un.isLoggedIn(),items:c,itemClick:_,logout:{altText:this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.altText)||Ua.logout.label,label:p,icon:a.navigation?.profile?.logout?.icon||Ua.logout.icon,testId:a.navigation?.profile?.logout?.testId||Ce.prepareForTests(p),doLogout:()=>{hr.logout()}},onUserInfoUpdate:y=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(I=>{I?y(I):hr.getUserInfoStore().subscribe(N=>{y(N)})})}},T=u.selectedNode,E=T&&u.rootNodes.includes(T)?T:void 0;return{appTitle:d||a.settings?.header?.title,logo:a.settings?.header?.logo,topNodes:this.buildNavItems(u.rootNodes,E,u),productSwitcher:a.navigation?.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||a.navigation?.profile?R:void 0,appSwitcher:a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),navClick:y=>y.node&&this.navItemClick(y.node,u)}}getParentNode(n,r){if(n&&n===r.nodesInPath?.[r.nodesInPath.length-1])return r.nodesInPath[r.nodesInPath.length-2]}getAppSwitcherData(n,r){const a=n,u=a?.showMainAppEntry;if(a&&a.items&&u){const c={title:this.luigi.i18n().getTranslation(r.title||""),subTitle:r.subTitle,link:"/"};if(a.items?.map(l=>({...l,title:this.luigi.i18n().getTranslation(l.title||"")})),a.items.some(l=>l.link===c.link))return a;a.items.unshift(c)}return a}async getTabNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{};const u=a?.selectedNode;let c;if(!u)return{};if(!u.tabNav&&(c=this.getParentNode(u,a),c&&!c.tabNav))return{};let l="";a.nodesInPath?.forEach(_=>{_.children&&(l+="/"+(_.pathSegment||""))});const d=c?this.getTruncatedChildren(c.children??[]):this.getTruncatedChildren(u.children??[]),p=this.buildNavItems(d,u,a);return{selectedNode:u,items:p,basePath:l.replace(/\/\/+/g,"/"),navClick:_=>_.node&&this.navItemClick(_.node,a)}}onNodeChange(n,r){const a=this.luigi.getConfigValue("navigation.nodeChangeHook");D.isFunction(a)?a(n,r):a!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(n){const r=await this.getPathData(n);return{nodeObject:M.getLastNodeObject(r),pathData:r}}async shouldPreventNavigation(n){return!!(n?.onNodeActivation&&(D.isFunction(n.onNodeActivation)||D.isAsyncFunction(n.onNodeActivation))&&await n.onNodeActivation(n)===!1)}async shouldPreventNavigationForPath(n){const{nodeObject:r}=await this.extractDataFromPath(n);return!!await this.shouldPreventNavigation(r)}async openViewInNewTab(n){if(await this.shouldPreventNavigationForPath(n))return;this.luigi.getConfigValue("routing.useHashRouting")&&(n="#"+n);let a;try{if(a=new URL(n,window.location.origin),a.origin!==window.location.origin)return}catch{return}window.open(a.toString(),"_blank","noopener,noreferrer")}resolveTooltipText(n,r){return Ce.generateTooltipText(n,r,this.luigi)}prepareRootNodes(n,r){const a=n;return a.length&&a.forEach(u=>{u.isRootNode=!0}),a}getAccessibleNodes(n,r,a){return r?r.filter(u=>Ce.isNodeAccessPermitted(u,n,a,this.luigi)):[]}async handleNavigationRequest(n,r){const{path:a,preserveView:u,drawerSettings:c,modalSettings:l,newTab:d,withoutSync:p,preventContextUpdate:_,preventHistoryEntry:R,options:T}=n,y=(await this.buildPath(a,T||{})).replace(/\/\/+/g,"/"),I=R?"replaceState":"pushState";if(c||l)c?this.luigi.navigation().openAsDrawer(y,c,r):(l.keepPrevious||this.getModalService().closeModals(),this.luigi.navigation().openAsModal(y,l,r));else{const N={detail:{preventContextUpdate:!!_,preventHistoryEntry:!!R,withoutSync:!!p}};if(await te.get(mn).closeModals(),d){await this.openViewInNewTab(y);return}const H=this.luigi.getConfigValue("routing.disableBrowserHistory")?"replaceState":I;if(this.luigi.getConfig().routing?.useHashRouting)if(!p&&H!=="replaceState")location.hash=y;else{const W=new CustomEvent("hashchange",N);window.history[H]({path:"/#"+y},"","/#"+y),window.dispatchEvent(W)}else{const W=new CustomEvent("popstate",N);window.history[H]({path:y},"",y),window.dispatchEvent(W)}}}async getChildren(n,r={}){const a=te.get(_n);if(!n)return[];let u=[];if(a.hasChildren(n)){let l=a.getChildren(n);l&&(u=l.children)}else try{u=await $n.getConfigValueFromObjectAsync(n,"children",r||n.context),u==null&&(u=[]),u=u.map(l=>this.getExpandStructuralPathSegment(l)).map(l=>this.bindChildToParent(l,n))||[]}catch(l){console.error("Could not lazy-load children for node",l)}let c=this.getAccessibleNodes(n,u,r);return a.setChildren(n,{children:u,filteredChildren:c}),c}getExpandStructuralPathSegment(n){if(n&&n.pathSegment&&n.pathSegment.indexOf("/")!==-1){const r=n.pathSegment.split("/"),a={...n},u=(c,l)=>{const d=c.shift();let p={};return c.length?(p.pathSegment=d,l.hideFromNav&&(p.hideFromNav=l.hideFromNav),p.children=[u(c,l)]):(p=a,p.pathSegment=d),p};return u(r,n)}return n}bindChildToParent(n,r){return r&&r.pathSegment&&(n.parent=r),n}buildVirtualTree(n,r,a){const u=n.virtualTree,c=n._virtualTree,l=n._virtualViewUrl||n.viewUrl;if((u||c)&&r){let d=typeof n._virtualPathIndex=="number"?n._virtualPathIndex:void 0;u&&(d=void 0,n.keepSelectedForChildren=!0);const p=50;if(typeof d=="number"&&d>p)return;const _=(d??0)+1;if(_>p)return;const R=["_*","virtualTree","parent","children","keepSelectedForChildren","navigationContext"],T=D.removeProperties(n,R);Object.assign(T,{pathSegment:":virtualSegment_"+_,label:":virtualSegment_"+_,viewUrl:D.trimTrailingSlash(this.buildVirtualViewUrl(l||"",a,_)),_virtualTree:!0,_virtualPathIndex:_,_virtualViewUrl:l});const E=Array.isArray(n.children)&&n.children.length>0?n.children[0]._virtualTree:!1;return n.children&&!E&&console.warn(`Found both virtualTree and children nodes defined on a navigation node.
|
|
53
53
|
Children nodes are redundant and ignored when virtualTree is enabled.
|
|
54
|
-
Please refer to documentation`),[T]}}buildVirtualViewUrl(n,r,a){let u="";for(const c in r)c.startsWith("virtualSegment")&&(u+=":"+c+"/");return a?(u+=":virtualSegment_"+a+"/",n+"/"+u):n}async buildPath(n,r){const{fromVirtualTreeRoot:a,fromContext:u,fromClosestContext:c,fromParent:l,relative:d,nodeParams:p}=r,_=this.luigi.getConfigValue("routing.useHashRouting"),{path:R,query:T}=M.getCurrentPath(_),E=R+(T?"?"+T:""),y=await this.getPathData(E),I=y.nodesInPath;let N=n;if(I===void 0)return console.warn("No nodes in path found for current path:",E),N;if(a){N="";const H=[...I].map((W,ie)=>W.virtualTree?ie:-1).filter(W=>W!==-1).pop();I.forEach((W,ie)=>{W.pathSegment&&(H===void 0||ie<=H)&&(N+="/"+W.pathSegment)}),N+="/"+n}else if(u){const H=u,W=[...I].reverse().find(ie=>H===ie.navigationContext);N=M.concatenatePath(M.getSubPath(W,y.pathParams),n)}else if(c){const H=[...I].reverse().find(W=>W.navigationContext&&W.navigationContext.length>0);N=M.concatenatePath(M.getSubPath(H,y.pathParams),n)}else l?N=M.concatenatePath(M.getSubPath(y.selectedNode?.parent,y.pathParams),n):d&&(N=M.concatenatePath(M.getSubPath(y.selectedNode,y.pathParams),n));return p&&Object.keys(p).length>0&&(N+=N.includes("?")?"&":"?",Object.entries(p).forEach((H,W)=>{N+=encodeURIComponent(M.getContentViewParamPrefix(this.luigi)+H[0])+"="+encodeURIComponent(H[1])+(W<Object.keys(p).length-1?"&":"")})),N}}class Mn{constructor(n){this.luigi=n}getNavigationService(){return this.navigationService||(this.navigationService=te.get(vn)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const n=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||n).filter(a=>location.href.match(a)).length!==0}enableRouting(){const n=this.luigi.getConfig();console.log("Init Routing...",n.routing),n.routing?.useHashRouting?(window.addEventListener("hashchange",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(M.getCurrentPath(!0),u,a)}),this.handleRouteChange(M.getCurrentPath(!0))):(window.addEventListener("popstate",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(M.getCurrentPath(),u,a)}),this.handleRouteChange(M.getCurrentPath()))}async handleRouteChange(n,r=!1,a=!1){const u=n.path,c=n.query,l=u+(c?"?"+c:""),d=new URLSearchParams(c),p=Object.create(null);if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(l),await this.shouldShowModalPathInUrl(n),d.forEach((I,N)=>{p[N]=I}),this.checkInvalidateCache(this.previousPathData,u);const _=await this.getNavigationService().getPathData(u);this.previousPathData=_;const R=M.filterNodeParams(p,this.luigi),T=D.getPathWithoutHash(u);this.currentRoute={raw:window.location.href,path:u,nodeParams:R};const E=_?.selectedNode??await this.getNavigationService().getCurrentNode(u),y=E?.viewUrl||"";if(!await this.handlePageNotFound(E,y,_,u,T)&&(this.luigi.getEngine()._connector?.renderTopNav(await this.getNavigationService().getTopNavData(u,_)),this.luigi.getEngine()._connector?.renderLeftNav(await this.getNavigationService().getLeftNavData(u,_)),this.luigi.getEngine()._connector?.renderTabNav(await this.getNavigationService().getTabNavData(u,_)),E)){const I={nodeParams:R||{},pathParams:_?.pathParams||{},searchParams:M.prepareSearchParamsForClient(E,this.luigi)};this.currentRoute.node=E,this.getNavigationService().onNodeChange(this.previousNode,E),this.previousNode=E,ne.updateMainContent(E,this.luigi,I,r,a)}}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(n){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(n)}async handleBookmarkableModalPath(n){const r=te.get(vn),a=te.get(mn),u=new URLSearchParams(n?.query||""),c=M.getModalViewParamName(this.luigi),l=u.get(c);if(l){const d=u.get(`${c}Params`);try{const p=JSON.parse(d||"{}"),{nodeObject:_}=await r.extractDataFromPath(l);document.querySelector(".lui-modal luigi-container")?this.luigi.getEngine()._connector?.updateModalSettings(p):this.luigi.navigation().openAsModal(l,p||_.openNodeInModal)}catch(p){console.error("Error parsing modal settings from URL parameters",p)}}else{a.closeModals();return}}appendModalDataToUrl(n,r){const a=M.getHashQueryParamSeparator(),u=M.getQueryParams(this.luigi),c=M.getModalViewParamName(this.luigi),l=u[c],d=new URL(location.href),p=this.luigi.getConfigValue("routing.useHashRouting");let _=history.state,R,T;if(p){let[E,y]=d.hash.split("?");R=E,T=M.getURLWithoutModalData(y,c),T&&(R+="?"+T)}else R=d.pathname,T=M.getURLWithoutModalData(d.search,c),T&&(R+="?"+M.getURLWithoutModalData(d.search,c));if(_=M.handleHistoryState(_,R),l!==n){if(u[c]=n,r&&Object.keys(r).length&&(u[`${c}Params`]=JSON.stringify(r)),p){const E=location.hash.indexOf(a);E!==-1&&(d.hash=d.hash.slice(0,E)),d.hash=`${d.hash}${a}${M.encodeParams(u)}`}else d.search=`?${M.encodeParams(u)}`;history.pushState(_,"",d.href)}else{const E=new URL(d);if(p){let y=E.hash.split("?")[0];E.hash=y,T&&(E.hash+="?"+T)}else E.search=T;history.replaceState({},"",E.href),history.pushState(_,"",d.href)}}removeModalDataFromUrl(n){const r=M.getQueryParams(this.luigi),a=M.getModalViewParamName(this.luigi);let u=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let l={};r[a]&&(l[a]=r[a]),r[`${a}Params`]&&(l[`${a}Params`]=r[`${a}Params`]);let d=M.encodeParams(l);u.hash.includes(`?${d}`)?u.hash=u.hash.replace(`?${d}`,""):u.hash.includes(`&${d}`)&&(u.hash=u.hash.replace(`&${d}`,""))}else{let l=new URLSearchParams(u.search.slice(1));l.delete(a),l.delete(`${a}Params`);let d="";Array.from(l.keys()).forEach(p=>{d+=(d===""?"?":"&")+p+"="+l.get(p)}),u.search=d}if(history.state&&history.state.modalHistoryLength>=0&&n){history.state.modalHistoryLength;const l=history.state.pathBeforeHistory;let d=!1;if(window.addEventListener("popstate",p=>{d?(history.replaceState({},"",l),history.pushState({},"",l),history.back()):(history.pushState({},"",l),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const p=history.length-1;d=!0,history.go(-p),window.Luigi.preventLoadingModalData=!0}else{const p=history.state.modalHistoryLength;history.go(-p)}}else history.pushState({},"",u.href)}setFeatureToggle(n){const r=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),a=this.luigi.featureToggles();r&&typeof n=="string"&&M.setFeatureToggles(r,n,a)}updateModalDataInUrl(n,r,a){let u=M.getHashQueryParamSeparator();const c=M.getQueryParams(this.luigi),l=M.getModalViewParamName(this.luigi);c[l]=n,r&&Object.keys(r).length&&(c[`${l}Params`]=JSON.stringify(r));const d=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const _=location.hash.indexOf(u);_!==-1&&(d.hash=d.hash.slice(0,_)),d.hash=`${d.hash}${u}${M.encodeParams(c)}`}else d.search=`?${M.encodeParams(c)}`;a?history.pushState(window.state,"",d.href):history.replaceState(window.state,"",d.href)}checkInvalidateCache(n,r){if(!n)return;const a=te.get(_n);let u=r.split("/");if(n.nodesInPath&&n.nodesInPath.length>0){let c=n.nodesInPath.slice(1),l=!0;for(let d=0;d<c.length;d++){let p=u.length>d?u[d]:void 0,_=c[d];if(p!==_.pathSegment||!l)if(M.isDynamicNode(_)){if(!l||p!==M.getDynamicNodeValue(_,n.pathParams)){a.deleteNodesRecursively(_);break}}else l=!1}}else a.deleteCache()}async handlePageNotFound(n,r,a,u,c){const l=D.getTrimmedUrl(u),d=M.isExistingRoute(l,a);if(!r&&!n?.compound||n?.tabNav?.showAsTabHeader){const p=await M.getDefaultChildNode(a,async(_,R)=>await this.getNavigationService().getChildren(_,R));if(d){const _=D.getTrimmedUrl(u);return this.getNavigationService().handleNavigationRequest({path:`${_?`/${_}`:""}/${p}`,preserveView:void 0,modalSettings:void 0,newTab:!1,withoutSync:!1,preventContextUpdate:!1,preventHistoryEntry:!0}),!1}else{if(p&&a?.nodesInPath&&a.nodesInPath.length>1)return this.showPageNotFoundError(D.trimTrailingSlash(l||"")+"/"+p,c,!0),!0;const _=await M.getDefaultChildNode(a);this.showPageNotFoundError(_,c,!1)}return!0}return d?!1:(this.showPageNotFoundError(a.matchedPath,c,!0),!0)}async showPageNotFoundError(n,r,a=!1){const u=M.getPageNotFoundRedirectResult(r,a,this.luigi);if(u.ignoreLuigiErrorHandling)return;const c=u.path;if(c){if(u.keepURL){const l=this.luigi.getConfig().routing?.useHashRouting,d=M.getCurrentPath(l);d.path=c,this.handleRouteChange(d)}else this.getNavigationService().handleNavigationRequest({path:c});return}M.showRouteNotFoundAlert(r,a,this.luigi),this.getNavigationService().handleNavigationRequest({path:D.addLeadingSlash(n)})}}class mr{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(n){this.decorators=this.decorators.filter(r=>r.uid!==n.uid).concat(n)}applyDecorators(n,r){if(!n)return n;const a=new URL(D.prependOrigin(n)),u=this.decorators.filter(c=>c.type==="queryString");for(let c=0;c<u.length;c++){const l=u[c];a.searchParams.has(l.key)&&a.searchParams.delete(l.key);const d=l.valueFn();a.searchParams.append(l.key,d)}return r&&(a.search=decodeURIComponent(a.search)),a.href}}const Oa=async(i,n,r)=>{const a=await n.readUserSettings(),c=i.userSettingsGroup&&typeof a=="object"&&a!==null&&i.userSettingsGroup?a[i.userSettingsGroup]:null,l=r?.nodeParams||{},d=r?.pathParams||{},p=r?.searchParams||{};if(i.webcomponent&&i.viewUrl&&!M.checkWCUrl(i.viewUrl,n))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const _=document.createElement("luigi-compound-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.compoundConfig=i.compound,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=Ce.findVirtualTreeRootNode(i),n.getEngine()._comm.addListeners(_,n),_}else{const _=document.createElement("luigi-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.cssVariables=await n.theming().getCSSVariables(),_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=Ce.findVirtualTreeRootNode(i),vc(_,n),Sc(_,n),n.getEngine()._comm.addListeners(_,n),_.luigiMfId=D.getRandomId(),_}},vc=(i,n)=>{const r=n.getConfigValue("settings.customSandboxRules");if(!r?.length)return;const a=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],u=r?[...new Set([...a,...r])]:a;i.sandboxRules=u},Sc=(i,n)=>{const r=n.getConfigValue("settings.allowRules");r?.length&&(r.forEach((a,u)=>{r[u]=a+(a.indexOf(";")!=-1?"":";")}),i.allowRules=r)},ne={navService:void 0,routingService:void 0,luigi:void 0,modalContainer:[],drawerContainer:void 0,init:i=>{console.log("Init UI..."),ne.navService=te.get(vn),ne.routingService=te.get(Mn),ne.luigi=i,i.getEngine()._connector?.renderMainLayout()},update:async i=>{const n=ne.routingService.getCurrentRoute();if(!n)return;const r=!i||i.length===0;(r||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&ne.luigi.getEngine()._connector?.renderTopNav(await ne.navService.getTopNavData(n.path)),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(te.get(_n).deleteCache(),ne.luigi.getEngine()._connector?.renderLeftNav(await ne.navService.getLeftNavData(n.path)),ne.luigi.getEngine()._connector?.renderTabNav(await ne.navService.getTabNavData(n.path))),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(te.get(_n).deleteCache(),n.node&&ne.updateMainContent(n.node,ne.luigi))},updateMainContent:async(i,n,r,a,u)=>{const c=await n.readUserSettings(),d=i.userSettingsGroup&&typeof c=="object"&&c!==null&&i.userSettingsGroup?c[i.userSettingsGroup]:null,p=n.getEngine()._connector?.getContainerWrapper();n.getEngine()._connector?.hideLoadingIndicator(p);const _=r?.nodeParams||{},R=r?.pathParams||{},T=r?.searchParams||{};if(i&&p){let E,y;if((i.virtualTree||i._virtualTree)&&(y=Ce.findVirtualTreeRootNode(i)),[...p.childNodes].forEach(I=>{I.tagName?.indexOf("LUIGI-")===0&&(I.viewGroup&&i.viewGroup!==I.viewGroup?I.style.display="none":I.viewGroup||I.virtualTree&&y===I.virtualTreeRootNode?E=I:I.remove())}),E)a||(E.style.display="block",E.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i.viewUrl,R,n),i.decodeViewUrl??!1):"",E.nodeParams=_,E.pathParams=R,E.clientPermissions=i.clientPermissions,E.searchParams=T,E.locale=n.i18n().getCurrentLocale(),E.theme=n.theming().getCurrentTheme(),E.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),E.userSettingsGroup=i.userSettingsGroup,E.userSettings=d,vc(E,n),Sc(E,n)),u||E.updateContext(i.context||{});else{const I=await Oa(i,n,r);p?.appendChild(I);const N=n.getEngine()._connector;i.loadingIndicator?.enabled!==!1&&N?.showLoadingIndicator(p)}}},openModal:async(i,n,r,a)=>{const u=await Oa(n,i);ne.modalContainer.push(u);const c=te.get(Mn),l=te.get(mn);let d=!1,p,_;const T=new Promise(I=>{p=()=>{d||(d=!0,I(),l.removeLastModalFromStack())},_=()=>{p&&p(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},u.addEventListener(U.CLOSE_CURRENT_MODAL_REQUEST,_)}),E={closePromise:T,resolveFn:p,onCloseRequestHandler:_,onInternalClose:()=>{try{E.resolveFn&&E.resolveFn()}catch(I){console.warn("onInternalClose failed",I)}},modalsettings:r};l.registerModal(E),i.getEngine()._connector?.renderModal(u,r,()=>{a?.(),l.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},()=>T);const y=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&y?.showLoadingIndicator(u.parentElement)},updateModalSettings:(i,n,r)=>{const a=te.get(mn);if(a.getModalStackLength()===0)return;a.updateFirstModalSettings(i);const u=te.get(Mn),c=M.getModalPathFromPath(r);c&&u.updateModalDataInUrl(c,a.getModalSettings(),n),r.getEngine()._connector?.updateModalSettings(a.getModalSettings())},openDrawer:async(i,n,r,a)=>{const u=await Oa(n,i);ne.drawerContainer=u,i.getEngine()._connector?.renderDrawer(u,r,a);const c=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&c?.showLoadingIndicator(u.parentElement)}},sS={getMicrofrontendsInDom(i){return[...this.getMainMicrofrontends(i).map(n=>({container:n.iframe,active:n.active,type:"main",id:n.id})),...this.getModalMicrofrontends().map(n=>({container:n.iframe,active:n.active,type:"modal",id:n.id})),...(()=>{const n=this.getDrawerMicrofrontends();return n.iframe?[{container:n.iframe,active:n.active,type:"drawer",id:n.id}]:[]})()]},getMainMicrofrontends(i){const n=i.getEngine()._connector?.getContainerWrapper();if(!n)return[];const r=[];for(const a of n.childNodes)if(a.tagName?.startsWith("LUIGI-"))if(a.iframeHandle?.iframe)r.push({iframe:a.iframeHandle.iframe,id:a.luigiMfId,active:D.isElementVisible(a)});else{const u=a.shadowRoot?.firstElementChild?.firstElementChild??null;u&&r.push({iframe:u,id:a.luigiMfId,active:D.isElementVisible(a)})}return r},getModalMicrofrontends(){const i=[];for(const n of ne.modalContainer)if(n.iframeHandle?.iframe)i.push({iframe:n.iframeHandle.iframe,id:n.luigiMfId,active:D.isElementVisible(n)});else{const r=n.shadowRoot?.firstElementChild?.firstElementChild??null;r&&i.push({iframe:r,id:n.luigiMfId,active:D.isElementVisible(n)})}return i},getDrawerMicrofrontends(){if(!ne.drawerContainer)return{};if(ne.drawerContainer.iframeHandle?.iframe)return{iframe:ne.drawerContainer.iframeHandle.iframe,id:ne.drawerContainer.luigiMfId,active:D.isElementVisible(ne.drawerContainer)};{const i=ne.drawerContainer.shadowRoot?.firstElementChild?.firstElementChild??null;if(i)return{iframe:i,id:ne.drawerContainer.luigiMfId,active:D.isElementVisible(ne.drawerContainer)}}return{}}};class aS{constructor(n){this.luigi=n}getShellbar(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarElement()||null}getShellbarActions(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarActions()||null}getLuigiContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getLuigiContainer()||null}getNavFooterContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getNavFooterContainer()||null}getMicrofrontends(){return sS.getMicrofrontendsInDom(this.luigi)}getMicrofrontendIframes(){const n=this.luigi.getEngine()._connector?.getContainerWrapper();let r=[];if(ne.modalContainer)for(const a of Array.from(ne.modalContainer))a.tagName?.startsWith("LUIGI-")&&a.iframeHandle?.iframe&&r.push(a.iframeHandle.iframe);if(ne.drawerContainer&&r.push(ne.drawerContainer.iframeHandle.iframe),!n)return null;for(const a of Array.from(n.childNodes))a.tagName?.startsWith("LUIGI-")&&a.iframeHandle?.iframe&&r.push(a.iframeHandle.iframe);return r}getCurrentMicrofrontendIframe(){const n=this.luigi.getEngine()._connector?.getContainerWrapper();if(!n)return null;const r=ne.modalContainer[0]?.iframeHandle?.iframe??null;let a=null,u=null;for(const c of Array.from(n.children))c.tagName?.startsWith("LUIGI-")&&D.isElementVisible(c)&&(c.iframeHandle?.iframe?a=c.iframeHandle.iframe:u=c.shadowRoot?.firstElementChild?.firstElementChild??null);return r||a||u}}const oS={luigiAfterInit:async i=>{D.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await Xe.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class uS{constructor(){this.featureToggleList=new Set}setFeatureToggle(n,r=!1){this.isValid(n)&&(n.startsWith("!")&&!r||this.isDuplicatedOrDisabled(n)||this.featureToggleList.add(n))}unsetFeatureToggle(n){if(this.isValid(n)){if(!this.featureToggleList.has(n)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(n)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(r=>!r.startsWith("!"))}isValid(n){return D.isString(n)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(n){return this.featureToggleList.has(n)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${n}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class lS{constructor(n){this.hashRouting=!1,this.options={fromContext:null,fromClosestContext:!1,fromVirtualTreeRoot:!1,fromParent:!1,nodeParams:{}},this.navigate=async(r,a,u,c,l)=>{const d=r[0]!=="/";this.options.relative=d;const p={modalSettings:u,newTab:!1,options:this.options,path:r,preserveView:a,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(p,void 0)},this.openAsModal=async(r,a,u)=>{a?.keepPrevious||await this.modalService.closeModals();const c=r.replace(/\/\/+/g,"/");if(!await Ce.validatePathAndGetRedirect(c,this.luigi))return;const d=await this.navService.getCurrentNode(c),p=a||{};p.title||(p.title=d?.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(c,p),this.luigi.getEngine()._ui.openModal(this.luigi,d,p,u)},this.openAsDrawer=async(r,a,u)=>{const c=r.replace(/\/\/+/g,"/");if(!await Ce.validatePathAndGetRedirect(c,this.luigi))return;const d=await this.navService.getCurrentNode(c),p=a||{};p.title||(p.title=d?.label||""),this.luigi.getEngine()._ui.openDrawer(this.luigi,d,p,u)},this.runTimeErrorHandler=async r=>{const{path:a}=M.getCurrentPath(this.luigi.getConfig().routing?.useHashRouting),u=await this.navService.getCurrentNode(a),c=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");u?.runTimeErrorHandler?.errorFn&&D.isFunction(u?.runTimeErrorHandler?.errorFn)?u.runTimeErrorHandler.errorFn(r,u):c?.errorFn&&D.isFunction(c.errorFn)&&c.errorFn(r,u)},this.pathExists=async r=>await M.pathExists(r,this.luigi),this.luigi=n,this.hashRouting=n.getConfig().routing?.useHashRouting,this.navService=te.get(vn),this.routingService=te.get(Mn),this.modalService=te.get(mn)}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this.options.fromParent=!1,this}fromContext(n){return this.options.fromContext=n,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this.options.fromParent=!1,this}fromParent(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!1,this.options.fromParent=!0,this}withParams(n){return n&&Object.assign(this.options.nodeParams??{},n),this}}class cS{constructor(n){this.luigi=n}addSearchParams(n,r=!1){if(!D.isObject(n)){console.log("Params argument must be an object");return}const a=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?a.hash=M.addParamsOnHashRouting(n,a.hash):M.modifySearchParams(n,a.searchParams),this.handleBrowserHistory(r,a),this.luigi.configChanged()}getSearchParams(){const n={},r=["__proto__","constructor","prototype"],a=new URL(location.href);let u;if(this.luigi.getConfigValue("routing.useHashRouting")){const c=a.hash.split("?")[1];u=c?new URLSearchParams(c).entries():[]}else u=a.searchParams.entries();for(const[c,l]of u){if(r.some(d=>c===d)){console.warn(`Blocked because of potentially dangerous query param: ${c}`);continue}n[c]=l}return n}handleBrowserHistory(n,r){const a=this.sanitizeUrl(r.href);if(!a){console.warn("invalid url: "+a);return}n?window.history.pushState({},"",a):window.history.replaceState({},"",a)}sanitizeUrl(n){return new URL(location.href).origin===new URL(n).origin?n:void 0}addNodeParams(n,r){if(!D.isObject(n)){console.log("Params argument must be an object");return}const a=M.getContentViewParamPrefix(this.luigi),u=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?u.hash=M.addParamsOnHashRouting(n,u.hash,a):M.modifySearchParams(n,u.searchParams,a),this.handleBrowserHistory(r,u),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}class fS{#e;#f="";constructor(n){this.#e=n}async getAvailableThemes(){return await this.#e.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(n){this.#f=n,this.#e.__cssVars=void 0}async getThemeObject(n){return(await this.getAvailableThemes())?.find(a=>a.id===n)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.#f)return this.#f;const n=this.#e.getConfigValue("settings.theming");return n.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",n),n.defaultTheme}isThemingAvailable(){return!!this.#e.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const n=this.#e.getConfigValue("settings.theming.variables.file");if(n)try{const r=await fetch(n);window.Luigi.__cssVars=(await r.json()).root,Object.keys(window.Luigi.__cssVars).forEach(a=>{const u=getComputedStyle(document.documentElement).getPropertyValue("--"+a);u&&(window.Luigi.__cssVars[a]=u)})}catch(r){D.isFunction(this.#e.getConfigValue("settings.theming.variables.errorHandling"))?this.#e.getConfigValue("settings.theming.variables.errorHandling")(r):console.error("CSS variables file error: ",r)}else this.#e.getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(r=>{window.Luigi.__cssVars[r]=getComputedStyle(document.documentElement).getPropertyValue("--"+r)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const n=te.get(mr);(()=>{const a=this.#e.getConfigValue("settings.theming");a&&a.nodeViewURLDecorator&&a.nodeViewURLDecorator.queryStringParameter&&n.add({type:"queryString",uid:"theming",key:a.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const u=this.getCurrentTheme(),c=a.nodeViewURLDecorator.queryStringParameter.value;return c?c(u):u}}),a&&a.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}class ss{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(n,r){if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const a=new Set;a.add(r),this.unsavedChanges={dirtySet:a}}this.unsavedChanges.persistUrl=window.location.href,n?this.unsavedChanges.dirtySet?.add(r):this.unsavedChanges.dirtySet?.delete(r)}clearDirtyState(n){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(n?this.unsavedChanges.dirtySet.delete(n):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let zl;const Pe={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),Pe.luigi=i,Pe.documentTitle=ns(void 0),zl=te.get(ss)},processAlert:(i,n,r)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");const a={openFromClient:n,close:()=>{i.id&&r.notifyAlertClosed(i.id)},link:u=>{if(i.links){const c=i.links[u];if(c&&(c.url&&Pe.luigi?.navigation().navigate(c.url),c.dismissKey&&i.id))return r.notifyAlertClosed(i.id,c.dismissKey),!0}return!1}};Pe.luigi.getEngine()._connector?.renderAlert(i,a)},handleConfirmationModalRequest:(i,n)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:Pe.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:Pe.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:Pe.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:Pe.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),Pe.luigi.getEngine()._connector?.renderConfirmationModal(i,{confirm(){n.notifyConfirmationModalClosed(!0)},dismiss(){n.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,n)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");zl.updateDirtyStatus(i,n)}};class hS{processUserSettingGroups(n,r){const a=[],u=n?.userSettingGroups,c=r?.userSettings?.userSettingGroups,l=u||c;if(D.isObject(l)){for(const d in l){const p={};p[d]=l[d],a.push(p)}return a}return a}getUserSettingsIframesInDom(){const n=document.querySelector(".iframeUserSettingsCtn");return n?[...n.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(n=>{n.style.display="none"})}findActiveCustomUserSettingsIframe(n){const r=document.querySelectorAll("[userSettingsGroup]");for(let a=0;a<r.length;a++)if(r[a].contentWindow===n)return r[a];return null}}const dS=new hS;class gS{constructor(n){this.dirtyStatusService=te.get(ss),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=r=>new Promise(a=>{r.id||(r.id=D.getRandomId().toString());const u={openFromClient:!1,close:()=>{a(!0)},link:c=>{if(r.links){const l=r.links[c];if(l&&(l.url&&this.luigi?.navigation().navigate(l.url),l.dismissKey))return a(l.dismissKey),!0}return!1}};this.luigi.getEngine()._connector?.renderAlert(r,u)}),this.showConfirmationModal=r=>(r&&(r={...r,header:this.luigi.i18n().getTranslation(r.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(r.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(r.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(r.buttonConfirm||"luigi.button.confirm")}),new Promise((a,u)=>{this.luigi.getEngine()._connector?.renderConfirmationModal(r,{confirm(){a(!0)},dismiss(){u()}})})),this.processUserSettingGroups=()=>{const r=this.luigi.getConfigValue("userSettings"),a=this.luigi.getConfigValue("settings");return dS.processUserSettingGroups(r,a)},this.openUserSettings=r=>{this.luigi.getEngine()._connector?.openUserSettings(r)},this.closeUserSettings=()=>{this.luigi.getEngine()._connector?.closeUserSettings()},this.setDocumentTitle=r=>{this.luigi.getEngine()._ux?.documentTitle?.set(r),this.luigi.getEngine()._connector?.setDocumentTitle(r)},this.getDocumentTitle=()=>ic(this.luigi.getEngine()._ux?.documentTitle)||window.document.title||"",this.hideAppLoadingIndicator=()=>{const r=document.querySelector(this.appLoadingIndicatorSelector);r&&(r.classList.add("hidden"),setTimeout(()=>{r.parentNode?.removeChild(r)},500))},this.showLoadingIndicator=r=>this.luigi.getEngine()._connector?.showLoadingIndicator(r),this.hideLoadingIndicator=r=>this.luigi.getEngine()._connector?.hideLoadingIndicator(r),this.addBackdrop=()=>this.luigi.getEngine()._connector?.addBackdrop(),this.removeBackdrop=()=>this.luigi.getEngine()._connector?.removeBackdrop(),this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=n}}class pS{constructor(n){this.engine=n,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=r=>{this.config=r,this.setConfigCallback(this.getConfigReadyCallback()),hr.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,oS.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...r)=>{this.getEngine()._ui.update(r)},this.i18n=()=>(this._i18n||(this._i18n=new Bv(this)),this._i18n),this.elements=()=>(this._elements||(this._elements=new aS(this)),this._elements),this.navigation=()=>new lS(this),this.ux=()=>new gS(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new uS),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new cS(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new fS(this)),this._theming),this.auth=()=>or,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(n){return D.getConfigValueFromObject(this.getConfig(),n)}getConfigValueAsync(n,...r){return $n.getConfigValueFromObjectAsync(this.getConfig(),n,r)}clearNavigationCache(){te.get(_n).deleteCache()}async readUserSettings(){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&D.isFunction(r.readUserSettings))return r.readUserSettings();const a=localStorage.getItem(this.USER_SETTINGS_KEY);return a&&JSON.parse(a)}async storeUserSettings(n,r){const a=await this.getConfigValueAsync("userSettings"),u=a||await this.getConfigValueAsync("settings.userSettings");if(u&&D.isFunction(u.storeUserSettings))return u.storeUserSettings(n,r);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(n)),this.configChanged()}createConfigStore(){const n=ns({}),r={};let a=[];return{subscribe:u=>{a.push(n.subscribe(u))},reset:u=>{n.update(u)},subscribeToScope:(u,c)=>{let l=r[c];l||(l=new Set,r[c]=l),l.add(u)},fire:(u,c)=>{const l=r[u];l&&[...l].forEach(d=>{d(c)})},clear:()=>{a.forEach(u=>{u()}),a=[]}}}getConfigReadyCallback(){return new Promise(n=>{this.i18n()._init(),n()})}setConfigCallback(n){this.configReadyCallback=n}}const _S=!1;var mS=Array.isArray,vS=Array.prototype.indexOf,vr=Array.prototype.includes,SS=Array.from,wS=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,ES=Object.prototype,CS=Array.prototype,TS=Object.getPrototypeOf,Kl=Object.isExtensible;const yS=()=>{};function RS(i){for(var n=0;n<i.length;n++)i[n]()}function AS(){var i,n,r=new Promise((a,u)=>{i=a,n=u});return{promise:r,resolve:i,reject:n}}const Fe=2,Zr=4,wc=8,Ec=1<<24,Xt=16,Sn=32,kn=64,ka=128,mt=512,Ue=1024,Ge=2048,Mt=4096,Yt=8192,gn=16384,ei=32768,Yl=1<<25,as=65536,Ha=1<<17,bS=1<<18,us=1<<19,PS=1<<20,Hn=65536,Wa=1<<21,qa=1<<22,Jr=1<<23,$a=Symbol("$state"),za=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function IS(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xS(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function LS(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function NS(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function US(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Be=Symbol();function OS(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function $S(i){return i===this.v}let Ka=!1,DS=!1;function MS(){Ka=!0}let xt=null;function os(i){xt=i}function FS(i,n=!1,r){xt={p:xt,i:!1,c:null,e:null,s:i,x:null,r:pe,l:Ka&&!n?{s:null,u:null,$:[]}:null}}function kS(i){var n=xt,r=n.e;if(r!==null){n.e=null;for(var a of r)ew(a)}return n.i=!0,xt=n.p,{}}function ls(){return!Ka||xt!==null&&xt.l===null}let ur=[];function HS(){var i=ur;ur=[],RS(i)}function gr(i){if(ur.length===0){var n=ur;queueMicrotask(()=>{n===ur&&HS()})}ur.push(i)}function Cc(i){var n=pe;if(n===null)return ue.f|=Jr,i;if((n.f&ei)===0&&(n.f&Zr)===0)throw i;lr(i,n)}function lr(i,n){for(;n!==null;){if((n.f&ka)!==0){if((n.f&ei)===0)throw i;try{n.b.error(i);return}catch(r){i=r}}n=n.parent}throw i}const WS=-7169;function Te(i,n){i.f=i.f&WS|n}function Ya(i){(i.f&mt)!==0||i.deps===null?Te(i,Ue):Te(i,Mt)}function Tc(i){if(i!==null)for(const n of i)(n.f&Fe)===0||(n.f&Hn)===0||(n.f^=Hn,Tc(n.deps))}function yc(i,n,r){(i.f&Ge)!==0?n.add(i):(i.f&Mt)!==0&&r.add(i),Tc(i.deps),Te(i,Ue)}const ln=new Set;let Ee=null,Pt=null,Va=null,Da=!1,cr=null,ji=null;var Xl=0;let VS=1;class Wn{id=VS++;current=new Map;previous=new Map;#e=new Set;#f=new Set;#n=new Map;#o=new Map;#r=null;#t=[];#s=[];#i=new Set;#a=new Set;#u=new Map;is_fork=!1;#c=!1;#h=new Set;#d(){return this.is_fork||this.#o.size>0}#g(){for(const a of this.#h)for(const u of a.#o.keys()){for(var n=!1,r=u;r.parent!==null;){if(this.#u.has(r)){n=!0;break}r=r.parent}if(!n)return!0}return!1}skip_effect(n){this.#u.has(n)||this.#u.set(n,{d:[],m:[]})}unskip_effect(n){var r=this.#u.get(n);if(r){this.#u.delete(n);for(var a of r.d)Te(a,Ge),this.schedule(a);for(a of r.m)Te(a,Mt),this.schedule(a)}}#l(){if(Xl++>1e3&&(ln.delete(this),BS()),!this.#d()){for(const d of this.#i)this.#a.delete(d),Te(d,Ge),this.schedule(d);for(const d of this.#a)Te(d,Mt),this.schedule(d)}const n=this.#t;this.#t=[],this.apply();var r=cr=[],a=[],u=ji=[];for(const d of n)try{this.#p(d,r,a)}catch(p){throw bc(d),p}if(Ee=null,u.length>0){var c=Wn.ensure();for(const d of u)c.schedule(d)}if(cr=null,ji=null,this.#d()||this.#g()){this.#_(a),this.#_(r);for(const[d,p]of this.#u)Ac(d,p)}else{this.#n.size===0&&ln.delete(this),this.#i.clear(),this.#a.clear();for(const d of this.#e)d(this);this.#e.clear(),Zl(a),Zl(r),this.#r?.resolve()}var l=Ee;if(this.#t.length>0){const d=l??=this;d.#t.push(...this.#t.filter(p=>!d.#t.includes(p)))}l!==null&&(ln.add(l),l.#l()),ln.has(this)||this.#S()}#p(n,r,a){n.f^=Ue;for(var u=n.first;u!==null;){var c=u.f,l=(c&(Sn|kn))!==0,d=l&&(c&Ue)!==0,p=d||(c&Yt)!==0||this.#u.has(u);if(!p&&u.fn!==null){l?u.f^=Ue:(c&Zr)!==0?r.push(u):ni(u)&&((c&Xt)!==0&&this.#a.add(u),wr(u));var _=u.first;if(_!==null){u=_;continue}}for(;u!==null;){var R=u.next;if(R!==null){u=R;break}u=u.parent}}}#_(n){for(var r=0;r<n.length;r+=1)yc(n[r],this.#i,this.#a)}capture(n,r,a=!1){r!==Be&&!this.previous.has(n)&&this.previous.set(n,r),(n.f&Jr)===0&&(this.current.set(n,[n.v,a]),Pt?.set(n,n.v))}activate(){Ee=this}deactivate(){Ee=null,Pt=null}flush(){try{Da=!0,Ee=this,this.#l()}finally{Xl=0,Va=null,cr=null,ji=null,Da=!1,Ee=null,Pt=null,pn.clear()}}discard(){for(const n of this.#f)n(this);this.#f.clear(),ln.delete(this)}register_created_effect(n){this.#s.push(n)}#S(){for(const R of ln){var n=R.id<this.id,r=[];for(const[T,[E,y]]of this.current){if(R.current.has(T)){var a=R.current.get(T)[0];if(n&&E!==a)R.current.set(T,[E,y]);else continue}r.push(T)}var u=[...R.current.keys()].filter(T=>!this.current.has(T));if(u.length===0)n&&R.discard();else if(r.length>0){R.activate();var c=new Set,l=new Map;for(var d of r)Rc(d,u,c,l);l=new Map;var p=[...R.current.keys()].filter(T=>this.current.has(T)?this.current.get(T)[0]!==T:!0);for(const T of this.#s)(T.f&(gn|Yt|Ha))===0&&Xa(T,p,l)&&((T.f&(qa|Xt))!==0?(Te(T,Ge),R.schedule(T)):R.#i.add(T));if(R.#t.length>0){R.apply();for(var _ of R.#t)R.#p(_,[],[]);R.#t=[]}R.deactivate()}}for(const R of ln)R.#h.has(this)&&(R.#h.delete(this),R.#h.size===0&&!R.#d()&&(R.activate(),R.#l()))}increment(n,r){let a=this.#n.get(r)??0;if(this.#n.set(r,a+1),n){let u=this.#o.get(r)??0;this.#o.set(r,u+1)}}decrement(n,r,a){let u=this.#n.get(r)??0;if(u===1?this.#n.delete(r):this.#n.set(r,u-1),n){let c=this.#o.get(r)??0;c===1?this.#o.delete(r):this.#o.set(r,c-1)}this.#c||a||(this.#c=!0,gr(()=>{this.#c=!1,this.flush()}))}transfer_effects(n,r){for(const a of n)this.#i.add(a);for(const a of r)this.#a.add(a);n.clear(),r.clear()}oncommit(n){this.#e.add(n)}ondiscard(n){this.#f.add(n)}settled(){return(this.#r??=AS()).promise}static ensure(){if(Ee===null){const n=Ee=new Wn;Da||(ln.add(Ee),gr(()=>{Ee===n&&n.flush()}))}return Ee}apply(){{Pt=null;return}}schedule(n){if(Va=n,n.b?.is_pending&&(n.f&(Zr|wc|Ec))!==0&&(n.f&ei)===0){n.b.defer_effect(n);return}for(var r=n;r.parent!==null;){r=r.parent;var a=r.f;if(cr!==null&&r===pe&&(ue===null||(ue.f&Fe)===0))return;if((a&(kn|Sn))!==0){if((a&Ue)===0)return;r.f^=Ue}}this.#t.push(r)}}function BS(){try{IS()}catch(i){lr(i,Va)}}let Kt=null;function Zl(i){var n=i.length;if(n!==0){for(var r=0;r<n;){var a=i[r++];if((a.f&(gn|Yt))===0&&ni(a)&&(Kt=new Set,wr(a),a.deps===null&&a.first===null&&a.nodes===null&&a.teardown===null&&a.ac===null&&Fc(a),Kt?.size>0)){pn.clear();for(const u of Kt){if((u.f&(gn|Yt))!==0)continue;const c=[u];let l=u.parent;for(;l!==null;)Kt.has(l)&&(Kt.delete(l),c.push(l)),l=l.parent;for(let d=c.length-1;d>=0;d--){const p=c[d];(p.f&(gn|Yt))===0&&wr(p)}}Kt.clear()}}Kt=null}}function Rc(i,n,r,a){if(!r.has(i)&&(r.add(i),i.reactions!==null))for(const u of i.reactions){const c=u.f;(c&Fe)!==0?Rc(u,n,r,a):(c&(qa|Xt))!==0&&(c&Ge)===0&&Xa(u,n,a)&&(Te(u,Ge),Za(u))}}function Xa(i,n,r){const a=r.get(i);if(a!==void 0)return a;if(i.deps!==null)for(const u of i.deps){if(vr.call(n,u))return!0;if((u.f&Fe)!==0&&Xa(u,n,r))return r.set(u,!0),!0}return r.set(i,!1),!1}function Za(i){Ee.schedule(i)}function Ac(i,n){if(!((i.f&Sn)!==0&&(i.f&Ue)!==0)){(i.f&Ge)!==0?n.d.push(i):(i.f&Mt)!==0&&n.m.push(i),Te(i,Ue);for(var r=i.first;r!==null;)Ac(r,n),r=r.next}}function bc(i){Te(i,Ue);for(var n=i.first;n!==null;)bc(n),n=n.next}function GS(i){let n=0,r=ja(0),a;return()=>{eo()&&(fr(r),nw(()=>(n===0&&(a=cw(()=>i(()=>Kr(r)))),n+=1,()=>{gr(()=>{n-=1,n===0&&(a?.(),a=void 0,Kr(r))})})))}}var QS=as|us;function qS(i,n,r,a){new zS(i,n,r,a)}class zS{parent;is_pending=!1;transform_error;#e;#f=null;#n;#o;#r;#t=null;#s=null;#i=null;#a=null;#u=0;#c=0;#h=!1;#d=new Set;#g=new Set;#l=null;#p=GS(()=>(this.#l=ja(this.#u),()=>{this.#l=null}));constructor(n,r,a,u){this.#e=n,this.#n=r,this.#o=c=>{var l=pe;l.b=this,l.f|=ka,a(c)},this.parent=pe.b,this.transform_error=u??this.parent?.transform_error??(c=>c),this.#r=rw(()=>{this.#w()},QS)}#_(){try{this.#t=Ln(()=>this.#o(this.#e))}catch(n){this.error(n)}}#S(n){const r=this.#n.failed;r&&(this.#i=Ln(()=>{r(this.#e,()=>n,()=>()=>{})}))}#C(){const n=this.#n.pending;n&&(this.is_pending=!0,this.#s=Ln(()=>n(this.#e)),gr(()=>{var r=this.#a=document.createDocumentFragment(),a=Oc();r.append(a),this.#t=this.#v(()=>Ln(()=>this.#o(a))),this.#c===0&&(this.#e.before(r),this.#a=null,es(this.#s,()=>{this.#s=null}),this.#m(Ee))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#c=0,this.#u=0,this.#t=Ln(()=>{this.#o(this.#e)}),this.#c>0){var n=this.#a=document.createDocumentFragment();aw(this.#t,n);const r=this.#n.pending;this.#s=Ln(()=>r(this.#e))}else this.#m(Ee)}catch(r){this.error(r)}}#m(n){this.is_pending=!1,n.transfer_effects(this.#d,this.#g)}defer_effect(n){yc(n,this.#d,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#v(n){var r=pe,a=ue,u=xt;wn(this.#r),Ft(this.#r),os(this.#r.ctx);try{return Wn.ensure(),n()}catch(c){return Cc(c),null}finally{wn(r),Ft(a),os(u)}}#E(n,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(n,r);return}this.#c+=n,this.#c===0&&(this.#m(r),this.#s&&es(this.#s,()=>{this.#s=null}),this.#a&&(this.#e.before(this.#a),this.#a=null))}update_pending_count(n,r){this.#E(n,r),this.#u+=n,!(!this.#l||this.#h)&&(this.#h=!0,gr(()=>{this.#h=!1,this.#l&&Lc(this.#l,this.#u)}))}get_effect_pending(){return this.#p(),fr(this.#l)}error(n){var r=this.#n.onerror;let a=this.#n.failed;if(!r&&!a)throw n;this.#t&&(Dt(this.#t),this.#t=null),this.#s&&(Dt(this.#s),this.#s=null),this.#i&&(Dt(this.#i),this.#i=null);var u=!1,c=!1;const l=()=>{if(u){OS();return}u=!0,c&&US(),this.#i!==null&&es(this.#i,()=>{this.#i=null}),this.#v(()=>{this.#w()})},d=p=>{try{c=!0,r?.(p,l),c=!1}catch(_){lr(_,this.#r&&this.#r.parent)}a&&(this.#i=this.#v(()=>{try{return Ln(()=>{var _=pe;_.b=this,_.f|=ka,a(this.#e,()=>p,()=>l)})}catch(_){return lr(_,this.#r.parent),null}}))};gr(()=>{var p;try{p=this.transform_error(n)}catch(_){lr(_,this.#r&&this.#r.parent);return}p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(d,_=>lr(_,this.#r&&this.#r.parent)):d(p)})}}function KS(i){var n=i.effects;if(n!==null){i.effects=null;for(var r=0;r<n.length;r+=1)Dt(n[r])}}function YS(i){for(var n=i.parent;n!==null;){if((n.f&Fe)===0)return(n.f&gn)===0?n:null;n=n.parent}return null}function Ja(i){var n,r=pe;wn(YS(i));try{i.f&=~Hn,KS(i),n=Bc(i)}finally{wn(r)}return n}function Pc(i){var n=i.v,r=Ja(i);if(!i.equals(r)&&(i.wv=Wc(),(!Ee?.is_fork||i.deps===null)&&(i.v=r,Ee?.capture(i,n,!0),i.deps===null))){Te(i,Ue);return}Sr||(Pt!==null?(eo()||Ee?.is_fork)&&Pt.set(i,r):Ya(i))}function XS(i){if(i.effects!==null)for(const n of i.effects)(n.teardown||n.ac)&&(n.teardown?.(),n.ac?.abort(za),n.teardown=yS,n.ac=null,jr(n,0),to(n))}function Ic(i){if(i.effects!==null)for(const n of i.effects)n.teardown&&wr(n)}let Ba=new Set;const pn=new Map;let xc=!1;function ja(i,n){var r={f:0,v:i,reactions:null,equals:$S,rv:0,wv:0};return r}function cn(i,n){const r=ja(i);return ow(r),r}function Nn(i,n,r=!1){ue!==null&&(!It||(ue.f&Ha)!==0)&&ls()&&(ue.f&(Fe|Xt|qa|Ha))!==0&&(vt===null||!vr.call(vt,i))&&NS();let a=r?Gr(n):n;return Lc(i,a,ji)}function Lc(i,n,r=null){if(!i.equals(n)){var a=i.v;Sr?pn.set(i,n):pn.set(i,a),i.v=n;var u=Wn.ensure();if(u.capture(i,a),(i.f&Fe)!==0){const c=i;(i.f&Ge)!==0&&Ja(c),Pt===null&&Ya(c)}i.wv=Wc(),Nc(i,Ge,r),ls()&&pe!==null&&(pe.f&Ue)!==0&&(pe.f&(Sn|kn))===0&&(pt===null?uw([i]):pt.push(i)),!u.is_fork&&Ba.size>0&&!xc&&ZS()}return n}function ZS(){xc=!1;for(const i of Ba)(i.f&Ue)!==0&&Te(i,Mt),ni(i)&&wr(i);Ba.clear()}function Kr(i){Nn(i,i.v+1)}function Nc(i,n,r){var a=i.reactions;if(a!==null)for(var u=ls(),c=a.length,l=0;l<c;l++){var d=a[l],p=d.f;if(!(!u&&d===pe)){var _=(p&Ge)===0;if(_&&Te(d,n),(p&Fe)!==0){var R=d;Pt?.delete(R),(p&Hn)===0&&(p&mt&&(d.f|=Hn),Nc(R,Mt,r))}else if(_){var T=d;(p&Xt)!==0&&Kt!==null&&Kt.add(T),r!==null?r.push(T):Za(T)}}}}function Gr(i){if(typeof i!="object"||i===null||$a in i)return i;const n=TS(i);if(n!==ES&&n!==CS)return i;var r=new Map,a=mS(i),u=cn(0),c=Fn,l=d=>{if(Fn===c)return d();var p=ue,_=Fn;Ft(null),ec(c);var R=d();return Ft(p),ec(_),R};return a&&r.set("length",cn(i.length)),new Proxy(i,{defineProperty(d,p,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&xS();var R=r.get(p);return R===void 0?l(()=>{var T=cn(_.value);return r.set(p,T),T}):Nn(R,_.value,!0),!0},deleteProperty(d,p){var _=r.get(p);if(_===void 0){if(p in d){const R=l(()=>cn(Be));r.set(p,R),Kr(u)}}else Nn(_,Be),Kr(u);return!0},get(d,p,_){if(p===$a)return i;var R=r.get(p),T=p in d;if(R===void 0&&(!T||zr(d,p)?.writable)&&(R=l(()=>{var y=Gr(T?d[p]:Be),I=cn(y);return I}),r.set(p,R)),R!==void 0){var E=fr(R);return E===Be?void 0:E}return Reflect.get(d,p,_)},getOwnPropertyDescriptor(d,p){var _=Reflect.getOwnPropertyDescriptor(d,p);if(_&&"value"in _){var R=r.get(p);R&&(_.value=fr(R))}else if(_===void 0){var T=r.get(p),E=T?.v;if(T!==void 0&&E!==Be)return{enumerable:!0,configurable:!0,value:E,writable:!0}}return _},has(d,p){if(p===$a)return!0;var _=r.get(p),R=_!==void 0&&_.v!==Be||Reflect.has(d,p);if(_!==void 0||pe!==null&&(!R||zr(d,p)?.writable)){_===void 0&&(_=l(()=>{var E=R?Gr(d[p]):Be,y=cn(E);return y}),r.set(p,_));var T=fr(_);if(T===Be)return!1}return R},set(d,p,_,R){var T=r.get(p),E=p in d;if(a&&p==="length")for(var y=_;y<T.v;y+=1){var I=r.get(y+"");I!==void 0?Nn(I,Be):y in d&&(I=l(()=>cn(Be)),r.set(y+"",I))}if(T===void 0)(!E||zr(d,p)?.writable)&&(T=l(()=>cn(void 0)),Nn(T,Gr(_)),r.set(p,T));else{E=T.v!==Be;var N=l(()=>Gr(_));Nn(T,N)}var H=Reflect.getOwnPropertyDescriptor(d,p);if(H?.set&&H.set.call(R,_),!E){if(a&&typeof p=="string"){var W=r.get("length"),ie=Number(p);Number.isInteger(ie)&&ie>=W.v&&Nn(W,ie+1)}Kr(u)}return!0},ownKeys(d){fr(u);var p=Reflect.ownKeys(d).filter(T=>{var E=r.get(T);return E===void 0||E.v!==Be});for(var[_,R]of r)R.v!==Be&&!(_ in d)&&p.push(_);return p},setPrototypeOf(){LS()}})}var Jl,Uc;function JS(){if(Jl===void 0){Jl=window;var i=Element.prototype,n=Node.prototype,r=Text.prototype;zr(n,"firstChild").get,Uc=zr(n,"nextSibling").get,Kl(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Kl(r)&&(r.__t=void 0)}}function Oc(i=""){return document.createTextNode(i)}function $c(i){return Uc.call(i)}function Dc(i){var n=ue,r=pe;Ft(null),wn(null);try{return i()}finally{Ft(n),wn(r)}}function jS(i,n){var r=n.last;r===null?n.last=n.first=i:(r.next=i,i.prev=r,n.last=i)}function ti(i,n){var r=pe;r!==null&&(r.f&Yt)!==0&&(i|=Yt);var a={ctx:xt,deps:null,nodes:null,f:i|Ge|mt,first:null,fn:n,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};Ee?.register_created_effect(a);var u=a;if((i&Zr)!==0)cr!==null?cr.push(a):Wn.ensure().schedule(a);else if(n!==null){try{wr(a)}catch(l){throw Dt(a),l}u.deps===null&&u.teardown===null&&u.nodes===null&&u.first===u.last&&(u.f&us)===0&&(u=u.first,(i&Xt)!==0&&(i&as)!==0&&u!==null&&(u.f|=as))}if(u!==null&&(u.parent=r,r!==null&&jS(u,r),ue!==null&&(ue.f&Fe)!==0&&(i&kn)===0)){var c=ue;(c.effects??=[]).push(u)}return a}function eo(){return ue!==null&&!It}function ew(i){return ti(Zr|PS,i)}function tw(i){Wn.ensure();const n=ti(kn|us,i);return(r={})=>new Promise(a=>{r.outro?es(n,()=>{Dt(n),a(void 0)}):(Dt(n),a(void 0))})}function nw(i,n=0){return ti(wc|n,i)}function rw(i,n=0){var r=ti(Xt|n,i);return r}function Ln(i){return ti(Sn|us,i)}function Mc(i){var n=i.teardown;if(n!==null){const r=Sr,a=ue;jl(!0),Ft(null);try{n.call(null)}finally{jl(r),Ft(a)}}}function to(i,n=!1){var r=i.first;for(i.first=i.last=null;r!==null;){const u=r.ac;u!==null&&Dc(()=>{u.abort(za)});var a=r.next;(r.f&kn)!==0?r.parent=null:Dt(r,n),r=a}}function iw(i){for(var n=i.first;n!==null;){var r=n.next;(n.f&Sn)===0&&Dt(n),n=r}}function Dt(i,n=!0){var r=!1;(n||(i.f&bS)!==0)&&i.nodes!==null&&i.nodes.end!==null&&(sw(i.nodes.start,i.nodes.end),r=!0),Te(i,Yl),to(i,n&&!r),jr(i,0);var a=i.nodes&&i.nodes.t;if(a!==null)for(const c of a)c.stop();Mc(i),i.f^=Yl,i.f|=gn;var u=i.parent;u!==null&&u.first!==null&&Fc(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=i.b=null}function sw(i,n){for(;i!==null;){var r=i===n?null:$c(i);i.remove(),i=r}}function Fc(i){var n=i.parent,r=i.prev,a=i.next;r!==null&&(r.next=a),a!==null&&(a.prev=r),n!==null&&(n.first===i&&(n.first=a),n.last===i&&(n.last=r))}function es(i,n,r=!0){var a=[];kc(i,a,!0);var u=()=>{r&&Dt(i),n&&n()},c=a.length;if(c>0){var l=()=>--c||u();for(var d of a)d.out(l)}else u()}function kc(i,n,r){if((i.f&Yt)===0){i.f^=Yt;var a=i.nodes&&i.nodes.t;if(a!==null)for(const d of a)(d.is_global||r)&&n.push(d);for(var u=i.first;u!==null;){var c=u.next,l=(u.f&as)!==0||(u.f&Sn)!==0&&(i.f&Xt)!==0;kc(u,n,l?r:!1),u=c}}}function aw(i,n){if(i.nodes)for(var r=i.nodes.start,a=i.nodes.end;r!==null;){var u=r===a?null:$c(r);n.append(r),r=u}}let ts=!1,Sr=!1;function jl(i){Sr=i}let ue=null,It=!1;function Ft(i){ue=i}let pe=null;function wn(i){pe=i}let vt=null;function ow(i){ue!==null&&(vt===null?vt=[i]:vt.push(i))}let Ze=null,at=0,pt=null;function uw(i){pt=i}let Hc=1,On=0,Fn=On;function ec(i){Fn=i}function Wc(){return++Hc}function ni(i){var n=i.f;if((n&Ge)!==0)return!0;if(n&Fe&&(i.f&=~Hn),(n&Mt)!==0){for(var r=i.deps,a=r.length,u=0;u<a;u++){var c=r[u];if(ni(c)&&Pc(c),c.wv>i.wv)return!0}(n&mt)!==0&&Pt===null&&Te(i,Ue)}return!1}function Vc(i,n,r=!0){var a=i.reactions;if(a!==null&&!(vt!==null&&vr.call(vt,i)))for(var u=0;u<a.length;u++){var c=a[u];(c.f&Fe)!==0?Vc(c,n,!1):n===c&&(r?Te(c,Ge):(c.f&Ue)!==0&&Te(c,Mt),Za(c))}}function Bc(i){var n=Ze,r=at,a=pt,u=ue,c=vt,l=xt,d=It,p=Fn,_=i.f;Ze=null,at=0,pt=null,ue=(_&(Sn|kn))===0?i:null,vt=null,os(i.ctx),It=!1,Fn=++On,i.ac!==null&&(Dc(()=>{i.ac.abort(za)}),i.ac=null);try{i.f|=Wa;var R=i.fn,T=R();i.f|=ei;var E=i.deps,y=Ee?.is_fork;if(Ze!==null){var I;if(y||jr(i,at),E!==null&&at>0)for(E.length=at+Ze.length,I=0;I<Ze.length;I++)E[at+I]=Ze[I];else i.deps=E=Ze;if(eo()&&(i.f&mt)!==0)for(I=at;I<E.length;I++)(E[I].reactions??=[]).push(i)}else!y&&E!==null&&at<E.length&&(jr(i,at),E.length=at);if(ls()&&pt!==null&&!It&&E!==null&&(i.f&(Fe|Mt|Ge))===0)for(I=0;I<pt.length;I++)Vc(pt[I],i);if(u!==null&&u!==i){if(On++,u.deps!==null)for(let N=0;N<r;N+=1)u.deps[N].rv=On;if(n!==null)for(const N of n)N.rv=On;pt!==null&&(a===null?a=pt:a.push(...pt))}return(i.f&Jr)!==0&&(i.f^=Jr),T}catch(N){return Cc(N)}finally{i.f^=Wa,Ze=n,at=r,pt=a,ue=u,vt=c,os(l),It=d,Fn=p}}function lw(i,n){let r=n.reactions;if(r!==null){var a=vS.call(r,i);if(a!==-1){var u=r.length-1;u===0?r=n.reactions=null:(r[a]=r[u],r.pop())}}if(r===null&&(n.f&Fe)!==0&&(Ze===null||!vr.call(Ze,n))){var c=n;(c.f&mt)!==0&&(c.f^=mt,c.f&=~Hn),Ya(c),XS(c),jr(c,0)}}function jr(i,n){var r=i.deps;if(r!==null)for(var a=n;a<r.length;a++)lw(i,r[a])}function wr(i){var n=i.f;if((n&gn)===0){Te(i,Ue);var r=pe,a=ts;pe=i,ts=!0;try{(n&(Xt|Ec))!==0?iw(i):to(i),Mc(i);var u=Bc(i);i.teardown=typeof u=="function"?u:null,i.wv=Hc;var c;_S&&DS&&(i.f&Ge)!==0&&i.deps}finally{ts=a,pe=r}}}function fr(i){var n=i.f,r=(n&Fe)!==0;if(ue!==null&&!It){var a=pe!==null&&(pe.f&gn)!==0;if(!a&&(vt===null||!vr.call(vt,i))){var u=ue.deps;if((ue.f&Wa)!==0)i.rv<On&&(i.rv=On,Ze===null&&u!==null&&u[at]===i?at++:Ze===null?Ze=[i]:Ze.push(i));else{(ue.deps??=[]).push(i);var c=i.reactions;c===null?i.reactions=[ue]:vr.call(c,ue)||c.push(ue)}}}if(Sr&&pn.has(i))return pn.get(i);if(r){var l=i;if(Sr){var d=l.v;return((l.f&Ue)===0&&l.reactions!==null||Qc(l))&&(d=Ja(l)),pn.set(l,d),d}var p=(l.f&mt)===0&&!It&&ue!==null&&(ts||(ue.f&mt)!==0),_=(l.f&ei)===0;ni(l)&&(p&&(l.f|=mt),Pc(l)),p&&!_&&(Ic(l),Gc(l))}if(Pt?.has(i))return Pt.get(i);if((i.f&Jr)!==0)throw i.v;return i.v}function Gc(i){if(i.f|=mt,i.deps!==null)for(const n of i.deps)(n.reactions??=[]).push(i),(n.f&Fe)!==0&&(n.f&mt)===0&&(Ic(n),Gc(n))}function Qc(i){if(i.v===Be)return!0;if(i.deps===null)return!1;for(const n of i.deps)if(pn.has(n)||(n.f&Fe)!==0&&Qc(n))return!0;return!1}function cw(i){var n=It;try{return It=!0,i()}finally{It=n}}const fw=["touchstart","touchmove"];function hw(i){return fw.includes(i)}const Xi=Symbol("events"),dw=new Set,tc=new Set;let nc=null;function rc(i){var n=this,r=n.ownerDocument,a=i.type,u=i.composedPath?.()||[],c=u[0]||i.target;nc=i;var l=0,d=nc===i&&i[Xi];if(d){var p=u.indexOf(d);if(p!==-1&&(n===document||n===window)){i[Xi]=n;return}var _=u.indexOf(n);if(_===-1)return;p<=_&&(l=p)}if(c=u[l]||i.target,c!==n){wS(i,"currentTarget",{configurable:!0,get(){return c||r}});var R=ue,T=pe;Ft(null),wn(null);try{for(var E,y=[];c!==null;){var I=c.assignedSlot||c.parentNode||c.host||null;try{var N=c[Xi]?.[a];N!=null&&(!c.disabled||i.target===c)&&N.call(c,i)}catch(H){E?y.push(H):E=H}if(i.cancelBubble||I===n||I===null)break;c=I}if(E){for(let H of y)queueMicrotask(()=>{throw H});throw E}}finally{i[Xi]=n,delete i.currentTarget,Ft(R),wn(T)}}}function gw(i,n){return pw(i,n)}const Zi=new Map;function pw(i,{target:n,anchor:r,props:a={},events:u,context:c,intro:l=!0,transformError:d}){JS();var p=void 0,_=tw(()=>{var R=r??n.appendChild(Oc());qS(R,{pending:()=>{}},y=>{FS({});var I=xt;c&&(I.c=c),u&&(a.$$events=u),p=i(y,a)||{},kS()},d);var T=new Set,E=y=>{for(var I=0;I<y.length;I++){var N=y[I];if(!T.has(N)){T.add(N);var H=hw(N);for(const Oe of[n,document]){var W=Zi.get(Oe);W===void 0&&(W=new Map,Zi.set(Oe,W));var ie=W.get(N);ie===void 0?(Oe.addEventListener(N,rc,{passive:H}),W.set(N,1)):W.set(N,ie+1)}}}};return E(SS(dw)),tc.add(E),()=>{for(var y of T)for(const H of[n,document]){var I=Zi.get(H),N=I.get(y);--N==0?(H.removeEventListener(y,rc),I.delete(y),I.size===0&&Zi.delete(H)):I.set(y,N)}tc.delete(E),R!==r&&R.parentNode?.removeChild(R)}});return _w.set(p,_),p}let _w=new WeakMap;const mw="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(mw);MS();function vw(i){}const Ga={init:i=>{te.get(Mn).enableRouting()},handlePageErrorHandler:(i,n,r)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)n.viewUrl=i.viewUrl,r.getEngine()._ui.updateMainContent(n,r);else if(i.errorFn)i.errorFn(n);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const a=i.redirectPath||"/";r.navigation().navigate(a)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const r=window.open(i.url,"_blank","noopener noreferrer");r&&(r.opener=null,r.focus())}},async addSearchParamsFromClient(i,n,r){const a=te.get(vn),u=M.getCurrentPath(r.getConfig().routing?.useHashRouting),l=(await a.getCurrentNode(u.path))?.clientPermissions?.urlParameters,d={...i};if(l){const p={};Object.keys(l).forEach(_=>{_ in d&&l[_]?.write===!0&&(p[_]=d[_],delete d[_])});for(const _ in d)console.warn(`No permission to add the search param "${_}" to the url`);Object.keys(p).length>0&&r.routing().addSearchParams(p,n)}}},$t={luigi:{},init:i=>{console.log("Init communication..."),$t.luigi=i},addListeners:(i,n)=>{i.addEventListener(U.INITIALIZED,r=>{Pe.luigi?.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(U.NAVIGATION_REQUEST,r=>{const{drawer:a,link:u,preserveView:c,modal:l,newTab:d,withoutSync:p,preventContextUpdate:_,preventHistoryEntry:R,fromVirtualTreeRoot:T,fromContext:E,fromClosestContext:y,fromParent:I,relative:N,nodeParams:H}=r.detail,W={drawerSettings:a,modalSettings:l,newTab:d,path:u,preserveView:c,preventContextUpdate:_,options:{fromVirtualTreeRoot:T,fromContext:E,fromClosestContext:y,fromParent:I,relative:N,nodeParams:H},preventHistoryEntry:R,withoutSync:p};te.get(vn).handleNavigationRequest(W,r.callbackFn)}),i.addEventListener(U.RUNTIME_ERROR_HANDLING_REQUEST,r=>{n.navigation().runTimeErrorHandler(r.payload?.data?.errorObj||{})}),i.addEventListener(U.ALERT_REQUEST,r=>{Pe.processAlert(r.payload,!0,i)}),i.addEventListener(U.SHOW_CONFIRMATION_MODAL_REQUEST,r=>{Pe.handleConfirmationModalRequest(r.payload,i)}),i.addEventListener(U.SET_DOCUMENT_TITLE_REQUEST,r=>{$t.luigi.getEngine()._connector?.setDocumentTitle(r.detail.title)}),i.addEventListener(U.SHOW_LOADING_INDICATOR_REQUEST,r=>{$t.luigi.getEngine()._connector?.showLoadingIndicator(i.parentNode)}),i.addEventListener(U.HIDE_LOADING_INDICATOR_REQUEST,r=>{$t.luigi.getEngine()._connector?.hideLoadingIndicator(i.parentNode)}),i.addEventListener(U.ADD_BACKDROP_REQUEST,r=>{$t.luigi.getEngine()._connector?.addBackdrop()}),i.addEventListener(U.REMOVE_BACKDROP_REQUEST,r=>{$t.luigi.getEngine()._connector?.removeBackdrop()}),i.addEventListener(U.SET_DIRTY_STATUS_REQUEST,r=>{Pe.handleDirtyStatusRequest(r.detail?.data?.dirty,r.detail?.source)}),i.addEventListener(U.ADD_NODE_PARAMS_REQUEST,r=>{n.routing().addNodeParams(r.payload.data,r.payload.keepBrowserHistory)}),i.addEventListener(U.OPEN_USER_SETTINGS_REQUEST,r=>{$t.luigi.getEngine()._connector?.openUserSettings(r.detail)}),i.addEventListener(U.CLOSE_USER_SETTINGS_REQUEST,r=>{$t.luigi.getEngine()._connector?.closeUserSettings()}),i.addEventListener(U.ADD_SEARCH_PARAMS_REQUEST,r=>{Ga.addSearchParamsFromClient(r.detail.data,r.detail.keepBrowserHistory,n)}),i.addEventListener(U.UPDATE_MODAL_SETTINGS_REQUEST,r=>{ne.updateModalSettings(r.payload.updatedModalSettings,r.payload.addHistoryEntry,n)}),i.addEventListener(U.SET_CURRENT_LOCALE_REQUEST,r=>{n.i18n().setCurrentLocale(r.detail?.data?.data?.currentLocale,i)})}};class Sw{constructor(){this._ui=ne,this._comm=$t,this._ux=Pe,this._routing=Ga}bootstrap(n){this._app=gw(vw,{target:document.body}),this._connector=n}init(){const n=window.Luigi;te.register(ss,()=>new ss),te.register(vn,()=>new vn(n)),te.register(_n,()=>new _n),te.register(Mn,()=>new Mn(n)),te.register(mr,()=>new mr),te.register(mn,()=>new mn(n)),n.theming()._init(),ne.init(n),Ga.init(n),$t.init(n),Pe.init(n)}}window.Luigi=new pS(new Sw);
|
|
54
|
+
Please refer to documentation`),[T]}}buildVirtualViewUrl(n,r,a){let u="";for(const l in r)l.startsWith("virtualSegment")&&(u+=":"+l+"/");if(!a)return n;u+=":virtualSegment_"+a+"/";let c=n;n.includes("{virtualTreePath}")?c=n.replace("{virtualTreePath}",u):c=n+"/"+u;try{if(new URL(c,"http://dummy-base").origin===new URL(n,"http://dummy-base").origin)return c}catch(l){console.error("Error building virtual view URL -- make sure virtualTreePath is not part of origin.",l)}return n}async buildPath(n,r){const{fromVirtualTreeRoot:a,fromContext:u,fromClosestContext:c,fromParent:l,relative:d,nodeParams:p}=r,_=this.luigi.getConfigValue("routing.useHashRouting"),{path:R,query:T}=M.getCurrentPath(_),E=R+(T?"?"+T:""),y=await this.getPathData(E),I=y.nodesInPath;let N=n;if(I===void 0)return console.warn("No nodes in path found for current path:",E),N;if(a){N="";const H=[...I].map((W,ie)=>W.virtualTree?ie:-1).filter(W=>W!==-1).pop();I.forEach((W,ie)=>{W.pathSegment&&(H===void 0||ie<=H)&&(N+="/"+W.pathSegment)}),N+="/"+n}else if(u){const H=u,W=[...I].reverse().find(ie=>H===ie.navigationContext);N=M.concatenatePath(M.getSubPath(W,y.pathParams),n)}else if(c){const H=[...I].reverse().find(W=>W.navigationContext&&W.navigationContext.length>0);N=M.concatenatePath(M.getSubPath(H,y.pathParams),n)}else l?N=M.concatenatePath(M.getSubPath(y.selectedNode?.parent,y.pathParams),n):d&&(N=M.concatenatePath(M.getSubPath(y.selectedNode,y.pathParams),n));return p&&Object.keys(p).length>0&&(N+=N.includes("?")?"&":"?",Object.entries(p).forEach((H,W)=>{N+=encodeURIComponent(M.getContentViewParamPrefix(this.luigi)+H[0])+"="+encodeURIComponent(H[1])+(W<Object.keys(p).length-1?"&":"")})),N}}class Mn{constructor(n){this.luigi=n}getNavigationService(){return this.navigationService||(this.navigationService=te.get(vn)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const n=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||n).filter(a=>location.href.match(a)).length!==0}enableRouting(){const n=this.luigi.getConfig();console.log("Init Routing...",n.routing),n.routing?.useHashRouting?(window.addEventListener("hashchange",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(M.getCurrentPath(!0),u,a)}),this.handleRouteChange(M.getCurrentPath(!0))):(window.addEventListener("popstate",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(M.getCurrentPath(),u,a)}),this.handleRouteChange(M.getCurrentPath()))}async handleRouteChange(n,r=!1,a=!1){const u=n.path,c=n.query,l=u+(c?"?"+c:""),d=new URLSearchParams(c),p=Object.create(null);if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(l),await this.shouldShowModalPathInUrl(n),d.forEach((I,N)=>{p[N]=I}),this.checkInvalidateCache(this.previousPathData,u);const _=await this.getNavigationService().getPathData(u);this.previousPathData=_;const R=M.filterNodeParams(p,this.luigi),T=D.getPathWithoutHash(u);this.currentRoute={raw:window.location.href,path:u,nodeParams:R};const E=_?.selectedNode??await this.getNavigationService().getCurrentNode(u),y=E?.viewUrl||"";if(!await this.handlePageNotFound(E,y,_,u,T)&&(this.luigi.getEngine()._connector?.renderTopNav(await this.getNavigationService().getTopNavData(u,_)),this.luigi.getEngine()._connector?.renderLeftNav(await this.getNavigationService().getLeftNavData(u,_)),this.luigi.getEngine()._connector?.renderTabNav(await this.getNavigationService().getTabNavData(u,_)),E)){const I={nodeParams:R||{},pathParams:_?.pathParams||{},searchParams:M.prepareSearchParamsForClient(E,this.luigi)};this.currentRoute.node=E,this.getNavigationService().onNodeChange(this.previousNode,E),this.previousNode=E,ne.updateMainContent(E,this.luigi,I,r,a)}}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(n){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(n)}async handleBookmarkableModalPath(n){const r=te.get(vn),a=te.get(mn),u=new URLSearchParams(n?.query||""),c=M.getModalViewParamName(this.luigi),l=u.get(c);if(l){const d=u.get(`${c}Params`);try{const p=JSON.parse(d||"{}"),{nodeObject:_}=await r.extractDataFromPath(l);document.querySelector(".lui-modal luigi-container")?this.luigi.getEngine()._connector?.updateModalSettings(p):this.luigi.navigation().openAsModal(l,p||_.openNodeInModal)}catch(p){console.error("Error parsing modal settings from URL parameters",p)}}else{a.closeModals();return}}appendModalDataToUrl(n,r){const a=M.getHashQueryParamSeparator(),u=M.getQueryParams(this.luigi),c=M.getModalViewParamName(this.luigi),l=u[c],d=new URL(location.href),p=this.luigi.getConfigValue("routing.useHashRouting");let _=history.state,R,T;if(p){let[E,y]=d.hash.split("?");R=E,T=M.getURLWithoutModalData(y,c),T&&(R+="?"+T)}else R=d.pathname,T=M.getURLWithoutModalData(d.search,c),T&&(R+="?"+M.getURLWithoutModalData(d.search,c));if(_=M.handleHistoryState(_,R),l!==n){if(u[c]=n,r&&Object.keys(r).length&&(u[`${c}Params`]=JSON.stringify(r)),p){const E=location.hash.indexOf(a);E!==-1&&(d.hash=d.hash.slice(0,E)),d.hash=`${d.hash}${a}${M.encodeParams(u)}`}else d.search=`?${M.encodeParams(u)}`;history.pushState(_,"",d.href)}else{const E=new URL(d);if(p){let y=E.hash.split("?")[0];E.hash=y,T&&(E.hash+="?"+T)}else E.search=T;history.replaceState({},"",E.href),history.pushState(_,"",d.href)}}removeModalDataFromUrl(n){const r=M.getQueryParams(this.luigi),a=M.getModalViewParamName(this.luigi);let u=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let l={};r[a]&&(l[a]=r[a]),r[`${a}Params`]&&(l[`${a}Params`]=r[`${a}Params`]);let d=M.encodeParams(l);u.hash.includes(`?${d}`)?u.hash=u.hash.replace(`?${d}`,""):u.hash.includes(`&${d}`)&&(u.hash=u.hash.replace(`&${d}`,""))}else{let l=new URLSearchParams(u.search.slice(1));l.delete(a),l.delete(`${a}Params`);let d="";Array.from(l.keys()).forEach(p=>{d+=(d===""?"?":"&")+p+"="+l.get(p)}),u.search=d}if(history.state&&history.state.modalHistoryLength>=0&&n){history.state.modalHistoryLength;const l=history.state.pathBeforeHistory;let d=!1;if(window.addEventListener("popstate",p=>{d?(history.replaceState({},"",l),history.pushState({},"",l),history.back()):(history.pushState({},"",l),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const p=history.length-1;d=!0,history.go(-p),window.Luigi.preventLoadingModalData=!0}else{const p=history.state.modalHistoryLength;history.go(-p)}}else history.pushState({},"",u.href)}setFeatureToggle(n){const r=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),a=this.luigi.featureToggles();r&&typeof n=="string"&&M.setFeatureToggles(r,n,a)}updateModalDataInUrl(n,r,a){let u=M.getHashQueryParamSeparator();const c=M.getQueryParams(this.luigi),l=M.getModalViewParamName(this.luigi);c[l]=n,r&&Object.keys(r).length&&(c[`${l}Params`]=JSON.stringify(r));const d=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const _=location.hash.indexOf(u);_!==-1&&(d.hash=d.hash.slice(0,_)),d.hash=`${d.hash}${u}${M.encodeParams(c)}`}else d.search=`?${M.encodeParams(c)}`;a?history.pushState(window.state,"",d.href):history.replaceState(window.state,"",d.href)}checkInvalidateCache(n,r){if(!n)return;const a=te.get(_n);let u=r.split("/");if(n.nodesInPath&&n.nodesInPath.length>0){let c=n.nodesInPath.slice(1),l=!0;for(let d=0;d<c.length;d++){let p=u.length>d?u[d]:void 0,_=c[d];if(p!==_.pathSegment||!l)if(M.isDynamicNode(_)){if(!l||p!==M.getDynamicNodeValue(_,n.pathParams)){a.deleteNodesRecursively(_);break}}else l=!1}}else a.deleteCache()}async handlePageNotFound(n,r,a,u,c){const l=D.getTrimmedUrl(u),d=M.isExistingRoute(l,a);if(!r&&!n?.compound||n?.tabNav?.showAsTabHeader){const p=await M.getDefaultChildNode(a,async(_,R)=>await this.getNavigationService().getChildren(_,R));if(d){const _=D.getTrimmedUrl(u);return this.getNavigationService().handleNavigationRequest({path:`${_?`/${_}`:""}/${p}`,preserveView:void 0,modalSettings:void 0,newTab:!1,withoutSync:!1,preventContextUpdate:!1,preventHistoryEntry:!0}),!1}else{if(p&&a?.nodesInPath&&a.nodesInPath.length>1)return this.showPageNotFoundError(D.trimTrailingSlash(l||"")+"/"+p,c,!0),!0;const _=await M.getDefaultChildNode(a);this.showPageNotFoundError(_,c,!1)}return!0}return d?!1:(this.showPageNotFoundError(a.matchedPath,c,!0),!0)}async showPageNotFoundError(n,r,a=!1){const u=M.getPageNotFoundRedirectResult(r,a,this.luigi);if(u.ignoreLuigiErrorHandling)return;const c=u.path;if(c){if(u.keepURL){const l=this.luigi.getConfig().routing?.useHashRouting,d=M.getCurrentPath(l);d.path=c,this.handleRouteChange(d)}else this.getNavigationService().handleNavigationRequest({path:c});return}M.showRouteNotFoundAlert(r,a,this.luigi),this.getNavigationService().handleNavigationRequest({path:D.addLeadingSlash(n)})}}class mr{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(n){this.decorators=this.decorators.filter(r=>r.uid!==n.uid).concat(n)}applyDecorators(n,r){if(!n)return n;const a=new URL(D.prependOrigin(n)),u=this.decorators.filter(c=>c.type==="queryString");for(let c=0;c<u.length;c++){const l=u[c];a.searchParams.has(l.key)&&a.searchParams.delete(l.key);const d=l.valueFn();a.searchParams.append(l.key,d)}return r&&(a.search=decodeURIComponent(a.search)),a.href}}const Oa=async(i,n,r)=>{const a=await n.readUserSettings(),c=i.userSettingsGroup&&typeof a=="object"&&a!==null&&i.userSettingsGroup?a[i.userSettingsGroup]:null,l=r?.nodeParams||{},d=r?.pathParams||{},p=r?.searchParams||{};if(i.webcomponent&&i.viewUrl&&!M.checkWCUrl(i.viewUrl,n))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const _=document.createElement("luigi-compound-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.compoundConfig=i.compound,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=Ce.findVirtualTreeRootNode(i),n.getEngine()._comm.addListeners(_,n),_}else{const _=document.createElement("luigi-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.cssVariables=await n.theming().getCSSVariables(),_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=Ce.findVirtualTreeRootNode(i),vc(_,n),Sc(_,n),n.getEngine()._comm.addListeners(_,n),_.luigiMfId=D.getRandomId(),_}},vc=(i,n)=>{const r=n.getConfigValue("settings.customSandboxRules");if(!r?.length)return;const a=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],u=r?[...new Set([...a,...r])]:a;i.sandboxRules=u},Sc=(i,n)=>{const r=n.getConfigValue("settings.allowRules");r?.length&&(r.forEach((a,u)=>{r[u]=a+(a.indexOf(";")!=-1?"":";")}),i.allowRules=r)},ne={navService:void 0,routingService:void 0,luigi:void 0,modalContainer:[],drawerContainer:void 0,init:i=>{console.log("Init UI..."),ne.navService=te.get(vn),ne.routingService=te.get(Mn),ne.luigi=i,i.getEngine()._connector?.renderMainLayout()},update:async i=>{const n=ne.routingService.getCurrentRoute();if(!n)return;const r=!i||i.length===0;(r||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&ne.luigi.getEngine()._connector?.renderTopNav(await ne.navService.getTopNavData(n.path)),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(te.get(_n).deleteCache(),ne.luigi.getEngine()._connector?.renderLeftNav(await ne.navService.getLeftNavData(n.path)),ne.luigi.getEngine()._connector?.renderTabNav(await ne.navService.getTabNavData(n.path))),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(te.get(_n).deleteCache(),n.node&&ne.updateMainContent(n.node,ne.luigi))},updateMainContent:async(i,n,r,a,u)=>{const c=await n.readUserSettings(),d=i.userSettingsGroup&&typeof c=="object"&&c!==null&&i.userSettingsGroup?c[i.userSettingsGroup]:null,p=n.getEngine()._connector?.getContainerWrapper();n.getEngine()._connector?.hideLoadingIndicator(p);const _=r?.nodeParams||{},R=r?.pathParams||{},T=r?.searchParams||{};if(i&&p){let E,y;if((i.virtualTree||i._virtualTree)&&(y=Ce.findVirtualTreeRootNode(i)),[...p.childNodes].forEach(I=>{I.tagName?.indexOf("LUIGI-")===0&&(I.viewGroup&&i.viewGroup!==I.viewGroup?I.style.display="none":I.viewGroup||I.virtualTree&&y===I.virtualTreeRootNode?E=I:I.remove())}),E)a||(E.style.display="block",E.viewurl=i.viewUrl?te.get(mr).applyDecorators(M.substituteViewUrl(i,R,n),i.decodeViewUrl??!1):"",E.nodeParams=_,E.pathParams=R,E.clientPermissions=i.clientPermissions,E.searchParams=T,E.locale=n.i18n().getCurrentLocale(),E.theme=n.theming().getCurrentTheme(),E.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),E.userSettingsGroup=i.userSettingsGroup,E.userSettings=d,vc(E,n),Sc(E,n)),u||E.updateContext(i.context||{});else{const I=await Oa(i,n,r);p?.appendChild(I);const N=n.getEngine()._connector;i.loadingIndicator?.enabled!==!1&&N?.showLoadingIndicator(p)}}},openModal:async(i,n,r,a)=>{const u=await Oa(n,i);ne.modalContainer.push(u);const c=te.get(Mn),l=te.get(mn);let d=!1,p,_;const T=new Promise(I=>{p=()=>{d||(d=!0,I(),l.removeLastModalFromStack())},_=()=>{p&&p(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},u.addEventListener(U.CLOSE_CURRENT_MODAL_REQUEST,_)}),E={closePromise:T,resolveFn:p,onCloseRequestHandler:_,onInternalClose:()=>{try{E.resolveFn&&E.resolveFn()}catch(I){console.warn("onInternalClose failed",I)}},modalsettings:r};l.registerModal(E),i.getEngine()._connector?.renderModal(u,r,()=>{a?.(),l.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},()=>T);const y=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&y?.showLoadingIndicator(u.parentElement)},updateModalSettings:(i,n,r)=>{const a=te.get(mn);if(a.getModalStackLength()===0)return;a.updateFirstModalSettings(i);const u=te.get(Mn),c=M.getModalPathFromPath(r);c&&u.updateModalDataInUrl(c,a.getModalSettings(),n),r.getEngine()._connector?.updateModalSettings(a.getModalSettings())},openDrawer:async(i,n,r,a)=>{const u=await Oa(n,i);ne.drawerContainer=u,i.getEngine()._connector?.renderDrawer(u,r,a);const c=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&c?.showLoadingIndicator(u.parentElement)}},sS={getMicrofrontendsInDom(i){return[...this.getMainMicrofrontends(i).map(n=>({container:n.iframe,active:n.active,type:"main",id:n.id})),...this.getModalMicrofrontends().map(n=>({container:n.iframe,active:n.active,type:"modal",id:n.id})),...(()=>{const n=this.getDrawerMicrofrontends();return n.iframe?[{container:n.iframe,active:n.active,type:"drawer",id:n.id}]:[]})()]},getMainMicrofrontends(i){const n=i.getEngine()._connector?.getContainerWrapper();if(!n)return[];const r=[];for(const a of n.childNodes)if(a.tagName?.startsWith("LUIGI-"))if(a.iframeHandle?.iframe)r.push({iframe:a.iframeHandle.iframe,id:a.luigiMfId,active:D.isElementVisible(a)});else{const u=a.shadowRoot?.firstElementChild?.firstElementChild??null;u&&r.push({iframe:u,id:a.luigiMfId,active:D.isElementVisible(a)})}return r},getModalMicrofrontends(){const i=[];for(const n of ne.modalContainer)if(n.iframeHandle?.iframe)i.push({iframe:n.iframeHandle.iframe,id:n.luigiMfId,active:D.isElementVisible(n)});else{const r=n.shadowRoot?.firstElementChild?.firstElementChild??null;r&&i.push({iframe:r,id:n.luigiMfId,active:D.isElementVisible(n)})}return i},getDrawerMicrofrontends(){if(!ne.drawerContainer)return{};if(ne.drawerContainer.iframeHandle?.iframe)return{iframe:ne.drawerContainer.iframeHandle.iframe,id:ne.drawerContainer.luigiMfId,active:D.isElementVisible(ne.drawerContainer)};{const i=ne.drawerContainer.shadowRoot?.firstElementChild?.firstElementChild??null;if(i)return{iframe:i,id:ne.drawerContainer.luigiMfId,active:D.isElementVisible(ne.drawerContainer)}}return{}}};class aS{constructor(n){this.luigi=n}getShellbar(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarElement()||null}getShellbarActions(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarActions()||null}getLuigiContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getLuigiContainer()||null}getNavFooterContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getNavFooterContainer()||null}getMicrofrontends(){return sS.getMicrofrontendsInDom(this.luigi)}getMicrofrontendIframes(){const n=this.luigi.getEngine()._connector?.getContainerWrapper();let r=[];if(ne.modalContainer)for(const a of Array.from(ne.modalContainer))a.tagName?.startsWith("LUIGI-")&&a.iframeHandle?.iframe&&r.push(a.iframeHandle.iframe);if(ne.drawerContainer&&r.push(ne.drawerContainer.iframeHandle.iframe),!n)return null;for(const a of Array.from(n.childNodes))a.tagName?.startsWith("LUIGI-")&&a.iframeHandle?.iframe&&r.push(a.iframeHandle.iframe);return r}getCurrentMicrofrontendIframe(){const n=this.luigi.getEngine()._connector?.getContainerWrapper();if(!n)return null;const r=ne.modalContainer[0]?.iframeHandle?.iframe??null;let a=null,u=null;for(const c of Array.from(n.children))c.tagName?.startsWith("LUIGI-")&&D.isElementVisible(c)&&(c.iframeHandle?.iframe?a=c.iframeHandle.iframe:u=c.shadowRoot?.firstElementChild?.firstElementChild??null);return r||a||u}}const oS={luigiAfterInit:async i=>{D.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await Xe.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class uS{constructor(){this.featureToggleList=new Set}setFeatureToggle(n,r=!1){this.isValid(n)&&(n.startsWith("!")&&!r||this.isDuplicatedOrDisabled(n)||this.featureToggleList.add(n))}unsetFeatureToggle(n){if(this.isValid(n)){if(!this.featureToggleList.has(n)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(n)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(r=>!r.startsWith("!"))}isValid(n){return D.isString(n)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(n){return this.featureToggleList.has(n)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${n}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class lS{constructor(n){this.hashRouting=!1,this.options={fromContext:null,fromClosestContext:!1,fromVirtualTreeRoot:!1,fromParent:!1,nodeParams:{}},this.navigate=async(r,a,u,c,l)=>{const d=r[0]!=="/";this.options.relative=d;const p={modalSettings:u,newTab:!1,options:this.options,path:r,preserveView:a,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(p,void 0)},this.openAsModal=async(r,a,u)=>{a?.keepPrevious||await this.modalService.closeModals();const c=r.replace(/\/\/+/g,"/");if(!await Ce.validatePathAndGetRedirect(c,this.luigi))return;const d=await this.navService.getCurrentNode(c),p=a||{};p.title||(p.title=d?.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(c,p),this.luigi.getEngine()._ui.openModal(this.luigi,d,p,u)},this.openAsDrawer=async(r,a,u)=>{const c=r.replace(/\/\/+/g,"/");if(!await Ce.validatePathAndGetRedirect(c,this.luigi))return;const d=await this.navService.getCurrentNode(c),p=a||{};p.title||(p.title=d?.label||""),this.luigi.getEngine()._ui.openDrawer(this.luigi,d,p,u)},this.runTimeErrorHandler=async r=>{const{path:a}=M.getCurrentPath(this.luigi.getConfig().routing?.useHashRouting),u=await this.navService.getCurrentNode(a),c=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");u?.runTimeErrorHandler?.errorFn&&D.isFunction(u?.runTimeErrorHandler?.errorFn)?u.runTimeErrorHandler.errorFn(r,u):c?.errorFn&&D.isFunction(c.errorFn)&&c.errorFn(r,u)},this.pathExists=async r=>await M.pathExists(r,this.luigi),this.luigi=n,this.hashRouting=n.getConfig().routing?.useHashRouting,this.navService=te.get(vn),this.routingService=te.get(Mn),this.modalService=te.get(mn)}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this.options.fromParent=!1,this}fromContext(n){return this.options.fromContext=n,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this.options.fromParent=!1,this}fromParent(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!1,this.options.fromParent=!0,this}withParams(n){return n&&Object.assign(this.options.nodeParams??{},n),this}}class cS{constructor(n){this.luigi=n}addSearchParams(n,r=!1){if(!D.isObject(n)){console.log("Params argument must be an object");return}const a=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?a.hash=M.addParamsOnHashRouting(n,a.hash):M.modifySearchParams(n,a.searchParams),this.handleBrowserHistory(r,a),this.luigi.configChanged()}getSearchParams(){const n={},r=["__proto__","constructor","prototype"],a=new URL(location.href);let u;if(this.luigi.getConfigValue("routing.useHashRouting")){const c=a.hash.split("?")[1];u=c?new URLSearchParams(c).entries():[]}else u=a.searchParams.entries();for(const[c,l]of u){if(r.some(d=>c===d)){console.warn(`Blocked because of potentially dangerous query param: ${c}`);continue}n[c]=l}return n}handleBrowserHistory(n,r){const a=this.sanitizeUrl(r.href);if(!a){console.warn("invalid url: "+a);return}n?window.history.pushState({},"",a):window.history.replaceState({},"",a)}sanitizeUrl(n){return new URL(location.href).origin===new URL(n).origin?n:void 0}addNodeParams(n,r){if(!D.isObject(n)){console.log("Params argument must be an object");return}const a=M.getContentViewParamPrefix(this.luigi),u=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?u.hash=M.addParamsOnHashRouting(n,u.hash,a):M.modifySearchParams(n,u.searchParams,a),this.handleBrowserHistory(r,u),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}class fS{#e;#f="";constructor(n){this.#e=n}async getAvailableThemes(){return await this.#e.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(n){this.#f=n,this.#e.__cssVars=void 0}async getThemeObject(n){return(await this.getAvailableThemes())?.find(a=>a.id===n)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.#f)return this.#f;const n=this.#e.getConfigValue("settings.theming");return n.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",n),n.defaultTheme}isThemingAvailable(){return!!this.#e.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const n=this.#e.getConfigValue("settings.theming.variables.file");if(n)try{const r=await fetch(n);window.Luigi.__cssVars=(await r.json()).root,Object.keys(window.Luigi.__cssVars).forEach(a=>{const u=getComputedStyle(document.documentElement).getPropertyValue("--"+a);u&&(window.Luigi.__cssVars[a]=u)})}catch(r){D.isFunction(this.#e.getConfigValue("settings.theming.variables.errorHandling"))?this.#e.getConfigValue("settings.theming.variables.errorHandling")(r):console.error("CSS variables file error: ",r)}else this.#e.getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(r=>{window.Luigi.__cssVars[r]=getComputedStyle(document.documentElement).getPropertyValue("--"+r)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const n=te.get(mr);(()=>{const a=this.#e.getConfigValue("settings.theming");a&&a.nodeViewURLDecorator&&a.nodeViewURLDecorator.queryStringParameter&&n.add({type:"queryString",uid:"theming",key:a.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const u=this.getCurrentTheme(),c=a.nodeViewURLDecorator.queryStringParameter.value;return c?c(u):u}}),a&&a.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}class ss{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(n,r){if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const a=new Set;a.add(r),this.unsavedChanges={dirtySet:a}}this.unsavedChanges.persistUrl=window.location.href,n?this.unsavedChanges.dirtySet?.add(r):this.unsavedChanges.dirtySet?.delete(r)}clearDirtyState(n){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(n?this.unsavedChanges.dirtySet.delete(n):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let zl;const Pe={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),Pe.luigi=i,Pe.documentTitle=ns(void 0),zl=te.get(ss)},processAlert:(i,n,r)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");const a={openFromClient:n,close:()=>{i.id&&r.notifyAlertClosed(i.id)},link:u=>{if(i.links){const c=i.links[u];if(c&&(c.url&&Pe.luigi?.navigation().navigate(c.url),c.dismissKey&&i.id))return r.notifyAlertClosed(i.id,c.dismissKey),!0}return!1}};Pe.luigi.getEngine()._connector?.renderAlert(i,a)},handleConfirmationModalRequest:(i,n)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:Pe.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:Pe.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:Pe.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:Pe.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),Pe.luigi.getEngine()._connector?.renderConfirmationModal(i,{confirm(){n.notifyConfirmationModalClosed(!0)},dismiss(){n.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,n)=>{if(!Pe.luigi)throw new Error("Luigi is not initialized.");zl.updateDirtyStatus(i,n)}};class hS{processUserSettingGroups(n,r){const a=[],u=n?.userSettingGroups,c=r?.userSettings?.userSettingGroups,l=u||c;if(D.isObject(l)){for(const d in l){const p={};p[d]=l[d],a.push(p)}return a}return a}getUserSettingsIframesInDom(){const n=document.querySelector(".iframeUserSettingsCtn");return n?[...n.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(n=>{n.style.display="none"})}findActiveCustomUserSettingsIframe(n){const r=document.querySelectorAll("[userSettingsGroup]");for(let a=0;a<r.length;a++)if(r[a].contentWindow===n)return r[a];return null}}const dS=new hS;class gS{constructor(n){this.dirtyStatusService=te.get(ss),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=r=>new Promise(a=>{r.id||(r.id=D.getRandomId().toString());const u={openFromClient:!1,close:()=>{a(!0)},link:c=>{if(r.links){const l=r.links[c];if(l&&(l.url&&this.luigi?.navigation().navigate(l.url),l.dismissKey))return a(l.dismissKey),!0}return!1}};this.luigi.getEngine()._connector?.renderAlert(r,u)}),this.showConfirmationModal=r=>(r&&(r={...r,header:this.luigi.i18n().getTranslation(r.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(r.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(r.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(r.buttonConfirm||"luigi.button.confirm")}),new Promise((a,u)=>{this.luigi.getEngine()._connector?.renderConfirmationModal(r,{confirm(){a(!0)},dismiss(){u()}})})),this.processUserSettingGroups=()=>{const r=this.luigi.getConfigValue("userSettings"),a=this.luigi.getConfigValue("settings");return dS.processUserSettingGroups(r,a)},this.openUserSettings=r=>{this.luigi.getEngine()._connector?.openUserSettings(r)},this.closeUserSettings=()=>{this.luigi.getEngine()._connector?.closeUserSettings()},this.setDocumentTitle=r=>{this.luigi.getEngine()._ux?.documentTitle?.set(r),this.luigi.getEngine()._connector?.setDocumentTitle(r)},this.getDocumentTitle=()=>ic(this.luigi.getEngine()._ux?.documentTitle)||window.document.title||"",this.hideAppLoadingIndicator=()=>{const r=document.querySelector(this.appLoadingIndicatorSelector);r&&(r.classList.add("hidden"),setTimeout(()=>{r.parentNode?.removeChild(r)},500))},this.showLoadingIndicator=r=>this.luigi.getEngine()._connector?.showLoadingIndicator(r),this.hideLoadingIndicator=r=>this.luigi.getEngine()._connector?.hideLoadingIndicator(r),this.addBackdrop=()=>this.luigi.getEngine()._connector?.addBackdrop(),this.removeBackdrop=()=>this.luigi.getEngine()._connector?.removeBackdrop(),this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=n}}class pS{constructor(n){this.engine=n,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=r=>{this.config=r,this.setConfigCallback(this.getConfigReadyCallback()),hr.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,oS.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...r)=>{this.getEngine()._ui.update(r)},this.i18n=()=>(this._i18n||(this._i18n=new Bv(this)),this._i18n),this.elements=()=>(this._elements||(this._elements=new aS(this)),this._elements),this.navigation=()=>new lS(this),this.ux=()=>new gS(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new uS),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new cS(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new fS(this)),this._theming),this.auth=()=>or,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(n){return D.getConfigValueFromObject(this.getConfig(),n)}getConfigValueAsync(n,...r){return $n.getConfigValueFromObjectAsync(this.getConfig(),n,r)}clearNavigationCache(){te.get(_n).deleteCache()}async readUserSettings(){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&D.isFunction(r.readUserSettings))return r.readUserSettings();const a=localStorage.getItem(this.USER_SETTINGS_KEY);return a&&JSON.parse(a)}async storeUserSettings(n,r){const a=await this.getConfigValueAsync("userSettings"),u=a||await this.getConfigValueAsync("settings.userSettings");if(u&&D.isFunction(u.storeUserSettings))return u.storeUserSettings(n,r);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(n)),this.configChanged()}createConfigStore(){const n=ns({}),r={};let a=[];return{subscribe:u=>{a.push(n.subscribe(u))},reset:u=>{n.update(u)},subscribeToScope:(u,c)=>{let l=r[c];l||(l=new Set,r[c]=l),l.add(u)},fire:(u,c)=>{const l=r[u];l&&[...l].forEach(d=>{d(c)})},clear:()=>{a.forEach(u=>{u()}),a=[]}}}getConfigReadyCallback(){return new Promise(n=>{this.i18n()._init(),n()})}setConfigCallback(n){this.configReadyCallback=n}}const _S=!1;var mS=Array.isArray,vS=Array.prototype.indexOf,vr=Array.prototype.includes,SS=Array.from,wS=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,ES=Object.prototype,CS=Array.prototype,TS=Object.getPrototypeOf,Kl=Object.isExtensible;const yS=()=>{};function RS(i){for(var n=0;n<i.length;n++)i[n]()}function AS(){var i,n,r=new Promise((a,u)=>{i=a,n=u});return{promise:r,resolve:i,reject:n}}const Fe=2,Zr=4,wc=8,Ec=1<<24,Xt=16,Sn=32,kn=64,ka=128,mt=512,Ue=1024,Ge=2048,Mt=4096,Yt=8192,gn=16384,ei=32768,Yl=1<<25,as=65536,Ha=1<<17,bS=1<<18,us=1<<19,PS=1<<20,Hn=65536,Wa=1<<21,qa=1<<22,Jr=1<<23,$a=Symbol("$state"),za=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function IS(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xS(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function LS(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function NS(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function US(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Be=Symbol();function OS(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function $S(i){return i===this.v}let Ka=!1,DS=!1;function MS(){Ka=!0}let xt=null;function os(i){xt=i}function FS(i,n=!1,r){xt={p:xt,i:!1,c:null,e:null,s:i,x:null,r:pe,l:Ka&&!n?{s:null,u:null,$:[]}:null}}function kS(i){var n=xt,r=n.e;if(r!==null){n.e=null;for(var a of r)ew(a)}return n.i=!0,xt=n.p,{}}function ls(){return!Ka||xt!==null&&xt.l===null}let ur=[];function HS(){var i=ur;ur=[],RS(i)}function gr(i){if(ur.length===0){var n=ur;queueMicrotask(()=>{n===ur&&HS()})}ur.push(i)}function Cc(i){var n=pe;if(n===null)return ue.f|=Jr,i;if((n.f&ei)===0&&(n.f&Zr)===0)throw i;lr(i,n)}function lr(i,n){for(;n!==null;){if((n.f&ka)!==0){if((n.f&ei)===0)throw i;try{n.b.error(i);return}catch(r){i=r}}n=n.parent}throw i}const WS=-7169;function Te(i,n){i.f=i.f&WS|n}function Ya(i){(i.f&mt)!==0||i.deps===null?Te(i,Ue):Te(i,Mt)}function Tc(i){if(i!==null)for(const n of i)(n.f&Fe)===0||(n.f&Hn)===0||(n.f^=Hn,Tc(n.deps))}function yc(i,n,r){(i.f&Ge)!==0?n.add(i):(i.f&Mt)!==0&&r.add(i),Tc(i.deps),Te(i,Ue)}const ln=new Set;let Ee=null,Pt=null,Va=null,Da=!1,cr=null,ji=null;var Xl=0;let VS=1;class Wn{id=VS++;current=new Map;previous=new Map;#e=new Set;#f=new Set;#n=new Map;#o=new Map;#r=null;#t=[];#s=[];#i=new Set;#a=new Set;#u=new Map;is_fork=!1;#c=!1;#h=new Set;#d(){return this.is_fork||this.#o.size>0}#g(){for(const a of this.#h)for(const u of a.#o.keys()){for(var n=!1,r=u;r.parent!==null;){if(this.#u.has(r)){n=!0;break}r=r.parent}if(!n)return!0}return!1}skip_effect(n){this.#u.has(n)||this.#u.set(n,{d:[],m:[]})}unskip_effect(n){var r=this.#u.get(n);if(r){this.#u.delete(n);for(var a of r.d)Te(a,Ge),this.schedule(a);for(a of r.m)Te(a,Mt),this.schedule(a)}}#l(){if(Xl++>1e3&&(ln.delete(this),BS()),!this.#d()){for(const d of this.#i)this.#a.delete(d),Te(d,Ge),this.schedule(d);for(const d of this.#a)Te(d,Mt),this.schedule(d)}const n=this.#t;this.#t=[],this.apply();var r=cr=[],a=[],u=ji=[];for(const d of n)try{this.#p(d,r,a)}catch(p){throw bc(d),p}if(Ee=null,u.length>0){var c=Wn.ensure();for(const d of u)c.schedule(d)}if(cr=null,ji=null,this.#d()||this.#g()){this.#_(a),this.#_(r);for(const[d,p]of this.#u)Ac(d,p)}else{this.#n.size===0&&ln.delete(this),this.#i.clear(),this.#a.clear();for(const d of this.#e)d(this);this.#e.clear(),Zl(a),Zl(r),this.#r?.resolve()}var l=Ee;if(this.#t.length>0){const d=l??=this;d.#t.push(...this.#t.filter(p=>!d.#t.includes(p)))}l!==null&&(ln.add(l),l.#l()),ln.has(this)||this.#S()}#p(n,r,a){n.f^=Ue;for(var u=n.first;u!==null;){var c=u.f,l=(c&(Sn|kn))!==0,d=l&&(c&Ue)!==0,p=d||(c&Yt)!==0||this.#u.has(u);if(!p&&u.fn!==null){l?u.f^=Ue:(c&Zr)!==0?r.push(u):ni(u)&&((c&Xt)!==0&&this.#a.add(u),wr(u));var _=u.first;if(_!==null){u=_;continue}}for(;u!==null;){var R=u.next;if(R!==null){u=R;break}u=u.parent}}}#_(n){for(var r=0;r<n.length;r+=1)yc(n[r],this.#i,this.#a)}capture(n,r,a=!1){r!==Be&&!this.previous.has(n)&&this.previous.set(n,r),(n.f&Jr)===0&&(this.current.set(n,[n.v,a]),Pt?.set(n,n.v))}activate(){Ee=this}deactivate(){Ee=null,Pt=null}flush(){try{Da=!0,Ee=this,this.#l()}finally{Xl=0,Va=null,cr=null,ji=null,Da=!1,Ee=null,Pt=null,pn.clear()}}discard(){for(const n of this.#f)n(this);this.#f.clear(),ln.delete(this)}register_created_effect(n){this.#s.push(n)}#S(){for(const R of ln){var n=R.id<this.id,r=[];for(const[T,[E,y]]of this.current){if(R.current.has(T)){var a=R.current.get(T)[0];if(n&&E!==a)R.current.set(T,[E,y]);else continue}r.push(T)}var u=[...R.current.keys()].filter(T=>!this.current.has(T));if(u.length===0)n&&R.discard();else if(r.length>0){R.activate();var c=new Set,l=new Map;for(var d of r)Rc(d,u,c,l);l=new Map;var p=[...R.current.keys()].filter(T=>this.current.has(T)?this.current.get(T)[0]!==T:!0);for(const T of this.#s)(T.f&(gn|Yt|Ha))===0&&Xa(T,p,l)&&((T.f&(qa|Xt))!==0?(Te(T,Ge),R.schedule(T)):R.#i.add(T));if(R.#t.length>0){R.apply();for(var _ of R.#t)R.#p(_,[],[]);R.#t=[]}R.deactivate()}}for(const R of ln)R.#h.has(this)&&(R.#h.delete(this),R.#h.size===0&&!R.#d()&&(R.activate(),R.#l()))}increment(n,r){let a=this.#n.get(r)??0;if(this.#n.set(r,a+1),n){let u=this.#o.get(r)??0;this.#o.set(r,u+1)}}decrement(n,r,a){let u=this.#n.get(r)??0;if(u===1?this.#n.delete(r):this.#n.set(r,u-1),n){let c=this.#o.get(r)??0;c===1?this.#o.delete(r):this.#o.set(r,c-1)}this.#c||a||(this.#c=!0,gr(()=>{this.#c=!1,this.flush()}))}transfer_effects(n,r){for(const a of n)this.#i.add(a);for(const a of r)this.#a.add(a);n.clear(),r.clear()}oncommit(n){this.#e.add(n)}ondiscard(n){this.#f.add(n)}settled(){return(this.#r??=AS()).promise}static ensure(){if(Ee===null){const n=Ee=new Wn;Da||(ln.add(Ee),gr(()=>{Ee===n&&n.flush()}))}return Ee}apply(){{Pt=null;return}}schedule(n){if(Va=n,n.b?.is_pending&&(n.f&(Zr|wc|Ec))!==0&&(n.f&ei)===0){n.b.defer_effect(n);return}for(var r=n;r.parent!==null;){r=r.parent;var a=r.f;if(cr!==null&&r===pe&&(ue===null||(ue.f&Fe)===0))return;if((a&(kn|Sn))!==0){if((a&Ue)===0)return;r.f^=Ue}}this.#t.push(r)}}function BS(){try{IS()}catch(i){lr(i,Va)}}let Kt=null;function Zl(i){var n=i.length;if(n!==0){for(var r=0;r<n;){var a=i[r++];if((a.f&(gn|Yt))===0&&ni(a)&&(Kt=new Set,wr(a),a.deps===null&&a.first===null&&a.nodes===null&&a.teardown===null&&a.ac===null&&Fc(a),Kt?.size>0)){pn.clear();for(const u of Kt){if((u.f&(gn|Yt))!==0)continue;const c=[u];let l=u.parent;for(;l!==null;)Kt.has(l)&&(Kt.delete(l),c.push(l)),l=l.parent;for(let d=c.length-1;d>=0;d--){const p=c[d];(p.f&(gn|Yt))===0&&wr(p)}}Kt.clear()}}Kt=null}}function Rc(i,n,r,a){if(!r.has(i)&&(r.add(i),i.reactions!==null))for(const u of i.reactions){const c=u.f;(c&Fe)!==0?Rc(u,n,r,a):(c&(qa|Xt))!==0&&(c&Ge)===0&&Xa(u,n,a)&&(Te(u,Ge),Za(u))}}function Xa(i,n,r){const a=r.get(i);if(a!==void 0)return a;if(i.deps!==null)for(const u of i.deps){if(vr.call(n,u))return!0;if((u.f&Fe)!==0&&Xa(u,n,r))return r.set(u,!0),!0}return r.set(i,!1),!1}function Za(i){Ee.schedule(i)}function Ac(i,n){if(!((i.f&Sn)!==0&&(i.f&Ue)!==0)){(i.f&Ge)!==0?n.d.push(i):(i.f&Mt)!==0&&n.m.push(i),Te(i,Ue);for(var r=i.first;r!==null;)Ac(r,n),r=r.next}}function bc(i){Te(i,Ue);for(var n=i.first;n!==null;)bc(n),n=n.next}function GS(i){let n=0,r=ja(0),a;return()=>{eo()&&(fr(r),nw(()=>(n===0&&(a=cw(()=>i(()=>Kr(r)))),n+=1,()=>{gr(()=>{n-=1,n===0&&(a?.(),a=void 0,Kr(r))})})))}}var QS=as|us;function qS(i,n,r,a){new zS(i,n,r,a)}class zS{parent;is_pending=!1;transform_error;#e;#f=null;#n;#o;#r;#t=null;#s=null;#i=null;#a=null;#u=0;#c=0;#h=!1;#d=new Set;#g=new Set;#l=null;#p=GS(()=>(this.#l=ja(this.#u),()=>{this.#l=null}));constructor(n,r,a,u){this.#e=n,this.#n=r,this.#o=c=>{var l=pe;l.b=this,l.f|=ka,a(c)},this.parent=pe.b,this.transform_error=u??this.parent?.transform_error??(c=>c),this.#r=rw(()=>{this.#w()},QS)}#_(){try{this.#t=Ln(()=>this.#o(this.#e))}catch(n){this.error(n)}}#S(n){const r=this.#n.failed;r&&(this.#i=Ln(()=>{r(this.#e,()=>n,()=>()=>{})}))}#C(){const n=this.#n.pending;n&&(this.is_pending=!0,this.#s=Ln(()=>n(this.#e)),gr(()=>{var r=this.#a=document.createDocumentFragment(),a=Oc();r.append(a),this.#t=this.#v(()=>Ln(()=>this.#o(a))),this.#c===0&&(this.#e.before(r),this.#a=null,es(this.#s,()=>{this.#s=null}),this.#m(Ee))}))}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#c=0,this.#u=0,this.#t=Ln(()=>{this.#o(this.#e)}),this.#c>0){var n=this.#a=document.createDocumentFragment();aw(this.#t,n);const r=this.#n.pending;this.#s=Ln(()=>r(this.#e))}else this.#m(Ee)}catch(r){this.error(r)}}#m(n){this.is_pending=!1,n.transfer_effects(this.#d,this.#g)}defer_effect(n){yc(n,this.#d,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#v(n){var r=pe,a=ue,u=xt;wn(this.#r),Ft(this.#r),os(this.#r.ctx);try{return Wn.ensure(),n()}catch(c){return Cc(c),null}finally{wn(r),Ft(a),os(u)}}#E(n,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(n,r);return}this.#c+=n,this.#c===0&&(this.#m(r),this.#s&&es(this.#s,()=>{this.#s=null}),this.#a&&(this.#e.before(this.#a),this.#a=null))}update_pending_count(n,r){this.#E(n,r),this.#u+=n,!(!this.#l||this.#h)&&(this.#h=!0,gr(()=>{this.#h=!1,this.#l&&Lc(this.#l,this.#u)}))}get_effect_pending(){return this.#p(),fr(this.#l)}error(n){var r=this.#n.onerror;let a=this.#n.failed;if(!r&&!a)throw n;this.#t&&(Dt(this.#t),this.#t=null),this.#s&&(Dt(this.#s),this.#s=null),this.#i&&(Dt(this.#i),this.#i=null);var u=!1,c=!1;const l=()=>{if(u){OS();return}u=!0,c&&US(),this.#i!==null&&es(this.#i,()=>{this.#i=null}),this.#v(()=>{this.#w()})},d=p=>{try{c=!0,r?.(p,l),c=!1}catch(_){lr(_,this.#r&&this.#r.parent)}a&&(this.#i=this.#v(()=>{try{return Ln(()=>{var _=pe;_.b=this,_.f|=ka,a(this.#e,()=>p,()=>l)})}catch(_){return lr(_,this.#r.parent),null}}))};gr(()=>{var p;try{p=this.transform_error(n)}catch(_){lr(_,this.#r&&this.#r.parent);return}p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(d,_=>lr(_,this.#r&&this.#r.parent)):d(p)})}}function KS(i){var n=i.effects;if(n!==null){i.effects=null;for(var r=0;r<n.length;r+=1)Dt(n[r])}}function YS(i){for(var n=i.parent;n!==null;){if((n.f&Fe)===0)return(n.f&gn)===0?n:null;n=n.parent}return null}function Ja(i){var n,r=pe;wn(YS(i));try{i.f&=~Hn,KS(i),n=Bc(i)}finally{wn(r)}return n}function Pc(i){var n=i.v,r=Ja(i);if(!i.equals(r)&&(i.wv=Wc(),(!Ee?.is_fork||i.deps===null)&&(i.v=r,Ee?.capture(i,n,!0),i.deps===null))){Te(i,Ue);return}Sr||(Pt!==null?(eo()||Ee?.is_fork)&&Pt.set(i,r):Ya(i))}function XS(i){if(i.effects!==null)for(const n of i.effects)(n.teardown||n.ac)&&(n.teardown?.(),n.ac?.abort(za),n.teardown=yS,n.ac=null,jr(n,0),to(n))}function Ic(i){if(i.effects!==null)for(const n of i.effects)n.teardown&&wr(n)}let Ba=new Set;const pn=new Map;let xc=!1;function ja(i,n){var r={f:0,v:i,reactions:null,equals:$S,rv:0,wv:0};return r}function cn(i,n){const r=ja(i);return ow(r),r}function Nn(i,n,r=!1){ue!==null&&(!It||(ue.f&Ha)!==0)&&ls()&&(ue.f&(Fe|Xt|qa|Ha))!==0&&(vt===null||!vr.call(vt,i))&&NS();let a=r?Gr(n):n;return Lc(i,a,ji)}function Lc(i,n,r=null){if(!i.equals(n)){var a=i.v;Sr?pn.set(i,n):pn.set(i,a),i.v=n;var u=Wn.ensure();if(u.capture(i,a),(i.f&Fe)!==0){const c=i;(i.f&Ge)!==0&&Ja(c),Pt===null&&Ya(c)}i.wv=Wc(),Nc(i,Ge,r),ls()&&pe!==null&&(pe.f&Ue)!==0&&(pe.f&(Sn|kn))===0&&(pt===null?uw([i]):pt.push(i)),!u.is_fork&&Ba.size>0&&!xc&&ZS()}return n}function ZS(){xc=!1;for(const i of Ba)(i.f&Ue)!==0&&Te(i,Mt),ni(i)&&wr(i);Ba.clear()}function Kr(i){Nn(i,i.v+1)}function Nc(i,n,r){var a=i.reactions;if(a!==null)for(var u=ls(),c=a.length,l=0;l<c;l++){var d=a[l],p=d.f;if(!(!u&&d===pe)){var _=(p&Ge)===0;if(_&&Te(d,n),(p&Fe)!==0){var R=d;Pt?.delete(R),(p&Hn)===0&&(p&mt&&(d.f|=Hn),Nc(R,Mt,r))}else if(_){var T=d;(p&Xt)!==0&&Kt!==null&&Kt.add(T),r!==null?r.push(T):Za(T)}}}}function Gr(i){if(typeof i!="object"||i===null||$a in i)return i;const n=TS(i);if(n!==ES&&n!==CS)return i;var r=new Map,a=mS(i),u=cn(0),c=Fn,l=d=>{if(Fn===c)return d();var p=ue,_=Fn;Ft(null),ec(c);var R=d();return Ft(p),ec(_),R};return a&&r.set("length",cn(i.length)),new Proxy(i,{defineProperty(d,p,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&xS();var R=r.get(p);return R===void 0?l(()=>{var T=cn(_.value);return r.set(p,T),T}):Nn(R,_.value,!0),!0},deleteProperty(d,p){var _=r.get(p);if(_===void 0){if(p in d){const R=l(()=>cn(Be));r.set(p,R),Kr(u)}}else Nn(_,Be),Kr(u);return!0},get(d,p,_){if(p===$a)return i;var R=r.get(p),T=p in d;if(R===void 0&&(!T||zr(d,p)?.writable)&&(R=l(()=>{var y=Gr(T?d[p]:Be),I=cn(y);return I}),r.set(p,R)),R!==void 0){var E=fr(R);return E===Be?void 0:E}return Reflect.get(d,p,_)},getOwnPropertyDescriptor(d,p){var _=Reflect.getOwnPropertyDescriptor(d,p);if(_&&"value"in _){var R=r.get(p);R&&(_.value=fr(R))}else if(_===void 0){var T=r.get(p),E=T?.v;if(T!==void 0&&E!==Be)return{enumerable:!0,configurable:!0,value:E,writable:!0}}return _},has(d,p){if(p===$a)return!0;var _=r.get(p),R=_!==void 0&&_.v!==Be||Reflect.has(d,p);if(_!==void 0||pe!==null&&(!R||zr(d,p)?.writable)){_===void 0&&(_=l(()=>{var E=R?Gr(d[p]):Be,y=cn(E);return y}),r.set(p,_));var T=fr(_);if(T===Be)return!1}return R},set(d,p,_,R){var T=r.get(p),E=p in d;if(a&&p==="length")for(var y=_;y<T.v;y+=1){var I=r.get(y+"");I!==void 0?Nn(I,Be):y in d&&(I=l(()=>cn(Be)),r.set(y+"",I))}if(T===void 0)(!E||zr(d,p)?.writable)&&(T=l(()=>cn(void 0)),Nn(T,Gr(_)),r.set(p,T));else{E=T.v!==Be;var N=l(()=>Gr(_));Nn(T,N)}var H=Reflect.getOwnPropertyDescriptor(d,p);if(H?.set&&H.set.call(R,_),!E){if(a&&typeof p=="string"){var W=r.get("length"),ie=Number(p);Number.isInteger(ie)&&ie>=W.v&&Nn(W,ie+1)}Kr(u)}return!0},ownKeys(d){fr(u);var p=Reflect.ownKeys(d).filter(T=>{var E=r.get(T);return E===void 0||E.v!==Be});for(var[_,R]of r)R.v!==Be&&!(_ in d)&&p.push(_);return p},setPrototypeOf(){LS()}})}var Jl,Uc;function JS(){if(Jl===void 0){Jl=window;var i=Element.prototype,n=Node.prototype,r=Text.prototype;zr(n,"firstChild").get,Uc=zr(n,"nextSibling").get,Kl(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Kl(r)&&(r.__t=void 0)}}function Oc(i=""){return document.createTextNode(i)}function $c(i){return Uc.call(i)}function Dc(i){var n=ue,r=pe;Ft(null),wn(null);try{return i()}finally{Ft(n),wn(r)}}function jS(i,n){var r=n.last;r===null?n.last=n.first=i:(r.next=i,i.prev=r,n.last=i)}function ti(i,n){var r=pe;r!==null&&(r.f&Yt)!==0&&(i|=Yt);var a={ctx:xt,deps:null,nodes:null,f:i|Ge|mt,first:null,fn:n,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};Ee?.register_created_effect(a);var u=a;if((i&Zr)!==0)cr!==null?cr.push(a):Wn.ensure().schedule(a);else if(n!==null){try{wr(a)}catch(l){throw Dt(a),l}u.deps===null&&u.teardown===null&&u.nodes===null&&u.first===u.last&&(u.f&us)===0&&(u=u.first,(i&Xt)!==0&&(i&as)!==0&&u!==null&&(u.f|=as))}if(u!==null&&(u.parent=r,r!==null&&jS(u,r),ue!==null&&(ue.f&Fe)!==0&&(i&kn)===0)){var c=ue;(c.effects??=[]).push(u)}return a}function eo(){return ue!==null&&!It}function ew(i){return ti(Zr|PS,i)}function tw(i){Wn.ensure();const n=ti(kn|us,i);return(r={})=>new Promise(a=>{r.outro?es(n,()=>{Dt(n),a(void 0)}):(Dt(n),a(void 0))})}function nw(i,n=0){return ti(wc|n,i)}function rw(i,n=0){var r=ti(Xt|n,i);return r}function Ln(i){return ti(Sn|us,i)}function Mc(i){var n=i.teardown;if(n!==null){const r=Sr,a=ue;jl(!0),Ft(null);try{n.call(null)}finally{jl(r),Ft(a)}}}function to(i,n=!1){var r=i.first;for(i.first=i.last=null;r!==null;){const u=r.ac;u!==null&&Dc(()=>{u.abort(za)});var a=r.next;(r.f&kn)!==0?r.parent=null:Dt(r,n),r=a}}function iw(i){for(var n=i.first;n!==null;){var r=n.next;(n.f&Sn)===0&&Dt(n),n=r}}function Dt(i,n=!0){var r=!1;(n||(i.f&bS)!==0)&&i.nodes!==null&&i.nodes.end!==null&&(sw(i.nodes.start,i.nodes.end),r=!0),Te(i,Yl),to(i,n&&!r),jr(i,0);var a=i.nodes&&i.nodes.t;if(a!==null)for(const c of a)c.stop();Mc(i),i.f^=Yl,i.f|=gn;var u=i.parent;u!==null&&u.first!==null&&Fc(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=i.b=null}function sw(i,n){for(;i!==null;){var r=i===n?null:$c(i);i.remove(),i=r}}function Fc(i){var n=i.parent,r=i.prev,a=i.next;r!==null&&(r.next=a),a!==null&&(a.prev=r),n!==null&&(n.first===i&&(n.first=a),n.last===i&&(n.last=r))}function es(i,n,r=!0){var a=[];kc(i,a,!0);var u=()=>{r&&Dt(i),n&&n()},c=a.length;if(c>0){var l=()=>--c||u();for(var d of a)d.out(l)}else u()}function kc(i,n,r){if((i.f&Yt)===0){i.f^=Yt;var a=i.nodes&&i.nodes.t;if(a!==null)for(const d of a)(d.is_global||r)&&n.push(d);for(var u=i.first;u!==null;){var c=u.next,l=(u.f&as)!==0||(u.f&Sn)!==0&&(i.f&Xt)!==0;kc(u,n,l?r:!1),u=c}}}function aw(i,n){if(i.nodes)for(var r=i.nodes.start,a=i.nodes.end;r!==null;){var u=r===a?null:$c(r);n.append(r),r=u}}let ts=!1,Sr=!1;function jl(i){Sr=i}let ue=null,It=!1;function Ft(i){ue=i}let pe=null;function wn(i){pe=i}let vt=null;function ow(i){ue!==null&&(vt===null?vt=[i]:vt.push(i))}let Ze=null,at=0,pt=null;function uw(i){pt=i}let Hc=1,On=0,Fn=On;function ec(i){Fn=i}function Wc(){return++Hc}function ni(i){var n=i.f;if((n&Ge)!==0)return!0;if(n&Fe&&(i.f&=~Hn),(n&Mt)!==0){for(var r=i.deps,a=r.length,u=0;u<a;u++){var c=r[u];if(ni(c)&&Pc(c),c.wv>i.wv)return!0}(n&mt)!==0&&Pt===null&&Te(i,Ue)}return!1}function Vc(i,n,r=!0){var a=i.reactions;if(a!==null&&!(vt!==null&&vr.call(vt,i)))for(var u=0;u<a.length;u++){var c=a[u];(c.f&Fe)!==0?Vc(c,n,!1):n===c&&(r?Te(c,Ge):(c.f&Ue)!==0&&Te(c,Mt),Za(c))}}function Bc(i){var n=Ze,r=at,a=pt,u=ue,c=vt,l=xt,d=It,p=Fn,_=i.f;Ze=null,at=0,pt=null,ue=(_&(Sn|kn))===0?i:null,vt=null,os(i.ctx),It=!1,Fn=++On,i.ac!==null&&(Dc(()=>{i.ac.abort(za)}),i.ac=null);try{i.f|=Wa;var R=i.fn,T=R();i.f|=ei;var E=i.deps,y=Ee?.is_fork;if(Ze!==null){var I;if(y||jr(i,at),E!==null&&at>0)for(E.length=at+Ze.length,I=0;I<Ze.length;I++)E[at+I]=Ze[I];else i.deps=E=Ze;if(eo()&&(i.f&mt)!==0)for(I=at;I<E.length;I++)(E[I].reactions??=[]).push(i)}else!y&&E!==null&&at<E.length&&(jr(i,at),E.length=at);if(ls()&&pt!==null&&!It&&E!==null&&(i.f&(Fe|Mt|Ge))===0)for(I=0;I<pt.length;I++)Vc(pt[I],i);if(u!==null&&u!==i){if(On++,u.deps!==null)for(let N=0;N<r;N+=1)u.deps[N].rv=On;if(n!==null)for(const N of n)N.rv=On;pt!==null&&(a===null?a=pt:a.push(...pt))}return(i.f&Jr)!==0&&(i.f^=Jr),T}catch(N){return Cc(N)}finally{i.f^=Wa,Ze=n,at=r,pt=a,ue=u,vt=c,os(l),It=d,Fn=p}}function lw(i,n){let r=n.reactions;if(r!==null){var a=vS.call(r,i);if(a!==-1){var u=r.length-1;u===0?r=n.reactions=null:(r[a]=r[u],r.pop())}}if(r===null&&(n.f&Fe)!==0&&(Ze===null||!vr.call(Ze,n))){var c=n;(c.f&mt)!==0&&(c.f^=mt,c.f&=~Hn),Ya(c),XS(c),jr(c,0)}}function jr(i,n){var r=i.deps;if(r!==null)for(var a=n;a<r.length;a++)lw(i,r[a])}function wr(i){var n=i.f;if((n&gn)===0){Te(i,Ue);var r=pe,a=ts;pe=i,ts=!0;try{(n&(Xt|Ec))!==0?iw(i):to(i),Mc(i);var u=Bc(i);i.teardown=typeof u=="function"?u:null,i.wv=Hc;var c;_S&&DS&&(i.f&Ge)!==0&&i.deps}finally{ts=a,pe=r}}}function fr(i){var n=i.f,r=(n&Fe)!==0;if(ue!==null&&!It){var a=pe!==null&&(pe.f&gn)!==0;if(!a&&(vt===null||!vr.call(vt,i))){var u=ue.deps;if((ue.f&Wa)!==0)i.rv<On&&(i.rv=On,Ze===null&&u!==null&&u[at]===i?at++:Ze===null?Ze=[i]:Ze.push(i));else{(ue.deps??=[]).push(i);var c=i.reactions;c===null?i.reactions=[ue]:vr.call(c,ue)||c.push(ue)}}}if(Sr&&pn.has(i))return pn.get(i);if(r){var l=i;if(Sr){var d=l.v;return((l.f&Ue)===0&&l.reactions!==null||Qc(l))&&(d=Ja(l)),pn.set(l,d),d}var p=(l.f&mt)===0&&!It&&ue!==null&&(ts||(ue.f&mt)!==0),_=(l.f&ei)===0;ni(l)&&(p&&(l.f|=mt),Pc(l)),p&&!_&&(Ic(l),Gc(l))}if(Pt?.has(i))return Pt.get(i);if((i.f&Jr)!==0)throw i.v;return i.v}function Gc(i){if(i.f|=mt,i.deps!==null)for(const n of i.deps)(n.reactions??=[]).push(i),(n.f&Fe)!==0&&(n.f&mt)===0&&(Ic(n),Gc(n))}function Qc(i){if(i.v===Be)return!0;if(i.deps===null)return!1;for(const n of i.deps)if(pn.has(n)||(n.f&Fe)!==0&&Qc(n))return!0;return!1}function cw(i){var n=It;try{return It=!0,i()}finally{It=n}}const fw=["touchstart","touchmove"];function hw(i){return fw.includes(i)}const Xi=Symbol("events"),dw=new Set,tc=new Set;let nc=null;function rc(i){var n=this,r=n.ownerDocument,a=i.type,u=i.composedPath?.()||[],c=u[0]||i.target;nc=i;var l=0,d=nc===i&&i[Xi];if(d){var p=u.indexOf(d);if(p!==-1&&(n===document||n===window)){i[Xi]=n;return}var _=u.indexOf(n);if(_===-1)return;p<=_&&(l=p)}if(c=u[l]||i.target,c!==n){wS(i,"currentTarget",{configurable:!0,get(){return c||r}});var R=ue,T=pe;Ft(null),wn(null);try{for(var E,y=[];c!==null;){var I=c.assignedSlot||c.parentNode||c.host||null;try{var N=c[Xi]?.[a];N!=null&&(!c.disabled||i.target===c)&&N.call(c,i)}catch(H){E?y.push(H):E=H}if(i.cancelBubble||I===n||I===null)break;c=I}if(E){for(let H of y)queueMicrotask(()=>{throw H});throw E}}finally{i[Xi]=n,delete i.currentTarget,Ft(R),wn(T)}}}function gw(i,n){return pw(i,n)}const Zi=new Map;function pw(i,{target:n,anchor:r,props:a={},events:u,context:c,intro:l=!0,transformError:d}){JS();var p=void 0,_=tw(()=>{var R=r??n.appendChild(Oc());qS(R,{pending:()=>{}},y=>{FS({});var I=xt;c&&(I.c=c),u&&(a.$$events=u),p=i(y,a)||{},kS()},d);var T=new Set,E=y=>{for(var I=0;I<y.length;I++){var N=y[I];if(!T.has(N)){T.add(N);var H=hw(N);for(const Oe of[n,document]){var W=Zi.get(Oe);W===void 0&&(W=new Map,Zi.set(Oe,W));var ie=W.get(N);ie===void 0?(Oe.addEventListener(N,rc,{passive:H}),W.set(N,1)):W.set(N,ie+1)}}}};return E(SS(dw)),tc.add(E),()=>{for(var y of T)for(const H of[n,document]){var I=Zi.get(H),N=I.get(y);--N==0?(H.removeEventListener(y,rc),I.delete(y),I.size===0&&Zi.delete(H)):I.set(y,N)}tc.delete(E),R!==r&&R.parentNode?.removeChild(R)}});return _w.set(p,_),p}let _w=new WeakMap;const mw="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(mw);MS();function vw(i){}const Ga={init:i=>{te.get(Mn).enableRouting()},handlePageErrorHandler:(i,n,r)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)n.viewUrl=i.viewUrl,r.getEngine()._ui.updateMainContent(n,r);else if(i.errorFn)i.errorFn(n);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const a=i.redirectPath||"/";r.navigation().navigate(a)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const r=window.open(i.url,"_blank","noopener noreferrer");r&&(r.opener=null,r.focus())}},async addSearchParamsFromClient(i,n,r){const a=te.get(vn),u=M.getCurrentPath(r.getConfig().routing?.useHashRouting),l=(await a.getCurrentNode(u.path))?.clientPermissions?.urlParameters,d={...i};if(l){const p={};Object.keys(l).forEach(_=>{_ in d&&l[_]?.write===!0&&(p[_]=d[_],delete d[_])});for(const _ in d)console.warn(`No permission to add the search param "${_}" to the url`);Object.keys(p).length>0&&r.routing().addSearchParams(p,n)}}},$t={luigi:{},init:i=>{console.log("Init communication..."),$t.luigi=i},addListeners:(i,n)=>{i.addEventListener(U.INITIALIZED,r=>{Pe.luigi?.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(U.NAVIGATION_REQUEST,r=>{const{drawer:a,link:u,preserveView:c,modal:l,newTab:d,withoutSync:p,preventContextUpdate:_,preventHistoryEntry:R,fromVirtualTreeRoot:T,fromContext:E,fromClosestContext:y,fromParent:I,relative:N,nodeParams:H}=r.detail,W={drawerSettings:a,modalSettings:l,newTab:d,path:u,preserveView:c,preventContextUpdate:_,options:{fromVirtualTreeRoot:T,fromContext:E,fromClosestContext:y,fromParent:I,relative:N,nodeParams:H},preventHistoryEntry:R,withoutSync:p};te.get(vn).handleNavigationRequest(W,r.callbackFn)}),i.addEventListener(U.RUNTIME_ERROR_HANDLING_REQUEST,r=>{n.navigation().runTimeErrorHandler(r.payload?.data?.errorObj||{})}),i.addEventListener(U.ALERT_REQUEST,r=>{Pe.processAlert(r.payload,!0,i)}),i.addEventListener(U.SHOW_CONFIRMATION_MODAL_REQUEST,r=>{Pe.handleConfirmationModalRequest(r.payload,i)}),i.addEventListener(U.SET_DOCUMENT_TITLE_REQUEST,r=>{$t.luigi.getEngine()._connector?.setDocumentTitle(r.detail.title)}),i.addEventListener(U.SHOW_LOADING_INDICATOR_REQUEST,r=>{$t.luigi.getEngine()._connector?.showLoadingIndicator(i.parentNode)}),i.addEventListener(U.HIDE_LOADING_INDICATOR_REQUEST,r=>{$t.luigi.getEngine()._connector?.hideLoadingIndicator(i.parentNode)}),i.addEventListener(U.ADD_BACKDROP_REQUEST,r=>{$t.luigi.getEngine()._connector?.addBackdrop()}),i.addEventListener(U.REMOVE_BACKDROP_REQUEST,r=>{$t.luigi.getEngine()._connector?.removeBackdrop()}),i.addEventListener(U.SET_DIRTY_STATUS_REQUEST,r=>{Pe.handleDirtyStatusRequest(r.detail?.data?.dirty,r.detail?.source)}),i.addEventListener(U.ADD_NODE_PARAMS_REQUEST,r=>{n.routing().addNodeParams(r.payload.data,r.payload.keepBrowserHistory)}),i.addEventListener(U.OPEN_USER_SETTINGS_REQUEST,r=>{$t.luigi.getEngine()._connector?.openUserSettings(r.detail)}),i.addEventListener(U.CLOSE_USER_SETTINGS_REQUEST,r=>{$t.luigi.getEngine()._connector?.closeUserSettings()}),i.addEventListener(U.ADD_SEARCH_PARAMS_REQUEST,r=>{Ga.addSearchParamsFromClient(r.detail.data,r.detail.keepBrowserHistory,n)}),i.addEventListener(U.UPDATE_MODAL_SETTINGS_REQUEST,r=>{ne.updateModalSettings(r.payload.updatedModalSettings,r.payload.addHistoryEntry,n)}),i.addEventListener(U.SET_CURRENT_LOCALE_REQUEST,r=>{n.i18n().setCurrentLocale(r.detail?.data?.data?.currentLocale,i)})}};class Sw{constructor(){this._ui=ne,this._comm=$t,this._ux=Pe,this._routing=Ga}bootstrap(n){this._app=gw(vw,{target:document.body}),this._connector=n}init(){const n=window.Luigi;te.register(ss,()=>new ss),te.register(vn,()=>new vn(n)),te.register(_n,()=>new _n),te.register(Mn,()=>new Mn(n)),te.register(mr,()=>new mr),te.register(mn,()=>new mn(n)),n.theming()._init(),ne.init(n),Ga.init(n),$t.init(n),Pe.init(n)}}window.Luigi=new pS(new Sw);
|
|
55
55
|
//# sourceMappingURL=luigi.js.map
|