@luigi-project/core-modular 0.0.3-dev.202602240045 → 0.0.3-dev.202602250917

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 CHANGED
@@ -1,16 +1,16 @@
1
- var ui=Object.defineProperty;var St=i=>{throw TypeError(i)};var hi=(i,e,t)=>e in i?ui(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>hi(i,typeof e!="symbol"?e+"":e,t),_t=(i,e,t)=>e.has(i)||St("Cannot "+t);var Q=(i,e,t)=>(_t(i,e,"read from private field"),t?t.call(i):e.get(i)),it=(i,e,t)=>e.has(i)?St("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),nt=(i,e,t,n)=>(_t(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);class di{constructor(e){this.$subscribers=new Set,this.$value=e}set(e){this.$value=e,this.$subscribers.forEach(t=>{t(e)})}update(e){this.set(e(this.$value))}subscribe(e){return this.$subscribers.add(e),e(this.$value),()=>{this.$subscribers.delete(e)}}}function Ot(i){return i.$value}function Be(i){return new di(i)}const v={getRandomId:()=>window.crypto.getRandomValues(new Uint32Array(1))[0],isPromise:i=>i&&v.isFunction(i.then),isFunction:i=>i&&{}.toString.call(i)==="[object Function]",isAsyncFunction:i=>i&&{}.toString.call(i)==="[object AsyncFunction]",isString:i=>typeof i=="string"||i instanceof String,isObject:i=>!!(i&&typeof i=="object"&&!Array.isArray(i)),trimLeadingSlash:i=>v.isString(i)?i.replace(/^\/+/g,""):"",trimTrailingSlash:i=>v.isString(i)?i.replace(/\/+$/,""):"",isElementVisible:i=>i?window.getComputedStyle(i).getPropertyValue("display")!=="none":!1,getNodeList:(i,e=!1)=>{const t=[];return i&&Array.from(document.querySelectorAll(i)).forEach(r=>{e?v.isElementVisible(r)&&t.push(r):t.push(r)}),t},prependOrigin:i=>{if(!i||i.startsWith("http"))return i;const e=i.startsWith("/");return i.length?window.location.origin+(e?"":"/")+i:window.location.origin},getConfigValueFromObject:(i,e)=>{let t=0,n=i;const r=e.split(".");for(;n&&t<r.length;)n=n[r[t++]];return n},getConfigBooleanValue:(i,e)=>{const t=v.getConfigValueFromObject(i,e);return t===!0||t==="true"},getUrlParameter:i=>new URLSearchParams(window.location.search).get(i)},we={wrapAsPromise:i=>new Promise(e=>{e(i)}),applyFunctionPromisified:(i,e)=>(i=i.apply(void 0,e),v.isPromise(i)?i:we.wrapAsPromise(i)),getConfigValueFromObjectAsync:(i,e,...t)=>{const n=v.getConfigValueFromObject(i,e);return v.isFunction(n)?we.applyFunctionPromisified(n,t):we.wrapAsPromise(n)}};class gi{setErrorMessage(e){var t,n;(n=(t=this.getLuigi().getEngine())==null?void 0:t._connector)==null||n.showFatalError(e)}getLuigi(){return window.Luigi}getConfigValue(e){return this.getLuigi().getConfigValue(e)}getConfigValueAsync(e){return this.getLuigi().getConfigValueAsync(e)}async executeConfigFnAsync(e,t=!1,...n){const r=this.getConfigValue(e);if(v.isFunction(r))try{return await we.applyFunctionPromisified(r,n)}catch(s){if(t)return Promise.reject(s)}return Promise.resolve(void 0)}}const F=new gi;class fi{constructor(){this._internalStorage={},this._defaultStorage="localStorage",this._authKey="luigi.auth",this._newlyAuthorizedKey="luigi.newlyAuthorized",this._invalidStorageMsg="Configuration Error: Invalid auth.storage value defined. Must be one of localStorage, sessionStorage or none."}reset(){this._storageType=void 0}getStorageKey(){return this._authKey}getStorageType(){return this._storageType||(this._storageType=F.getConfigValue("auth.storage")||this._defaultStorage),this._storageType}getAuthData(){return this._getStore(this.getStorageKey())}setAuthData(e){this._setStore(this.getStorageKey(),e)}removeAuthData(){this._setStore(this.getStorageKey(),void 0)}isNewlyAuthorized(){return!!this._getStore(this._newlyAuthorizedKey)}setNewlyAuthorized(){this._setStore(this._newlyAuthorizedKey,!0)}removeNewlyAuthorized(){this._setStore(this._newlyAuthorizedKey,void 0)}_getWebStorage(e){return window[e]}_setStore(e,t){switch(this.getStorageType()){case"localStorage":case"sessionStorage":t!==void 0?this._getWebStorage(this.getStorageType()).setItem(e,JSON.stringify(t)):this._getWebStorage(this.getStorageType()).removeItem(e);break;case"none":this._internalStorage[e]=t;break;default:console.error(this._invalidStorageMsg)}}_getStore(e){try{switch(this.getStorageType()){case"localStorage":case"sessionStorage":return JSON.parse(this._getWebStorage(this.getStorageType()).getItem(e));case"none":return this._internalStorage[e];default:console.error(this._invalidStorageMsg)}}catch{console.warn("Error parsing authorization data. Auto-logout might not work!")}}}const q=new fi;class pi{isAuthorizationEnabled(){return!!F.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&Te.startAuthorization()}logout(){this.isAuthorizationEnabled()&&Te.logout()}async handleAuthEvent(e,t,n,r){const s=await F.executeConfigFnAsync("auth.events."+e,!1,t,n),a=s===void 0||!!s;if(a&&r){window.location.href=r;return}return a}get store(){var e;return(e=F.getLuigi())!=null&&e.initialized||console.warn("Luigi Core is not initialized yet. Consider moving your code to the luigiAfterInit lifecycle hook. Documentation: https://docs.luigi-project.io/docs/lifecycle-hooks"),{getStorageKey:()=>q.getStorageKey(),getStorageType:()=>q.getStorageType(),getAuthData:()=>q.getAuthData(),setAuthData:t=>q.setAuthData(t),removeAuthData:()=>q.removeAuthData(),setNewlyAuthorized:()=>{q.setNewlyAuthorized(),Te.resetExpirationChecks()}}}}const ve=new pi;class mi{getStoredAuthData(){return q.getAuthData()}isLoggedIn(){const e=this.getStoredAuthData();return!!(e&&e.accessTokenExpirationDate>Number(new Date))}parseUrlAuthErrors(){const e=v.getUrlParameter("error"),t=v.getUrlParameter("errorDescription");if(e)return{error:e,errorDescription:t}}async handleUrlAuthErrors(e,t,n){return t?await ve.handleAuthEvent("onAuthError",e,{error:t,errorDescription:n},e.logoutUrl+"?post_logout_redirect_uri="+e.post_logout_redirect_uri+"&error="+t+"&errorDescription="+n):!0}}const he=new mi;class Si{constructor(){this._userInfoStore=Be({}),this._loggedInStore=Be(!1)}setUserInfo(e){this._userInfoStore.set(e)}setLoggedIn(e){this._loggedInStore.set(e)}getUserInfoStore(){return this._userInfoStore}getLoggedInStore(){return this._loggedInStore}async init(){const e=F.getConfigValue("auth.use");if(!e)return Promise.resolve(!0);const t=F.getConfigValue(`auth.${e}`),n=he.parseUrlAuthErrors()||{};if(await he.handleUrlAuthErrors(t,n.error,n.errorDescription))return this.idpProviderInstance=this.getIdpProviderInstance(e,t),v.isPromise(this.idpProviderInstance)?this.idpProviderInstance.then(s=>(this.idpProviderInstance=s,this.checkAuth(t))).catch(s=>{const a=`Error: ${s.message||s}`;console.error(a,s.message&&s),F.setErrorMessage(a)}):this.checkAuth(t)}async checkAuth(e){const t=he.getStoredAuthData();if(!t||!he.isLoggedIn()){if(F.getConfigValue("auth.disableAutoLogin"))return;let r=!0;return t&&(r=await ve.handleAuthEvent("onAuthExpired",e)),r?this.startAuthorization():void 0}this.idpProviderInstance.settings&&v.isFunction(this.idpProviderInstance.settings.userInfoFn)?this.idpProviderInstance.settings.userInfoFn(this.idpProviderInstance.settings,t).then(r=>{this.setUserInfo(r),this.setLoggedIn(!0)}):v.isFunction(this.idpProviderInstance.userInfo)?this.idpProviderInstance.userInfo(e).then(r=>{this.setUserInfo(r),this.setLoggedIn(!0)}):(this.setLoggedIn(!0),this.setUserInfo(Ot(this._userInfoStore))),v.isFunction(F.getConfigValue("auth.events.onAuthSuccessful"))&&q.isNewlyAuthorized()&&await ve.handleAuthEvent("onAuthSuccessful",e,t),q.removeNewlyAuthorized(),v.isFunction(this.idpProviderInstance.setTokenExpirationAction)&&this.idpProviderInstance.setTokenExpirationAction(),v.isFunction(this.idpProviderInstance.setTokenExpireSoonAction)&&this.idpProviderInstance.setTokenExpireSoonAction()}async startAuthorization(){if(this.idpProviderInstance)return this.idpProviderInstance.login().then(e=>{q.setNewlyAuthorized(),e&&console.error(e)})}logout(){const e=he.getStoredAuthData(),t=async s=>{await ve.handleAuthEvent("onLogout",this.idpProviderInstance.settings,void 0,s),q.removeAuthData()},n=F.getConfigValue(`auth.${F.getConfigValue("auth.use")}.logoutFn`),r=F.getConfigValueAsync("navigation.profile.logout.customLogoutFn");v.isFunction(n)?n(this.idpProviderInstance.settings,e,t):v.isFunction(this.idpProviderInstance.logout)?this.idpProviderInstance.logout(e,t):r&&v.isFunction(r)?r(e,t):t(this.idpProviderInstance.settings.logoutUrl)}createIdpProviderException(e){return{message:e,name:"IdpProviderException"}}async getIdpProviderInstance(e,t){const n=v.getConfigValueFromObject(t,"idpProvider");if(n){const s=await new n(t);return["login"].forEach(a=>{if(!v.isFunction(s[a]))throw this.createIdpProviderException(`${a} function does not exist in custom IDP Provider ${e}`)}),s}if(v.isFunction(F.getConfigValue("auth.events.onAuthConfigError")))await ve.handleAuthEvent("onAuthConfigError",{idpProviderName:e,type:"IdpProviderException"});else throw this.createIdpProviderException(`IDP Provider ${e} does not exist.`)}unload(){this.idpProviderInstance&&v.isFunction(this.idpProviderInstance.unload)&&this.idpProviderInstance.unload()}resetExpirationChecks(){this.idpProviderInstance&&v.isFunction(this.idpProviderInstance.resetExpirationChecks)&&this.idpProviderInstance.resetExpirationChecks()}}const Te=new Si,_i={luigi:{button:{confirm:"Yes",dismiss:"No"},confirmationModal:{body:"Are you sure you want to do this?",header:"Confirmation"},navigation:{up:"Up"},notExactTargetNode:"Could not map the exact target node for the requested route {route}.",requestedRouteNotFound:"Could not find the requested route {route}.",unsavedChangesAlert:{body:"Unsaved changes will be lost. Do you want to continue?",header:"Unsaved changes detected"}}},Ei=_i,qe={sanitizeHtml(i=""){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/javascript:/g,"")},restoreSanitizedBrs(i=""){return i.replace(/&lt;br\/&gt;/g,"<br>").replace(/&lt;br \/&gt;/g,"<br>").replace(/&lt;br&gt;/g,"<br>").replace(/&lt;br &gt;/g,"<br>")},restoreSanitizedElements(i=""){let e=i;const t=["i","b","br","mark","strong","em","small","del","ins","sub","sup"];for(let n=0;n<t.length;n++){const r=new RegExp(`&lt;${t[n]}/&gt;`,"g"),s=new RegExp(`&lt;${t[n]} /&gt;`,"g"),a=new RegExp(`&lt;${t[n]}&gt;`,"g"),o=new RegExp(`&lt;${t[n]} &gt;`,"g"),l=new RegExp(`&lt;/${t[n]}[/]&gt;`,"g"),c=new RegExp(`&lt;/${t[n]} [/]&gt;`,"g"),f=new RegExp(`&lt;[/]${t[n]}&gt;`,"g"),h=new RegExp(`&lt;[/]${t[n]} &gt;`,"g");e=e.replace(r,`<${t[n]}>`).replace(s,`<${t[n]}>`).replace(a,`<${t[n]}>`).replace(o,`<${t[n]}>`).replace(l,`</${t[n]}>`).replace(c,`</${t[n]}>`).replace(f,`</${t[n]}>`).replace(h,`</${t[n]}>`)}return e},sanatizeHtmlExceptTextFormatting(i=""){return this.restoreSanitizedElements(this.sanitizeHtml(i))},sanitizeParam(i=""){return String(i).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&sol;")},escapeKeyForRegexp(i=""){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},processTextAndLinks(i="",e,t){const r={sanitizedText:this.restoreSanitizedBrs(this.sanitizeHtml(i)),links:[]};return e?Object.entries(e).reduce((s,[a,o])=>{const l=`_luigi_alert_${t}_link_${this.sanitizeParam(a)}`,c=this.restoreSanitizedBrs(this.sanitizeHtml(o.text)),f=`<a id="${l}">${c}</a>`,h=this.escapeKeyForRegexp(a),u=new RegExp(`({${h}})`,"g");return{sanitizedText:s.sanitizedText.replace(u,f),links:s.links.concat({elemId:l,url:o.url?encodeURI(this.sanitizeHtml(o.url)):void 0,dismissKey:o.dismissKey?encodeURI(this.sanitizeHtml(o.dismissKey)):void 0})}},r):r}};class vi{constructor(e){this.luigi=e,this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.listeners={},this.translationTable=Ei}_init(){this._initCustomImplementation(),this.addCurrentLocaleChangeListener(e=>{this.broadcastLocaleToAllContainers(e)})}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(e,t){var n,r;if(!((n=t==null?void 0:t.clientPermissions)!=null&&n.changeCurrentLocale)){console.error('Current locale change declined from client, as client permission "changeCurrentLocale" is not set for this view.');return}e&&(t&&(t.locale=e),sessionStorage.setItem(this.currentLocaleStorageKey,e),this._notifyLocaleChange(e)),(r=this.luigi.getEngine()._connector)==null||r.setCurrentLocale(e)}addCurrentLocaleChangeListener(e){let t=null;return v.isFunction(e)?(t=v.getRandomId(),this.listeners[t]=e):console.error("Provided locale change listener is not a function."),t}removeCurrentLocaleChangeListener(e){e&&this.listeners[e]?delete this.listeners[e]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}getTranslation(e,t=void 0,n=void 0){if(!e)return"";if(this.translationImpl){const s=this.translationImpl.getTranslation(e,t,n);if(s!==e)return s}const r=this.findTranslation(e,this.translationTable,t);return r||e}_notifyLocaleChange(e){Object.getOwnPropertyNames(this.listeners).forEach(t=>{this.listeners[Number(t)](e)}),this.luigi.configChanged()}_initCustomImplementation(){this.translationImpl=this.luigi.getConfigValue("settings.customTranslationImplementation"),v.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}broadcastLocaleToAllContainers(e){const t=v.getNodeList("luigi-container[lui_container]");t!=null&&t.length&&e&&t.forEach(n=>{n.locale=e,n.updateContext({locale:e})})}findTranslation(e,t,n){const r=e.split(".");for(let s=0;s<r.length;s++){const a=r[s];if(Object.prototype.hasOwnProperty.call(t,a)&&typeof t[a]=="object")t=t[a];else return n?this.findInterpolations(t[a],n):t[a]}}findInterpolations(e,t){return typeof e!="string"||!e.trim()||Object.keys(t).forEach(n=>{e=e.replace(new RegExp("{"+qe.escapeKeyForRegexp(n)+"}","gi"),t[n])}),e}}const Ci={luigiAfterInit:async i=>{v.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await F.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class wi{constructor(){this.featureToggleList=new Set}setFeatureToggle(e,t=!1){this.isValid(e)&&(e.startsWith("!")&&!t||this.isDuplicatedOrDisabled(e)||this.featureToggleList.add(e))}unsetFeatureToggle(e){if(this.isValid(e)){if(!this.featureToggleList.has(e)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(e)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(t=>!t.startsWith("!"))}isValid(e){return v.isString(e)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(e){return this.featureToggleList.has(e)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${e}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class fe{constructor(e){this.luigi=e,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const e=[...this._modalStack];for(const{onInternalClose:t}of e)try{typeof t=="function"&&t()}catch(n){console.warn("onInternalClose threw an error",n)}this.clearModalStack()}registerModal(e){e&&this._modalStack.push(e)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(e){if(this._modalStack.length>0){const t=this._modalStack[0];t.modalsettings={...t.modalsettings,...e}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){this._modalStack.pop()}}const M={normalizePath:i=>{if(!i||i.length<=0)return i;let e=i;return e.startsWith("#")&&(e=e.substring(1)),e.startsWith("/")&&(e=e.substring(1)),e},segmentMatches:(i,e,t)=>!!(i===e||e.startsWith(":")&&t&&t[e.substr(1)]===i),checkMatch:(i,e,t)=>{let n=!0;return v.trimTrailingSlash(v.trimLeadingSlash(i)).split("/").forEach((r,s)=>{var a,o;n&&(s+1>=e.length||!((a=e[s+1])!=null&&a.pathSegment)||!M.segmentMatches(r,((o=e[s+1])==null?void 0:o.pathSegment)??"",t??{}))&&(n=!1)}),n},checkVisibleForFeatureToggles:(i,e)=>{if(i!=null&&i.visibleForFeatureToggles){const t=(e==null?void 0:e.getActiveFeatureToggleList())||[];for(const n of i.visibleForFeatureToggles)if(n.startsWith("!")){if(t.includes(n.slice(1)))return!1}else if(!t.includes(n))return!1}return!0},generateTooltipText:(i,e,t)=>{let n=i==null?void 0:i.tooltipText;switch(n===void 0&&(n=t.getConfigValue("navigation.defaults.tooltipText")),n){case void 0:return e;case!1:return"";default:return t.i18n().getTranslation(n)}},isNodeAccessPermitted:(i,e,t,n)=>{if(n.auth().isAuthorizationEnabled()){const a=he.isLoggedIn(),o=i.anonymousAccess;if(a&&o==="exclusive"||!a&&o!=="exclusive"&&o!==!0)return!1}const r=n.featureToggles();if(!M.checkVisibleForFeatureToggles(i,r))return!1;const s=n.getConfigValue("navigation.nodeAccessibilityResolver");return typeof s!="function"?!0:s(i,e,t)},updateHeaderTitle:(i,e)=>{const t=i==null?void 0:i.items;if(t&&e){let n="";return[...t].sort((r,s)=>(s.link||"").localeCompare(r.link||"")).some(r=>{let s=!1;if(s=M.checkMatch(r.link||"",e.nodesInPath??[]),!s&&r.selectionConditions&&r.selectionConditions.route&&(s=M.checkMatch(r.selectionConditions.route,e.nodesInPath??[]),s&&(r.selectionConditions.contextCriteria||[]).forEach(a=>{var o,l;s=s&&((l=(o=e==null?void 0:e.selectedNode)==null?void 0:o.context)==null?void 0:l[a.key])===a.value})),s)return n=r.title||"",!0}),n}},buildPath(i,e){return i.map(n=>{var s;const r=n.pathSegment;if(r!=null&&r.startsWith(":")){const a=r.slice(1),o=(s=e==null?void 0:e.pathParams)==null?void 0:s[a];if(o!=null)return encodeURIComponent(String(o))}return r}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let e="";return i.forEach(t=>{t&&(e+=(e?"_":"")+encodeURIComponent(t.toLowerCase().split(" ").join("")))}),e}};class le{constructor(){this.dataManagement=new Map}setChildren(e,t){this.dataManagement.set(e,t),this.navPath=""}getChildren(e){return e?this.dataManagement.get(e):{}}hasChildren(e){const t=this.getChildren(e);return!!(t&&Object.prototype.hasOwnProperty.call(t,"children"))}setRootNode(e){this.dataManagement.set("_luigiRootNode",{node:e})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(e){if(this.hasChildren(e)){const t=this.getChildren(e).children;for(let n=0;n<t.length;n++)this.deleteNodesRecursively(t[n])}this.dataManagement.delete(e)}}const C={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,e,t){let n=e;const[r,s]=n.split("?"),a=new URLSearchParams(s);return this.modifySearchParams(i,a,t),n=r,a.toString()!==""&&(n+=`?${a.toString()}`),n},modifySearchParams(i,e,t){for(const[n,r]of Object.entries(i)){const s=t?`${t}${n}`:n;e.set(s,r),r===void 0&&e.delete(s)}},filterNodeParams(i,e){const t={},n=this.getContentViewParamPrefix(e);return i&&Object.entries(i).forEach(r=>{if(r[0].startsWith(n)){const s=r[0].substr(n.length);t[s]=r[1]}}),this.sanitizeParamsMap(t)},getContentViewParamPrefix(i){let e=i==null?void 0:i.getConfigValue("routing.nodeParamPrefix");return e===!1?e="":e||(e=this.defaultContentViewParamPrefix),e},sanitizeParamsMap(i){return Object.entries(i).reduce((e,t)=>(e[qe.sanitizeParam(t[0])]=qe.sanitizeParam(t[1]),e),{})},prepareSearchParamsForClient(i,e){const t={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(n=>{var r,s;n in e.routing().getSearchParams()&&((r=i.clientPermissions)!=null&&r.urlParameters)&&((s=i.clientPermissions.urlParameters[n])==null?void 0:s.read)===!0&&(t[n]=e.routing().getSearchParams()[n])}),t},getCurrentPath(i){if(i){const e=M.normalizePath(location.hash),[t,n]=e.split("?");return{path:t,query:n}}else return{path:M.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,e){return this.getQueryParams(e)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return C.getLocation().search?C.parseParams(C.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=C.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?C.parseParams(C.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let e=i.getConfigValue("routing.modalPathParam");return e||(e=this.defaultModalViewParamName),e},parseParams(i){const e=new URLSearchParams(i),t=new Map;for(const[n,r]of e.entries())t.set(n,r);return Object.fromEntries(t)},getModalParamsFromPath(i){const e=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return e&&JSON.parse(e)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,e){const t=new URLSearchParams(i);return t.delete(e),t.delete(`${e}Params`),t.toString()},handleHistoryState(i,e){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:e},i},encodeParams(i){const e=[];for(const t in i)e.push(encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,e){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const n=e.getConfigValue("navigation.validWebcomponentUrls");if((n==null?void 0:n.length)>0)for(const r of n)try{if(new RegExp(r).test(i))return!0}catch(s){console.error(s)}return!1}return!0},setFeatureToggles(i,e,t){const n=this.sanitizeParamsMap(this.parseParams(e.split("?")[1]));let r;if(n[i]&&(r=n[i]),!r)return;const s=r.split(",");s.length>0&&s[0]!==""&&s.forEach(a=>t==null?void 0:t.setFeatureToggle(a,!0))},substituteDynamicParamsInObject(i,e,t=":",n=!1){return Object.entries(i).map(([r,s])=>{const a=n?Object.keys(e).find(o=>s&&s.indexOf(t+o)>=0):Object.keys(e).find(o=>s===t+o);return[r,a?n?s.replace(t+a,e[a]):e[a]:s]}).reduce((r,[s,a])=>Object.assign(r,{[s]:a}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,e){return this.isDynamicNode(i)&&i.pathSegment?e[i.pathSegment.substring(1)]:void 0}},rt={logout:{label:"Sign Out",icon:"log"}};class Ti{constructor(){this.services=new Map}register(e,t,n=!0){this.services.set(e,{factory:t,singleton:n})}get(e){const t=this.services.get(e);if(!t)throw new Error(`Service '${e}' is not registered.`);return t.singleton?(t.instance||(t.instance=t.factory()),t.instance):t.factory()}}const y=new Ti;class ce{constructor(e){this.luigi=e}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=y.get(le)),this.nodeDataManagementService}async getPathData(e){var c,f,h;const t=this.luigi.getConfig();let n=e.split("/");(n==null?void 0:n.length)>0&&n[0]===""&&(n=n.slice(1));let s=((c=t.navigation)==null?void 0:c.globalContext)||{},a;if(this.getNodeDataManagementService().hasRootNode())a=this.getNodeDataManagementService().getRootNode().node;else{let u=await this.luigi.getConfigValueAsync("navigation.nodes");typeof u=="object"&&!Array.isArray(u)?(a=u,a.pathSegment&&(a.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):a={children:u},a.children=await this.getChildren(a,s),a.children=this.prepareRootNodes(a.children||[],s),this.getNodeDataManagementService().setRootNode(a)}let o={};const l={selectedNodeChildren:a.children,nodesInPath:[a],rootNodes:a.children,pathParams:o};for(const u of n)if(l.selectedNodeChildren){const d=this.findMatchingNode(u,l.selectedNodeChildren||[]);if(!d){console.warn("No matching node found for segment:",u);break}const p=d.context||{},_=M.mergeContext(s,p);let E=_;l.selectedNodeChildren=this.getAccessibleNodes(d,d.children||[],_),(f=d.pathSegment)!=null&&f.startsWith(":")&&(o[d.pathSegment.replace(":","")]=qe.sanitizeParam(u),E=C.substituteDynamicParamsInObject(_,o)),s=E,d.context=E,l.selectedNode=d,l.selectedNode&&((h=l.nodesInPath)==null||h.push(l.selectedNode));let R=await this.getChildren(d,s);l.selectedNodeChildren=R?this.getAccessibleNodes(l.selectedNode,R,s):void 0}return l}findMatchingNode(e,t){let n;const r=t.filter(a=>!!a.pathSegment).length,s=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":")).length;if(r>1&&(s===1&&(console.warn(`Invalid node setup detected.
1
+ var di=Object.defineProperty;var Et=i=>{throw TypeError(i)};var gi=(i,e,t)=>e in i?di(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var A=(i,e,t)=>gi(i,typeof e!="symbol"?e+"":e,t),vt=(i,e,t)=>e.has(i)||Et("Cannot "+t);var Q=(i,e,t)=>(vt(i,e,"read from private field"),t?t.call(i):e.get(i)),it=(i,e,t)=>e.has(i)?Et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),nt=(i,e,t,n)=>(vt(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);class fi{constructor(e){this.$subscribers=new Set,this.$value=e}set(e){this.$value=e,this.$subscribers.forEach(t=>{t(e)})}update(e){this.set(e(this.$value))}subscribe(e){return this.$subscribers.add(e),e(this.$value),()=>{this.$subscribers.delete(e)}}}function Dt(i){return i.$value}function Be(i){return new fi(i)}const E={getRandomId:()=>window.crypto.getRandomValues(new Uint32Array(1))[0],isPromise:i=>i&&E.isFunction(i.then),isFunction:i=>i&&{}.toString.call(i)==="[object Function]",isAsyncFunction:i=>i&&{}.toString.call(i)==="[object AsyncFunction]",isString:i=>typeof i=="string"||i instanceof String,isObject:i=>!!(i&&typeof i=="object"&&!Array.isArray(i)),trimLeadingSlash:i=>E.isString(i)?i.replace(/^\/+/g,""):"",trimTrailingSlash:i=>E.isString(i)?i.replace(/\/+$/,""):"",isElementVisible:i=>i?window.getComputedStyle(i).getPropertyValue("display")!=="none":!1,getNodeList:(i,e=!1)=>{const t=[];return i&&Array.from(document.querySelectorAll(i)).forEach(r=>{e?E.isElementVisible(r)&&t.push(r):t.push(r)}),t},prependOrigin:i=>{if(!i||i.startsWith("http"))return i;const e=i.startsWith("/");return i.length?window.location.origin+(e?"":"/")+i:window.location.origin},getConfigValueFromObject:(i,e)=>{let t=0,n=i;const r=e.split(".");for(;n&&t<r.length;)n=n[r[t++]];return n},getConfigBooleanValue:(i,e)=>{const t=E.getConfigValueFromObject(i,e);return t===!0||t==="true"},getUrlParameter:i=>new URLSearchParams(window.location.search).get(i)},we={wrapAsPromise:i=>new Promise(e=>{e(i)}),applyFunctionPromisified:(i,e)=>(i=i.apply(void 0,e),E.isPromise(i)?i:we.wrapAsPromise(i)),getConfigValueFromObjectAsync:(i,e,...t)=>{const n=E.getConfigValueFromObject(i,e);return E.isFunction(n)?we.applyFunctionPromisified(n,t):we.wrapAsPromise(n)}};class pi{setErrorMessage(e){var t,n;(n=(t=this.getLuigi().getEngine())==null?void 0:t._connector)==null||n.showFatalError(e)}getLuigi(){return window.Luigi}getConfigValue(e){return this.getLuigi().getConfigValue(e)}getConfigValueAsync(e){return this.getLuigi().getConfigValueAsync(e)}async executeConfigFnAsync(e,t=!1,...n){const r=this.getConfigValue(e);if(E.isFunction(r))try{return await we.applyFunctionPromisified(r,n)}catch(a){if(t)return Promise.reject(a)}return Promise.resolve(void 0)}}const F=new pi;class mi{constructor(){this._internalStorage={},this._defaultStorage="localStorage",this._authKey="luigi.auth",this._newlyAuthorizedKey="luigi.newlyAuthorized",this._invalidStorageMsg="Configuration Error: Invalid auth.storage value defined. Must be one of localStorage, sessionStorage or none."}reset(){this._storageType=void 0}getStorageKey(){return this._authKey}getStorageType(){return this._storageType||(this._storageType=F.getConfigValue("auth.storage")||this._defaultStorage),this._storageType}getAuthData(){return this._getStore(this.getStorageKey())}setAuthData(e){this._setStore(this.getStorageKey(),e)}removeAuthData(){this._setStore(this.getStorageKey(),void 0)}isNewlyAuthorized(){return!!this._getStore(this._newlyAuthorizedKey)}setNewlyAuthorized(){this._setStore(this._newlyAuthorizedKey,!0)}removeNewlyAuthorized(){this._setStore(this._newlyAuthorizedKey,void 0)}_getWebStorage(e){return window[e]}_setStore(e,t){switch(this.getStorageType()){case"localStorage":case"sessionStorage":t!==void 0?this._getWebStorage(this.getStorageType()).setItem(e,JSON.stringify(t)):this._getWebStorage(this.getStorageType()).removeItem(e);break;case"none":this._internalStorage[e]=t;break;default:console.error(this._invalidStorageMsg)}}_getStore(e){try{switch(this.getStorageType()){case"localStorage":case"sessionStorage":return JSON.parse(this._getWebStorage(this.getStorageType()).getItem(e));case"none":return this._internalStorage[e];default:console.error(this._invalidStorageMsg)}}catch{console.warn("Error parsing authorization data. Auto-logout might not work!")}}}const q=new mi;class Si{isAuthorizationEnabled(){return!!F.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&Te.startAuthorization()}logout(){this.isAuthorizationEnabled()&&Te.logout()}async handleAuthEvent(e,t,n,r){const a=await F.executeConfigFnAsync("auth.events."+e,!1,t,n),s=a===void 0||!!a;if(s&&r){window.location.href=r;return}return s}get store(){var e;return(e=F.getLuigi())!=null&&e.initialized||console.warn("Luigi Core is not initialized yet. Consider moving your code to the luigiAfterInit lifecycle hook. Documentation: https://docs.luigi-project.io/docs/lifecycle-hooks"),{getStorageKey:()=>q.getStorageKey(),getStorageType:()=>q.getStorageType(),getAuthData:()=>q.getAuthData(),setAuthData:t=>q.setAuthData(t),removeAuthData:()=>q.removeAuthData(),setNewlyAuthorized:()=>{q.setNewlyAuthorized(),Te.resetExpirationChecks()}}}}const ve=new Si;class _i{getStoredAuthData(){return q.getAuthData()}isLoggedIn(){const e=this.getStoredAuthData();return!!(e&&e.accessTokenExpirationDate>Number(new Date))}parseUrlAuthErrors(){const e=E.getUrlParameter("error"),t=E.getUrlParameter("errorDescription");if(e)return{error:e,errorDescription:t}}async handleUrlAuthErrors(e,t,n){return t?await ve.handleAuthEvent("onAuthError",e,{error:t,errorDescription:n},e.logoutUrl+"?post_logout_redirect_uri="+e.post_logout_redirect_uri+"&error="+t+"&errorDescription="+n):!0}}const he=new _i;class Ei{constructor(){this._userInfoStore=Be({}),this._loggedInStore=Be(!1)}setUserInfo(e){this._userInfoStore.set(e)}setLoggedIn(e){this._loggedInStore.set(e)}getUserInfoStore(){return this._userInfoStore}getLoggedInStore(){return this._loggedInStore}async init(){const e=F.getConfigValue("auth.use");if(!e)return Promise.resolve(!0);const t=F.getConfigValue(`auth.${e}`),n=he.parseUrlAuthErrors()||{};if(await he.handleUrlAuthErrors(t,n.error,n.errorDescription))return this.idpProviderInstance=this.getIdpProviderInstance(e,t),E.isPromise(this.idpProviderInstance)?this.idpProviderInstance.then(a=>(this.idpProviderInstance=a,this.checkAuth(t))).catch(a=>{const s=`Error: ${a.message||a}`;console.error(s,a.message&&a),F.setErrorMessage(s)}):this.checkAuth(t)}async checkAuth(e){const t=he.getStoredAuthData();if(!t||!he.isLoggedIn()){if(F.getConfigValue("auth.disableAutoLogin"))return;let r=!0;return t&&(r=await ve.handleAuthEvent("onAuthExpired",e)),r?this.startAuthorization():void 0}this.idpProviderInstance.settings&&E.isFunction(this.idpProviderInstance.settings.userInfoFn)?this.idpProviderInstance.settings.userInfoFn(this.idpProviderInstance.settings,t).then(r=>{this.setUserInfo(r),this.setLoggedIn(!0)}):E.isFunction(this.idpProviderInstance.userInfo)?this.idpProviderInstance.userInfo(e).then(r=>{this.setUserInfo(r),this.setLoggedIn(!0)}):(this.setLoggedIn(!0),this.setUserInfo(Dt(this._userInfoStore))),E.isFunction(F.getConfigValue("auth.events.onAuthSuccessful"))&&q.isNewlyAuthorized()&&await ve.handleAuthEvent("onAuthSuccessful",e,t),q.removeNewlyAuthorized(),E.isFunction(this.idpProviderInstance.setTokenExpirationAction)&&this.idpProviderInstance.setTokenExpirationAction(),E.isFunction(this.idpProviderInstance.setTokenExpireSoonAction)&&this.idpProviderInstance.setTokenExpireSoonAction()}async startAuthorization(){if(this.idpProviderInstance)return this.idpProviderInstance.login().then(e=>{q.setNewlyAuthorized(),e&&console.error(e)})}logout(){const e=he.getStoredAuthData(),t=async a=>{await ve.handleAuthEvent("onLogout",this.idpProviderInstance.settings,void 0,a),q.removeAuthData()},n=F.getConfigValue(`auth.${F.getConfigValue("auth.use")}.logoutFn`),r=F.getConfigValueAsync("navigation.profile.logout.customLogoutFn");E.isFunction(n)?n(this.idpProviderInstance.settings,e,t):E.isFunction(this.idpProviderInstance.logout)?this.idpProviderInstance.logout(e,t):r&&E.isFunction(r)?r(e,t):t(this.idpProviderInstance.settings.logoutUrl)}createIdpProviderException(e){return{message:e,name:"IdpProviderException"}}async getIdpProviderInstance(e,t){const n=E.getConfigValueFromObject(t,"idpProvider");if(n){const a=await new n(t);return["login"].forEach(s=>{if(!E.isFunction(a[s]))throw this.createIdpProviderException(`${s} function does not exist in custom IDP Provider ${e}`)}),a}if(E.isFunction(F.getConfigValue("auth.events.onAuthConfigError")))await ve.handleAuthEvent("onAuthConfigError",{idpProviderName:e,type:"IdpProviderException"});else throw this.createIdpProviderException(`IDP Provider ${e} does not exist.`)}unload(){this.idpProviderInstance&&E.isFunction(this.idpProviderInstance.unload)&&this.idpProviderInstance.unload()}resetExpirationChecks(){this.idpProviderInstance&&E.isFunction(this.idpProviderInstance.resetExpirationChecks)&&this.idpProviderInstance.resetExpirationChecks()}}const Te=new Ei,vi={luigi:{button:{confirm:"Yes",dismiss:"No"},confirmationModal:{body:"Are you sure you want to do this?",header:"Confirmation"},navigation:{up:"Up"},notExactTargetNode:"Could not map the exact target node for the requested route {route}.",requestedRouteNotFound:"Could not find the requested route {route}.",unsavedChangesAlert:{body:"Unsaved changes will be lost. Do you want to continue?",header:"Unsaved changes detected"}}},Ci=vi,qe={sanitizeHtml(i=""){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/javascript:/g,"")},restoreSanitizedBrs(i=""){return i.replace(/&lt;br\/&gt;/g,"<br>").replace(/&lt;br \/&gt;/g,"<br>").replace(/&lt;br&gt;/g,"<br>").replace(/&lt;br &gt;/g,"<br>")},restoreSanitizedElements(i=""){let e=i;const t=["i","b","br","mark","strong","em","small","del","ins","sub","sup"];for(let n=0;n<t.length;n++){const r=new RegExp(`&lt;${t[n]}/&gt;`,"g"),a=new RegExp(`&lt;${t[n]} /&gt;`,"g"),s=new RegExp(`&lt;${t[n]}&gt;`,"g"),o=new RegExp(`&lt;${t[n]} &gt;`,"g"),l=new RegExp(`&lt;/${t[n]}[/]&gt;`,"g"),c=new RegExp(`&lt;/${t[n]} [/]&gt;`,"g"),f=new RegExp(`&lt;[/]${t[n]}&gt;`,"g"),h=new RegExp(`&lt;[/]${t[n]} &gt;`,"g");e=e.replace(r,`<${t[n]}>`).replace(a,`<${t[n]}>`).replace(s,`<${t[n]}>`).replace(o,`<${t[n]}>`).replace(l,`</${t[n]}>`).replace(c,`</${t[n]}>`).replace(f,`</${t[n]}>`).replace(h,`</${t[n]}>`)}return e},sanatizeHtmlExceptTextFormatting(i=""){return this.restoreSanitizedElements(this.sanitizeHtml(i))},sanitizeParam(i=""){return String(i).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&sol;")},escapeKeyForRegexp(i=""){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},processTextAndLinks(i="",e,t){const r={sanitizedText:this.restoreSanitizedBrs(this.sanitizeHtml(i)),links:[]};return e?Object.entries(e).reduce((a,[s,o])=>{const l=`_luigi_alert_${t}_link_${this.sanitizeParam(s)}`,c=this.restoreSanitizedBrs(this.sanitizeHtml(o.text)),f=`<a id="${l}">${c}</a>`,h=this.escapeKeyForRegexp(s),u=new RegExp(`({${h}})`,"g");return{sanitizedText:a.sanitizedText.replace(u,f),links:a.links.concat({elemId:l,url:o.url?encodeURI(this.sanitizeHtml(o.url)):void 0,dismissKey:o.dismissKey?encodeURI(this.sanitizeHtml(o.dismissKey)):void 0})}},r):r}};class wi{constructor(e){this.luigi=e,this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.listeners={},this.translationTable=Ci}_init(){this._initCustomImplementation(),this.addCurrentLocaleChangeListener(e=>{this.broadcastLocaleToAllContainers(e)})}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(e,t){var n,r;if(!((n=t==null?void 0:t.clientPermissions)!=null&&n.changeCurrentLocale)){console.error('Current locale change declined from client, as client permission "changeCurrentLocale" is not set for this view.');return}e&&(t&&(t.locale=e),sessionStorage.setItem(this.currentLocaleStorageKey,e),this._notifyLocaleChange(e)),(r=this.luigi.getEngine()._connector)==null||r.setCurrentLocale(e)}addCurrentLocaleChangeListener(e){let t=null;return E.isFunction(e)?(t=E.getRandomId(),this.listeners[t]=e):console.error("Provided locale change listener is not a function."),t}removeCurrentLocaleChangeListener(e){e&&this.listeners[e]?delete this.listeners[e]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}getTranslation(e,t=void 0,n=void 0){if(!e)return"";if(this.translationImpl){const a=this.translationImpl.getTranslation(e,t,n);if(a!==e)return a}const r=this.findTranslation(e,this.translationTable,t);return r||e}_notifyLocaleChange(e){Object.getOwnPropertyNames(this.listeners).forEach(t=>{this.listeners[Number(t)](e)}),this.luigi.configChanged()}_initCustomImplementation(){this.translationImpl=this.luigi.getConfigValue("settings.customTranslationImplementation"),E.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}broadcastLocaleToAllContainers(e){const t=E.getNodeList("luigi-container[lui_container]");t!=null&&t.length&&e&&t.forEach(n=>{n.locale=e,n.updateContext({locale:e})})}findTranslation(e,t,n){const r=e.split(".");for(let a=0;a<r.length;a++){const s=r[a];if(Object.prototype.hasOwnProperty.call(t,s)&&typeof t[s]=="object")t=t[s];else return n?this.findInterpolations(t[s],n):t[s]}}findInterpolations(e,t){return typeof e!="string"||!e.trim()||Object.keys(t).forEach(n=>{e=e.replace(new RegExp("{"+qe.escapeKeyForRegexp(n)+"}","gi"),t[n])}),e}}const Ti={luigiAfterInit:async i=>{E.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await F.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class yi{constructor(){this.featureToggleList=new Set}setFeatureToggle(e,t=!1){this.isValid(e)&&(e.startsWith("!")&&!t||this.isDuplicatedOrDisabled(e)||this.featureToggleList.add(e))}unsetFeatureToggle(e){if(this.isValid(e)){if(!this.featureToggleList.has(e)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(e)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(t=>!t.startsWith("!"))}isValid(e){return E.isString(e)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(e){return this.featureToggleList.has(e)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${e}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class fe{constructor(e){this.luigi=e,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const e=[...this._modalStack];for(const{onInternalClose:t}of e)try{typeof t=="function"&&t()}catch(n){console.warn("onInternalClose threw an error",n)}this.clearModalStack()}registerModal(e){e&&this._modalStack.push(e)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(e){if(this._modalStack.length>0){const t=this._modalStack[0];t.modalsettings={...t.modalsettings,...e}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){this._modalStack.pop()}}const M={normalizePath:i=>{if(!i||i.length<=0)return i;let e=i;return e.startsWith("#")&&(e=e.substring(1)),e.startsWith("/")&&(e=e.substring(1)),e},segmentMatches:(i,e,t)=>!!(i===e||e.startsWith(":")&&t&&t[e.substr(1)]===i),checkMatch:(i,e,t)=>{let n=!0;return E.trimTrailingSlash(E.trimLeadingSlash(i)).split("/").forEach((r,a)=>{var s,o;n&&(a+1>=e.length||!((s=e[a+1])!=null&&s.pathSegment)||!M.segmentMatches(r,((o=e[a+1])==null?void 0:o.pathSegment)??"",t??{}))&&(n=!1)}),n},checkVisibleForFeatureToggles:(i,e)=>{if(i!=null&&i.visibleForFeatureToggles){const t=(e==null?void 0:e.getActiveFeatureToggleList())||[];for(const n of i.visibleForFeatureToggles)if(n.startsWith("!")){if(t.includes(n.slice(1)))return!1}else if(!t.includes(n))return!1}return!0},generateTooltipText:(i,e,t)=>{let n=i==null?void 0:i.tooltipText;switch(n===void 0&&(n=t.getConfigValue("navigation.defaults.tooltipText")),n){case void 0:return e;case!1:return"";default:return t.i18n().getTranslation(n)}},isNodeAccessPermitted:(i,e,t,n)=>{if(n.auth().isAuthorizationEnabled()){const s=he.isLoggedIn(),o=i.anonymousAccess;if(s&&o==="exclusive"||!s&&o!=="exclusive"&&o!==!0)return!1}const r=n.featureToggles();if(!M.checkVisibleForFeatureToggles(i,r))return!1;const a=n.getConfigValue("navigation.nodeAccessibilityResolver");return typeof a!="function"?!0:a(i,e,t)},updateHeaderTitle:(i,e)=>{const t=i==null?void 0:i.items;if(t&&e){let n="";return[...t].sort((r,a)=>(a.link||"").localeCompare(r.link||"")).some(r=>{let a=!1;if(a=M.checkMatch(r.link||"",e.nodesInPath??[]),!a&&r.selectionConditions&&r.selectionConditions.route&&(a=M.checkMatch(r.selectionConditions.route,e.nodesInPath??[]),a&&(r.selectionConditions.contextCriteria||[]).forEach(s=>{var o,l;a=a&&((l=(o=e==null?void 0:e.selectedNode)==null?void 0:o.context)==null?void 0:l[s.key])===s.value})),a)return n=r.title||"",!0}),n}},buildPath(i,e){return i.map(n=>{var a;const r=n.pathSegment;if(r!=null&&r.startsWith(":")){const s=r.slice(1),o=(a=e==null?void 0:e.pathParams)==null?void 0:a[s];if(o!=null)return encodeURIComponent(String(o))}return r}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let e="";return i.forEach(t=>{t&&(e+=(e?"_":"")+encodeURIComponent(t.toLowerCase().split(" ").join("")))}),e}};class le{constructor(){this.dataManagement=new Map}setChildren(e,t){this.dataManagement.set(e,t),this.navPath=""}getChildren(e){return e?this.dataManagement.get(e):{}}hasChildren(e){const t=this.getChildren(e);return!!(t&&Object.prototype.hasOwnProperty.call(t,"children"))}setRootNode(e){this.dataManagement.set("_luigiRootNode",{node:e})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(e){if(this.hasChildren(e)){const t=this.getChildren(e).children;for(let n=0;n<t.length;n++)this.deleteNodesRecursively(t[n])}this.dataManagement.delete(e)}}const C={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,e,t){let n=e;const[r,a]=n.split("?"),s=new URLSearchParams(a);return this.modifySearchParams(i,s,t),n=r,s.toString()!==""&&(n+=`?${s.toString()}`),n},modifySearchParams(i,e,t){for(const[n,r]of Object.entries(i)){const a=t?`${t}${n}`:n;e.set(a,r),r===void 0&&e.delete(a)}},filterNodeParams(i,e){const t={},n=this.getContentViewParamPrefix(e);return i&&Object.entries(i).forEach(r=>{if(r[0].startsWith(n)){const a=r[0].substr(n.length);t[a]=r[1]}}),this.sanitizeParamsMap(t)},getContentViewParamPrefix(i){let e=i==null?void 0:i.getConfigValue("routing.nodeParamPrefix");return e===!1?e="":e||(e=this.defaultContentViewParamPrefix),e},sanitizeParamsMap(i){return Object.entries(i).reduce((e,t)=>(e[qe.sanitizeParam(t[0])]=qe.sanitizeParam(t[1]),e),{})},prepareSearchParamsForClient(i,e){const t={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(n=>{var r,a;n in e.routing().getSearchParams()&&((r=i.clientPermissions)!=null&&r.urlParameters)&&((a=i.clientPermissions.urlParameters[n])==null?void 0:a.read)===!0&&(t[n]=e.routing().getSearchParams()[n])}),t},getCurrentPath(i){if(i){const e=M.normalizePath(location.hash),[t,n]=e.split("?");return{path:t,query:n}}else return{path:M.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,e){return this.getQueryParams(e)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return C.getLocation().search?C.parseParams(C.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=C.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?C.parseParams(C.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let e=i.getConfigValue("routing.modalPathParam");return e||(e=this.defaultModalViewParamName),e},parseParams(i){const e=new URLSearchParams(i),t=new Map;for(const[n,r]of e.entries())t.set(n,r);return Object.fromEntries(t)},getModalParamsFromPath(i){const e=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return e&&JSON.parse(e)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,e){const t=new URLSearchParams(i);return t.delete(e),t.delete(`${e}Params`),t.toString()},handleHistoryState(i,e){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:e},i},encodeParams(i){const e=[];for(const t in i)e.push(encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,e){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const n=e.getConfigValue("navigation.validWebcomponentUrls");if((n==null?void 0:n.length)>0)for(const r of n)try{if(new RegExp(r).test(i))return!0}catch(a){console.error(a)}return!1}return!0},setFeatureToggles(i,e,t){const n=this.sanitizeParamsMap(this.parseParams(e.split("?")[1]));let r;if(n[i]&&(r=n[i]),!r)return;const a=r.split(",");a.length>0&&a[0]!==""&&a.forEach(s=>t==null?void 0:t.setFeatureToggle(s,!0))},substituteDynamicParamsInObject(i,e,t=":",n=!1){return Object.entries(i).map(([r,a])=>{const s=n?Object.keys(e).find(o=>a&&a.indexOf(t+o)>=0):Object.keys(e).find(o=>a===t+o);return[r,s?n?a.replace(t+s,e[s]):e[s]:a]}).reduce((r,[a,s])=>Object.assign(r,{[a]:s}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,e){return this.isDynamicNode(i)&&i.pathSegment?e[i.pathSegment.substring(1)]:void 0}},rt={logout:{label:"Sign Out",icon:"log"}};class bi{constructor(){this.services=new Map}register(e,t,n=!0){this.services.set(e,{factory:t,singleton:n})}get(e){const t=this.services.get(e);if(!t)throw new Error(`Service '${e}' is not registered.`);return t.singleton?(t.instance||(t.instance=t.factory()),t.instance):t.factory()}}const y=new bi;class ce{constructor(e){this.luigi=e}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=y.get(le)),this.nodeDataManagementService}async getPathData(e){var c,f,h;const t=this.luigi.getConfig();let n=e.split("/");(n==null?void 0:n.length)>0&&n[0]===""&&(n=n.slice(1));let a=((c=t.navigation)==null?void 0:c.globalContext)||{},s;if(this.getNodeDataManagementService().hasRootNode())s=this.getNodeDataManagementService().getRootNode().node;else{let u=await this.luigi.getConfigValueAsync("navigation.nodes");typeof u=="object"&&!Array.isArray(u)?(s=u,s.pathSegment&&(s.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):s={children:u},s.children=await this.getChildren(s,a),s.children=this.prepareRootNodes(s.children||[],a),this.getNodeDataManagementService().setRootNode(s)}let o={};const l={selectedNodeChildren:s.children,nodesInPath:[s],rootNodes:s.children,pathParams:o};if(s.viewUrl&&n.length===0)l.selectedNode=s;else for(const u of n)if(l.selectedNodeChildren){const d=this.findMatchingNode(u,l.selectedNodeChildren||[]);if(!d){console.warn("No matching node found for segment:",u);break}const p=d.context||{},_=M.mergeContext(a,p);let v=_;(f=d.pathSegment)!=null&&f.startsWith(":")&&(o[d.pathSegment.replace(":","")]=qe.sanitizeParam(u),v=C.substituteDynamicParamsInObject(_,o)),a=v,d.context=v,l.selectedNode=d,l.selectedNode&&((h=l.nodesInPath)==null||h.push(l.selectedNode)),l.selectedNodeChildren=await this.getChildren(d,a)}return l}findMatchingNode(e,t){let n;const r=t.filter(s=>!!s.pathSegment).length,a=t.filter(s=>s.pathSegment&&s.pathSegment.startsWith(":")).length;if(r>1&&(a===1&&(console.warn(`Invalid node setup detected.
2
2
  Static and dynamic nodes cannot be used together on the same level. Static node gets cleaned up.
3
3
  Remove the static node from the configuration to resolve this warning.
4
- Affected pathSegment:`,e,"Children:",t),t=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":"))),s>1)){console.error(`Invalid node setup detected.
4
+ Affected pathSegment:`,e,"Children:",t),t=t.filter(s=>s.pathSegment&&s.pathSegment.startsWith(":"))),a>1)){console.error(`Invalid node setup detected.
5
5
  Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
6
- Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegment&&a.pathSegment.startsWith(":"))return n=a,!0}),n}buildNavItems(e,t,n){const r={},s=[];return e==null||e.forEach(a=>{var o,l,c;if(M.isNodeAccessPermitted(a,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(a.category){const f=a.category.id||a.category.label||a.category,h=this.luigi.i18n().getTranslation(a.category.label||a.category.id||a.category);let u=r[f];u||(u={category:{altText:a.category.altText||"",icon:a.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(a.category,h)}},r[f]=u,s.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:a,selected:a===t,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,altText:a.altText,icon:a.icon})}else s.push({altText:a.altText,icon:a.icon,label:a.label?this.luigi.i18n().getTranslation(a.label):void 0,tooltip:a.label?this.resolveTooltipText(a,a.label):void 0,node:a,selected:a===t})}),s}async shouldRedirect(e,t){var r,s;const n=t??await this.getPathData(e);if(e=="")return(r=n.rootNodes[0])==null?void 0:r.pathSegment;if(n.selectedNode&&!n.selectedNode.viewUrl&&((s=n.selectedNode.children)!=null&&s.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(s=>{(!t||s.tabNav)&&(s.tabNav===!1&&(n=!0),s.keepSelectedForChildren===!1?t=!0:(s.keepSelectedForChildren||s.tabNav&&!n)&&(t=!0,r=[])),r.push(s)}),r.reverse()}applyNavGroups(e){const t={},n=[],s=[];return e.forEach(a=>{if(a.node)s.push(a);else if(a.category){const o=a.category.id;o&&o.indexOf("::")>0?n.push(a):(a.category.isGroup,t[o]=a,s.push(a))}}),n.forEach(a=>{var c;const o=((c=a.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(a))}),s.filter(a=>{var o,l,c,f,h,u;if((o=a.category)!=null&&o.isGroup&&((l=a.category)!=null&&l.nodes)&&((c=a.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=a.category)==null?void 0:f.nodes.length);d++){const p=(h=a.category)==null?void 0:h.nodes[d];if(p.node&&!p.node.hideFromNav&&p.node.label||(u=p.category)!=null&&u.nodes&&p.category.nodes.filter(_=>{var E,R;return!((E=_.node)!=null&&E.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var p,_;const n=t??await this.getPathData(e);let r=[];const s=[];let a="";(p=n.nodesInPath)==null||p.forEach(E=>{E.children&&(E.tabNav||(a+="/"+(E.pathSegment||"")),s.push(E))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...s].pop():(f=[...s].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(s,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:a.replace(/\/\/+/g,"/"),sideNavFooterText:(_=this.luigi.getConfig().settings)==null?void 0:_.sideNavFooterText,navClick:E=>E.node&&this.navItemClick(E.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var h,u,d,p,_,E,R,L,U,z,G,K,J,j,k,I,$,S,te,H,O,re,g,ue,b,D,pe;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),s=(d=(u=(h=n.navigation)==null?void 0:h.profile)==null?void 0:u.items)!=null&&d.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],a=((p=n.navigation)==null?void 0:p.appSwitcher)&&this.getAppSwitcherData((_=n.navigation)==null?void 0:_.appSwitcher,(E=n.settings)==null?void 0:E.header),o=M.updateHeaderTitle(a,r);s!=null&&s.length&&s.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((U=(L=(R=n.navigation)==null?void 0:R.profile)==null?void 0:L.logout)==null?void 0:U.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:s,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((K=(G=(z=n.navigation)==null?void 0:z.profile)==null?void 0:G.logout)==null?void 0:K.altText)||rt.logout.label,label:l,icon:((k=(j=(J=n.navigation)==null?void 0:J.profile)==null?void 0:j.logout)==null?void 0:k.icon)||rt.logout.icon,testId:((S=($=(I=n.navigation)==null?void 0:I.profile)==null?void 0:$.logout)==null?void 0:S.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}};return{appTitle:o||((H=(te=n.settings)==null?void 0:te.header)==null?void 0:H.title),logo:(re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.logo,topNodes:this.buildNavItems(r.rootNodes,void 0,r),productSwitcher:(g=n.navigation)==null?void 0:g.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(ue=n.navigation)!=null&&ue.profile?f:void 0,appSwitcher:((b=n.navigation)==null?void 0:b.appSwitcher)&&this.getAppSwitcherData((D=n.navigation)==null?void 0:D.appSwitcher,(pe=n.settings)==null?void 0:pe.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var s;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const a={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((s=n.items)==null||s.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===a.link))return n;n.items.unshift(a)}return n}async getTabNavData(e,t){var f;const n=t??await this.getPathData(e),r=n==null?void 0:n.selectedNode;let s;if(!r)return{};if(!r.tabNav&&(s=this.getParentNode(r,n),s&&!s.tabNav))return{};let a="";(f=n.nodesInPath)==null||f.forEach(h=>{h.children&&(a+="/"+(h.pathSegment||""))});const o=s?this.getTruncatedChildren(s.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:a.replace(/\/\/+/g,"/"),navClick:h=>h.node&&this.navItemClick(h.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");v.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(v.isFunction(e.onNodeActivation)||v.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t){var u;const{path:n,preserveView:r,modalSettings:s,newTab:a,withoutSync:o,preventContextUpdate:l,preventHistoryEntry:c}=e,f=n.replace(/\/\/+/g,"/"),h=c?"replaceState":"pushState";if(s)this.luigi.navigation().openAsModal(n,s,t);else{const d={detail:{preventContextUpdate:!!l,preventHistoryEntry:!!c,withoutSync:!!o}};if(await y.get(fe).closeModals(),a){await this.openViewInNewTab(n);return}const p=this.luigi.getConfigValue("routing.disableBrowserHistory")?"replaceState":h;if((u=this.luigi.getConfig().routing)!=null&&u.useHashRouting)if(!o&&p!=="replaceState")location.hash=f;else{const _=new CustomEvent("hashchange",d);window.history[p]({path:"/#"+f},"","/#"+f),window.dispatchEvent(_)}else{const _=new CustomEvent("popstate",d);window.history[p]({path:f},"",f),window.dispatchEvent(_)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let a=n.getChildren(e);a&&(r=a.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(a=>this.getExpandStructuralPathSegment(a)).map(a=>this.bindChildToParent(a,e))||[]}catch(a){console.error("Could not lazy-load children for node",a)}let s=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:s}),s}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(s,a)=>{const o=s.shift();let l={};return s.length?(l.pathSegment=o,a.hideFromNav&&(l.hideFromNav=a.hideFromNav),l.children=[r(s,a)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function Dt(i){return i()}function Et(){return Object.create(null)}function ze(i){i.forEach(Dt)}function xt(i){return typeof i=="function"}function kt(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function vt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function yi(i,e,t){const n=(function(r){if(!r)return document;const s=r.getRootNode?r.getRootNode():r.ownerDocument;return s&&s.host?s:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(s,a){(function(o,l){o.appendChild(l)})(s.head||s,a),a.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Mt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ft(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Vt(i){Ft().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Ct=[],bi=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Ri(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Ct.length;)Ct.pop()();ot=!1,st.clear(),Oe(i)}function Ri(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ai=new Set;function Pi(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],s=[];ye.forEach((a=>n.indexOf(a)===-1?r.push(a):s.push(a))),s.forEach((a=>a())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ii(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,bi.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Ht(i,e,t,n,r,s,a=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ae,not_equal:r,bound:Et(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Et(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};a&&a(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,p,..._)=>{const E=_.length?_[0]:p;return c.ctx&&r(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&Ii(i,d)),p})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(p){return Array.from(p.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ai.delete(h),h.i(u)),(function(d,p,_){const{fragment:E,after_update:R}=d.$$;E&&E.m(p,_),lt((()=>{const L=d.$$.on_mount.map(Dt).filter(xt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Qt;function je(i,e,t,n){var s;const r=(s=t[i])==null?void 0:s.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function Wt(i,e,t,n,r,s){let a=class extends Qt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(a.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(a.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),s&&(a=s(a)),i.element=a,a}typeof HTMLElement=="function"&&(Qt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let o;return{c:function(){o=Ae("slot"),a!=="default"&&W(o,"name",a)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(a){const o={};return a.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const a of this.$$s)a in r&&(n[a]=[t(a)]);for(const a of this.attributes){const o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=je(o,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)a in this.$$d||this[a]===void 0||(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){const o=je(a,this.$$d[a],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,o)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const a in this.$$l)for(const o of this.$$l[a]){const l=this.$$c.$on(a,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Gt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Pi(this,1),this.$destroy=ae}$on(e,t){if(!xt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class $i extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const m={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var s;const r=n||"custom";if((s=e==null?void 0:e.iframe)!=null&&s.contentWindow){const a=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},a.origin):e.iframe.contentWindow.postMessage({msg:r,...t},a.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,s){this.dispatch(e,t,n,s,r)}dispatch(e,t,n,r,s){const a=new $i(e,n,s,r);t.dispatchEvent(a)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,s,a,o,l,c,f,h;const t=this.getTargetContainer(e),n=(s=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:s.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(m.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(m.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(m.ALERT_REQUEST,t,e,(o=(a=e.data)==null?void 0:a.data)==null?void 0:o.settings,(u=>{var d,p,_;t.notifyAlertClosed((_=(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(m.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(m.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(m.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(m.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(m.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(m.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(m.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(m.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(m.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(m.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(m.GO_BACK_REQUEST,t,u),this.dispatch(m.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(m.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,p;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(m.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(m.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(m.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(m.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,p;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(m.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(m.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(m.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(m.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(m.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,s)=>{if(t){const a=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:s||{},internal:a,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const s={...r};s.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),s.id=i,se.sendCustomMessageToIframe(n,s)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},wt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Li extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=jt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Ni extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let s="@media only screen ";r.minWidth!=null&&(s+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(s+=`and (max-width: ${r.maxWidth}px) `),s+=`{
6
+ Invalid Children:`,t);return}return t.some(s=>{if(s.pathSegment===e||s.pathSegment&&s.pathSegment.startsWith(":"))return n=s,!0}),n}buildNavItems(e,t,n){const r={},a=[];return e==null||e.forEach(s=>{var o,l,c;if(M.isNodeAccessPermitted(s,this.getParentNode(n.selectedNode,n),((o=n==null?void 0:n.selectedNode)==null?void 0:o.context)||{},this.luigi))if(s.category){const f=s.category.id||s.category.label||s.category,h=this.luigi.i18n().getTranslation(s.category.label||s.category.id||s.category);let u=r[f];u||(u={category:{altText:s.category.altText||"",icon:s.category.icon,id:f,label:h,nodes:[],tooltip:this.resolveTooltipText(s.category,h)}},r[f]=u,a.push(u)),(c=(l=u.category)==null?void 0:l.nodes)==null||c.push({node:s,selected:s===t,label:s.label?this.luigi.i18n().getTranslation(s.label):void 0,tooltip:s.label?this.resolveTooltipText(s,s.label):void 0,altText:s.altText,icon:s.icon})}else a.push({altText:s.altText,icon:s.icon,label:s.label?this.luigi.i18n().getTranslation(s.label):void 0,tooltip:s.label?this.resolveTooltipText(s,s.label):void 0,node:s,selected:s===t})}),a}async shouldRedirect(e,t){var r,a,s,o;const n=t??await this.getPathData(e);if(e=="")return(r=n==null?void 0:n.nodesInPath)!=null&&r[0].viewUrl||(s=(a=n==null?void 0:n.rootNodes)==null?void 0:a[0])==null?void 0:s.pathSegment;if(n!=null&&n.selectedNode&&!n.selectedNode.viewUrl&&((o=n.selectedNode.children)!=null&&o.length))return e+"/"+n.selectedNode.children[0].pathSegment}async getCurrentNode(e){var r;const t=await this.getPathData(e),n=t.selectedNode;if(!(!n||!M.isNodeAccessPermitted(n,this.getParentNode(t.selectedNode,t),((r=t==null?void 0:t.selectedNode)==null?void 0:r.context)||{},this.luigi)))return n}async getPathParams(e){return(await this.getPathData(e)).pathParams}getTruncatedChildren(e){let t=!1,n=!1,r=[];return e.slice().reverse().forEach(a=>{(!t||a.tabNav)&&(a.tabNav===!1&&(n=!0),a.keepSelectedForChildren===!1?t=!0:(a.keepSelectedForChildren||a.tabNav&&!n)&&(t=!0,r=[])),r.push(a)}),r.reverse()}applyNavGroups(e){const t={},n=[],a=[];return e.forEach(s=>{if(s.node)a.push(s);else if(s.category){const o=s.category.id;o&&o.indexOf("::")>0?n.push(s):(s.category.isGroup,t[o]=s,a.push(s))}}),n.forEach(s=>{var c;const o=((c=s.category)==null?void 0:c.id.split("::")[0])||"",l=t[o];l&&l.category&&(l.category.isGroup||(l.category.isGroup=!0),l.category.nodes||(l.category.nodes=[]),l.category.nodes.push(s))}),a.filter(s=>{var o,l,c,f,h,u;if((o=s.category)!=null&&o.isGroup&&((l=s.category)!=null&&l.nodes)&&((c=s.category)==null?void 0:c.nodes.length)>0){for(let d=0;d<((f=s.category)==null?void 0:f.nodes.length);d++){const p=(h=s.category)==null?void 0:h.nodes[d];if(p.node&&!p.node.hideFromNav&&p.node.label||(u=p.category)!=null&&u.nodes&&p.category.nodes.filter(_=>{var v,R;return!((v=_.node)!=null&&v.hideFromNav)&&((R=_.node)==null?void 0:R.label)}).length>0)return!0}return!1}return!0})}async getLeftNavData(e,t){var p,_,v;const n=t??await this.getPathData(e);if(e===""&&((p=n==null?void 0:n.nodesInPath)!=null&&p[0].viewUrl))return{items:[],basePath:"",selectedNode:void 0,navClick:void 0};let r=[];const a=[];let s="";(_=n.nodesInPath)==null||_.forEach(R=>{R.children&&(R.tabNav||(s+="/"+(R.pathSegment||"")),a.push(R))});const o=this.getTruncatedChildren(n.nodesInPath);let l=[...o].pop(),c=n.selectedNode;(l!=null&&l.keepSelectedForChildren||l!=null&&l.tabNav)&&(c=l,o.pop(),l=[...o].pop());let f,h=c;c?n.rootNodes.includes(c)?(f=c,h=void 0):c.tabNav?f=l:f=[...a].pop():(f=[...a].pop(),h=void 0);let u=await this.getChildren(f,(f==null?void 0:f.context)||{})||[];r=this.buildNavItems(u,h,n);const d=M.buildPath(a,n);return r=this.applyNavGroups(r),{selectedNode:c,items:r,basePath:s.replace(/\/\/+/g,"/"),sideNavFooterText:(v=this.luigi.getConfig().settings)==null?void 0:v.sideNavFooterText,navClick:R=>R.node&&this.navItemClick(R.node,d)}}navItemClick(e,t){if(!e.pathSegment){console.error("Navigation error: pathSegment is not defined for the node.");return}let n="/";if(t.trim()!=="")n+=t+"/";else if(!e.isRootNode){console.error("Navigation error: parentPath is empty while the node is not a root node");return}n+=e.pathSegment,this.luigi.navigation().navigate(n)}async getTopNavData(e,t){var d,p,_,v,R,L,U,z,G,K,J,j,k,I,$,S,te,H,O,re,g,ue,b,x,pe,St,_t;const n=this.luigi.getConfig(),r=t??await this.getPathData(e),a=(_=(p=(d=n.navigation)==null?void 0:d.profile)==null?void 0:p.items)!=null&&_.length?JSON.parse(JSON.stringify(n.navigation.profile.items)):[],s=((v=n.navigation)==null?void 0:v.appSwitcher)&&this.getAppSwitcherData((R=n.navigation)==null?void 0:R.appSwitcher,(L=n.settings)==null?void 0:L.header),o=M.updateHeaderTitle(s,r);a!=null&&a.length&&a.map(P=>({...P,label:this.luigi.i18n().getTranslation(P.label||"")}));const l=this.luigi.i18n().getTranslation((G=(z=(U=n.navigation)==null?void 0:U.profile)==null?void 0:z.logout)==null?void 0:G.label)||rt.logout.label,c=P=>{var Ue,Qe;if(P.openNodeInModal&&!((Ue=P.externalLink)!=null&&Ue.url))this.luigi.navigation().openAsModal(P.link||"",P.openNodeInModal===!0?{}:P.openNodeInModal);else if(P.link)this.luigi.navigation().navigate(P.link);else if((Qe=P.externalLink)!=null&&Qe.url)if(P.externalLink.sameWindow)window.location.href=P.externalLink.url;else{const tt=window.open(P.externalLink.url,"_blank","noopener noreferrer");tt&&(tt.opener=null,tt.focus())}},f={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&he.isLoggedIn(),items:a,itemClick:c,logout:{altText:this.luigi.i18n().getTranslation((j=(J=(K=n.navigation)==null?void 0:K.profile)==null?void 0:J.logout)==null?void 0:j.altText)||rt.logout.label,label:l,icon:(($=(I=(k=n.navigation)==null?void 0:k.profile)==null?void 0:I.logout)==null?void 0:$.icon)||rt.logout.icon,testId:((H=(te=(S=n.navigation)==null?void 0:S.profile)==null?void 0:te.logout)==null?void 0:H.testId)||M.prepareForTests(l),doLogout:()=>{Te.logout()}},onUserInfoUpdate:P=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(Ue=>{Ue?P(Ue):Te.getUserInfoStore().subscribe(Qe=>{P(Qe)})})}},h=r.selectedNode,u=h&&r.rootNodes.includes(h)?h:void 0;return{appTitle:o||((re=(O=n.settings)==null?void 0:O.header)==null?void 0:re.title),logo:(ue=(g=n.settings)==null?void 0:g.header)==null?void 0:ue.logo,topNodes:this.buildNavItems(r.rootNodes,u,r),productSwitcher:(b=n.navigation)==null?void 0:b.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||(x=n.navigation)!=null&&x.profile?f:void 0,appSwitcher:((pe=n.navigation)==null?void 0:pe.appSwitcher)&&this.getAppSwitcherData((St=n.navigation)==null?void 0:St.appSwitcher,(_t=n.settings)==null?void 0:_t.header),navClick:P=>P.node&&this.navItemClick(P.node,"")}}getParentNode(e,t){var n;if(e&&e===((n=t.nodesInPath)==null?void 0:n[t.nodesInPath.length-1]))return t.nodesInPath[t.nodesInPath.length-2]}getAppSwitcherData(e,t){var a;const n=e,r=n==null?void 0:n.showMainAppEntry;if(n&&n.items&&r){const s={title:this.luigi.i18n().getTranslation(t.title||""),subTitle:t.subTitle,link:"/"};if((a=n.items)==null||a.map(o=>({...o,title:this.luigi.i18n().getTranslation(o.title||"")})),n.items.some(o=>o.link===s.link))return n;n.items.unshift(s)}return n}async getTabNavData(e,t){var f,h;const n=t??await this.getPathData(e);if(e===""&&((f=n==null?void 0:n.nodesInPath)!=null&&f[0].viewUrl))return{};const r=n==null?void 0:n.selectedNode;let a;if(!r)return{};if(!r.tabNav&&(a=this.getParentNode(r,n),a&&!a.tabNav))return{};let s="";(h=n.nodesInPath)==null||h.forEach(u=>{u.children&&(s+="/"+(u.pathSegment||""))});const o=a?this.getTruncatedChildren(a.children):this.getTruncatedChildren(r.children),l=this.buildNavItems(o,r,n),c=M.buildPath(n.nodesInPath||[],n);return{selectedNode:r,items:l,basePath:s.replace(/\/\/+/g,"/"),navClick:u=>u.node&&this.navItemClick(u.node,c)}}onNodeChange(e,t){const n=this.luigi.getConfigValue("navigation.nodeChangeHook");E.isFunction(n)?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(e){const t=await this.getPathData(e);return{nodeObject:C.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e!=null&&e.onNodeActivation&&(E.isFunction(e.onNodeActivation)||E.isAsyncFunction(e.onNodeActivation))&&await e.onNodeActivation(e)===!1)}async shouldPreventNavigationForPath(e){const{nodeObject:t}=await this.extractDataFromPath(e);return!!await this.shouldPreventNavigation(t)}async openViewInNewTab(e){if(await this.shouldPreventNavigationForPath(e))return;this.luigi.getConfigValue("routing.useHashRouting")&&(e="#"+e),window.open(e,"_blank","noopener,noreferrer")}resolveTooltipText(e,t){return M.generateTooltipText(e,t,this.luigi)}prepareRootNodes(e,t){const n=e;return n.length&&n.forEach(r=>{r.isRootNode=!0}),n}getAccessibleNodes(e,t,n){return t?t.filter(r=>M.isNodeAccessPermitted(r,e,n,this.luigi)):[]}async handleNavigationRequest(e,t){var u;const{path:n,preserveView:r,modalSettings:a,newTab:s,withoutSync:o,preventContextUpdate:l,preventHistoryEntry:c}=e,f=n.replace(/\/\/+/g,"/"),h=c?"replaceState":"pushState";if(a)this.luigi.navigation().openAsModal(n,a,t);else{const d={detail:{preventContextUpdate:!!l,preventHistoryEntry:!!c,withoutSync:!!o}};if(await y.get(fe).closeModals(),s){await this.openViewInNewTab(n);return}const p=this.luigi.getConfigValue("routing.disableBrowserHistory")?"replaceState":h;if((u=this.luigi.getConfig().routing)!=null&&u.useHashRouting)if(!o&&p!=="replaceState")location.hash=f;else{const _=new CustomEvent("hashchange",d);window.history[p]({path:"/#"+f},"","/#"+f),window.dispatchEvent(_)}else{const _=new CustomEvent("popstate",d);window.history[p]({path:f},"",f),window.dispatchEvent(_)}}}async getChildren(e,t={}){const n=y.get(le);if(!e)return[];let r=[];if(n.hasChildren(e)){let s=n.getChildren(e);s&&(r=s.children)}else try{r=await we.getConfigValueFromObjectAsync(e,"children",t||e.context),r==null&&(r=[]),r=r.map(s=>this.getExpandStructuralPathSegment(s)).map(s=>this.bindChildToParent(s,e))||[]}catch(s){console.error("Could not lazy-load children for node",s)}let a=this.getAccessibleNodes(e,r,t);return n.setChildren(e,{children:r,filteredChildren:a}),a}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},r=(a,s)=>{const o=a.shift();let l={};return a.length?(l.pathSegment=o,s.hideFromNav&&(l.hideFromNav=s.hideFromNav),l.children=[r(a,s)]):(l=n,l.pathSegment=o),l};return r(t,e)}return e}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}}function ae(){}function kt(i){return i()}function Ct(){return Object.create(null)}function ze(i){i.forEach(kt)}function Mt(i){return typeof i=="function"}function Ft(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let We,ke;function wt(i,e){return i===e||(We||(We=document.createElement("a")),We.href=e,i===We.href)}function Ri(i,e,t){const n=(function(r){if(!r)return document;const a=r.getRootNode?r.getRootNode():r.ownerDocument;return a&&a.host?a:r.ownerDocument})(i);if(!n.getElementById(e)){const r=Ae("style");r.id=e,r.textContent=t,(function(a,s){(function(o,l){o.appendChild(l)})(a.head||a,s),s.sheet})(n,r)}}function de(i,e,t){i.insertBefore(e,t||null)}function oe(i){i.parentNode&&i.parentNode.removeChild(i)}function Ae(i){return document.createElement(i)}function Vt(i){return document.createTextNode(i)}function W(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Oe(i){ke=i}function Ht(){if(!ke)throw new Error("Function called outside component initialization");return ke}function Qt(i){Ht().$$.on_mount.push(i)}const _e=[],Me=[];let ye=[];const Tt=[],Ai=Promise.resolve();let ot=!1;function lt(i){ye.push(i)}const st=new Set;let me=0;function w(){if(me!==0)return;const i=ke;do{try{for(;me<_e.length;){const e=_e[me];me++,Oe(e),Pi(e.$$)}}catch(e){throw _e.length=0,me=0,e}for(Oe(null),_e.length=0,me=0;Me.length;)Me.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];st.has(t)||(st.add(t),t())}ye.length=0}while(_e.length);for(;Tt.length;)Tt.pop()();ot=!1,st.clear(),Oe(i)}function Pi(i){if(i.fragment!==null){i.update(),ze(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(lt)}}const Ii=new Set;function $i(i,e){const t=i.$$;t.fragment!==null&&((function(n){const r=[],a=[];ye.forEach((s=>n.indexOf(s)===-1?r.push(s):a.push(s))),a.forEach((s=>s())),ye=r})(t.after_update),ze(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Li(i,e){i.$$.dirty[0]===-1&&(_e.push(i),ot||(ot=!0,Ai.then(w)),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Wt(i,e,t,n,r,a,s=null,o=[-1]){const l=ke;Oe(i);const c=i.$$={fragment:null,ctx:[],props:a,update:ae,not_equal:r,bound:Ct(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Ct(),dirty:o,skip_bound:!1,root:e.target||l.$$.root};s&&s(c.root);let f=!1;if(c.ctx=t?t(i,e.props||{},((d,p,..._)=>{const v=_.length?_[0]:p;return c.ctx&&r(c.ctx[d],c.ctx[d]=v)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](v),f&&Li(i,d)),p})):[],c.update(),f=!0,ze(c.before_update),c.fragment=!!n&&n(c.ctx),e.target){if(e.hydrate){const d=(function(p){return Array.from(p.childNodes)})(e.target);c.fragment&&c.fragment.l(d),d.forEach(oe)}else c.fragment&&c.fragment.c();e.intro&&(h=i.$$.fragment)&&h.i&&(Ii.delete(h),h.i(u)),(function(d,p,_){const{fragment:v,after_update:R}=d.$$;v&&v.m(p,_),lt((()=>{const L=d.$$.on_mount.map(kt).filter(Mt);d.$$.on_destroy?d.$$.on_destroy.push(...L):ze(L),d.$$.on_mount=[]})),R.forEach(lt)})(i,e.target,e.anchor),w()}var h,u;Oe(l)}let Gt;function je(i,e,t,n){var a;const r=(a=t[i])==null?void 0:a.type;if(e=r==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!t[i])return e;if(n==="toAttribute")switch(r){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(r){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return e!=null?+e:e}}function jt(i,e,t,n,r,a){let s=class extends Gt{constructor(){super(i,t,r),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((o=>(e[o].attribute||o).toLowerCase()))}};return Object.keys(e).forEach((o=>{Object.defineProperty(s.prototype,o,{get(){return this.$$c&&o in this.$$c?this.$$c[o]:this.$$d[o]},set(l){var c;l=je(o,l,e),this.$$d[o]=l,(c=this.$$c)==null||c.$set({[o]:l})}})})),n.forEach((o=>{Object.defineProperty(s.prototype,o,{get(){var l;return(l=this.$$c)==null?void 0:l[o]}})})),a&&(s=a(s)),i.element=s,s}typeof HTMLElement=="function"&&(Gt=class extends HTMLElement{constructor(e,t,n){super();A(this,"$$ctor");A(this,"$$s");A(this,"$$c");A(this,"$$cn",!1);A(this,"$$d",{});A(this,"$$r",!1);A(this,"$$p_d",{});A(this,"$$l",{});A(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(s){return()=>{let o;return{c:function(){o=Ae("slot"),s!=="default"&&W(o,"name",s)},m:function(l,c){de(l,o,c)},d:function(l){l&&oe(o)}}}};var e=t;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=(function(s){const o={};return s.childNodes.forEach((l=>{o[l.slot||"default"]=!0})),o})(this);for(const s of this.$$s)s in r&&(n[s]=[t(s)]);for(const s of this.attributes){const o=this.$$g_p(s.name);o in this.$$d||(this.$$d[o]=je(o,s.value,this.$$p_d,"toProp"))}for(const s in this.$$p_d)s in this.$$d||this[s]===void 0||(this.$$d[s]=this[s],delete this[s]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});const a=()=>{this.$$r=!0;for(const s in this.$$p_d)if(this.$$d[s]=this.$$c.$$.ctx[this.$$c.$$.props[s]],this.$$p_d[s].reflect){const o=je(s,this.$$d[s],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,o)}this.$$r=!1};this.$$c.$$.after_update.push(a),a();for(const s in this.$$l)for(const o of this.$$l[s]){const l=this.$$c.$on(s,o);this.$$l_u.set(o,l)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=je(e,n,this.$$p_d,"toProp"),(r=this.$$c)==null||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(e){return Object.keys(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});class Bt{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){$i(this,1),this.$destroy=ae}$on(e,t){if(!Mt(t))return ae;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){var t;this.$$set&&(t=e,Object.keys(t).length!==0)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var T;typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4"),(function(i){i.CUSTOM_MESSAGE="custom",i.GET_CONTEXT="luigi.get-context",i.SEND_CONTEXT_HANDSHAKE="luigi.init",i.CONTEXT_RECEIVED="luigi.init.ok",i.NAVIGATION_REQUEST="luigi.navigation.open",i.ALERT_REQUEST="luigi.ux.alert.show",i.ALERT_CLOSED="luigi.ux.alert.hide",i.INITIALIZED="luigi.init.ok",i.ADD_SEARCH_PARAMS_REQUEST="luigi.addSearchParams",i.ADD_NODE_PARAMS_REQUEST="luigi.addNodeParams",i.SHOW_CONFIRMATION_MODAL_REQUEST="luigi.ux.confirmationModal.show",i.CONFIRMATION_MODAL_CLOSED="luigi.ux.confirmationModal.hide",i.SHOW_LOADING_INDICATOR_REQUEST="luigi.show-loading-indicator",i.HIDE_LOADING_INDICATOR_REQUEST="luigi.hide-loading-indicator",i.SET_CURRENT_LOCALE_REQUEST="luigi.ux.set-current-locale",i.LOCAL_STORAGE_SET_REQUEST="storage",i.RUNTIME_ERROR_HANDLING_REQUEST="luigi-runtime-error-handling",i.SET_ANCHOR_LINK_REQUEST="luigi.setAnchor",i.SET_THIRD_PARTY_COOKIES_REQUEST="luigi.third-party-cookie",i.BACK_NAVIGATION_REQUEST="luigi.navigation.back",i.GET_CURRENT_ROUTE_REQUEST="luigi.navigation.currentRoute",i.SEND_CURRENT_ROUTE_ANSWER="luigi.navigation.currentRoute.answer",i.SEND_CONTEXT_OBJECT="luigi.navigate",i.NAVIGATION_COMPLETED_REPORT="luigi.navigate.ok",i.CLOSE_MODAL_ANSWER="luigi.navigation.modal.close",i.UPDATE_MODAL_PATH_DATA_REQUEST="luigi.navigation.updateModalDataPath",i.UPDATE_MODAL_SETTINGS="luigi.navigation.updateModalSettings",i.CHECK_PATH_EXISTS_REQUEST="luigi.navigation.pathExists",i.SEND_PATH_EXISTS_ANSWER="luigi.navigation.pathExists.answer",i.SET_DIRTY_STATUS_REQUEST="luigi.set-page-dirty",i.AUTH_SET_TOKEN="luigi.auth.tokenIssued",i.ADD_BACKDROP_REQUEST="luigi.add-backdrop",i.REMOVE_BACKDROP_REQUEST="luigi.remove-backdrop",i.SET_VIEW_GROUP_DATA_REQUEST="luigi.setVGData",i.CLOSE_CURRENT_MODAL_REQUEST="luigi.close-modal"})(T||(T={}));class Ni extends Event{constructor(e,t,n,r){super(e),this.detail=t,this.payload=n||t||{},this.callbackFn=r}callback(e){this.callbackFn&&this.callbackFn(e)}}const m={ADD_BACKDROP_REQUEST:"add-backdrop-request",ADD_NODE_PARAMS_REQUEST:"add-node-params-request",ADD_SEARCH_PARAMS_REQUEST:"add-search-params-request",ALERT_CLOSED:"close-alert-request",ALERT_REQUEST:"show-alert-request",BACK_NAVIGATION_REQUEST:"navigate-back-request",CHECK_PATH_EXISTS_REQUEST:"check-path-exists-request",CLOSE_CURRENT_MODAL_REQUEST:"close-current-modal-request",CLOSE_USER_SETTINGS_REQUEST:"close-user-settings-request",COLLAPSE_LEFT_NAV_REQUEST:"collapse-leftnav-request",CUSTOM_MESSAGE:"custom-message",GET_CONTEXT_REQUEST:"get-context-request",GET_CURRENT_ROUTE_REQUEST:"get-current-route-request",GO_BACK_REQUEST:"go-back-request",HAS_BACK_REQUEST:"has-back-request",HIDE_LOADING_INDICATOR_REQUEST:"hide-loading-indicator-request",INITIALIZED:"initialized",LOCAL_STORAGE_SET_REQUEST:"set-storage-request",NAVIGATION_COMPLETED_REPORT:"report-navigation-completed-request",NAVIGATION_REQUEST:"navigation-request",OPEN_USER_SETTINGS_REQUEST:"open-user-settings-request",PATH_EXISTS_REQUEST:"path-exists-request",REMOVE_BACKDROP_REQUEST:"remove-backdrop-request",RUNTIME_ERROR_HANDLING_REQUEST:"runtime-error-handling-request",SET_ANCHOR_LINK_REQUEST:"set-anchor-request",SET_CURRENT_LOCALE_REQUEST:"set-current-locale-request",SET_DIRTY_STATUS_REQUEST:"set-dirty-status-request",SET_DOCUMENT_TITLE_REQUEST:"set-document-title-request",SET_THIRD_PARTY_COOKIES_REQUEST:"set-third-party-cookies-request",SET_VIEW_GROUP_DATA_REQUEST:"set-viewgroup-data-request",SHOW_CONFIRMATION_MODAL_REQUEST:"show-confirmation-modal-request",SHOW_LOADING_INDICATOR_REQUEST:"show-loading-indicator-request",UPDATE_MODAL_PATH_DATA_REQUEST:"update-modal-path-data-request",UPDATE_MODAL_SETTINGS_REQUEST:"update-modal-settings-request",UPDATE_TOP_NAVIGATION_REQUEST:"update-top-navigation-request"};class ht{isVisible(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}sendCustomMessageToIframe(e,t,n){var a;const r=n||"custom";if((a=e==null?void 0:e.iframe)!=null&&a.contentWindow){const s=new URL(e.iframe.src);r==="custom"?e.iframe.contentWindow.postMessage({msg:r,data:t},s.origin):e.iframe.contentWindow.postMessage({msg:r,...t},s.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(e,t,n,r,a){this.dispatch(e,t,n,a,r)}dispatch(e,t,n,r,a){const s=new Ni(e,n,a,r);t.dispatchEvent(s)}getTargetContainer(e){let t;return globalThis.__luigi_container_manager.container.forEach((n=>{var r;(r=n.iframeHandle)!=null&&r.iframe&&n.iframeHandle.iframe.contentWindow===e.source&&(t=n)})),t}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:e=>{var r,a,s,o,l,c,f,h;const t=this.getTargetContainer(e),n=(a=(r=t==null?void 0:t.iframeHandle)==null?void 0:r.iframe)==null?void 0:a.contentWindow;if(n&&n===e.source)switch(e.data.msg){case T.CUSTOM_MESSAGE:{const u=e.data.data,d=u.id;delete u.id,this.dispatch(m.CUSTOM_MESSAGE,t,{id:d,_metaData:{},data:u})}break;case T.GET_CONTEXT:n.postMessage({msg:T.SEND_CONTEXT_HANDSHAKE,context:t.context||{},internal:{thirdPartyCookieCheck:{disabled:t.skipCookieCheck==="true"},currentTheme:t.theme,currentLocale:t.locale,activeFeatureToggleList:t.activeFeatureToggleList||[],cssVariables:t.cssVariables||{},anchor:t.anchor||"",userSettings:t.userSettings||null,drawer:t.drawer||!1,modal:t.modal||!1,viewStackSize:t.viewStackSize||0,isNavigateBack:t.isNavigateBack||!1},authData:t.authData||{},nodeParams:t.nodeParams||{},searchParams:t.searchParams||{},pathParams:t.pathParams||{}},e.origin);break;case T.NAVIGATION_REQUEST:this.dispatch(m.NAVIGATION_REQUEST,t,e.data.params,(u=>{n.postMessage({msg:T.CLOSE_MODAL_ANSWER,data:u},e.origin)}));break;case T.ALERT_REQUEST:this.dispatchWithPayload(m.ALERT_REQUEST,t,e,(o=(s=e.data)==null?void 0:s.data)==null?void 0:o.settings,(u=>{var d,p,_;t.notifyAlertClosed((_=(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.settings)==null?void 0:_.id,u)}));break;case T.INITIALIZED:this.dispatch(m.INITIALIZED,t,((l=e.data)==null?void 0:l.params)||{});break;case T.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(m.ADD_SEARCH_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.ADD_NODE_PARAMS_REQUEST:this.dispatch(m.ADD_NODE_PARAMS_REQUEST,t,{data:e.data.data,keepBrowserHistory:e.data.keepBrowserHistory});break;case T.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(m.SHOW_CONFIRMATION_MODAL_REQUEST,t,e.data.data,(c=e.data.data)==null?void 0:c.settings,(u=>{t.notifyConfirmationModalClosed(u)}));break;case T.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(m.SHOW_LOADING_INDICATOR_REQUEST,t,e);break;case T.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(m.HIDE_LOADING_INDICATOR_REQUEST,t,e);break;case T.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(m.SET_CURRENT_LOCALE_REQUEST,t,e,e.data.data);break;case T.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(m.LOCAL_STORAGE_SET_REQUEST,t,e,(f=e.data.data)==null?void 0:f.params);break;case T.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,t,e);break;case T.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(m.SET_ANCHOR_LINK_REQUEST,t,e,e.data.anchor);break;case T.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(m.SET_THIRD_PARTY_COOKIES_REQUEST,t,e);break;case T.BACK_NAVIGATION_REQUEST:{let u=((h=e.data)==null?void 0:h.goBackContext)||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(d){console.warn(d)}this.dispatch(m.GO_BACK_REQUEST,t,u),this.dispatch(m.BACK_NAVIGATION_REQUEST,t,e)}break;case T.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(m.GET_CURRENT_ROUTE_REQUEST,t,e,e.data.data,(u=>{var d,p;n.postMessage({msg:T.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.id,route:u}},e.origin)}));break;case T.NAVIGATION_COMPLETED_REPORT:this.dispatch(m.NAVIGATION_COMPLETED_REPORT,t,e);break;case T.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(m.UPDATE_MODAL_PATH_DATA_REQUEST,t,e,e.data.params);break;case T.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(m.UPDATE_MODAL_SETTINGS_REQUEST,t,e,{addHistoryEntry:e.data.addHistoryEntry,updatedModalSettings:e.data.updatedModalSettings});break;case T.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(m.CHECK_PATH_EXISTS_REQUEST,t,e,e.data.data,(u=>{var d,p;n.postMessage({msg:T.SEND_PATH_EXISTS_ANSWER,data:{correlationId:(p=(d=e.data)==null?void 0:d.data)==null?void 0:p.id,pathExists:u}},e.origin)}));break;case T.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(m.SET_DIRTY_STATUS_REQUEST,t,e,{dirty:e.data.dirty});break;case T.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(m.SET_VIEW_GROUP_DATA_REQUEST,t,e.data.data);break;case T.ADD_BACKDROP_REQUEST:this.dispatch(m.ADD_BACKDROP_REQUEST,t,e);break;case T.REMOVE_BACKDROP_REQUEST:this.dispatch(m.REMOVE_BACKDROP_REQUEST,t,e);break;case T.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(m.CLOSE_CURRENT_MODAL_REQUEST,t,e)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(e){this.getContainerManager().container.push(e)}}const se=new ht,Ee=new class{constructor(){this.updateContext=(i,e,t,n,r,a)=>{if(t){const s=e||{};se.sendCustomMessageToIframe(t,{context:i,nodeParams:n||{},pathParams:r||{},searchParams:a||{},internal:s,withoutSync:!0},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,e,t,n)=>{if(n){const r=t||{};se.sendCustomMessageToIframe(n,{context:e,internal:r,withoutSync:!1,viewUrl:i},T.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,e)=>{i&&e?se.sendCustomMessageToIframe(i,{authData:e},T.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,e,t,n,r)=>{if(t&&e._luigi_mfe_webcomponent)se.dispatch(i,e._luigi_mfe_webcomponent,r);else{const a={...r};a.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),a.id=i,se.sendCustomMessageToIframe(n,a)}},this.notifyConfirmationModalClosed=(i,e)=>{const t={data:{confirmed:i}};se.sendCustomMessageToIframe(e,t,T.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,e,t){const n=e?{id:i,dismissKey:e}:{id:i};se.sendCustomMessageToIframe(t,n,T.ALERT_CLOSED)}},yt=i=>{if(!i)return;const e=i;return e.forEach(((t,n)=>{e[n]=t+(t.indexOf(";")!=-1?"":";"),e[n]=i[n].replaceAll('"',"'")})),e.join(" ")};class Pe{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(e){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Ui extends Pe{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=qt({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class Oi extends Pe{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach((r=>{if(r.minWidth||r.maxWidth){let a="@media only screen ";r.minWidth!=null&&(a+=`and (min-width: ${r.minWidth}px) `),r.maxWidth!=null&&(a+=`and (max-width: ${r.maxWidth}px) `),a+=`{
7
7
  .${e} {
8
8
  grid-template-columns: ${r.columns||"auto"};
9
9
  grid-template-rows: ${r.rows||"auto"};
10
10
  grid-gap: ${r.gap||"0"};
11
11
  }
12
12
  }
13
- `,n+=s}})),t.innerHTML=`
13
+ `,n+=a}})),t.innerHTML=`
14
14
  <style scoped>
15
15
  .${e} {
16
16
  display: grid;
@@ -21,7 +21,7 @@ Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegme
21
21
  }
22
22
  ${n}
23
23
  </style>
24
- `,t}createCompoundItemContainer(e){const t=e||{},n=document.createElement("div");return n.setAttribute("style",`grid-row: ${t.row||"auto"}; grid-column: ${t.column||"auto"}`),n.classList.add("lui-compoundItemCnt"),n}}const jt=i=>{const e=i.use;return e?e==="grid"?new Ni(i):e.createCompoundContainer||e.createCompoundItemContainer||e.attachCompoundItem?new Li(i):new Pe(i):new Pe(i)},Tt=(i,e,t,n)=>{e!=null&&e.eventListeners&&e.eventListeners.forEach((r=>{const s=r.source+"."+r.name,a=i[s],o={wcElementId:t,wcElement:n,action:r.action,converter:r.dataConverter};a?a.push(o):i[s]=[o]}))};function yt(i){return String(i).replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&#39;","'").replaceAll("&sol;","/")}class Bt{constructor(){this.alertResolvers={},this.alertIndex=0,this.containerService=new ht}dynamicImport(e){return Object.freeze(import(e))}processViewUrl(e,t){return e}attachWC(e,t,n,r,s,a,o){if(n&&n.contains(t)){const l=document.createElement(e);a&&l.setAttribute("nodeId",a),l.setAttribute("lui_web_component","true"),this.initWC(l,e,n,s,r,a,o),n.replaceChild(l,t),n._luigi_node&&(n._luigi_mfe_webcomponent=l),n.dispatchEvent(new Event("wc_ready"))}}dispatchLuigiEvent(e,t,n){this.containerService.dispatch(e,this.thisComponent,t,n)}createClientAPI(e,t,n,r,s){return{linkManager:()=>{let a=null,o=!1,l=!1,c=!1,f={};const h={navigate:(u,d={})=>{const p={fromContext:a,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f,...d};this.dispatchLuigiEvent(m.NAVIGATION_REQUEST,{link:u,...p})},navigateToIntent:(u,d={})=>{var _;let p="#?intent=";if(p+=u,d&&((_=Object.keys(d))==null?void 0:_.length)){const E=Object.entries(d);if(E.length>0){p+="?";for(const[R,L]of E)p+=R+"="+L+"&";p=p.slice(0,-1)}}h.navigate(p)},fromClosestContext:()=>(o=!0,h),fromContext:u=>(a=u,h),fromVirtualTreeRoot:()=>(l=!0,h),fromParent:()=>(c=!0,h),getCurrentRoute:()=>{const u={fromContext:a,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f};return new Promise(((d,p)=>{this.containerService.dispatch(m.GET_CURRENT_ROUTE_REQUEST,this.thisComponent,{...u},(_=>{_?d(_):p("No current route received.")}))}))},withParams:u=>(f=u,h),updateModalPathInternalNavigation:(u,d={},p=!1)=>{if(!u)return void console.warn("Updating path of the modal upon internal navigation prevented. No path specified.");const _={fromClosestContext:o,fromContext:a,fromParent:c,fromVirtualTreeRoot:l,nodeParams:f};this.dispatchLuigiEvent(m.UPDATE_MODAL_PATH_DATA_REQUEST,Object.assign(_,{history:p,link:u,modal:d}))},updateTopNavigation:()=>{this.dispatchLuigiEvent(m.UPDATE_TOP_NAVIGATION_REQUEST,{})},pathExists:u=>{const d={fromContext:a,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f};return new Promise(((p,_)=>{this.containerService.dispatch(m.CHECK_PATH_EXISTS_REQUEST,this.thisComponent,{...d,link:u},(E=>{E?p(!0):_(!1)})),this.containerService.dispatch(m.PATH_EXISTS_REQUEST,this.thisComponent,{...d,link:u},(E=>{E?p(!0):_(!1)}))}))},openAsDrawer:(u,d={})=>{h.navigate(u,{drawer:d})},openAsModal:(u,d={})=>{h.navigate(u,{modal:d})},openAsSplitView:(u,d={})=>{h.navigate(u,{splitView:d})},goBack:u=>{this.dispatchLuigiEvent(m.GO_BACK_REQUEST,u)},hasBack:()=>!1,updateModalSettings:(u={},d=!1)=>{this.dispatchLuigiEvent(m.UPDATE_MODAL_SETTINGS_REQUEST,{updatedModalSettings:u,addHistoryEntry:d})}};return h},uxManager:()=>({showAlert:a=>(a.id=this.alertIndex++,new Promise((o=>{this.alertResolvers[a.id]=o,this.dispatchLuigiEvent(m.ALERT_REQUEST,a,(l=>{this.resolveAlert(a.id,l)}))}))),showConfirmationModal:a=>new Promise(((o,l)=>{this.modalResolver={resolve:o,reject:l},this.containerService.dispatch(m.SHOW_CONFIRMATION_MODAL_REQUEST,this.thisComponent,a,(c=>{c?o():l()}))})),getCurrentTheme:()=>this.thisComponent.theme,closeUserSettings:()=>{this.dispatchLuigiEvent(m.CLOSE_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},openUserSettings:()=>{this.dispatchLuigiEvent(m.OPEN_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},collapseLeftSideNav:()=>{this.dispatchLuigiEvent(m.COLLAPSE_LEFT_NAV_REQUEST,{})},getDirtyStatus:()=>this.thisComponent.dirtyStatus||!1,getDocumentTitle:()=>this.thisComponent.documentTitle,setDocumentTitle:a=>{this.dispatchLuigiEvent(m.SET_DOCUMENT_TITLE_REQUEST,a)},setDirtyStatus:a=>{this.dispatchLuigiEvent(m.SET_DIRTY_STATUS_REQUEST,{dirty:a})},setCurrentLocale:a=>{a&&this.dispatchLuigiEvent(m.SET_CURRENT_LOCALE_REQUEST,{currentLocale:a})},removeBackdrop:()=>{this.dispatchLuigiEvent(m.REMOVE_BACKDROP_REQUEST,{})},addBackdrop:()=>{this.dispatchLuigiEvent(m.ADD_BACKDROP_REQUEST,{})},showLoadingIndicator:()=>{this.dispatchLuigiEvent(m.SHOW_LOADING_INDICATOR_REQUEST,{})},hideLoadingIndicator:()=>{this.dispatchLuigiEvent(m.HIDE_LOADING_INDICATOR_REQUEST,{})},hideAppLoadingIndicator:()=>{this.dispatchLuigiEvent(m.HIDE_LOADING_INDICATOR_REQUEST,{})},closeCurrentModal:()=>{this.dispatchLuigiEvent(m.CLOSE_CURRENT_MODAL_REQUEST,{})}}),getCurrentLocale:()=>this.thisComponent.locale,getActiveFeatureToggles:()=>this.thisComponent.activeFeatureToggleList||[],publishEvent:a=>{e&&e.eventBus&&e.eventBus.onPublishEvent(a,t,n);const o={id:a.type,_metaData:{nodeId:t,wc_id:n,src:r},data:a.detail};this.dispatchLuigiEvent(m.CUSTOM_MESSAGE,o)},luigiClientInit:()=>{this.dispatchLuigiEvent(m.INITIALIZED,{})},addNodeParams:(a,o)=>{s||this.dispatchLuigiEvent(m.ADD_NODE_PARAMS_REQUEST,{params:a,data:a,keepBrowserHistory:o})},getNodeParams:a=>{return s?{}:a?(o=this.thisComponent.nodeParams,Object.entries(o).reduce(((l,c)=>(l[yt(c[0])]=yt(c[1]),l)),{})):this.thisComponent.nodeParams||{};var o},setAnchor:a=>{s||this.dispatchLuigiEvent(m.SET_ANCHOR_LINK_REQUEST,a)},getAnchor:()=>this.thisComponent.anchor||"",getCoreSearchParams:()=>this.thisComponent.searchParams||{},getPathParams:()=>this.thisComponent.pathParams||{},getClientPermissions:()=>this.thisComponent.clientPermissions||{},addCoreSearchParams:(a={},o=!0)=>{this.dispatchLuigiEvent(m.ADD_SEARCH_PARAMS_REQUEST,{data:a,keepBrowserHistory:o})},getUserSettings:()=>this.thisComponent.userSettings||{},setViewGroupData:a=>{this.dispatchLuigiEvent(m.SET_VIEW_GROUP_DATA_REQUEST,a)}}}initWC(e,t,n,r,s,a,o){const l=this.createClientAPI(n,a,t,e,o);if(e.__postProcess){const c=new URL(document.baseURI).origin===new URL(r,document.baseURI).origin?new URL("./",new URL(r,document.baseURI)):new URL("./",r);e.__postProcess(s,l,c.origin+c.pathname)}else e.context=s,e.LuigiClient=l}generateWCId(e){let t="";const n=new URL(e,encodeURI(location.href)).href;for(let r=0;r<n.length;r++)t+=n.charCodeAt(r).toString(16);return"luigi-wc-"+t}registerWCFromUrl(e,t){const n=this.processViewUrl(e);return new Promise(((r,s)=>{this.checkWCUrl(n)?this.dynamicImport(n).then((a=>{try{if(!window.customElements.get(t)){let o=a.default;if(!HTMLElement.isPrototypeOf(o)){const l=Object.keys(a);for(let c=0;c<l.length&&(o=a[l[c]],!HTMLElement.isPrototypeOf(o));c++);}window.customElements.define(t,o)}r(1)}catch(o){s(o)}})).catch((a=>{s(a)})):s(`Error: View URL '${n}' not allowed to be included`)}))}includeSelfRegisteredWCFromUrl(e,t,n){if(this.checkWCUrl(t)){this.containerService.getContainerManager()._registerWebcomponent||(this.containerService.getContainerManager()._registerWebcomponent=(s,a)=>{window.customElements.define(this.generateWCId(s),a)}),window.Luigi||(window.Luigi={},window.Luigi._registerWebcomponent||(window.Luigi._registerWebcomponent=(s,a)=>{this.containerService.getContainerManager()._registerWebcomponent(s,a)}));const r=document.createElement("script");r.setAttribute("src",t),e.webcomponent.type==="module"&&r.setAttribute("type","module"),r.setAttribute("defer","true"),r.addEventListener("load",(()=>{n()})),document.body.appendChild(r)}else console.warn(`View URL '${t}' not allowed to be included`)}checkWCUrl(e){return!0}renderWebComponent(e,t,n,r,s,a){var f,h;const o=this.processViewUrl(e,{context:n}),l=((f=r==null?void 0:r.webcomponent)==null?void 0:f.tagName)||this.generateWCId(o),c=document.createElement("div");t.appendChild(c),t._luigi_node=r,window.customElements.get(l)?this.attachWC(l,c,t,n,o,s,a):window.luigiWCFn?window.luigiWCFn(o,l,c,(()=>{this.attachWC(l,c,t,n,o,s,a)})):(h=r==null?void 0:r.webcomponent)!=null&&h.selfRegistered?this.includeSelfRegisteredWCFromUrl(r,o,(()=>{this.attachWC(l,c,t,n,o,s,a)})):this.registerWCFromUrl(o,l).then((()=>{this.attachWC(l,c,t,n,o,s,a)})).catch((u=>{console.warn("ERROR =>",u),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,u)}))}createCompoundContainerAsync(e,t,n){return new Promise(((r,s)=>{var a,o;if(e.viewUrl)try{const l=((a=n==null?void 0:n.webcomponent)==null?void 0:a.tagName)||this.generateWCId(e.viewUrl);(o=n==null?void 0:n.webcomponent)!=null&&o.selfRegistered?this.includeSelfRegisteredWCFromUrl(n,e.viewUrl,(()=>{const c=document.createElement(l);c.setAttribute("lui_web_component","true"),this.initWC(c,l,c,e.viewUrl,t,"_root"),r(c)})):this.registerWCFromUrl(e.viewUrl,l).then((()=>{const c=document.createElement(l);c.setAttribute("lui_web_component","true"),this.initWC(c,l,c,e.viewUrl,t,"_root"),r(c)})).catch((c=>{console.warn("Error: ",c),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,c)}))}catch(l){s(l)}else r(e.createCompoundContainer())}))}renderWebComponentCompound(e,t,n){var s;let r;return e.webcomponent&&e.viewUrl?(r=new Pe,r.viewUrl=this.processViewUrl(e.viewUrl,{context:n}),r.createCompoundItemContainer=a=>{const o=document.createElement("div");return a!=null&&a.slot&&o.setAttribute("slot",a.slot),o}):(s=e.compound)!=null&&s.renderer&&(r=jt(e.compound.renderer)),r=r||new Pe,new Promise((a=>{this.createCompoundContainerAsync(r,n,e).then((o=>{var c,f;t._luigi_mfe_webcomponent=o,t._luigi_node=e;const l={};o.eventBus={listeners:l,onPublishEvent:(h,u,d)=>{const p=l[u+"."+h.type]||[];p.push(...l["*."+h.type]||[]),p.forEach((_=>{const E=_.wcElement||o.querySelector("[nodeId="+_.wcElementId+"]");E?E.dispatchEvent(new CustomEvent(_.action,{detail:_.converter?_.converter(h.detail):h.detail})):console.debug("Could not find event target",_)}))}},(f=(c=e.compound)==null?void 0:c.children)==null||f.forEach(((h,u)=>{const d={...n,...h.context},p=r.createCompoundItemContainer(h.layoutConfig);p.eventBus=o.eventBus,r.attachCompoundItem(o,p);const _=h.id||"gen_"+u;this.renderWebComponent(h.viewUrl,p,d,h,_,!0),Tt(l,h,_)})),t.appendChild(o),Tt(l,e.compound,"_root",o),a(o)})).catch((o=>{console.warn("Error: ",o),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,o)}))}))}resolveAlert(e,t){this.alertResolvers[e]?(this.alertResolvers[e](t===void 0||t),this.alertResolvers[e]=void 0):console.log("Promise is not in the list.")}notifyConfirmationModalClosed(e){this.modalResolver?(e?this.modalResolver.resolve():this.modalResolver.reject(),this.modalResolver=void 0):console.log("Modal promise is not listed.")}}const De=new class{isFunction(i){return i&&{}.toString.call(i)==="[object Function]"}isObject(i){return!(!i||typeof i!="object"||Array.isArray(i))}checkWebcomponentValue(i){return typeof i=="string"?JSON.parse(i):typeof i=="boolean"||typeof i=="object"?i:void console.warn("Webcomponent value has a wrong type.")}resolveContext(i){return i?typeof i=="string"?JSON.parse(i):i:{}}};function bt(i){let e,t=(!i[4]||i[4]==="false")&&Rt(i);return{c(){t&&t.c(),e=Mt("")},m(n,r){t&&t.m(n,r),de(n,e,r)},p(n,r){n[4]&&n[4]!=="false"?t&&(t.d(1),t=null):t?t.p(n,r):(t=Rt(n),t.c(),t.m(e.parentNode,e))},d(n){n&&oe(e),t&&t.d(n)}}}function Rt(i){let e,t,n,r,s,a;return{c(){e=Ae("style"),e.textContent=`main.lui-isolated,
24
+ `,t}createCompoundItemContainer(e){const t=e||{},n=document.createElement("div");return n.setAttribute("style",`grid-row: ${t.row||"auto"}; grid-column: ${t.column||"auto"}`),n.classList.add("lui-compoundItemCnt"),n}}const qt=i=>{const e=i.use;return e?e==="grid"?new Oi(i):e.createCompoundContainer||e.createCompoundItemContainer||e.attachCompoundItem?new Ui(i):new Pe(i):new Pe(i)},bt=(i,e,t,n)=>{e!=null&&e.eventListeners&&e.eventListeners.forEach((r=>{const a=r.source+"."+r.name,s=i[a],o={wcElementId:t,wcElement:n,action:r.action,converter:r.dataConverter};s?s.push(o):i[a]=[o]}))};function Rt(i){return String(i).replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&quot;",'"').replaceAll("&#39;","'").replaceAll("&sol;","/")}class zt{constructor(){this.alertResolvers={},this.alertIndex=0,this.containerService=new ht}dynamicImport(e){return Object.freeze(import(e))}processViewUrl(e,t){return e}attachWC(e,t,n,r,a,s,o){if(n&&n.contains(t)){const l=document.createElement(e);s&&l.setAttribute("nodeId",s),l.setAttribute("lui_web_component","true"),this.initWC(l,e,n,a,r,s,o),n.replaceChild(l,t),n._luigi_node&&(n._luigi_mfe_webcomponent=l),n.dispatchEvent(new Event("wc_ready"))}}dispatchLuigiEvent(e,t,n){this.containerService.dispatch(e,this.thisComponent,t,n)}createClientAPI(e,t,n,r,a){return{linkManager:()=>{let s=null,o=!1,l=!1,c=!1,f={};const h={navigate:(u,d={})=>{const p={fromContext:s,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f,...d};this.dispatchLuigiEvent(m.NAVIGATION_REQUEST,{link:u,...p})},navigateToIntent:(u,d={})=>{var _;let p="#?intent=";if(p+=u,d&&((_=Object.keys(d))==null?void 0:_.length)){const v=Object.entries(d);if(v.length>0){p+="?";for(const[R,L]of v)p+=R+"="+L+"&";p=p.slice(0,-1)}}h.navigate(p)},fromClosestContext:()=>(o=!0,h),fromContext:u=>(s=u,h),fromVirtualTreeRoot:()=>(l=!0,h),fromParent:()=>(c=!0,h),getCurrentRoute:()=>{const u={fromContext:s,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f};return new Promise(((d,p)=>{this.containerService.dispatch(m.GET_CURRENT_ROUTE_REQUEST,this.thisComponent,{...u},(_=>{_?d(_):p("No current route received.")}))}))},withParams:u=>(f=u,h),updateModalPathInternalNavigation:(u,d={},p=!1)=>{if(!u)return void console.warn("Updating path of the modal upon internal navigation prevented. No path specified.");const _={fromClosestContext:o,fromContext:s,fromParent:c,fromVirtualTreeRoot:l,nodeParams:f};this.dispatchLuigiEvent(m.UPDATE_MODAL_PATH_DATA_REQUEST,Object.assign(_,{history:p,link:u,modal:d}))},updateTopNavigation:()=>{this.dispatchLuigiEvent(m.UPDATE_TOP_NAVIGATION_REQUEST,{})},pathExists:u=>{const d={fromContext:s,fromClosestContext:o,fromVirtualTreeRoot:l,fromParent:c,nodeParams:f};return new Promise(((p,_)=>{this.containerService.dispatch(m.CHECK_PATH_EXISTS_REQUEST,this.thisComponent,{...d,link:u},(v=>{v?p(!0):_(!1)})),this.containerService.dispatch(m.PATH_EXISTS_REQUEST,this.thisComponent,{...d,link:u},(v=>{v?p(!0):_(!1)}))}))},openAsDrawer:(u,d={})=>{h.navigate(u,{drawer:d})},openAsModal:(u,d={})=>{h.navigate(u,{modal:d})},openAsSplitView:(u,d={})=>{h.navigate(u,{splitView:d})},goBack:u=>{this.dispatchLuigiEvent(m.GO_BACK_REQUEST,u)},hasBack:()=>!1,updateModalSettings:(u={},d=!1)=>{this.dispatchLuigiEvent(m.UPDATE_MODAL_SETTINGS_REQUEST,{updatedModalSettings:u,addHistoryEntry:d})}};return h},uxManager:()=>({showAlert:s=>(s.id=this.alertIndex++,new Promise((o=>{this.alertResolvers[s.id]=o,this.dispatchLuigiEvent(m.ALERT_REQUEST,s,(l=>{this.resolveAlert(s.id,l)}))}))),showConfirmationModal:s=>new Promise(((o,l)=>{this.modalResolver={resolve:o,reject:l},this.containerService.dispatch(m.SHOW_CONFIRMATION_MODAL_REQUEST,this.thisComponent,s,(c=>{c?o():l()}))})),getCurrentTheme:()=>this.thisComponent.theme,closeUserSettings:()=>{this.dispatchLuigiEvent(m.CLOSE_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},openUserSettings:()=>{this.dispatchLuigiEvent(m.OPEN_USER_SETTINGS_REQUEST,this.thisComponent.userSettings)},collapseLeftSideNav:()=>{this.dispatchLuigiEvent(m.COLLAPSE_LEFT_NAV_REQUEST,{})},getDirtyStatus:()=>this.thisComponent.dirtyStatus||!1,getDocumentTitle:()=>this.thisComponent.documentTitle,setDocumentTitle:s=>{this.dispatchLuigiEvent(m.SET_DOCUMENT_TITLE_REQUEST,s)},setDirtyStatus:s=>{this.dispatchLuigiEvent(m.SET_DIRTY_STATUS_REQUEST,{dirty:s})},setCurrentLocale:s=>{s&&this.dispatchLuigiEvent(m.SET_CURRENT_LOCALE_REQUEST,{currentLocale:s})},removeBackdrop:()=>{this.dispatchLuigiEvent(m.REMOVE_BACKDROP_REQUEST,{})},addBackdrop:()=>{this.dispatchLuigiEvent(m.ADD_BACKDROP_REQUEST,{})},showLoadingIndicator:()=>{this.dispatchLuigiEvent(m.SHOW_LOADING_INDICATOR_REQUEST,{})},hideLoadingIndicator:()=>{this.dispatchLuigiEvent(m.HIDE_LOADING_INDICATOR_REQUEST,{})},hideAppLoadingIndicator:()=>{this.dispatchLuigiEvent(m.HIDE_LOADING_INDICATOR_REQUEST,{})},closeCurrentModal:()=>{this.dispatchLuigiEvent(m.CLOSE_CURRENT_MODAL_REQUEST,{})}}),getCurrentLocale:()=>this.thisComponent.locale,getActiveFeatureToggles:()=>this.thisComponent.activeFeatureToggleList||[],publishEvent:s=>{e&&e.eventBus&&e.eventBus.onPublishEvent(s,t,n);const o={id:s.type,_metaData:{nodeId:t,wc_id:n,src:r},data:s.detail};this.dispatchLuigiEvent(m.CUSTOM_MESSAGE,o)},luigiClientInit:()=>{this.dispatchLuigiEvent(m.INITIALIZED,{})},addNodeParams:(s,o)=>{a||this.dispatchLuigiEvent(m.ADD_NODE_PARAMS_REQUEST,{params:s,data:s,keepBrowserHistory:o})},getNodeParams:s=>{return a?{}:s?(o=this.thisComponent.nodeParams,Object.entries(o).reduce(((l,c)=>(l[Rt(c[0])]=Rt(c[1]),l)),{})):this.thisComponent.nodeParams||{};var o},setAnchor:s=>{a||this.dispatchLuigiEvent(m.SET_ANCHOR_LINK_REQUEST,s)},getAnchor:()=>this.thisComponent.anchor||"",getCoreSearchParams:()=>this.thisComponent.searchParams||{},getPathParams:()=>this.thisComponent.pathParams||{},getClientPermissions:()=>this.thisComponent.clientPermissions||{},addCoreSearchParams:(s={},o=!0)=>{this.dispatchLuigiEvent(m.ADD_SEARCH_PARAMS_REQUEST,{data:s,keepBrowserHistory:o})},getUserSettings:()=>this.thisComponent.userSettings||{},setViewGroupData:s=>{this.dispatchLuigiEvent(m.SET_VIEW_GROUP_DATA_REQUEST,s)}}}initWC(e,t,n,r,a,s,o){const l=this.createClientAPI(n,s,t,e,o);if(e.__postProcess){const c=new URL(document.baseURI).origin===new URL(r,document.baseURI).origin?new URL("./",new URL(r,document.baseURI)):new URL("./",r);e.__postProcess(a,l,c.origin+c.pathname)}else e.context=a,e.LuigiClient=l}generateWCId(e){let t="";const n=new URL(e,encodeURI(location.href)).href;for(let r=0;r<n.length;r++)t+=n.charCodeAt(r).toString(16);return"luigi-wc-"+t}registerWCFromUrl(e,t){const n=this.processViewUrl(e);return new Promise(((r,a)=>{this.checkWCUrl(n)?this.dynamicImport(n).then((s=>{try{if(!window.customElements.get(t)){let o=s.default;if(!HTMLElement.isPrototypeOf(o)){const l=Object.keys(s);for(let c=0;c<l.length&&(o=s[l[c]],!HTMLElement.isPrototypeOf(o));c++);}window.customElements.define(t,o)}r(1)}catch(o){a(o)}})).catch((s=>{a(s)})):a(`Error: View URL '${n}' not allowed to be included`)}))}includeSelfRegisteredWCFromUrl(e,t,n){if(this.checkWCUrl(t)){this.containerService.getContainerManager()._registerWebcomponent||(this.containerService.getContainerManager()._registerWebcomponent=(a,s)=>{window.customElements.define(this.generateWCId(a),s)}),window.Luigi||(window.Luigi={},window.Luigi._registerWebcomponent||(window.Luigi._registerWebcomponent=(a,s)=>{this.containerService.getContainerManager()._registerWebcomponent(a,s)}));const r=document.createElement("script");r.setAttribute("src",t),e.webcomponent.type==="module"&&r.setAttribute("type","module"),r.setAttribute("defer","true"),r.addEventListener("load",(()=>{n()})),document.body.appendChild(r)}else console.warn(`View URL '${t}' not allowed to be included`)}checkWCUrl(e){return!0}renderWebComponent(e,t,n,r,a,s){var f,h;const o=this.processViewUrl(e,{context:n}),l=((f=r==null?void 0:r.webcomponent)==null?void 0:f.tagName)||this.generateWCId(o),c=document.createElement("div");t.appendChild(c),t._luigi_node=r,window.customElements.get(l)?this.attachWC(l,c,t,n,o,a,s):window.luigiWCFn?window.luigiWCFn(o,l,c,(()=>{this.attachWC(l,c,t,n,o,a,s)})):(h=r==null?void 0:r.webcomponent)!=null&&h.selfRegistered?this.includeSelfRegisteredWCFromUrl(r,o,(()=>{this.attachWC(l,c,t,n,o,a,s)})):this.registerWCFromUrl(o,l).then((()=>{this.attachWC(l,c,t,n,o,a,s)})).catch((u=>{console.warn("ERROR =>",u),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,u)}))}createCompoundContainerAsync(e,t,n){return new Promise(((r,a)=>{var s,o;if(e.viewUrl)try{const l=((s=n==null?void 0:n.webcomponent)==null?void 0:s.tagName)||this.generateWCId(e.viewUrl);(o=n==null?void 0:n.webcomponent)!=null&&o.selfRegistered?this.includeSelfRegisteredWCFromUrl(n,e.viewUrl,(()=>{const c=document.createElement(l);c.setAttribute("lui_web_component","true"),this.initWC(c,l,c,e.viewUrl,t,"_root"),r(c)})):this.registerWCFromUrl(e.viewUrl,l).then((()=>{const c=document.createElement(l);c.setAttribute("lui_web_component","true"),this.initWC(c,l,c,e.viewUrl,t,"_root"),r(c)})).catch((c=>{console.warn("Error: ",c),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,c)}))}catch(l){a(l)}else r(e.createCompoundContainer())}))}renderWebComponentCompound(e,t,n){var a;let r;return e.webcomponent&&e.viewUrl?(r=new Pe,r.viewUrl=this.processViewUrl(e.viewUrl,{context:n}),r.createCompoundItemContainer=s=>{const o=document.createElement("div");return s!=null&&s.slot&&o.setAttribute("slot",s.slot),o}):(a=e.compound)!=null&&a.renderer&&(r=qt(e.compound.renderer)),r=r||new Pe,new Promise((s=>{this.createCompoundContainerAsync(r,n,e).then((o=>{var c,f;t._luigi_mfe_webcomponent=o,t._luigi_node=e;const l={};o.eventBus={listeners:l,onPublishEvent:(h,u,d)=>{const p=l[u+"."+h.type]||[];p.push(...l["*."+h.type]||[]),p.forEach((_=>{const v=_.wcElement||o.querySelector("[nodeId="+_.wcElementId+"]");v?v.dispatchEvent(new CustomEvent(_.action,{detail:_.converter?_.converter(h.detail):h.detail})):console.debug("Could not find event target",_)}))}},(f=(c=e.compound)==null?void 0:c.children)==null||f.forEach(((h,u)=>{const d={...n,...h.context},p=r.createCompoundItemContainer(h.layoutConfig);p.eventBus=o.eventBus,r.attachCompoundItem(o,p);const _=h.id||"gen_"+u;this.renderWebComponent(h.viewUrl,p,d,h,_,!0),bt(l,h,_)})),t.appendChild(o),bt(l,e.compound,"_root",o),s(o)})).catch((o=>{console.warn("Error: ",o),this.containerService.dispatch(m.RUNTIME_ERROR_HANDLING_REQUEST,this.thisComponent,o)}))}))}resolveAlert(e,t){this.alertResolvers[e]?(this.alertResolvers[e](t===void 0||t),this.alertResolvers[e]=void 0):console.log("Promise is not in the list.")}notifyConfirmationModalClosed(e){this.modalResolver?(e?this.modalResolver.resolve():this.modalResolver.reject(),this.modalResolver=void 0):console.log("Modal promise is not listed.")}}const xe=new class{isFunction(i){return i&&{}.toString.call(i)==="[object Function]"}isObject(i){return!(!i||typeof i!="object"||Array.isArray(i))}checkWebcomponentValue(i){return typeof i=="string"?JSON.parse(i):typeof i=="boolean"||typeof i=="object"?i:void console.warn("Webcomponent value has a wrong type.")}resolveContext(i){return i?typeof i=="string"?JSON.parse(i):i:{}}};function At(i){let e,t=(!i[4]||i[4]==="false")&&Pt(i);return{c(){t&&t.c(),e=Vt("")},m(n,r){t&&t.m(n,r),de(n,e,r)},p(n,r){n[4]&&n[4]!=="false"?t&&(t.d(1),t=null):t?t.p(n,r):(t=Pt(n),t.c(),t.m(e.parentNode,e))},d(n){n&&oe(e),t&&t.d(n)}}}function Pt(i){let e,t,n,r,a,s;return{c(){e=Ae("style"),e.textContent=`main.lui-isolated,
25
25
  .lui-isolated iframe {
26
26
  width: 100%;
27
27
  height: 100%;
@@ -30,5 +30,5 @@ Invalid Children:`,t);return}return t.some(a=>{if(a.pathSegment===e||a.pathSegme
30
30
 
31
31
  main.lui-isolated {
32
32
  line-height: 0;
33
- }`,t=Mt(" "),n=Ae("iframe"),vt(n.src,r=i[3])||W(n,"src",r),W(n,"title",i[1]),W(n,"allow",s=wt(i[0])),W(n,"sandbox",a=i[2]?i[2].join(" "):void 0)},m(o,l){de(o,e,l),de(o,t,l),de(o,n,l),i[28](n)},p(o,l){8&l[0]&&!vt(n.src,r=o[3])&&W(n,"src",r),2&l[0]&&W(n,"title",o[1]),1&l[0]&&s!==(s=wt(o[0]))&&W(n,"allow",s),4&l[0]&&a!==(a=o[2]?o[2].join(" "):void 0)&&W(n,"sandbox",a)},d(o){o&&(oe(e),oe(t),oe(n)),i[28](null)}}}function Ui(i){let e,t,n=i[5]&&bt(i);return{c(){e=Ae("main"),n&&n.c(),W(e,"class",t=i[4]?void 0:"lui-isolated")},m(r,s){de(r,e,s),n&&n.m(e,null),i[29](e)},p(r,s){r[5]?n?n.p(r,s):(n=bt(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null),16&s[0]&&t!==(t=r[4]?void 0:"lui-isolated")&&W(e,"class",t)},i:ae,o:ae,d(r){r&&oe(e),n&&n.d(),i[29](null)}}}function Oi(i,e,t){let{activeFeatureToggleList:n}=e,{allowRules:r}=e,{anchor:s}=e,{authData:a}=e,{clientPermissions:o}=e,{context:l}=e,{deferInit:c}=e,{dirtyStatus:f}=e,{documentTitle:h}=e,{hasBack:u}=e,{label:d}=e,{locale:p}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{sandboxRules:L}=e,{searchParams:U}=e,{skipCookieCheck:z}=e,{skipInitCheck:G}=e,{theme:K}=e,{userSettings:J}=e,{viewurl:j}=e,{webcomponent:k}=e;const I={};let $,S,te=!1;const H=new Bt,O=g=>{if(!te){g.sendCustomMessage=(b,D)=>{Ee.sendCustomMessage(b,g.getNoShadow()?g:$,!!k,I,D)},g.updateContext=(b,D)=>{if(t(8,l=b),k)(g.getNoShadow()?g:$)._luigi_mfe_webcomponent.context=b;else{const pe={...D||{},activeFeatureToggleList:g.activeFeatureToggleList||[],currentLocale:g.locale,currentTheme:g.theme,userSettings:g.userSettings||null,cssVariables:g.cssVariables||{},anchor:g.anchor||"",drawer:g.drawer||!1,modal:g.modal||!1,viewStackSize:g.viewStackSize||0,isNavigateBack:g.isNavigateBack||!1};Ee.updateContext(b,pe,I,E,R,U)}},g.closeAlert=(b,D)=>{g.notifyAlertClosed(b,D)},g.notifyAlertClosed=(b,D)=>{g.isConnected&&(k?H.resolveAlert(b,D):Ee.notifyAlertClosed(b,D,I))},g.notifyConfirmationModalClosed=b=>{g.isConnected&&(k?H.notifyConfirmationModalClosed(!!b):Ee.notifyConfirmationModalClosed(!!b,I))},se.registerContainer(g),H.thisComponent=g;const ue=De.resolveContext(l);if(g.updateViewUrl=(b,D)=>{b!=null&&b.length&&Ee.updateViewUrl(b,De.resolveContext(l),D,I)},k&&k!="false"){g.getNoShadow()?g.innerHTML="":(t(7,$.innerHTML="",$),g.attachShadow({mode:"open"}).append($));const b=De.checkWebcomponentValue(k);H.renderWebComponent(j,g.getNoShadow()?g:$,ue,typeof b=="object"?{webcomponent:b}:{})}else g.getNoShadow()||(g.innerHTML="",g.attachShadow({mode:"open"}).append($));G?(g.initialized=!0,setTimeout((()=>{H.dispatchLuigiEvent(m.INITIALIZED,{})}))):k&&(g.getNoShadow()?g:$).addEventListener("wc_ready",(()=>{var b;(b=(g.getNoShadow()?g:$)._luigi_mfe_webcomponent)!=null&&b.deferLuigiClientWCInit||(g.initialized=!0,H.dispatchLuigiEvent(m.INITIALIZED,{}))})),t(5,te=!0),g.containerInitialized=!0}};var re;return Vt((async()=>{t(27,S=$.parentNode),t(27,S.iframeHandle=I,S),t(27,S.init=()=>{O(S)},S),!c&&j&&O(S)})),re=async()=>{},Ft().$$.on_destroy.push(re),i.$$set=g=>{"activeFeatureToggleList"in g&&t(9,n=g.activeFeatureToggleList),"allowRules"in g&&t(0,r=g.allowRules),"anchor"in g&&t(10,s=g.anchor),"authData"in g&&t(11,a=g.authData),"clientPermissions"in g&&t(12,o=g.clientPermissions),"context"in g&&t(8,l=g.context),"deferInit"in g&&t(13,c=g.deferInit),"dirtyStatus"in g&&t(14,f=g.dirtyStatus),"documentTitle"in g&&t(15,h=g.documentTitle),"hasBack"in g&&t(16,u=g.hasBack),"label"in g&&t(1,d=g.label),"locale"in g&&t(17,p=g.locale),"noShadow"in g&&t(18,_=g.noShadow),"nodeParams"in g&&t(19,E=g.nodeParams),"pathParams"in g&&t(20,R=g.pathParams),"sandboxRules"in g&&t(2,L=g.sandboxRules),"searchParams"in g&&t(21,U=g.searchParams),"skipCookieCheck"in g&&t(22,z=g.skipCookieCheck),"skipInitCheck"in g&&t(23,G=g.skipInitCheck),"theme"in g&&t(24,K=g.theme),"userSettings"in g&&t(25,J=g.userSettings),"viewurl"in g&&t(3,j=g.viewurl),"webcomponent"in g&&t(4,k=g.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!te&&j&&!c&&S&&O(S)},[r,d,L,j,k,te,I,$,l,n,s,a,o,c,f,h,u,p,_,E,R,U,z,G,K,J,()=>n&&r&&s&&a&&o&&f&&h&&u&&p&&_&&E&&R&&L&&U&&z&&G&&K&&J,S,function(g){Me[g?"unshift":"push"]((()=>{I.iframe=g,t(6,I)}))},function(g){Me[g?"unshift":"push"]((()=>{$=g,t(7,$)}))}]}class qt extends Gt{constructor(e){super(),Ht(this,e,Oi,Ui,kt,{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(e){this.$$set({activeFeatureToggleList:e}),w()}get allowRules(){return this.$$.ctx[0]}set allowRules(e){this.$$set({allowRules:e}),w()}get anchor(){return this.$$.ctx[10]}set anchor(e){this.$$set({anchor:e}),w()}get authData(){return this.$$.ctx[11]}set authData(e){this.$$set({authData:e}),w()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get context(){return this.$$.ctx[8]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[13]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[16]}set hasBack(e){this.$$set({hasBack:e}),w()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),w()}get locale(){return this.$$.ctx[17]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[18]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[20]}set pathParams(e){this.$$set({pathParams:e}),w()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(e){this.$$set({sandboxRules:e}),w()}get searchParams(){return this.$$.ctx[21]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(e){this.$$set({skipCookieCheck:e}),w()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[24]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[25]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[3]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[26]}}function Di(i){yi(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function xi(i){let e;return{c(){e=Ae("main"),W(e,"class","svelte-1buc46y")},m(t,n){de(t,e,n),i[21](e)},p:ae,i:ae,o:ae,d(t){t&&oe(e),i[21](null)}}}function ki(i,e,t){let n,r,{activeFeatureToggleList:s}=e,{anchor:a}=e,{clientPermissions:o}=e,{compoundConfig:l}=e,{context:c}=e,{deferInit:f}=e,{dirtyStatus:h}=e,{documentTitle:u}=e,{hasBack:d}=e,{locale:p}=e,{noShadow:_}=e,{nodeParams:E}=e,{pathParams:R}=e,{searchParams:L}=e,{skipInitCheck:U}=e,{theme:z}=e,{userSettings:G}=e,{viewurl:K}=e,{webcomponent:J}=e,j=!1;const k=new ht,I=new Bt,$=S=>{if(!l||j)return;S.updateContext=(O,re)=>{const g=S.getNoShadow()?S:n;g._luigi_mfe_webcomponent.context=O,t(1,c=O);const ue=g._luigi_mfe_webcomponent;if(ue){const b=ue.querySelectorAll("[lui_web_component]");b==null||b.forEach((D=>{const pe=D.context||{};D.context=Object.assign(pe,O)}))}};const te=De.resolveContext(c);t(2,f=!1),S.notifyAlertClosed=(O,re)=>{S.isConnected&&I.resolveAlert(O,re)},S.notifyConfirmationModalClosed=O=>{S.isConnected&&I.notifyConfirmationModalClosed(!!O)};const H={compound:l,viewUrl:K,webcomponent:De.checkWebcomponentValue(J)||!0};S.getNoShadow()?S.innerHTML="":(t(0,n.innerHTML="",n),S.attachShadow({mode:"open"}).append(n)),I.renderWebComponentCompound(H,S.getNoShadow()?S:n,te).then((O=>{r=O,U||!H.viewUrl?(S.initialized=!0,setTimeout((()=>{I.dispatchLuigiEvent(m.INITIALIZED,{})}))):r.LuigiClient&&!r.deferLuigiClientWCInit&&(S.initialized=!0,I.dispatchLuigiEvent(m.INITIALIZED,{}))})),j=!0,S.containerInitialized=!0};return Vt((async()=>{const S=n.getRootNode()===document?n.parentNode:n.getRootNode().host;S.init=()=>{$(S)},f||$(S),k.registerContainer(S),I.thisComponent=S})),i.$$set=S=>{"activeFeatureToggleList"in S&&t(3,s=S.activeFeatureToggleList),"anchor"in S&&t(4,a=S.anchor),"clientPermissions"in S&&t(5,o=S.clientPermissions),"compoundConfig"in S&&t(6,l=S.compoundConfig),"context"in S&&t(1,c=S.context),"deferInit"in S&&t(2,f=S.deferInit),"dirtyStatus"in S&&t(7,h=S.dirtyStatus),"documentTitle"in S&&t(8,u=S.documentTitle),"hasBack"in S&&t(9,d=S.hasBack),"locale"in S&&t(10,p=S.locale),"noShadow"in S&&t(11,_=S.noShadow),"nodeParams"in S&&t(12,E=S.nodeParams),"pathParams"in S&&t(13,R=S.pathParams),"searchParams"in S&&t(14,L=S.searchParams),"skipInitCheck"in S&&t(15,U=S.skipInitCheck),"theme"in S&&t(16,z=S.theme),"userSettings"in S&&t(17,G=S.userSettings),"viewurl"in S&&t(18,K=S.viewurl),"webcomponent"in S&&t(19,J=S.webcomponent)},[n,c,f,s,a,o,l,h,u,d,p,_,E,R,L,U,z,G,K,J,()=>s&&a&&o&&h&&u&&d&&p&&_&&E&&R&&L&&U&&z&&G,function(S){Me[S?"unshift":"push"]((()=>{n=S,t(0,n)}))}]}Wt(qt,{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 e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"sendCustomMessage",e("sendCustomMessage"));A(this,"updateContext",e("updateContext"));A(this,"updateViewUrl",e("updateViewUrl"));A(this,"closeAlert",e("closeAlert"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.error("Error in super.attributeChangedCallback",a)}this.containerInitialized&&(n==="context"&&this.updateContext(JSON.parse(s)),n==="auth-data"&&Ee.updateAuthData(this.iframeHandle,JSON.parse(s)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class At extends Gt{constructor(e){super(),Ht(this,e,ki,xi,kt,{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},Di)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get anchor(){return this.$$.ctx[4]}set anchor(e){this.$$set({anchor:e}),w()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(e){this.$$set({compoundConfig:e}),w()}get context(){return this.$$.ctx[1]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[2]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[9]}set hasBack(e){this.$$set({hasBack:e}),w()}get locale(){return this.$$.ctx[10]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[11]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[13]}set pathParams(e){this.$$set({pathParams:e}),w()}get searchParams(){return this.$$.ctx[14]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[16]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[17]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[18]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[20]}}Wt(At,{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 e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"updateContext",e("updateContext"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,s){try{super.attributeChangedCallback(n,r,s)}catch(a){console.warn("Error in attributeChangedCallback",a)}this.containerInitialized&&n==="context"&&this.updateContext(JSON.parse(s))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",qt.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",At.element);class Ie{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(e){this.decorators=this.decorators.filter(t=>t.uid!==e.uid).concat(e)}applyDecorators(e,t){if(!e)return e;const n=new URL(v.prependOrigin(e)),r=this.decorators.filter(s=>s.type==="queryString");for(let s=0;s<r.length;s++){const a=r[s];n.searchParams.has(a.key)&&n.searchParams.delete(a.key);const o=a.valueFn();n.searchParams.append(a.key,o)}return t&&(n.search=decodeURIComponent(n.search)),n.href}}const at=async(i,e)=>{const t=await e.readUserSettings(),r=i.userSettingsGroup&&typeof t=="object"&&t!==null?t[i.userSettingsGroup]:null;if(i.webcomponent&&!C.checkWCUrl(i.viewUrl,e))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const s=document.createElement("luigi-compound-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.compoundConfig=i.compound,s.context=i.context,s.clientPermissions=i.clientPermissions,s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,e.getEngine()._comm.addListeners(s,e),s}else{const s=document.createElement("luigi-container");return s.setAttribute("lui_container","true"),s.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),s.webcomponent=i.webcomponent,s.context=i.context,s.clientPermissions=i.clientPermissions,s.cssVariables=await e.theming().getCSSVariables(),s.nodeParams=i.nodeParams,s.pathParams=i.pathParams,s.userSettingsGroup=i.userSettingsGroup,s.userSettings=r,s.searchParams=i.searchParams,s.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),s.locale=e.i18n().getCurrentLocale(),s.theme=e.theming().getCurrentTheme(),s.viewGroup=i.viewGroup,zt(s,e),Kt(s,e),e.getEngine()._comm.addListeners(s,e),s}},zt=(i,e)=>{const t=e.getConfigValue("settings.customSandboxRules");if(!(t!=null&&t.length))return;const n=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],r=t?[...new Set([...n,...t])]:n;i.sandboxRules=r},Kt=(i,e)=>{const t=e.getConfigValue("settings.allowRules");t!=null&&t.length&&(t.forEach((n,r)=>{t[r]=n+(n.indexOf(";")!=-1?"":";")}),i.allowRules=t)},x={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{var e;console.log("Init UI..."),x.navService=y.get(ce),x.routingService=y.get(ge),x.luigi=i,(e=i.getEngine()._connector)==null||e.renderMainLayout()},update:async i=>{var n,r,s;const e=x.routingService.getCurrentRoute();if(!e)return;const t=!i||i.length===0;(t||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&((n=x.luigi.getEngine()._connector)==null||n.renderTopNav(await x.navService.getTopNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(y.get(le).deleteCache(),(r=x.luigi.getEngine()._connector)==null||r.renderLeftNav(await x.navService.getLeftNavData(e.path)),(s=x.luigi.getEngine()._connector)==null||s.renderTabNav(await x.navService.getTabNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(y.get(le).deleteCache(),x.updateMainContent(e.node,x.luigi))},updateMainContent:async(i,e,t,n)=>{var l,c,f;const r=await e.readUserSettings(),a=i.userSettingsGroup&&typeof r=="object"&&r!==null?r[i.userSettingsGroup]:null,o=(l=e.getEngine()._connector)==null?void 0:l.getContainerWrapper();if((c=e.getEngine()._connector)==null||c.hideLoadingIndicator(o),i&&o){let h;if([...o.childNodes].forEach(u=>{var d;((d=u.tagName)==null?void 0:d.indexOf("LUIGI-"))===0&&(u.viewGroup?i.viewGroup===u.viewGroup?h=u:u.style.display="none":u.remove())}),h)t||(h.style.display="block",h.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),h.nodeParams=i.nodeParams,h.pathParams=i.pathParams,h.clientPermissions=i.clientPermissions,h.searchParams=C.prepareSearchParamsForClient(i,e),h.locale=e.i18n().getCurrentLocale(),h.theme=e.theming().getCurrentTheme(),h.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),h.userSettingsGroup=i.userSettingsGroup,h.userSettings=a,zt(h,e),Kt(h,e)),n||h.updateContext(i.context||{});else{const u=await at(i,e);o==null||o.appendChild(u);const d=e.getEngine()._connector;((f=i.loadingIndicator)==null?void 0:f.enabled)!==!1&&(d==null||d.showLoadingIndicator(o))}}},openModal:async(i,e,t,n)=>{var p,_;const r=await at(e,i),s=y.get(ge),a=y.get(fe);let o=!1,l,c;const h=new Promise(E=>{l=()=>{o||(o=!0,E(),a.removeLastModalFromStack())},c=()=>{l&&l(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},r.addEventListener(m.CLOSE_CURRENT_MODAL_REQUEST,c)}),u={closePromise:h,resolveFn:l,onCloseRequestHandler:c,onInternalClose:()=>{try{u.resolveFn&&u.resolveFn()}catch(E){console.warn("onInternalClose failed",E)}},modalsettings:t};a.registerModal(u),(p=i.getEngine()._connector)==null||p.renderModal(r,t,()=>{n==null||n(),a.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&a.getModalStackLength()===0&&s.removeModalDataFromUrl(!0)},()=>h);const d=i.getEngine()._connector;((_=e.loadingIndicator)==null?void 0:_.enabled)!==!1&&(d==null||d.showLoadingIndicator(r.parentElement))},updateModalSettings:(i,e,t)=>{var a;const n=y.get(fe);if(n.getModalStackLength()===0)return;n.updateFirstModalSettings(i);const r=y.get(ge),s=C.getModalPathFromPath(t);s&&r.updateModalDataInUrl(s,n.getModalSettings(),e),(a=t.getEngine()._connector)==null||a.updateModalSettings(n.getModalSettings())},openDrawer:async(i,e,t,n)=>{var a,o;const r=await at(e,i);(a=i.getEngine()._connector)==null||a.renderDrawer(r,t,n);const s=i.getEngine()._connector;((o=e.loadingIndicator)==null?void 0:o.enabled)!==!1&&(s==null||s.showLoadingIndicator(r.parentElement))}};class ge{constructor(e){this.luigi=e}getNavigationService(){return this.navigationService||(this.navigationService=y.get(ce)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const e=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||e).filter(n=>location.href.match(n)).length!==0}enableRouting(){var t;const e=this.luigi.getConfig();console.log("Init Routing...",e.routing),(t=e.routing)!=null&&t.useHashRouting?(window.addEventListener("hashchange",n=>{var a,o;const r=!!((a=n==null?void 0:n.detail)!=null&&a.preventContextUpdate),s=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(!0),s,r)}),this.handleRouteChange(C.getCurrentPath(!0))):(window.addEventListener("popstate",n=>{var a,o;const r=!!((a=n==null?void 0:n.detail)!=null&&a.preventContextUpdate),s=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(),s,r)}),this.handleRouteChange(C.getCurrentPath()))}async handleRouteChange(e,t=!1,n=!1){var d,p,_;const r=e.path,s=e.query,a=r+(s?"?"+s:""),o=new URLSearchParams(s),l={};if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(a),await this.shouldShowModalPathInUrl(e),o.forEach((E,R)=>{l[R]=E}),this.checkInvalidateCache(this.previousPathData,r);const c=await this.getNavigationService().getPathData(r);this.previousPathData=c;const f=C.filterNodeParams(l,this.luigi),h=await this.getNavigationService().shouldRedirect(r,c);if(h){this.luigi.navigation().navigate(h);return}this.currentRoute={raw:window.location.href,path:r,nodeParams:f},(d=this.luigi.getEngine()._connector)==null||d.renderTopNav(await this.getNavigationService().getTopNavData(r,c)),(p=this.luigi.getEngine()._connector)==null||p.renderLeftNav(await this.getNavigationService().getLeftNavData(r,c)),(_=this.luigi.getEngine()._connector)==null||_.renderTabNav(await this.getNavigationService().getTabNavData(r,c));const u=(c==null?void 0:c.selectedNode)??await this.getNavigationService().getCurrentNode(r);u&&(this.currentRoute.node=u,u.nodeParams=f||{},u.pathParams=(c==null?void 0:c.pathParams)||{},u.searchParams=C.prepareSearchParamsForClient(u,this.luigi),this.getNavigationService().onNodeChange(this.previousNode,u),this.previousNode=u,x.updateMainContent(u,this.luigi,t,n))}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(e){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(e)}async handleBookmarkableModalPath(e){var o;const t=y.get(ce),n=y.get(fe),r=new URLSearchParams((e==null?void 0:e.query)||""),s=C.getModalViewParamName(this.luigi),a=r.get(s);if(a){const l=r.get(`${s}Params`);try{const c=JSON.parse(l||"{}"),{nodeObject:f}=await t.extractDataFromPath(a);document.querySelector(".lui-modal luigi-container")?(o=this.luigi.getEngine()._connector)==null||o.updateModalSettings(c):this.luigi.navigation().openAsModal(a,c||f.openNodeInModal)}catch(c){console.error("Error parsing modal settings from URL parameters",c)}}else{n.closeModals();return}}appendModalDataToUrl(e,t){const n=C.getHashQueryParamSeparator(),r=C.getQueryParams(this.luigi),s=C.getModalViewParamName(this.luigi),a=r[s],o=new URL(location.href),l=this.luigi.getConfigValue("routing.useHashRouting");let c=history.state,f,h;if(l){let[u,d]=o.hash.split("?");f=u,h=C.getURLWithoutModalData(d,s),h&&(f+="?"+h)}else f=o.pathname,h=C.getURLWithoutModalData(o.search,s),h&&(f+="?"+C.getURLWithoutModalData(o.search,s));if(c=C.handleHistoryState(c,f),a!==e){if(r[s]=e,t&&Object.keys(t).length&&(r[`${s}Params`]=JSON.stringify(t)),l){const u=location.hash.indexOf(n);u!==-1&&(o.hash=o.hash.slice(0,u)),o.hash=`${o.hash}${n}${C.encodeParams(r)}`}else o.search=`?${C.encodeParams(r)}`;history.pushState(c,"",o.href)}else{const u=new URL(o);if(l){let d=u.hash.split("?")[0];u.hash=d,h&&(u.hash+="?"+h)}else u.search=h;history.replaceState({},"",u.href),history.pushState(c,"",o.href)}}removeModalDataFromUrl(e){const t=C.getQueryParams(this.luigi),n=C.getModalViewParamName(this.luigi);let r=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let a={};t[n]&&(a[n]=t[n]),t[`${n}Params`]&&(a[`${n}Params`]=t[`${n}Params`]);let o=C.encodeParams(a);r.hash.includes(`?${o}`)?r.hash=r.hash.replace(`?${o}`,""):r.hash.includes(`&${o}`)&&(r.hash=r.hash.replace(`&${o}`,""))}else{let a=new URLSearchParams(r.search.slice(1));a.delete(n),a.delete(`${n}Params`);let o="";Array.from(a.keys()).forEach(l=>{o+=(o===""?"?":"&")+l+"="+a.get(l)}),r.search=o}if(history.state&&history.state.modalHistoryLength>=0&&e){history.state.modalHistoryLength;const a=history.state.pathBeforeHistory;let o=!1;if(window.addEventListener("popstate",l=>{o?(history.replaceState({},"",a),history.pushState({},"",a),history.back()):(history.pushState({},"",a),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 l=history.length-1;o=!0,history.go(-l),window.Luigi.preventLoadingModalData=!0}else{const l=history.state.modalHistoryLength;history.go(-l)}}else history.pushState({},"",r.href)}setFeatureToggle(e){const t=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),n=this.luigi.featureToggles();t&&typeof e=="string"&&C.setFeatureToggles(t,e,n)}updateModalDataInUrl(e,t,n){let r=C.getHashQueryParamSeparator();const s=C.getQueryParams(this.luigi),a=C.getModalViewParamName(this.luigi);s[a]=e,t&&Object.keys(t).length&&(s[`${a}Params`]=JSON.stringify(t));const o=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const c=location.hash.indexOf(r);c!==-1&&(o.hash=o.hash.slice(0,c)),o.hash=`${o.hash}${r}${C.encodeParams(s)}`}else o.search=`?${C.encodeParams(s)}`;n?history.pushState(window.state,"",o.href):history.replaceState(window.state,"",o.href)}checkInvalidateCache(e,t){if(!e)return;const n=y.get(le);let r=t.split("/");if(e.nodesInPath&&e.nodesInPath.length>0){let s=e.nodesInPath.slice(1),a=!0;for(let o=0;o<s.length;o++){let l=r.length>o?r[o]:void 0,c=s[o];if(l!==c.pathSegment||!a)if(C.isDynamicNode(c)){if(!a||l!==C.getDynamicNodeValue(c,e.pathParams)){n.deleteNodesRecursively(c);break}}else a=!1}}else n.deleteCache()}}class Mi{constructor(e){var t;this.hashRouting=!1,this.navigate=async(n,r,s,a,o)=>{const l={modalSettings:s,newTab:!1,path:n,preserveView:r,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(l,void 0)},this.openAsModal=async(n,r,s)=>{r.keepPrevious||await this.modalService.closeModals();const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(a,l),this.luigi.getEngine()._ui.openModal(this.luigi,o,l,s)},this.openAsDrawer=async(n,r,s)=>{const a=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(a),l=r||{};l.title||(l.title=o.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,o,l,s)},this.runTimeErrorHandler=async n=>{var o,l,c;const{path:r}=C.getCurrentPath((o=this.luigi.getConfig().routing)==null?void 0:o.useHashRouting),s=await this.navService.getCurrentNode(r),a=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");(l=s==null?void 0:s.runTimeErrorHandler)!=null&&l.errorFn&&v.isFunction((c=s==null?void 0:s.runTimeErrorHandler)==null?void 0:c.errorFn)?s.runTimeErrorHandler.errorFn(n,s):a!=null&&a.errorFn&&v.isFunction(a.errorFn)&&a.errorFn(n,s)},this.luigi=e,this.hashRouting=(t=e.getConfig().routing)==null?void 0:t.useHashRouting,this.navService=y.get(ce),this.routingService=y.get(ge),this.modalService=y.get(fe)}}class Fi{constructor(e){this.luigi=e}addSearchParams(e,t=!1){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?n.hash=C.addParamsOnHashRouting(e,n.hash):C.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),this.luigi.configChanged()}getSearchParams(){const e={},t=["__proto__","constructor","prototype"],n=new URL(location.href);let r;if(this.luigi.getConfigValue("routing.useHashRouting")){const s=n.hash.split("?")[1];r=s?new URLSearchParams(s).entries():[]}else r=n.searchParams.entries();for(const[s,a]of r){if(t.some(o=>s===o)){console.warn(`Blocked because of potentially dangerous query param: ${s}`);continue}e[s]=a}return e}handleBrowserHistory(e,t){const n=this.sanitizeUrl(t.href);if(!n){console.warn("invalid url: "+n);return}e?window.history.pushState({},"",n):window.history.replaceState({},"",n)}sanitizeUrl(e){return new URL(location.href).origin===new URL(e).origin?e:void 0}addNodeParams(e,t){if(!v.isObject(e)){console.log("Params argument must be an object");return}const n=C.getContentViewParamPrefix(this.luigi),r=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?r.hash=C.addParamsOnHashRouting(e,r.hash,n):C.modifySearchParams(e,r.searchParams,n),this.handleBrowserHistory(t,r),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}var V,Re;class Vi{constructor(e){it(this,V);it(this,Re,"");nt(this,V,e)}async getAvailableThemes(){return await Q(this,V).getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){nt(this,Re,e),Q(this,V).__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t==null?void 0:t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(Q(this,Re))return Q(this,Re);const e=Q(this,V).getConfigValue("settings.theming");return e.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",e),e.defaultTheme}isThemingAvailable(){return!!Q(this,V).getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=Q(this,V).getConfigValue("settings.theming.variables.file");if(e)try{const t=await fetch(e);window.Luigi.__cssVars=(await t.json()).root,Object.keys(window.Luigi.__cssVars).forEach(n=>{const r=getComputedStyle(document.documentElement).getPropertyValue("--"+n);r&&(window.Luigi.__cssVars[n]=r)})}catch(t){v.isFunction(Q(this,V).getConfigValue("settings.theming.variables.errorHandling"))?Q(this,V).getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else Q(this,V).getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(t=>{window.Luigi.__cssVars[t]=getComputedStyle(document.documentElement).getPropertyValue("--"+t)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const e=y.get(Ie);(()=>{const n=Q(this,V).getConfigValue("settings.theming");n&&n.nodeViewURLDecorator&&n.nodeViewURLDecorator.queryStringParameter&&e.add({type:"queryString",uid:"theming",key:n.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const r=this.getCurrentTheme(),s=n.nodeViewURLDecorator.queryStringParameter.value;return s?s(r):r}}),n&&n.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}V=new WeakMap,Re=new WeakMap;class Ke{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(e,t){var n,r;if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const s=new Set;s.add(t),this.unsavedChanges={dirtySet:s}}this.unsavedChanges.persistUrl=window.location.href,e?(n=this.unsavedChanges.dirtySet)==null||n.add(t):(r=this.unsavedChanges.dirtySet)==null||r.delete(t)}clearDirtyState(e){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(e?this.unsavedChanges.dirtySet.delete(e):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let Pt;const N={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),N.luigi=i,N.documentTitle=Be(void 0),Pt=y.get(Ke)},processAlert:(i,e,t)=>{var r;if(!N.luigi)throw new Error("Luigi is not initialized.");const n={openFromClient:e,close:()=>{i.id&&t.notifyAlertClosed(i.id)},link:s=>{var a;if(i.links){const o=i.links[s];if(o&&(o.url&&((a=N.luigi)==null||a.navigation().navigate(o.url)),o.dismissKey&&i.id))return t.notifyAlertClosed(i.id,o.dismissKey),!0}return!1}};(r=N.luigi.getEngine()._connector)==null||r.renderAlert(i,n)},handleConfirmationModalRequest:(i,e)=>{var t;if(!N.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:N.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:N.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:N.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:N.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),(t=N.luigi.getEngine()._connector)==null||t.renderConfirmationModal(i,{confirm(){e.notifyConfirmationModalClosed(!0)},dismiss(){e.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,e)=>{if(!N.luigi)throw new Error("Luigi is not initialized.");Pt.updateDirtyStatus(i,e)}};class Hi{processUserSettingGroups(e,t){var o;const n=[],r=e==null?void 0:e.userSettingGroups,s=(o=t==null?void 0:t.userSettings)==null?void 0:o.userSettingGroups,a=r||s;if(v.isObject(a)){for(const l in a){const c={};c[l]=a[l],n.push(c)}return n}return n}getUserSettingsIframesInDom(){const e=document.querySelector(".iframeUserSettingsCtn");return e?[...e.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(e=>{e.style.display="none"})}findActiveCustomUserSettingsIframe(e){const t=document.querySelectorAll("[userSettingsGroup]");for(let n=0;n<t.length;n++)if(t[n].contentWindow===e)return t[n];return null}}const Qi=new Hi;class Wi{constructor(e){this.dirtyStatusService=y.get(Ke),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=t=>new Promise(n=>{var s;t.id||(t.id=v.getRandomId().toString());const r={openFromClient:!1,close:()=>{n(!0)},link:a=>{var o;if(t.links){const l=t.links[a];if(l&&(l.url&&((o=this.luigi)==null||o.navigation().navigate(l.url)),l.dismissKey))return n(l.dismissKey),!0}return!1}};(s=this.luigi.getEngine()._connector)==null||s.renderAlert(t,r)}),this.showConfirmationModal=t=>(t&&(t={...t,header:this.luigi.i18n().getTranslation(t.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(t.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(t.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(t.buttonConfirm||"luigi.button.confirm")}),new Promise((n,r)=>{var s;(s=this.luigi.getEngine()._connector)==null||s.renderConfirmationModal(t,{confirm(){n(!0)},dismiss(){r()}})})),this.processUserSettingGroups=()=>{const t=this.luigi.getConfigValue("userSettings"),n=this.luigi.getConfigValue("settings");return Qi.processUserSettingGroups(t,n)},this.openUserSettings=t=>{var n;(n=this.luigi.getEngine()._connector)==null||n.openUserSettings(t)},this.closeUserSettings=()=>{var t;(t=this.luigi.getEngine()._connector)==null||t.closeUserSettings()},this.setDocumentTitle=t=>{var n,r,s;(r=(n=this.luigi.getEngine()._ux)==null?void 0:n.documentTitle)==null||r.set(t),(s=this.luigi.getEngine()._connector)==null||s.setDocumentTitle(t)},this.getDocumentTitle=()=>{var t;return Ot((t=this.luigi.getEngine()._ux)==null?void 0:t.documentTitle)||window.document.title||""},this.hideAppLoadingIndicator=()=>{const t=document.querySelector(this.appLoadingIndicatorSelector);t&&(t.classList.add("hidden"),setTimeout(()=>{var n;(n=t.parentNode)==null||n.removeChild(t)},500))},this.showLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.showLoadingIndicator(t)},this.hideLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.hideLoadingIndicator(t)},this.addBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.addBackdrop()},this.removeBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.removeBackdrop()},this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=e}}class Gi{constructor(e){this.engine=e,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=t=>{this.config=t,this.setConfigCallback(this.getConfigReadyCallback()),Te.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Ci.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...t)=>{this.getEngine()._ui.update(t)},this.i18n=()=>(this._i18n||(this._i18n=new vi(this)),this._i18n),this.navigation=()=>new Mi(this),this.ux=()=>new Wi(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new wi),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new Fi(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new Vi(this)),this._theming),this.auth=()=>ve,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(e){return v.getConfigValueFromObject(this.getConfig(),e)}getConfigValueAsync(e,...t){return we.getConfigValueFromObjectAsync(this.getConfig(),e,t)}clearNavigationCache(){y.get(le).deleteCache()}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&v.isFunction(t.readUserSettings))return t.readUserSettings();const n=localStorage.getItem(this.USER_SETTINGS_KEY);return n&&JSON.parse(n)}async storeUserSettings(e,t){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&v.isFunction(r.storeUserSettings))return r.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}createConfigStore(){const e=Be({}),t={};let n=[];return{subscribe:r=>{n.push(e.subscribe(r))},reset:r=>{e.update(r)},subscribeToScope:(r,s)=>{let a=t[s];a||(a=new Set,t[s]=a),a.add(r)},fire:(r,s)=>{const a=t[r];a&&[...a].forEach(o=>{o(s)})},clear:()=>{n.forEach(r=>{r()}),n=[]}}}getConfigReadyCallback(){return new Promise(e=>{this.i18n()._init(),e()})}setConfigCallback(e){this.configReadyCallback=e}}const ji=!1;var Bi=Array.isArray,qi=Array.from,zi=Object.defineProperty,It=Object.getOwnPropertyDescriptor;const dt=2,Jt=4,Xt=8,Ki=16,Ve=32,Ye=64,Ze=128,Je=256,ne=512,Yt=1024,gt=2048,Zt=4096,et=8192,Ji=16384,Xi=1<<18,Yi=1<<19;function Zi(i){return i===this.v}function en(){throw new Error("effect_update_depth_exceeded")}function tn(i){return{f:0,v:i,reactions:null,equals:Zi,version:0}}var $t,ei;function nn(){if($t===void 0){$t=window;var i=Element.prototype,e=Node.prototype;It(e,"firstChild").get,ei=It(e,"nextSibling").get,i.__click=void 0,i.__className="",i.__attributes=null,i.__styles=null,i.__e=void 0,Text.prototype.__t=void 0}}function rn(i=""){return document.createTextNode(i)}function sn(i){return ei.call(i)}function ti(i){var e=i.children;if(e!==null){i.children=null;for(var t=0;t<e.length;t+=1){var n=e[t];(n.f&dt)!==0?ii(n):He(n)}}}function an(i){var e,t=ie;Le(i.parent);try{ti(i),e=li(i)}finally{Le(t)}return e}function on(i){var e=an(i),t=(Ce||(i.f&Ze)!==0)&&i.deps!==null?gt:ne;Ne(i,t),i.equals(e)||(i.v=e,i.version=gn())}function ii(i){ti(i),Fe(i,0),Ne(i,et),i.v=i.children=i.deps=i.ctx=i.reactions=null}function ln(i,e){var t=e.last;t===null?e.last=e.first=i:(t.next=i,i.prev=t,e.last=i)}function ft(i,e,t,n=!0){var r=(i&Ye)!==0,s=ie,a={ctx:ee,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:i|Yt,first:null,fn:e,last:null,next:null,parent:r?null:s,prev:null,teardown:null,transitions:null,version:0};if(t){var o=be;try{Lt(!0),mt(a),a.f|=Ji}catch(f){throw He(a),f}finally{Lt(o)}}else e!==null&&vn(a);var l=t&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&Yi)===0;if(!l&&!r&&n&&(s!==null&&ln(a,s),Z!==null&&(Z.f&dt)!==0)){var c=Z;(c.children??(c.children=[])).push(a)}return a}function cn(i){const e=ft(Ye,i,!0);return()=>{He(e)}}function un(i){return ft(Jt,i,!1)}function hn(i,e=!0){return ft(Xt|Ve,i,!0,e)}function ni(i){var e=i.teardown;if(e!==null){const t=Z;$e(null);try{e.call(null)}finally{$e(t)}}}function ri(i){var e=i.deriveds;if(e!==null){i.deriveds=null;for(var t=0;t<e.length;t+=1)ii(e[t])}}function si(i,e=!1){var t=i.first;for(i.first=i.last=null;t!==null;){var n=t.next;He(t,e),t=n}}function dn(i){for(var e=i.first;e!==null;){var t=e.next;(e.f&Ve)===0&&He(e),e=t}}function He(i,e=!0){var t=!1;if((e||(i.f&Xi)!==0)&&i.nodes_start!==null){for(var n=i.nodes_start,r=i.nodes_end;n!==null;){var s=n===r?null:sn(n);n.remove(),n=s}t=!0}ri(i),si(i,e&&!t),Fe(i,0),Ne(i,et);var a=i.transitions;if(a!==null)for(const l of a)l.stop();ni(i);var o=i.parent;o!==null&&o.first!==null&&ai(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.parent=i.fn=i.nodes_start=i.nodes_end=null}function ai(i){var e=i.parent,t=i.prev,n=i.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===i&&(e.first=n),e.last===i&&(e.last=t))}let Xe=!1,be=!1;function Lt(i){be=i}let ct=[],xe=0;let Z=null;function $e(i){Z=i}let ie=null;function Le(i){ie=i}let X=null,B=0,oi=0,Ce=!1,ee=null;function gn(){return++oi}function pt(i){var a,o;var e=i.f;if((e&Yt)!==0)return!0;if((e&gt)!==0){var t=i.deps,n=(e&Ze)!==0;if(t!==null){var r;if((e&Je)!==0){for(r=0;r<t.length;r++)((a=t[r]).reactions??(a.reactions=[])).push(i);i.f^=Je}for(r=0;r<t.length;r++){var s=t[r];if(pt(s)&&on(s),n&&ie!==null&&!Ce&&!((o=s==null?void 0:s.reactions)!=null&&o.includes(i))&&(s.reactions??(s.reactions=[])).push(i),s.version>i.version)return!0}}n||Ne(i,ne)}return!1}function fn(i,e,t){throw i}function li(i){var f;var e=X,t=B,n=Z,r=Ce,s=ee,a=i.f;X=null,B=0,Z=(a&(Ve|Ye))===0?i:null,Ce=!be&&(a&Ze)!==0,ee=i.ctx;try{var o=(0,i.fn)(),l=i.deps;if(X!==null){var c;if(Fe(i,B),l!==null&&B>0)for(l.length=B+X.length,c=0;c<X.length;c++)l[B+c]=X[c];else i.deps=l=X;if(!Ce)for(c=B;c<l.length;c++)((f=l[c]).reactions??(f.reactions=[])).push(i)}else l!==null&&B<l.length&&(Fe(i,B),l.length=B);return o}finally{X=e,B=t,Z=n,Ce=r,ee=s}}function pn(i,e){let t=e.reactions;if(t!==null){var n=t.indexOf(i);if(n!==-1){var r=t.length-1;r===0?t=e.reactions=null:(t[n]=t[r],t.pop())}}t===null&&(e.f&dt)!==0&&(X===null||!X.includes(e))&&(Ne(e,gt),(e.f&(Ze|Je))===0&&(e.f^=Je),Fe(e,0))}function Fe(i,e){var t=i.deps;if(t!==null)for(var n=e;n<t.length;n++)pn(i,t[n])}function mt(i){var e=i.f;if((e&et)===0){Ne(i,ne);var t=ie;ie=i;try{ri(i),(e&Ki)!==0?dn(i):si(i),ni(i);var n=li(i);i.teardown=typeof n=="function"?n:null,i.version=oi}catch(r){fn(r)}finally{ie=t}}}function mn(){xe>1e3&&(xe=0,en()),xe++}function Sn(i){var e=i.length;if(e!==0){mn();var t=be;be=!0;try{for(var n=0;n<e;n++){var r=i[n];(r.f&ne)===0&&(r.f^=ne);var s=[];ci(r,s),_n(s)}}finally{be=t}}}function _n(i){var e=i.length;if(e!==0)for(var t=0;t<e;t++){var n=i[t];(n.f&(et|Zt))===0&&pt(n)&&(mt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?ai(n):n.fn=null))}}function En(){if(Xe=!1,xe>1001)return;const i=ct;ct=[],Sn(i),Xe||(xe=0)}function vn(i){Xe||(Xe=!0,queueMicrotask(En));for(var e=i;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ye|Ve))!==0){if((t&ne)===0)return;e.f^=ne}}ct.push(e)}function ci(i,e){var t=i.first,n=[];e:for(;t!==null;){var r=t.f,s=(r&Ve)!==0,a=s&&(r&ne)!==0;if(!a&&(r&Zt)===0)if((r&Xt)!==0){s?t.f^=ne:pt(t)&&mt(t);var o=t.first;if(o!==null){t=o;continue}}else(r&Jt)!==0&&n.push(t);var l=t.next;if(l===null){let h=t.parent;for(;h!==null;){if(i===h)break e;var c=h.next;if(c!==null){t=c;continue e}h=h.parent}}t=l}for(var f=0;f<n.length;f++)o=n[f],e.push(o),ci(o,e)}const Cn=-3585;function Ne(i,e){i.f=i.f&Cn|e}function wn(i,e=!1,t){ee={p:ee,c:null,e:null,m:!1,s:i,x:null,l:null},e||(ee.l={s:null,u:null,r1:[],r2:tn(!1)})}function Tn(i){const e=ee;if(e!==null){const a=e.e;if(a!==null){var t=ie,n=Z;e.e=null;try{for(var r=0;r<a.length;r++){var s=a[r];Le(s.effect),$e(s.reaction),un(s.fn)}}finally{Le(t),$e(n)}}ee=e.p,e.m=!0}return{}}const yn=new Set,Nt=new Set;function Ge(i){var L;var e=this,t=e.ownerDocument,n=i.type,r=((L=i.composedPath)==null?void 0:L.call(i))||[],s=r[0]||i.target,a=0,o=i.__root;if(o){var l=r.indexOf(o);if(l!==-1&&(e===document||e===window)){i.__root=e;return}var c=r.indexOf(e);if(c===-1)return;l<=c&&(a=l)}if(s=r[a]||i.target,s!==e){zi(i,"currentTarget",{configurable:!0,get(){return s||t}});var f=Z,h=ie;$e(null),Le(null);try{for(var u,d=[];s!==null;){var p=s.assignedSlot||s.parentNode||s.host||null;try{var _=s["__"+n];if(_!==void 0&&!s.disabled)if(Bi(_)){var[E,...R]=_;E.apply(s,[i,...R])}else _.call(s,i)}catch(U){u?d.push(U):u=U}if(i.cancelBubble||p===e||p===null)break;s=p}if(u){for(let U of d)queueMicrotask(()=>{throw U});throw u}}finally{i.__root=e,delete i.currentTarget,$e(f),Le(h)}}}const bn=["touchstart","touchmove"];function Rn(i){return bn.includes(i)}function An(i,e){return Pn(i,e)}const Se=new Map;function Pn(i,{target:e,anchor:t,props:n={},events:r,context:s,intro:a=!0}){nn();var o=new Set,l=h=>{for(var u=0;u<h.length;u++){var d=h[u];if(!o.has(d)){o.add(d);var p=Rn(d);e.addEventListener(d,Ge,{passive:p});var _=Se.get(d);_===void 0?(document.addEventListener(d,Ge,{passive:p}),Se.set(d,1)):Se.set(d,_+1)}}};l(qi(yn)),Nt.add(l);var c=void 0,f=cn(()=>{var h=t??e.appendChild(rn());return hn(()=>{if(s){wn({});var u=ee;u.c=s}r&&(n.$$events=r),c=i(h,n)||{},s&&Tn()}),()=>{var p;for(var u of o){e.removeEventListener(u,Ge);var d=Se.get(u);--d===0?(document.removeEventListener(u,Ge),Se.delete(u)):Se.set(u,d)}Nt.delete(l),Ut.delete(c),h!==t&&((p=h.parentNode)==null||p.removeChild(h))}});return Ut.set(c,f),c}let Ut=new WeakMap;const In="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(In);function $n(i){}const ut={init:i=>{y.get(ge).enableRouting()},handlePageErrorHandler:(i,e,t)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)e.viewUrl=i.viewUrl,t.getEngine()._ui.updateMainContent(e,t);else if(i.errorFn)i.errorFn(e);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const n=i.redirectPath||"/";t.navigation().navigate(n)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const t=window.open(i.url,"_blank","noopener noreferrer");t&&(t.opener=null,t.focus())}},async addSearchParamsFromClient(i,e,t){var o;const n=y.get(ce),r=C.getCurrentPath(),s=await n.getCurrentNode(r.path),a={...i};if((o=s==null?void 0:s.clientPermissions)!=null&&o.urlParameters){const l={};Object.keys(s.clientPermissions.urlParameters).forEach(c=>{c in a&&s.clientPermissions.urlParameters[c].write===!0&&(l[c]=a[c],delete a[c])});for(const c in a)console.warn(`No permission to add the search param "${c}" to the url`);Object.keys(l).length>0&&t.routing().addSearchParams(l,e)}}},Y={luigi:{},init:i=>{console.log("Init communication..."),Y.luigi=i},addListeners:(i,e)=>{i.addEventListener(m.INITIALIZED,t=>{var n;(n=N.luigi)==null||n.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(m.NAVIGATION_REQUEST,t=>{const{link:n,modal:r,newTab:s,preserveView:a,preventContextUpdate:o,preventHistoryEntry:l,withoutSync:c}=t.detail,f={modalSettings:r,newTab:s,path:n,preserveView:a,preventContextUpdate:o,preventHistoryEntry:l,withoutSync:c};y.get(ce).handleNavigationRequest(f,t.callbackFn)}),i.addEventListener(m.RUNTIME_ERROR_HANDLING_REQUEST,t=>{var n,r;e.navigation().runTimeErrorHandler(((r=(n=t.payload)==null?void 0:n.data)==null?void 0:r.errorObj)||{})}),i.addEventListener(m.ALERT_REQUEST,t=>{N.processAlert(t.payload,!0,i)}),i.addEventListener(m.SHOW_CONFIRMATION_MODAL_REQUEST,t=>{N.handleConfirmationModalRequest(t.payload,i)}),i.addEventListener(m.SET_DOCUMENT_TITLE_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.setDocumentTitle(t.detail.title)}),i.addEventListener(m.SHOW_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.showLoadingIndicator(i.parentNode)}),i.addEventListener(m.HIDE_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.hideLoadingIndicator(i.parentNode)}),i.addEventListener(m.ADD_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.addBackdrop()}),i.addEventListener(m.REMOVE_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.removeBackdrop()}),i.addEventListener(m.SET_DIRTY_STATUS_REQUEST,t=>{var n,r,s;N.handleDirtyStatusRequest((r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.dirty,(s=t.detail)==null?void 0:s.source)}),i.addEventListener(m.ADD_NODE_PARAMS_REQUEST,t=>{e.routing().addNodeParams(t.payload.data,t.payload.keepBrowserHistory)}),i.addEventListener(m.OPEN_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.openUserSettings(t.detail)}),i.addEventListener(m.CLOSE_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.closeUserSettings()}),i.addEventListener(m.ADD_SEARCH_PARAMS_REQUEST,t=>{ut.addSearchParamsFromClient(t.detail.data,t.detail.keepBrowserHistory,e)}),i.addEventListener(m.UPDATE_MODAL_SETTINGS_REQUEST,t=>{x.updateModalSettings(t.payload.updatedModalSettings,t.payload.addHistoryEntry,e)}),i.addEventListener(m.SET_CURRENT_LOCALE_REQUEST,t=>{var n,r,s;e.i18n().setCurrentLocale((s=(r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.data)==null?void 0:s.currentLocale,i)})}};class Ln{constructor(){this._ui=x,this._comm=Y,this._ux=N,this._routing=ut}bootstrap(e){this._app=An($n,{target:document.body}),this._connector=e}init(){const e=window.Luigi;y.register(Ke,()=>new Ke),y.register(ce,()=>new ce(e)),y.register(le,()=>new le),y.register(ge,()=>new ge(e)),y.register(Ie,()=>new Ie),y.register(fe,()=>new fe(e)),e.theming()._init(),x.init(e),ut.init(e),Y.init(e),N.init(e)}}window.Luigi=new Gi(new Ln);
33
+ }`,t=Vt(" "),n=Ae("iframe"),wt(n.src,r=i[3])||W(n,"src",r),W(n,"title",i[1]),W(n,"allow",a=yt(i[0])),W(n,"sandbox",s=i[2]?i[2].join(" "):void 0)},m(o,l){de(o,e,l),de(o,t,l),de(o,n,l),i[28](n)},p(o,l){8&l[0]&&!wt(n.src,r=o[3])&&W(n,"src",r),2&l[0]&&W(n,"title",o[1]),1&l[0]&&a!==(a=yt(o[0]))&&W(n,"allow",a),4&l[0]&&s!==(s=o[2]?o[2].join(" "):void 0)&&W(n,"sandbox",s)},d(o){o&&(oe(e),oe(t),oe(n)),i[28](null)}}}function xi(i){let e,t,n=i[5]&&At(i);return{c(){e=Ae("main"),n&&n.c(),W(e,"class",t=i[4]?void 0:"lui-isolated")},m(r,a){de(r,e,a),n&&n.m(e,null),i[29](e)},p(r,a){r[5]?n?n.p(r,a):(n=At(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null),16&a[0]&&t!==(t=r[4]?void 0:"lui-isolated")&&W(e,"class",t)},i:ae,o:ae,d(r){r&&oe(e),n&&n.d(),i[29](null)}}}function Di(i,e,t){let{activeFeatureToggleList:n}=e,{allowRules:r}=e,{anchor:a}=e,{authData:s}=e,{clientPermissions:o}=e,{context:l}=e,{deferInit:c}=e,{dirtyStatus:f}=e,{documentTitle:h}=e,{hasBack:u}=e,{label:d}=e,{locale:p}=e,{noShadow:_}=e,{nodeParams:v}=e,{pathParams:R}=e,{sandboxRules:L}=e,{searchParams:U}=e,{skipCookieCheck:z}=e,{skipInitCheck:G}=e,{theme:K}=e,{userSettings:J}=e,{viewurl:j}=e,{webcomponent:k}=e;const I={};let $,S,te=!1;const H=new zt,O=g=>{if(!te){g.sendCustomMessage=(b,x)=>{Ee.sendCustomMessage(b,g.getNoShadow()?g:$,!!k,I,x)},g.updateContext=(b,x)=>{if(t(8,l=b),k)(g.getNoShadow()?g:$)._luigi_mfe_webcomponent.context=b;else{const pe={...x||{},activeFeatureToggleList:g.activeFeatureToggleList||[],currentLocale:g.locale,currentTheme:g.theme,userSettings:g.userSettings||null,cssVariables:g.cssVariables||{},anchor:g.anchor||"",drawer:g.drawer||!1,modal:g.modal||!1,viewStackSize:g.viewStackSize||0,isNavigateBack:g.isNavigateBack||!1};Ee.updateContext(b,pe,I,v,R,U)}},g.closeAlert=(b,x)=>{g.notifyAlertClosed(b,x)},g.notifyAlertClosed=(b,x)=>{g.isConnected&&(k?H.resolveAlert(b,x):Ee.notifyAlertClosed(b,x,I))},g.notifyConfirmationModalClosed=b=>{g.isConnected&&(k?H.notifyConfirmationModalClosed(!!b):Ee.notifyConfirmationModalClosed(!!b,I))},se.registerContainer(g),H.thisComponent=g;const ue=xe.resolveContext(l);if(g.updateViewUrl=(b,x)=>{b!=null&&b.length&&Ee.updateViewUrl(b,xe.resolveContext(l),x,I)},k&&k!="false"){g.getNoShadow()?g.innerHTML="":(t(7,$.innerHTML="",$),g.attachShadow({mode:"open"}).append($));const b=xe.checkWebcomponentValue(k);H.renderWebComponent(j,g.getNoShadow()?g:$,ue,typeof b=="object"?{webcomponent:b}:{})}else g.getNoShadow()||(g.innerHTML="",g.attachShadow({mode:"open"}).append($));G?(g.initialized=!0,setTimeout((()=>{H.dispatchLuigiEvent(m.INITIALIZED,{})}))):k&&(g.getNoShadow()?g:$).addEventListener("wc_ready",(()=>{var b;(b=(g.getNoShadow()?g:$)._luigi_mfe_webcomponent)!=null&&b.deferLuigiClientWCInit||(g.initialized=!0,H.dispatchLuigiEvent(m.INITIALIZED,{}))})),t(5,te=!0),g.containerInitialized=!0}};var re;return Qt((async()=>{t(27,S=$.parentNode),t(27,S.iframeHandle=I,S),t(27,S.init=()=>{O(S)},S),!c&&j&&O(S)})),re=async()=>{},Ht().$$.on_destroy.push(re),i.$$set=g=>{"activeFeatureToggleList"in g&&t(9,n=g.activeFeatureToggleList),"allowRules"in g&&t(0,r=g.allowRules),"anchor"in g&&t(10,a=g.anchor),"authData"in g&&t(11,s=g.authData),"clientPermissions"in g&&t(12,o=g.clientPermissions),"context"in g&&t(8,l=g.context),"deferInit"in g&&t(13,c=g.deferInit),"dirtyStatus"in g&&t(14,f=g.dirtyStatus),"documentTitle"in g&&t(15,h=g.documentTitle),"hasBack"in g&&t(16,u=g.hasBack),"label"in g&&t(1,d=g.label),"locale"in g&&t(17,p=g.locale),"noShadow"in g&&t(18,_=g.noShadow),"nodeParams"in g&&t(19,v=g.nodeParams),"pathParams"in g&&t(20,R=g.pathParams),"sandboxRules"in g&&t(2,L=g.sandboxRules),"searchParams"in g&&t(21,U=g.searchParams),"skipCookieCheck"in g&&t(22,z=g.skipCookieCheck),"skipInitCheck"in g&&t(23,G=g.skipInitCheck),"theme"in g&&t(24,K=g.theme),"userSettings"in g&&t(25,J=g.userSettings),"viewurl"in g&&t(3,j=g.viewurl),"webcomponent"in g&&t(4,k=g.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!te&&j&&!c&&S&&O(S)},[r,d,L,j,k,te,I,$,l,n,a,s,o,c,f,h,u,p,_,v,R,U,z,G,K,J,()=>n&&r&&a&&s&&o&&f&&h&&u&&p&&_&&v&&R&&L&&U&&z&&G&&K&&J,S,function(g){Me[g?"unshift":"push"]((()=>{I.iframe=g,t(6,I)}))},function(g){Me[g?"unshift":"push"]((()=>{$=g,t(7,$)}))}]}class Kt extends Bt{constructor(e){super(),Wt(this,e,Di,xi,Ft,{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(e){this.$$set({activeFeatureToggleList:e}),w()}get allowRules(){return this.$$.ctx[0]}set allowRules(e){this.$$set({allowRules:e}),w()}get anchor(){return this.$$.ctx[10]}set anchor(e){this.$$set({anchor:e}),w()}get authData(){return this.$$.ctx[11]}set authData(e){this.$$set({authData:e}),w()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get context(){return this.$$.ctx[8]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[13]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[16]}set hasBack(e){this.$$set({hasBack:e}),w()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),w()}get locale(){return this.$$.ctx[17]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[18]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[20]}set pathParams(e){this.$$set({pathParams:e}),w()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(e){this.$$set({sandboxRules:e}),w()}get searchParams(){return this.$$.ctx[21]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(e){this.$$set({skipCookieCheck:e}),w()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[24]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[25]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[3]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[26]}}function ki(i){Ri(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function Mi(i){let e;return{c(){e=Ae("main"),W(e,"class","svelte-1buc46y")},m(t,n){de(t,e,n),i[21](e)},p:ae,i:ae,o:ae,d(t){t&&oe(e),i[21](null)}}}function Fi(i,e,t){let n,r,{activeFeatureToggleList:a}=e,{anchor:s}=e,{clientPermissions:o}=e,{compoundConfig:l}=e,{context:c}=e,{deferInit:f}=e,{dirtyStatus:h}=e,{documentTitle:u}=e,{hasBack:d}=e,{locale:p}=e,{noShadow:_}=e,{nodeParams:v}=e,{pathParams:R}=e,{searchParams:L}=e,{skipInitCheck:U}=e,{theme:z}=e,{userSettings:G}=e,{viewurl:K}=e,{webcomponent:J}=e,j=!1;const k=new ht,I=new zt,$=S=>{if(!l||j)return;S.updateContext=(O,re)=>{const g=S.getNoShadow()?S:n;g._luigi_mfe_webcomponent.context=O,t(1,c=O);const ue=g._luigi_mfe_webcomponent;if(ue){const b=ue.querySelectorAll("[lui_web_component]");b==null||b.forEach((x=>{const pe=x.context||{};x.context=Object.assign(pe,O)}))}};const te=xe.resolveContext(c);t(2,f=!1),S.notifyAlertClosed=(O,re)=>{S.isConnected&&I.resolveAlert(O,re)},S.notifyConfirmationModalClosed=O=>{S.isConnected&&I.notifyConfirmationModalClosed(!!O)};const H={compound:l,viewUrl:K,webcomponent:xe.checkWebcomponentValue(J)||!0};S.getNoShadow()?S.innerHTML="":(t(0,n.innerHTML="",n),S.attachShadow({mode:"open"}).append(n)),I.renderWebComponentCompound(H,S.getNoShadow()?S:n,te).then((O=>{r=O,U||!H.viewUrl?(S.initialized=!0,setTimeout((()=>{I.dispatchLuigiEvent(m.INITIALIZED,{})}))):r.LuigiClient&&!r.deferLuigiClientWCInit&&(S.initialized=!0,I.dispatchLuigiEvent(m.INITIALIZED,{}))})),j=!0,S.containerInitialized=!0};return Qt((async()=>{const S=n.getRootNode()===document?n.parentNode:n.getRootNode().host;S.init=()=>{$(S)},f||$(S),k.registerContainer(S),I.thisComponent=S})),i.$$set=S=>{"activeFeatureToggleList"in S&&t(3,a=S.activeFeatureToggleList),"anchor"in S&&t(4,s=S.anchor),"clientPermissions"in S&&t(5,o=S.clientPermissions),"compoundConfig"in S&&t(6,l=S.compoundConfig),"context"in S&&t(1,c=S.context),"deferInit"in S&&t(2,f=S.deferInit),"dirtyStatus"in S&&t(7,h=S.dirtyStatus),"documentTitle"in S&&t(8,u=S.documentTitle),"hasBack"in S&&t(9,d=S.hasBack),"locale"in S&&t(10,p=S.locale),"noShadow"in S&&t(11,_=S.noShadow),"nodeParams"in S&&t(12,v=S.nodeParams),"pathParams"in S&&t(13,R=S.pathParams),"searchParams"in S&&t(14,L=S.searchParams),"skipInitCheck"in S&&t(15,U=S.skipInitCheck),"theme"in S&&t(16,z=S.theme),"userSettings"in S&&t(17,G=S.userSettings),"viewurl"in S&&t(18,K=S.viewurl),"webcomponent"in S&&t(19,J=S.webcomponent)},[n,c,f,a,s,o,l,h,u,d,p,_,v,R,L,U,z,G,K,J,()=>a&&s&&o&&h&&u&&d&&p&&_&&v&&R&&L&&U&&z&&G,function(S){Me[S?"unshift":"push"]((()=>{n=S,t(0,n)}))}]}jt(Kt,{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 e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"sendCustomMessage",e("sendCustomMessage"));A(this,"updateContext",e("updateContext"));A(this,"updateViewUrl",e("updateViewUrl"));A(this,"closeAlert",e("closeAlert"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,a){try{super.attributeChangedCallback(n,r,a)}catch(s){console.error("Error in super.attributeChangedCallback",s)}this.containerInitialized&&(n==="context"&&this.updateContext(JSON.parse(a)),n==="auth-data"&&Ee.updateAuthData(this.iframeHandle,JSON.parse(a)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class It extends Bt{constructor(e){super(),Wt(this,e,Fi,Mi,Ft,{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},ki)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(e){this.$$set({activeFeatureToggleList:e}),w()}get anchor(){return this.$$.ctx[4]}set anchor(e){this.$$set({anchor:e}),w()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(e){this.$$set({clientPermissions:e}),w()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(e){this.$$set({compoundConfig:e}),w()}get context(){return this.$$.ctx[1]}set context(e){this.$$set({context:e}),w()}get deferInit(){return this.$$.ctx[2]}set deferInit(e){this.$$set({deferInit:e}),w()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(e){this.$$set({dirtyStatus:e}),w()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(e){this.$$set({documentTitle:e}),w()}get hasBack(){return this.$$.ctx[9]}set hasBack(e){this.$$set({hasBack:e}),w()}get locale(){return this.$$.ctx[10]}set locale(e){this.$$set({locale:e}),w()}get noShadow(){return this.$$.ctx[11]}set noShadow(e){this.$$set({noShadow:e}),w()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(e){this.$$set({nodeParams:e}),w()}get pathParams(){return this.$$.ctx[13]}set pathParams(e){this.$$set({pathParams:e}),w()}get searchParams(){return this.$$.ctx[14]}set searchParams(e){this.$$set({searchParams:e}),w()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(e){this.$$set({skipInitCheck:e}),w()}get theme(){return this.$$.ctx[16]}set theme(e){this.$$set({theme:e}),w()}get userSettings(){return this.$$.ctx[17]}set userSettings(e){this.$$set({userSettings:e}),w()}get viewurl(){return this.$$.ctx[18]}set viewurl(e){this.$$set({viewurl:e}),w()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(e){this.$$set({webcomponent:e}),w()}get unwarn(){return this.$$.ctx[20]}}jt(It,{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 e=t=>()=>console.warn(t+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{constructor(){super(...arguments);A(this,"updateContext",e("updateContext"));A(this,"notifyAlertClosed",e("notifyAlertClosed"));A(this,"notifyConfirmationModalClosed",e("notifyConfirmationModalClosed"))}attributeChangedCallback(n,r,a){try{super.attributeChangedCallback(n,r,a)}catch(s){console.warn("Error in attributeChangedCallback",s)}this.containerInitialized&&n==="context"&&this.updateContext(JSON.parse(a))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",Kt.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",It.element);class Ie{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(e){this.decorators=this.decorators.filter(t=>t.uid!==e.uid).concat(e)}applyDecorators(e,t){if(!e)return e;const n=new URL(E.prependOrigin(e)),r=this.decorators.filter(a=>a.type==="queryString");for(let a=0;a<r.length;a++){const s=r[a];n.searchParams.has(s.key)&&n.searchParams.delete(s.key);const o=s.valueFn();n.searchParams.append(s.key,o)}return t&&(n.search=decodeURIComponent(n.search)),n.href}}const at=async(i,e)=>{const t=await e.readUserSettings(),r=i.userSettingsGroup&&typeof t=="object"&&t!==null?t[i.userSettingsGroup]:null;if(i.webcomponent&&!C.checkWCUrl(i.viewUrl,e))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const a=document.createElement("luigi-compound-container");return a.setAttribute("lui_container","true"),a.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),a.webcomponent=i.webcomponent,a.compoundConfig=i.compound,a.context=i.context,a.clientPermissions=i.clientPermissions,a.nodeParams=i.nodeParams,a.pathParams=i.pathParams,a.userSettingsGroup=i.userSettingsGroup,a.userSettings=r,a.searchParams=i.searchParams,a.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),a.locale=e.i18n().getCurrentLocale(),a.theme=e.theming().getCurrentTheme(),a.viewGroup=i.viewGroup,e.getEngine()._comm.addListeners(a,e),a}else{const a=document.createElement("luigi-container");return a.setAttribute("lui_container","true"),a.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),a.webcomponent=i.webcomponent,a.context=i.context,a.clientPermissions=i.clientPermissions,a.cssVariables=await e.theming().getCSSVariables(),a.nodeParams=i.nodeParams,a.pathParams=i.pathParams,a.userSettingsGroup=i.userSettingsGroup,a.userSettings=r,a.searchParams=i.searchParams,a.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),a.locale=e.i18n().getCurrentLocale(),a.theme=e.theming().getCurrentTheme(),a.viewGroup=i.viewGroup,Jt(a,e),Xt(a,e),e.getEngine()._comm.addListeners(a,e),a}},Jt=(i,e)=>{const t=e.getConfigValue("settings.customSandboxRules");if(!(t!=null&&t.length))return;const n=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],r=t?[...new Set([...n,...t])]:n;i.sandboxRules=r},Xt=(i,e)=>{const t=e.getConfigValue("settings.allowRules");t!=null&&t.length&&(t.forEach((n,r)=>{t[r]=n+(n.indexOf(";")!=-1?"":";")}),i.allowRules=t)},D={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{var e;console.log("Init UI..."),D.navService=y.get(ce),D.routingService=y.get(ge),D.luigi=i,(e=i.getEngine()._connector)==null||e.renderMainLayout()},update:async i=>{var n,r,a;const e=D.routingService.getCurrentRoute();if(!e)return;const t=!i||i.length===0;(t||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&((n=D.luigi.getEngine()._connector)==null||n.renderTopNav(await D.navService.getTopNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(y.get(le).deleteCache(),(r=D.luigi.getEngine()._connector)==null||r.renderLeftNav(await D.navService.getLeftNavData(e.path)),(a=D.luigi.getEngine()._connector)==null||a.renderTabNav(await D.navService.getTabNavData(e.path))),(t||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(y.get(le).deleteCache(),D.updateMainContent(e.node,D.luigi))},updateMainContent:async(i,e,t,n)=>{var l,c,f;const r=await e.readUserSettings(),s=i.userSettingsGroup&&typeof r=="object"&&r!==null?r[i.userSettingsGroup]:null,o=(l=e.getEngine()._connector)==null?void 0:l.getContainerWrapper();if((c=e.getEngine()._connector)==null||c.hideLoadingIndicator(o),i&&o){let h;if([...o.childNodes].forEach(u=>{var d;((d=u.tagName)==null?void 0:d.indexOf("LUIGI-"))===0&&(u.viewGroup?i.viewGroup===u.viewGroup?h=u:u.style.display="none":u.remove())}),h)t||(h.style.display="block",h.viewurl=y.get(Ie).applyDecorators(i.viewUrl,i.decodeViewUrl),h.nodeParams=i.nodeParams,h.pathParams=i.pathParams,h.clientPermissions=i.clientPermissions,h.searchParams=C.prepareSearchParamsForClient(i,e),h.locale=e.i18n().getCurrentLocale(),h.theme=e.theming().getCurrentTheme(),h.activeFeatureToggleList=e.featureToggles().getActiveFeatureToggleList(),h.userSettingsGroup=i.userSettingsGroup,h.userSettings=s,Jt(h,e),Xt(h,e)),n||h.updateContext(i.context||{});else{const u=await at(i,e);o==null||o.appendChild(u);const d=e.getEngine()._connector;((f=i.loadingIndicator)==null?void 0:f.enabled)!==!1&&(d==null||d.showLoadingIndicator(o))}}},openModal:async(i,e,t,n)=>{var p,_;const r=await at(e,i),a=y.get(ge),s=y.get(fe);let o=!1,l,c;const h=new Promise(v=>{l=()=>{o||(o=!0,v(),s.removeLastModalFromStack())},c=()=>{l&&l(),i.getConfigValue("routing.showModalPathInUrl")&&s.getModalStackLength()===0&&a.removeModalDataFromUrl(!0)},r.addEventListener(m.CLOSE_CURRENT_MODAL_REQUEST,c)}),u={closePromise:h,resolveFn:l,onCloseRequestHandler:c,onInternalClose:()=>{try{u.resolveFn&&u.resolveFn()}catch(v){console.warn("onInternalClose failed",v)}},modalsettings:t};s.registerModal(u),(p=i.getEngine()._connector)==null||p.renderModal(r,t,()=>{n==null||n(),s.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&s.getModalStackLength()===0&&a.removeModalDataFromUrl(!0)},()=>h);const d=i.getEngine()._connector;((_=e.loadingIndicator)==null?void 0:_.enabled)!==!1&&(d==null||d.showLoadingIndicator(r.parentElement))},updateModalSettings:(i,e,t)=>{var s;const n=y.get(fe);if(n.getModalStackLength()===0)return;n.updateFirstModalSettings(i);const r=y.get(ge),a=C.getModalPathFromPath(t);a&&r.updateModalDataInUrl(a,n.getModalSettings(),e),(s=t.getEngine()._connector)==null||s.updateModalSettings(n.getModalSettings())},openDrawer:async(i,e,t,n)=>{var s,o;const r=await at(e,i);(s=i.getEngine()._connector)==null||s.renderDrawer(r,t,n);const a=i.getEngine()._connector;((o=e.loadingIndicator)==null?void 0:o.enabled)!==!1&&(a==null||a.showLoadingIndicator(r.parentElement))}};class ge{constructor(e){this.luigi=e}getNavigationService(){return this.navigationService||(this.navigationService=y.get(ce)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const e=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||e).filter(n=>location.href.match(n)).length!==0}enableRouting(){var t;const e=this.luigi.getConfig();console.log("Init Routing...",e.routing),(t=e.routing)!=null&&t.useHashRouting?(window.addEventListener("hashchange",n=>{var s,o;const r=!!((s=n==null?void 0:n.detail)!=null&&s.preventContextUpdate),a=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(!0),a,r)}),this.handleRouteChange(C.getCurrentPath(!0))):(window.addEventListener("popstate",n=>{var s,o;const r=!!((s=n==null?void 0:n.detail)!=null&&s.preventContextUpdate),a=!!((o=n==null?void 0:n.detail)!=null&&o.withoutSync);this.handleRouteChange(C.getCurrentPath(),a,r)}),this.handleRouteChange(C.getCurrentPath()))}async handleRouteChange(e,t=!1,n=!1){var d,p,_;const r=e.path,a=e.query,s=r+(a?"?"+a:""),o=new URLSearchParams(a),l={};if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(s),await this.shouldShowModalPathInUrl(e),o.forEach((v,R)=>{l[R]=v}),this.checkInvalidateCache(this.previousPathData,r);const c=await this.getNavigationService().getPathData(r);this.previousPathData=c;const f=C.filterNodeParams(l,this.luigi),h=await this.getNavigationService().shouldRedirect(r,c);if(h){this.luigi.navigation().navigate(h);return}this.currentRoute={raw:window.location.href,path:r,nodeParams:f},(d=this.luigi.getEngine()._connector)==null||d.renderTopNav(await this.getNavigationService().getTopNavData(r,c)),(p=this.luigi.getEngine()._connector)==null||p.renderLeftNav(await this.getNavigationService().getLeftNavData(r,c)),(_=this.luigi.getEngine()._connector)==null||_.renderTabNav(await this.getNavigationService().getTabNavData(r,c));const u=(c==null?void 0:c.selectedNode)??await this.getNavigationService().getCurrentNode(r);u&&(this.currentRoute.node=u,u.nodeParams=f||{},u.pathParams=(c==null?void 0:c.pathParams)||{},u.searchParams=C.prepareSearchParamsForClient(u,this.luigi),this.getNavigationService().onNodeChange(this.previousNode,u),this.previousNode=u,D.updateMainContent(u,this.luigi,t,n))}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(e){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(e)}async handleBookmarkableModalPath(e){var o;const t=y.get(ce),n=y.get(fe),r=new URLSearchParams((e==null?void 0:e.query)||""),a=C.getModalViewParamName(this.luigi),s=r.get(a);if(s){const l=r.get(`${a}Params`);try{const c=JSON.parse(l||"{}"),{nodeObject:f}=await t.extractDataFromPath(s);document.querySelector(".lui-modal luigi-container")?(o=this.luigi.getEngine()._connector)==null||o.updateModalSettings(c):this.luigi.navigation().openAsModal(s,c||f.openNodeInModal)}catch(c){console.error("Error parsing modal settings from URL parameters",c)}}else{n.closeModals();return}}appendModalDataToUrl(e,t){const n=C.getHashQueryParamSeparator(),r=C.getQueryParams(this.luigi),a=C.getModalViewParamName(this.luigi),s=r[a],o=new URL(location.href),l=this.luigi.getConfigValue("routing.useHashRouting");let c=history.state,f,h;if(l){let[u,d]=o.hash.split("?");f=u,h=C.getURLWithoutModalData(d,a),h&&(f+="?"+h)}else f=o.pathname,h=C.getURLWithoutModalData(o.search,a),h&&(f+="?"+C.getURLWithoutModalData(o.search,a));if(c=C.handleHistoryState(c,f),s!==e){if(r[a]=e,t&&Object.keys(t).length&&(r[`${a}Params`]=JSON.stringify(t)),l){const u=location.hash.indexOf(n);u!==-1&&(o.hash=o.hash.slice(0,u)),o.hash=`${o.hash}${n}${C.encodeParams(r)}`}else o.search=`?${C.encodeParams(r)}`;history.pushState(c,"",o.href)}else{const u=new URL(o);if(l){let d=u.hash.split("?")[0];u.hash=d,h&&(u.hash+="?"+h)}else u.search=h;history.replaceState({},"",u.href),history.pushState(c,"",o.href)}}removeModalDataFromUrl(e){const t=C.getQueryParams(this.luigi),n=C.getModalViewParamName(this.luigi);let r=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let s={};t[n]&&(s[n]=t[n]),t[`${n}Params`]&&(s[`${n}Params`]=t[`${n}Params`]);let o=C.encodeParams(s);r.hash.includes(`?${o}`)?r.hash=r.hash.replace(`?${o}`,""):r.hash.includes(`&${o}`)&&(r.hash=r.hash.replace(`&${o}`,""))}else{let s=new URLSearchParams(r.search.slice(1));s.delete(n),s.delete(`${n}Params`);let o="";Array.from(s.keys()).forEach(l=>{o+=(o===""?"?":"&")+l+"="+s.get(l)}),r.search=o}if(history.state&&history.state.modalHistoryLength>=0&&e){history.state.modalHistoryLength;const s=history.state.pathBeforeHistory;let o=!1;if(window.addEventListener("popstate",l=>{o?(history.replaceState({},"",s),history.pushState({},"",s),history.back()):(history.pushState({},"",s),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 l=history.length-1;o=!0,history.go(-l),window.Luigi.preventLoadingModalData=!0}else{const l=history.state.modalHistoryLength;history.go(-l)}}else history.pushState({},"",r.href)}setFeatureToggle(e){const t=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),n=this.luigi.featureToggles();t&&typeof e=="string"&&C.setFeatureToggles(t,e,n)}updateModalDataInUrl(e,t,n){let r=C.getHashQueryParamSeparator();const a=C.getQueryParams(this.luigi),s=C.getModalViewParamName(this.luigi);a[s]=e,t&&Object.keys(t).length&&(a[`${s}Params`]=JSON.stringify(t));const o=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const c=location.hash.indexOf(r);c!==-1&&(o.hash=o.hash.slice(0,c)),o.hash=`${o.hash}${r}${C.encodeParams(a)}`}else o.search=`?${C.encodeParams(a)}`;n?history.pushState(window.state,"",o.href):history.replaceState(window.state,"",o.href)}checkInvalidateCache(e,t){if(!e)return;const n=y.get(le);let r=t.split("/");if(e.nodesInPath&&e.nodesInPath.length>0){let a=e.nodesInPath.slice(1),s=!0;for(let o=0;o<a.length;o++){let l=r.length>o?r[o]:void 0,c=a[o];if(l!==c.pathSegment||!s)if(C.isDynamicNode(c)){if(!s||l!==C.getDynamicNodeValue(c,e.pathParams)){n.deleteNodesRecursively(c);break}}else s=!1}}else n.deleteCache()}}class Vi{constructor(e){var t;this.hashRouting=!1,this.navigate=async(n,r,a,s,o)=>{const l={modalSettings:a,newTab:!1,path:n,preserveView:r,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(l,void 0)},this.openAsModal=async(n,r,a)=>{r.keepPrevious||await this.modalService.closeModals();const s=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(s),l=r||{};l.title||(l.title=o.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(s,l),this.luigi.getEngine()._ui.openModal(this.luigi,o,l,a)},this.openAsDrawer=async(n,r,a)=>{const s=n.replace(/\/\/+/g,"/"),o=await this.navService.getCurrentNode(s),l=r||{};l.title||(l.title=o.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,o,l,a)},this.runTimeErrorHandler=async n=>{var o,l,c;const{path:r}=C.getCurrentPath((o=this.luigi.getConfig().routing)==null?void 0:o.useHashRouting),a=await this.navService.getCurrentNode(r),s=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");(l=a==null?void 0:a.runTimeErrorHandler)!=null&&l.errorFn&&E.isFunction((c=a==null?void 0:a.runTimeErrorHandler)==null?void 0:c.errorFn)?a.runTimeErrorHandler.errorFn(n,a):s!=null&&s.errorFn&&E.isFunction(s.errorFn)&&s.errorFn(n,a)},this.luigi=e,this.hashRouting=(t=e.getConfig().routing)==null?void 0:t.useHashRouting,this.navService=y.get(ce),this.routingService=y.get(ge),this.modalService=y.get(fe)}}class Hi{constructor(e){this.luigi=e}addSearchParams(e,t=!1){if(!E.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?n.hash=C.addParamsOnHashRouting(e,n.hash):C.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),this.luigi.configChanged()}getSearchParams(){const e={},t=["__proto__","constructor","prototype"],n=new URL(location.href);let r;if(this.luigi.getConfigValue("routing.useHashRouting")){const a=n.hash.split("?")[1];r=a?new URLSearchParams(a).entries():[]}else r=n.searchParams.entries();for(const[a,s]of r){if(t.some(o=>a===o)){console.warn(`Blocked because of potentially dangerous query param: ${a}`);continue}e[a]=s}return e}handleBrowserHistory(e,t){const n=this.sanitizeUrl(t.href);if(!n){console.warn("invalid url: "+n);return}e?window.history.pushState({},"",n):window.history.replaceState({},"",n)}sanitizeUrl(e){return new URL(location.href).origin===new URL(e).origin?e:void 0}addNodeParams(e,t){if(!E.isObject(e)){console.log("Params argument must be an object");return}const n=C.getContentViewParamPrefix(this.luigi),r=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?r.hash=C.addParamsOnHashRouting(e,r.hash,n):C.modifySearchParams(e,r.searchParams,n),this.handleBrowserHistory(t,r),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}var V,Re;class Qi{constructor(e){it(this,V);it(this,Re,"");nt(this,V,e)}async getAvailableThemes(){return await Q(this,V).getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){nt(this,Re,e),Q(this,V).__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t==null?void 0:t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(Q(this,Re))return Q(this,Re);const e=Q(this,V).getConfigValue("settings.theming");return e.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",e),e.defaultTheme}isThemingAvailable(){return!!Q(this,V).getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=Q(this,V).getConfigValue("settings.theming.variables.file");if(e)try{const t=await fetch(e);window.Luigi.__cssVars=(await t.json()).root,Object.keys(window.Luigi.__cssVars).forEach(n=>{const r=getComputedStyle(document.documentElement).getPropertyValue("--"+n);r&&(window.Luigi.__cssVars[n]=r)})}catch(t){E.isFunction(Q(this,V).getConfigValue("settings.theming.variables.errorHandling"))?Q(this,V).getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else Q(this,V).getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(t=>{window.Luigi.__cssVars[t]=getComputedStyle(document.documentElement).getPropertyValue("--"+t)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const e=y.get(Ie);(()=>{const n=Q(this,V).getConfigValue("settings.theming");n&&n.nodeViewURLDecorator&&n.nodeViewURLDecorator.queryStringParameter&&e.add({type:"queryString",uid:"theming",key:n.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const r=this.getCurrentTheme(),a=n.nodeViewURLDecorator.queryStringParameter.value;return a?a(r):r}}),n&&n.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}V=new WeakMap,Re=new WeakMap;class Ke{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(e,t){var n,r;if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const a=new Set;a.add(t),this.unsavedChanges={dirtySet:a}}this.unsavedChanges.persistUrl=window.location.href,e?(n=this.unsavedChanges.dirtySet)==null||n.add(t):(r=this.unsavedChanges.dirtySet)==null||r.delete(t)}clearDirtyState(e){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(e?this.unsavedChanges.dirtySet.delete(e):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let $t;const N={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),N.luigi=i,N.documentTitle=Be(void 0),$t=y.get(Ke)},processAlert:(i,e,t)=>{var r;if(!N.luigi)throw new Error("Luigi is not initialized.");const n={openFromClient:e,close:()=>{i.id&&t.notifyAlertClosed(i.id)},link:a=>{var s;if(i.links){const o=i.links[a];if(o&&(o.url&&((s=N.luigi)==null||s.navigation().navigate(o.url)),o.dismissKey&&i.id))return t.notifyAlertClosed(i.id,o.dismissKey),!0}return!1}};(r=N.luigi.getEngine()._connector)==null||r.renderAlert(i,n)},handleConfirmationModalRequest:(i,e)=>{var t;if(!N.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:N.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:N.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:N.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:N.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),(t=N.luigi.getEngine()._connector)==null||t.renderConfirmationModal(i,{confirm(){e.notifyConfirmationModalClosed(!0)},dismiss(){e.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,e)=>{if(!N.luigi)throw new Error("Luigi is not initialized.");$t.updateDirtyStatus(i,e)}};class Wi{processUserSettingGroups(e,t){var o;const n=[],r=e==null?void 0:e.userSettingGroups,a=(o=t==null?void 0:t.userSettings)==null?void 0:o.userSettingGroups,s=r||a;if(E.isObject(s)){for(const l in s){const c={};c[l]=s[l],n.push(c)}return n}return n}getUserSettingsIframesInDom(){const e=document.querySelector(".iframeUserSettingsCtn");return e?[...e.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(e=>{e.style.display="none"})}findActiveCustomUserSettingsIframe(e){const t=document.querySelectorAll("[userSettingsGroup]");for(let n=0;n<t.length;n++)if(t[n].contentWindow===e)return t[n];return null}}const Gi=new Wi;class ji{constructor(e){this.dirtyStatusService=y.get(Ke),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=t=>new Promise(n=>{var a;t.id||(t.id=E.getRandomId().toString());const r={openFromClient:!1,close:()=>{n(!0)},link:s=>{var o;if(t.links){const l=t.links[s];if(l&&(l.url&&((o=this.luigi)==null||o.navigation().navigate(l.url)),l.dismissKey))return n(l.dismissKey),!0}return!1}};(a=this.luigi.getEngine()._connector)==null||a.renderAlert(t,r)}),this.showConfirmationModal=t=>(t&&(t={...t,header:this.luigi.i18n().getTranslation(t.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(t.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(t.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(t.buttonConfirm||"luigi.button.confirm")}),new Promise((n,r)=>{var a;(a=this.luigi.getEngine()._connector)==null||a.renderConfirmationModal(t,{confirm(){n(!0)},dismiss(){r()}})})),this.processUserSettingGroups=()=>{const t=this.luigi.getConfigValue("userSettings"),n=this.luigi.getConfigValue("settings");return Gi.processUserSettingGroups(t,n)},this.openUserSettings=t=>{var n;(n=this.luigi.getEngine()._connector)==null||n.openUserSettings(t)},this.closeUserSettings=()=>{var t;(t=this.luigi.getEngine()._connector)==null||t.closeUserSettings()},this.setDocumentTitle=t=>{var n,r,a;(r=(n=this.luigi.getEngine()._ux)==null?void 0:n.documentTitle)==null||r.set(t),(a=this.luigi.getEngine()._connector)==null||a.setDocumentTitle(t)},this.getDocumentTitle=()=>{var t;return Dt((t=this.luigi.getEngine()._ux)==null?void 0:t.documentTitle)||window.document.title||""},this.hideAppLoadingIndicator=()=>{const t=document.querySelector(this.appLoadingIndicatorSelector);t&&(t.classList.add("hidden"),setTimeout(()=>{var n;(n=t.parentNode)==null||n.removeChild(t)},500))},this.showLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.showLoadingIndicator(t)},this.hideLoadingIndicator=t=>{var n;return(n=this.luigi.getEngine()._connector)==null?void 0:n.hideLoadingIndicator(t)},this.addBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.addBackdrop()},this.removeBackdrop=()=>{var t;return(t=this.luigi.getEngine()._connector)==null?void 0:t.removeBackdrop()},this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=e}}class Bi{constructor(e){this.engine=e,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=t=>{this.config=t,this.setConfigCallback(this.getConfigReadyCallback()),Te.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Ti.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...t)=>{this.getEngine()._ui.update(t)},this.i18n=()=>(this._i18n||(this._i18n=new wi(this)),this._i18n),this.navigation=()=>new Vi(this),this.ux=()=>new ji(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new yi),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new Hi(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new Qi(this)),this._theming),this.auth=()=>ve,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(e){return E.getConfigValueFromObject(this.getConfig(),e)}getConfigValueAsync(e,...t){return we.getConfigValueFromObjectAsync(this.getConfig(),e,t)}clearNavigationCache(){y.get(le).deleteCache()}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&E.isFunction(t.readUserSettings))return t.readUserSettings();const n=localStorage.getItem(this.USER_SETTINGS_KEY);return n&&JSON.parse(n)}async storeUserSettings(e,t){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&E.isFunction(r.storeUserSettings))return r.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}createConfigStore(){const e=Be({}),t={};let n=[];return{subscribe:r=>{n.push(e.subscribe(r))},reset:r=>{e.update(r)},subscribeToScope:(r,a)=>{let s=t[a];s||(s=new Set,t[a]=s),s.add(r)},fire:(r,a)=>{const s=t[r];s&&[...s].forEach(o=>{o(a)})},clear:()=>{n.forEach(r=>{r()}),n=[]}}}getConfigReadyCallback(){return new Promise(e=>{this.i18n()._init(),e()})}setConfigCallback(e){this.configReadyCallback=e}}const qi=!1;var zi=Array.isArray,Ki=Array.from,Ji=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor;const dt=2,Yt=4,Zt=8,Xi=16,Ve=32,Ye=64,Ze=128,Je=256,ne=512,ei=1024,gt=2048,ti=4096,et=8192,Yi=16384,Zi=1<<18,en=1<<19;function tn(i){return i===this.v}function nn(){throw new Error("effect_update_depth_exceeded")}function rn(i){return{f:0,v:i,reactions:null,equals:tn,version:0}}var Nt,ii;function sn(){if(Nt===void 0){Nt=window;var i=Element.prototype,e=Node.prototype;Lt(e,"firstChild").get,ii=Lt(e,"nextSibling").get,i.__click=void 0,i.__className="",i.__attributes=null,i.__styles=null,i.__e=void 0,Text.prototype.__t=void 0}}function an(i=""){return document.createTextNode(i)}function on(i){return ii.call(i)}function ni(i){var e=i.children;if(e!==null){i.children=null;for(var t=0;t<e.length;t+=1){var n=e[t];(n.f&dt)!==0?ri(n):He(n)}}}function ln(i){var e,t=ie;Le(i.parent);try{ni(i),e=ui(i)}finally{Le(t)}return e}function cn(i){var e=ln(i),t=(Ce||(i.f&Ze)!==0)&&i.deps!==null?gt:ne;Ne(i,t),i.equals(e)||(i.v=e,i.version=pn())}function ri(i){ni(i),Fe(i,0),Ne(i,et),i.v=i.children=i.deps=i.ctx=i.reactions=null}function un(i,e){var t=e.last;t===null?e.last=e.first=i:(t.next=i,i.prev=t,e.last=i)}function ft(i,e,t,n=!0){var r=(i&Ye)!==0,a=ie,s={ctx:ee,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:i|ei,first:null,fn:e,last:null,next:null,parent:r?null:a,prev:null,teardown:null,transitions:null,version:0};if(t){var o=be;try{Ut(!0),mt(s),s.f|=Yi}catch(f){throw He(s),f}finally{Ut(o)}}else e!==null&&wn(s);var l=t&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&en)===0;if(!l&&!r&&n&&(a!==null&&un(s,a),Z!==null&&(Z.f&dt)!==0)){var c=Z;(c.children??(c.children=[])).push(s)}return s}function hn(i){const e=ft(Ye,i,!0);return()=>{He(e)}}function dn(i){return ft(Yt,i,!1)}function gn(i,e=!0){return ft(Zt|Ve,i,!0,e)}function si(i){var e=i.teardown;if(e!==null){const t=Z;$e(null);try{e.call(null)}finally{$e(t)}}}function ai(i){var e=i.deriveds;if(e!==null){i.deriveds=null;for(var t=0;t<e.length;t+=1)ri(e[t])}}function oi(i,e=!1){var t=i.first;for(i.first=i.last=null;t!==null;){var n=t.next;He(t,e),t=n}}function fn(i){for(var e=i.first;e!==null;){var t=e.next;(e.f&Ve)===0&&He(e),e=t}}function He(i,e=!0){var t=!1;if((e||(i.f&Zi)!==0)&&i.nodes_start!==null){for(var n=i.nodes_start,r=i.nodes_end;n!==null;){var a=n===r?null:on(n);n.remove(),n=a}t=!0}ai(i),oi(i,e&&!t),Fe(i,0),Ne(i,et);var s=i.transitions;if(s!==null)for(const l of s)l.stop();si(i);var o=i.parent;o!==null&&o.first!==null&&li(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.parent=i.fn=i.nodes_start=i.nodes_end=null}function li(i){var e=i.parent,t=i.prev,n=i.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===i&&(e.first=n),e.last===i&&(e.last=t))}let Xe=!1,be=!1;function Ut(i){be=i}let ct=[],De=0;let Z=null;function $e(i){Z=i}let ie=null;function Le(i){ie=i}let X=null,B=0,ci=0,Ce=!1,ee=null;function pn(){return++ci}function pt(i){var s,o;var e=i.f;if((e&ei)!==0)return!0;if((e&gt)!==0){var t=i.deps,n=(e&Ze)!==0;if(t!==null){var r;if((e&Je)!==0){for(r=0;r<t.length;r++)((s=t[r]).reactions??(s.reactions=[])).push(i);i.f^=Je}for(r=0;r<t.length;r++){var a=t[r];if(pt(a)&&cn(a),n&&ie!==null&&!Ce&&!((o=a==null?void 0:a.reactions)!=null&&o.includes(i))&&(a.reactions??(a.reactions=[])).push(i),a.version>i.version)return!0}}n||Ne(i,ne)}return!1}function mn(i,e,t){throw i}function ui(i){var f;var e=X,t=B,n=Z,r=Ce,a=ee,s=i.f;X=null,B=0,Z=(s&(Ve|Ye))===0?i:null,Ce=!be&&(s&Ze)!==0,ee=i.ctx;try{var o=(0,i.fn)(),l=i.deps;if(X!==null){var c;if(Fe(i,B),l!==null&&B>0)for(l.length=B+X.length,c=0;c<X.length;c++)l[B+c]=X[c];else i.deps=l=X;if(!Ce)for(c=B;c<l.length;c++)((f=l[c]).reactions??(f.reactions=[])).push(i)}else l!==null&&B<l.length&&(Fe(i,B),l.length=B);return o}finally{X=e,B=t,Z=n,Ce=r,ee=a}}function Sn(i,e){let t=e.reactions;if(t!==null){var n=t.indexOf(i);if(n!==-1){var r=t.length-1;r===0?t=e.reactions=null:(t[n]=t[r],t.pop())}}t===null&&(e.f&dt)!==0&&(X===null||!X.includes(e))&&(Ne(e,gt),(e.f&(Ze|Je))===0&&(e.f^=Je),Fe(e,0))}function Fe(i,e){var t=i.deps;if(t!==null)for(var n=e;n<t.length;n++)Sn(i,t[n])}function mt(i){var e=i.f;if((e&et)===0){Ne(i,ne);var t=ie;ie=i;try{ai(i),(e&Xi)!==0?fn(i):oi(i),si(i);var n=ui(i);i.teardown=typeof n=="function"?n:null,i.version=ci}catch(r){mn(r)}finally{ie=t}}}function _n(){De>1e3&&(De=0,nn()),De++}function En(i){var e=i.length;if(e!==0){_n();var t=be;be=!0;try{for(var n=0;n<e;n++){var r=i[n];(r.f&ne)===0&&(r.f^=ne);var a=[];hi(r,a),vn(a)}}finally{be=t}}}function vn(i){var e=i.length;if(e!==0)for(var t=0;t<e;t++){var n=i[t];(n.f&(et|ti))===0&&pt(n)&&(mt(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?li(n):n.fn=null))}}function Cn(){if(Xe=!1,De>1001)return;const i=ct;ct=[],En(i),Xe||(De=0)}function wn(i){Xe||(Xe=!0,queueMicrotask(Cn));for(var e=i;e.parent!==null;){e=e.parent;var t=e.f;if((t&(Ye|Ve))!==0){if((t&ne)===0)return;e.f^=ne}}ct.push(e)}function hi(i,e){var t=i.first,n=[];e:for(;t!==null;){var r=t.f,a=(r&Ve)!==0,s=a&&(r&ne)!==0;if(!s&&(r&ti)===0)if((r&Zt)!==0){a?t.f^=ne:pt(t)&&mt(t);var o=t.first;if(o!==null){t=o;continue}}else(r&Yt)!==0&&n.push(t);var l=t.next;if(l===null){let h=t.parent;for(;h!==null;){if(i===h)break e;var c=h.next;if(c!==null){t=c;continue e}h=h.parent}}t=l}for(var f=0;f<n.length;f++)o=n[f],e.push(o),hi(o,e)}const Tn=-3585;function Ne(i,e){i.f=i.f&Tn|e}function yn(i,e=!1,t){ee={p:ee,c:null,e:null,m:!1,s:i,x:null,l:null},e||(ee.l={s:null,u:null,r1:[],r2:rn(!1)})}function bn(i){const e=ee;if(e!==null){const s=e.e;if(s!==null){var t=ie,n=Z;e.e=null;try{for(var r=0;r<s.length;r++){var a=s[r];Le(a.effect),$e(a.reaction),dn(a.fn)}}finally{Le(t),$e(n)}}ee=e.p,e.m=!0}return{}}const Rn=new Set,Ot=new Set;function Ge(i){var L;var e=this,t=e.ownerDocument,n=i.type,r=((L=i.composedPath)==null?void 0:L.call(i))||[],a=r[0]||i.target,s=0,o=i.__root;if(o){var l=r.indexOf(o);if(l!==-1&&(e===document||e===window)){i.__root=e;return}var c=r.indexOf(e);if(c===-1)return;l<=c&&(s=l)}if(a=r[s]||i.target,a!==e){Ji(i,"currentTarget",{configurable:!0,get(){return a||t}});var f=Z,h=ie;$e(null),Le(null);try{for(var u,d=[];a!==null;){var p=a.assignedSlot||a.parentNode||a.host||null;try{var _=a["__"+n];if(_!==void 0&&!a.disabled)if(zi(_)){var[v,...R]=_;v.apply(a,[i,...R])}else _.call(a,i)}catch(U){u?d.push(U):u=U}if(i.cancelBubble||p===e||p===null)break;a=p}if(u){for(let U of d)queueMicrotask(()=>{throw U});throw u}}finally{i.__root=e,delete i.currentTarget,$e(f),Le(h)}}}const An=["touchstart","touchmove"];function Pn(i){return An.includes(i)}function In(i,e){return $n(i,e)}const Se=new Map;function $n(i,{target:e,anchor:t,props:n={},events:r,context:a,intro:s=!0}){sn();var o=new Set,l=h=>{for(var u=0;u<h.length;u++){var d=h[u];if(!o.has(d)){o.add(d);var p=Pn(d);e.addEventListener(d,Ge,{passive:p});var _=Se.get(d);_===void 0?(document.addEventListener(d,Ge,{passive:p}),Se.set(d,1)):Se.set(d,_+1)}}};l(Ki(Rn)),Ot.add(l);var c=void 0,f=hn(()=>{var h=t??e.appendChild(an());return gn(()=>{if(a){yn({});var u=ee;u.c=a}r&&(n.$$events=r),c=i(h,n)||{},a&&bn()}),()=>{var p;for(var u of o){e.removeEventListener(u,Ge);var d=Se.get(u);--d===0?(document.removeEventListener(u,Ge),Se.delete(u)):Se.set(u,d)}Ot.delete(l),xt.delete(c),h!==t&&((p=h.parentNode)==null||p.removeChild(h))}});return xt.set(c,f),c}let xt=new WeakMap;const Ln="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ln);function Nn(i){}const ut={init:i=>{y.get(ge).enableRouting()},handlePageErrorHandler:(i,e,t)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)e.viewUrl=i.viewUrl,t.getEngine()._ui.updateMainContent(e,t);else if(i.errorFn)i.errorFn(e);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const n=i.redirectPath||"/";t.navigation().navigate(n)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const t=window.open(i.url,"_blank","noopener noreferrer");t&&(t.opener=null,t.focus())}},async addSearchParamsFromClient(i,e,t){var o;const n=y.get(ce),r=C.getCurrentPath(),a=await n.getCurrentNode(r.path),s={...i};if((o=a==null?void 0:a.clientPermissions)!=null&&o.urlParameters){const l={};Object.keys(a.clientPermissions.urlParameters).forEach(c=>{c in s&&a.clientPermissions.urlParameters[c].write===!0&&(l[c]=s[c],delete s[c])});for(const c in s)console.warn(`No permission to add the search param "${c}" to the url`);Object.keys(l).length>0&&t.routing().addSearchParams(l,e)}}},Y={luigi:{},init:i=>{console.log("Init communication..."),Y.luigi=i},addListeners:(i,e)=>{i.addEventListener(m.INITIALIZED,t=>{var n;(n=N.luigi)==null||n.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(m.NAVIGATION_REQUEST,t=>{const{link:n,modal:r,newTab:a,preserveView:s,preventContextUpdate:o,preventHistoryEntry:l,withoutSync:c}=t.detail,f={modalSettings:r,newTab:a,path:n,preserveView:s,preventContextUpdate:o,preventHistoryEntry:l,withoutSync:c};y.get(ce).handleNavigationRequest(f,t.callbackFn)}),i.addEventListener(m.RUNTIME_ERROR_HANDLING_REQUEST,t=>{var n,r;e.navigation().runTimeErrorHandler(((r=(n=t.payload)==null?void 0:n.data)==null?void 0:r.errorObj)||{})}),i.addEventListener(m.ALERT_REQUEST,t=>{N.processAlert(t.payload,!0,i)}),i.addEventListener(m.SHOW_CONFIRMATION_MODAL_REQUEST,t=>{N.handleConfirmationModalRequest(t.payload,i)}),i.addEventListener(m.SET_DOCUMENT_TITLE_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.setDocumentTitle(t.detail.title)}),i.addEventListener(m.SHOW_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.showLoadingIndicator(i.parentNode)}),i.addEventListener(m.HIDE_LOADING_INDICATOR_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.hideLoadingIndicator(i.parentNode)}),i.addEventListener(m.ADD_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.addBackdrop()}),i.addEventListener(m.REMOVE_BACKDROP_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.removeBackdrop()}),i.addEventListener(m.SET_DIRTY_STATUS_REQUEST,t=>{var n,r,a;N.handleDirtyStatusRequest((r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.dirty,(a=t.detail)==null?void 0:a.source)}),i.addEventListener(m.ADD_NODE_PARAMS_REQUEST,t=>{e.routing().addNodeParams(t.payload.data,t.payload.keepBrowserHistory)}),i.addEventListener(m.OPEN_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.openUserSettings(t.detail)}),i.addEventListener(m.CLOSE_USER_SETTINGS_REQUEST,t=>{var n;(n=Y.luigi.getEngine()._connector)==null||n.closeUserSettings()}),i.addEventListener(m.ADD_SEARCH_PARAMS_REQUEST,t=>{ut.addSearchParamsFromClient(t.detail.data,t.detail.keepBrowserHistory,e)}),i.addEventListener(m.UPDATE_MODAL_SETTINGS_REQUEST,t=>{D.updateModalSettings(t.payload.updatedModalSettings,t.payload.addHistoryEntry,e)}),i.addEventListener(m.SET_CURRENT_LOCALE_REQUEST,t=>{var n,r,a;e.i18n().setCurrentLocale((a=(r=(n=t.detail)==null?void 0:n.data)==null?void 0:r.data)==null?void 0:a.currentLocale,i)})}};class Un{constructor(){this._ui=D,this._comm=Y,this._ux=N,this._routing=ut}bootstrap(e){this._app=In(Nn,{target:document.body}),this._connector=e}init(){const e=window.Luigi;y.register(Ke,()=>new Ke),y.register(ce,()=>new ce(e)),y.register(le,()=>new le),y.register(ge,()=>new ge(e)),y.register(Ie,()=>new Ie),y.register(fe,()=>new fe(e)),e.theming()._init(),D.init(e),ut.init(e),Y.init(e),N.init(e)}}window.Luigi=new Bi(new Un);
34
34
  //# sourceMappingURL=luigi.js.map