@luigi-project/core 2.13.1-dev.202406180027 → 2.13.1-dev.202406200026

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,4 +1,4 @@
1
- var Yw=Object.defineProperty;var Qw=(i,e,t)=>e in i?Yw(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Hf=(i,e,t)=>(Qw(i,typeof e!="symbol"?e+"":e,t),t);function We(){}function Zw(i,e){for(const t in e)i[t]=e[t];return i}function Xw(i){return i&&typeof i=="object"&&typeof i.then=="function"}function F_(i){return i()}function Wf(){return Object.create(null)}function Ye(i){i.forEach(F_)}function bi(i){return typeof i=="function"}function At(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Xa;function Xe(i,e){return Xa||(Xa=document.createElement("a")),Xa.href=e,i===Xa.href}function $w(i){return Object.keys(i).length===0}function Mo(i,...e){if(i==null)return We;const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function ol(i){let e;return Mo(i,t=>e=t)(),e}function wi(i,e,t){i.$$.on_destroy.push(Mo(e,t))}function U_(i,e,t,n){if(i){const l=B_(i,e,t,n);return i[0](l)}}function B_(i,e,t,n){return i[1]&&n?Zw(t.ctx.slice(),i[1](n(e))):t.ctx}function H_(i,e,t,n){if(i[2]&&n){const l=i[2](n(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],a=Math.max(e.dirty.length,l.length);for(let o=0;o<a;o+=1)r[o]=e.dirty[o]|l[o];return r}return e.dirty|l}return e.dirty}function W_(i,e,t,n,l,r){if(l){const a=B_(e,t,n,r);i.p(a,l)}}function z_(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function $n(i){return i??""}function q_(i){return i&&bi(i.destroy)?i.destroy:We}function w(i,e){i.appendChild(e)}function A(i,e,t){i.insertBefore(e,t||null)}function L(i){i.parentNode&&i.parentNode.removeChild(i)}function ht(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function S(i){return document.createElement(i)}function xw(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Le(i){return document.createTextNode(i)}function W(){return Le(" ")}function Ce(){return Le("")}function te(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function wt(i){return function(e){return e.preventDefault(),i.call(this,e)}}function Ut(i){return function(e){return e.stopPropagation(),i.call(this,e)}}function f(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function e2(i){return Array.from(i.childNodes)}function Ae(i,e){e=""+e,i.wholeText!==e&&(i.data=e)}function zf(i,e){i.value=e??""}function Vn(i,e,t,n){t===null?i.style.removeProperty(e):i.style.setProperty(e,t,n?"important":"")}function jt(i,e,t){i.classList[t?"add":"remove"](e)}function t2(i,e,{bubbles:t=!1,cancelable:n=!1}={}){const l=document.createEvent("CustomEvent");return l.initCustomEvent(i,t,n,e),l}class hr{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=xw(t.nodeName):this.e=S(t.nodeName),this.t=t,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)A(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(L)}}let zr;function Bi(i){zr=i}function hl(){if(!zr)throw new Error("Function called outside component initialization");return zr}function qn(i){hl().$$.before_update.push(i)}function $t(i){hl().$$.on_mount.push(i)}function jr(i){hl().$$.after_update.push(i)}function Jr(i){hl().$$.on_destroy.push(i)}function Jt(){const i=hl();return(e,t,{cancelable:n=!1}={})=>{const l=i.$$.callbacks[e];if(l){const r=t2(e,t,{cancelable:n});return l.slice().forEach(a=>{a.call(i,r)}),!r.defaultPrevented}return!0}}function Br(i,e){return hl().$$.context.set(i,e),e}function vt(i){return hl().$$.context.get(i)}function Ol(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Wr=[],Je=[],es=[],Ao=[],n2=Promise.resolve();let Eo=!1;function i2(){Eo||(Eo=!0,n2.then(Fo))}function Ro(i){es.push(i)}function mt(i){Ao.push(i)}const To=new Set;let $a=0;function Fo(){const i=zr;do{for(;$a<Wr.length;){const e=Wr[$a];$a++,Bi(e),l2(e.$$)}for(Bi(null),Wr.length=0,$a=0;Je.length;)Je.pop()();for(let e=0;e<es.length;e+=1){const t=es[e];To.has(t)||(To.add(t),t())}es.length=0}while(Wr.length);for(;Ao.length;)Ao.pop()();Eo=!1,To.clear(),Bi(i)}function l2(i){if(i.fragment!==null){i.update(),Ye(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Ro)}}const ts=new Set;let Ml;function ke(){Ml={r:0,c:[],p:Ml}}function Se(){Ml.r||Ye(Ml.c),Ml=Ml.p}function R(i,e){i&&i.i&&(ts.delete(i),i.i(e))}function U(i,e,t,n){if(i&&i.o){if(ts.has(i))return;ts.add(i),Ml.c.push(()=>{ts.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function is(i,e){const t=e.token={};function n(l,r,a,o){if(e.token!==t)return;e.resolved=o;let c=e.ctx;a!==void 0&&(c=c.slice(),c[a]=o);const g=l&&(e.current=l)(c);let d=!1;e.block&&(e.blocks?e.blocks.forEach((h,p)=>{p!==r&&h&&(ke(),U(h,1,1,()=>{e.blocks[p]===h&&(e.blocks[p]=null)}),Se())}):e.block.d(1),g.c(),R(g,1),g.m(e.mount(),e.anchor),d=!0),e.block=g,e.blocks&&(e.blocks[r]=g),d&&Fo()}if(Xw(i)){const l=hl();if(i.then(r=>{Bi(l),n(e.then,1,e.value,r),Bi(null)},r=>{if(Bi(l),n(e.catch,2,e.error,r),Bi(null),!e.hasCatch)throw r}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,i),!0;e.resolved=i}}function G_(i,e,t){const n=e.slice(),{resolved:l}=i;i.current===i.then&&(n[i.value]=l),i.current===i.catch&&(n[i.error]=l),i.block.p(n,t)}const gl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function bt(i,e,t,n){const l=i.$$.props[e];l!==void 0&&(i.$$.bound[l]=t,n===void 0&&t(i.$$.ctx[l]))}function Ue(i){i&&i.c()}function Me(i,e,t,n){const{fragment:l,after_update:r}=i.$$;l&&l.m(e,t),n||Ro(()=>{const a=i.$$.on_mount.map(F_).filter(bi);i.$$.on_destroy?i.$$.on_destroy.push(...a):Ye(a),i.$$.on_mount=[]}),r.forEach(Ro)}function Fe(i,e){const t=i.$$;t.fragment!==null&&(Ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function r2(i,e){i.$$.dirty[0]===-1&&(Wr.push(i),i2(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Dt(i,e,t,n,l,r,a,o=[-1]){const c=zr;Bi(i);const g=i.$$={fragment:null,ctx:[],props:r,update:We,not_equal:l,bound:Wf(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Wf(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};a&&a(g.root);let d=!1;if(g.ctx=t?t(i,e.props||{},(h,p,...b)=>{const m=b.length?b[0]:p;return g.ctx&&l(g.ctx[h],g.ctx[h]=m)&&(!g.skip_bound&&g.bound[h]&&g.bound[h](m),d&&r2(i,h)),p}):[],g.update(),d=!0,Ye(g.before_update),g.fragment=n?n(g.ctx):!1,e.target){if(e.hydrate){const h=e2(e.target);g.fragment&&g.fragment.l(h),h.forEach(L)}else g.fragment&&g.fragment.c();e.intro&&R(i.$$.fragment),Me(i,e.target,e.anchor,e.customElement),Fo()}Bi(c)}class Vt{$destroy(){Fe(this,1),this.$destroy=We}$on(e,t){if(!bi(t))return We;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const l=n.indexOf(t);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!$w(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}class a2{constructor(){this.handles={},this.keyExistencyTimeout=2e4,this.keyExistencyCheckInterval=50}wrapAsPromise(e){return new Promise(t=>{t(e)})}applyFunctionPromisified(e,t){return e=e.apply(this,t),le.isPromise(e)?e:this.wrapAsPromise(e)}getConfigValueFromObjectAsync(e,t,...n){let l=le.getConfigValueFromObject(e,t);return le.isFunction(l)?this.applyFunctionPromisified(l,n):this.wrapAsPromise(l)}}const ls=new a2;class s2{convertCustomMessageInternalToUser(e){return e.data}convertCustomMessageUserToInternal(e){return{msg:"custom",data:e}}}const rs=new s2;class o2{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&&t.hasOwnProperty("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)){let t=this.getChildren(e).children;for(let n=0;n<t.length;n++)this.deleteNodesRecursively(t[n])}this.dataManagement.delete(e)}}const zn=new o2;let u2=class{constructor(){this.configReadyCallback=function(){},this.initialized=!1,this.USER_SETTINGS_KEY="luigi.preferences.userSettings"}setConfigCallbacks(e){this.configReadyCallback=e}async setConfig(e){this.config=e,window.Luigi._store.update(()=>({config:e})),this._configModificationTimestamp=new Date,this.initialized||(this.initialized=!0,this.configReadyCallback().then(async()=>{q2.luigiAfterInit(),await this.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}))}getConfig(){return this.config}configChanged(...e){const t=dn.optimizeScope(e);t.length>0?t.forEach(n=>{window.Luigi._store.fire(n,{current:window.Luigi._store})}):window.Luigi._store.update(n=>n)}setErrorMessage(e){var t=document.createTextNode(e),n=document.createElement("div");n.setAttribute("class","fd-ui"),n.setAttribute("style","text-align: center;");var l=document.createElement("div");l.setAttribute("class","fd-message-strip fd-message-strip--error"),l.setAttribute("style","max-width: 800px; display: inline-block; margin-top: 40px;"),l.appendChild(t),n.appendChild(l),Hi.getLuigiContainer().appendChild(n)}getConfigValue(e){return le.getConfigValueFromObject(this.getConfig(),e)}getConfigBooleanValue(e){const t=le.getConfigValueFromObject(this.getConfig(),e);return t===!0||t==="true"}getConfigValueAsync(e,...t){return ls.getConfigValueFromObjectAsync(this.getConfig(),e,t)}async executeConfigFnAsync(e,t=!1,...n){const l=this.getConfigValue(e);if(le.isFunction(l))try{return await ls.applyFunctionPromisified(l,n)}catch(r){if(t)return Promise.reject(r)}return Promise.resolve(void 0)}isAuthorizationEnabled(){return pi.isAuthorizationEnabled()}unload(){this.initialized=!1,fn.unload(),On.removeAllEventListeners();const e=Hi.getLuigiContainer();for(;e.firstChild;)e.removeChild(e.lastChild)}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&le.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"),l=n||await this.getConfigValueAsync("settings.userSettings");if(l&&le.isFunction(l.storeUserSettings))return l.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}reset(){const e=this.getConfig();this.unload(),this.setConfig(e)}clearNavigationCache(){zn.deleteCache();const e=t=>{t&&t.forEach&&t.forEach(n=>{n.titleResolver&&n.titleResolver._cache&&(n.titleResolver._cache=void 0),n.children&&e(n.children)})};e(this.getConfig().navigation.nodes)}setGlobalContext(e,t){this.config&&this.config.navigation&&(this.config.navigation.globalContext=e,t||this.configChanged("navigation"))}getGlobalContext(){var e,t;return((t=(e=this.config)==null?void 0:e.navigation)==null?void 0:t.globalContext)||{}}updateContextValues(e){const t=Ee.getMicrofrontendIframes();t&&t.length>0&&t.forEach(n=>{n.luigi&&Ee.sendMessageToIframe(n,{msg:"luigi.navigate",context:JSON.stringify(Object.assign({},JSON.parse(n.luigi._lastUpdatedMessage.context),e)),nodeParams:n.luigi._lastUpdatedMessage.nodeParams,pathParams:JSON.stringify(Object.assign({},n.luigi.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(n.luigi.currentNode))),internal:Ee.applyCoreStateData(JSON.parse(n.luigi._lastUpdatedMessage.internal))})}),document.querySelector(".wcContainer")&&document.querySelectorAll("[lui_web_component=true]").forEach(l=>{l.context=Object.assign({},l.context,e)})}};const as=new u2;let f2=class{constructor(){}isAuthorizationEnabled(){return!!ae.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&fn.startAuthorization()}logout(){this.isAuthorizationEnabled()&&fn.logout()}async handleAuthEvent(e,t,n,l){const r=await ae.executeConfigFnAsync("auth.events."+e,!1,t,n);let a=r===void 0||!!r;if(a&&l){window.location.href=l;return}return a}get store(){return ae.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:()=>ui.getStorageKey(),getStorageType:()=>ui.getStorageType(),getAuthData:()=>ui.getAuthData(),setAuthData:e=>ui.setAuthData(e),removeAuthData:()=>ui.removeAuthData(),setNewlyAuthorized:()=>ui.setNewlyAuthorized()}}};const K_=new f2,sn={desktopMinWidth:600},c2=[{type:"main",selector:".iframeContainer iframe"},{type:"split-view",selector:".iframeSplitViewCnt iframe"},{type:"modal",selector:".iframeModalCtn._modal iframe"},{type:"drawer",selector:".iframeModalCtn._drawer iframe"},{type:"user-settings",selector:".iframeUserSettingsCtn iframe"}],d2={cssSelector:"[luigi-app-root]"},h2={cssSelector:"[luigi-app-loading-indicator]"};let g2=class{getLuigiContainer(){return this.getCustomLuigiContainer()||this.getDefaultLuigiContainer()}isCustomLuigiContainer(){return this.getLuigiContainer()===this.getCustomLuigiContainer()}getCustomLuigiContainer(){return document.querySelector(d2.cssSelector)}getDefaultLuigiContainer(){return document.querySelector("body")}getShellbar(){return document.getElementsByClassName("lui-shellbar-wrapper")[0]}getShellbarActions(){return document.getElementsByClassName("lui-shellbar_group--actions")[0]}getMicrofrontends(){return Ee.getMicrofrontendsInDom()}getMicrofrontendIframes(){return Ee.getMicrofrontendIframes()}getCurrentMicrofrontendIframe(){return Ee.getCurrentMicrofrontendIframe()}getNavFooterContainer(){return document.getElementsByClassName("lui-side-nav__footer")[0]}};const j_=new g2;class _2{constructor(){this.promises={}}setPromise(e,t){this.promises[e]=t}getPromise(e){return this.promises[e]}}class Xn extends _2{constructor(e){super(),Object.assign(this,e),this.options={preserveView:!1,nodeParams:{},errorSkipNavigation:!1,fromContext:null,fromClosestContext:!1,relative:!1,link:""}}async navigate(e,t,n,l,r){if(this.options.errorSkipNavigation)return this.options.errorSkipNavigation=!1,Promise.reject(new Error("navigation skipped"));this.options.preserveView=t;const a=e[0]!=="/";if(e==="/"&&(n||l||r))return console.warn("Navigation with an absolute path prevented."),Promise.reject(new Error("Navigation with an absolute path prevented."));const o=le.createRemotePromise(),c={msg:"luigi.navigation.open",params:Object.assign(this.options,{link:e,relative:a,modal:n,splitView:l,drawer:r}),remotePromiseId:o.id};return this.sendPostMessageToLuigiCore(c),o}openAsModal(e,t={},n){if(le.isFunction(n)){const l=le.createRemotePromise();l.then(r=>{n(r)}),t.onClosePromiseId=l.id}return this.navigate(e,!0,t)}openAsDrawer(e,t={}){return this.navigate(e,!0,void 0,void 0,t)}openAsSplitView(e,t={}){return this.navigate(e,!0,void 0,t),Luigi.splitView.splitViewHandle}fromContext(e){return this.options.fromContext=e,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this}withParams(e){return e&&Object.assign(this.options.nodeParams,e),this}pathExists(e){if(le.isFunction(Luigi.pathExists))return Luigi.pathExists(e);console.error("Luigi.navigation().pathExists(path) is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}hasBack(){return Luigi.hasBack()}goBack(e){this.sendPostMessageToLuigiCore({msg:"luigi.navigation.back",goBackContext:e&&JSON.stringify(e)})}sendPostMessageToLuigiCore(e){window.postMessage(e,"*")}}class p2{constructor(){}updateTopNavigation(){window.postMessage({msg:"luigi.navigation.update-badge-counters"},"*")}navigate(e,t,n,l,r){return new Xn().navigate(e,t,n,l,r)}openAsModal(e,t,n){return new Xn().openAsModal(e,t,n)}openAsSplitView(e,t={}){if(e==="/"){console.warn("Navigation with an absolute path prevented.");return}return new Xn().openAsSplitView(e,t)}openAsDrawer(e,t){return new Xn().openAsDrawer(e,t)}fromContext(e){return new Xn().fromContext(e)}fromClosestContext(){return new Xn().fromClosestContext()}fromVirtualTreeRoot(){return new Xn().fromVirtualTreeRoot()}withParams(e){return new Xn().withParams(e)}pathExists(e){return new Xn().pathExists(e)}hasBack(){return new Xn().hasBack()}goBack(e){return new Xn().goBack(e)}}const J_=new p2,m2={luigi:{unsavedChangesAlert:{header:"Unsaved changes detected",body:"Unsaved changes will be lost. Do you want to continue?"},confirmationModal:{header:"Confirmation",body:"Are you sure you want to do this?"},button:{dismiss:"No",confirm:"Yes"},requestedRouteNotFound:"Could not find the requested route {route}.",notExactTargetNode:"Could not map the exact target node for the requested route {route}.",navigation:{up:"Up"}}},b2=m2;class v2{constructor(){this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.translationTable=b2,this.listeners={}}_init(){dn.doOnStoreChange(window.Luigi._store,()=>{this._initCustomImplementation()},["settings"])}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(e){e&&(sessionStorage.setItem(this.currentLocaleStorageKey,e),this._notifyLocaleChange(e))}addCurrentLocaleChangeListener(e){if(le.isFunction(e)){const t=le.getRandomId();return this.listeners[t]=e,t}else console.error("Provided locale change listener is not a function.")}removeCurrentLocaleChangeListener(e){e&&this.listeners[e]?delete this.listeners[e]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}_notifyLocaleChange(e){Object.getOwnPropertyNames(this.listeners).forEach(t=>{this.listeners[t](e)}),as.configChanged()}_initCustomImplementation(){this.translationImpl=as.getConfigValue("settings.customTranslationImplementation"),le.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}getTranslation(e,t=void 0,n=void 0){if(!e)return"";if(this.translationImpl){const r=this.translationImpl.getTranslation(e,t,n);if(r!==e)return r}const l=this.findTranslation(e,this.translationTable,t);return l||e}findTranslation(e,t,n){let l=e.split(".");for(let r=0;r<l.length;r++){let a=l[r];if(t.hasOwnProperty(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("{"+dr.escapeKeyForRegexp(n)+"}","gi"),t[n])}),e}}const Y_=new v2;class w2{sendToAll(e){const t=rs.convertCustomMessageUserToInternal(e);Ee.getMicrofrontendsInDom().map(n=>n.container).map(n=>Ee.sendMessageToIframe(n,t))}send(e,t){const n=rs.convertCustomMessageUserToInternal(t);Ee.getMicrofrontendsInDom().filter(l=>l.id===e).map(l=>l.container).map(l=>Ee.sendMessageToIframe(l,n))}}const k2=new w2,ar=[];function S2(i,e){return{subscribe:fr(i,e).subscribe}}function fr(i,e=We){let t;const n=new Set;function l(o){if(At(i,o)&&(i=o,t)){const c=!ar.length;for(const g of n)g[1](),ar.push(g,i);if(c){for(let g=0;g<ar.length;g+=2)ar[g][0](ar[g+1]);ar.length=0}}}function r(o){l(o(i))}function a(o,c=We){const g=[o,c];return n.add(g),n.size===1&&(t=e(l)||We),o(i),()=>{n.delete(g),n.size===0&&(t(),t=null)}}return{set:l,update:r,subscribe:a}}class C2{initial(){this.responsiveNavSetting=ae.getConfigValue("settings.responsiveNavigation");const e=this.responsiveNavSetting==="semiCollapsible"||this.responsiveNavSetting==="Fiori3";JSON.parse(localStorage.getItem(oe.COL_NAV_KEY))!==!1&&e&&(this.isSemiCollapsed=this.getCollapsed()),this.semiCollapsible=!!e;let t=this.isSemiCollapsed===void 0;return this.semiCollapsible&&window.innerWidth!==0&&window.innerWidth<sn.desktopMinWidth?this.isSemiCollapsed=t?!0:this.getCollapsed():this.isSemiCollapsed=t?!1:this.getCollapsed(),this.setCollapsed(this.isSemiCollapsed),this.previousWindowWidth=window.innerWidth,{isSemiCollapsed:this.isSemiCollapsed,semiCollapsible:this.semiCollapsible}}onValueChanged(e){this.valueChangedFns?this.valueChangedFns.push(e):this.valueChangedFns=[e]}onResize(e){const t=window.innerWidth!==0&&window.innerWidth<sn.desktopMinWidth&&this.previousWindowWidth>=sn.desktopMinWidth,n=window.innerWidth!==0&&window.innerWidth>sn.desktopMinWidth&&this.previousWindowWidth>=sn.desktopMinWidth;return t&&this.setCollapsed(!0,!1),!this.isStoredCollapsed()&&n&&this.setCollapsed(!1,!1),e=this.closePopupMenu(e),{isSemiCollapsed:this.isSemiCollapsed,selectedCategory:e}}setCollapsed(e,t=!0){document.body.classList.remove("semiCollapsed"),e&&document.body.classList.add("semiCollapsed"),this.isSemiCollapsed=e,t&&localStorage.setItem(oe.COL_NAV_KEY,e),this.valueChangedFns instanceof Array&&this.valueChangedFns.forEach(n=>n({isSemiCollapsed:this.isSemiCollapsed}))}isStoredCollapsed(){return JSON.parse(localStorage.getItem(oe.COL_NAV_KEY))}getCollapsed(){return this.isStoredCollapsed()?!0:this.isSemiCollapsed}closePopupMenu(e){var t;return e&&(e=null,(t=document.getElementsByClassName("fd-app__sidebar")[0])==null||t.classList.remove("isBlocked")),e}buttonClicked(e){return this.closePopupMenu(),this.getCollapsed()?this.setCollapsed(!1):(this.setCollapsed(!0),document.getElementsByClassName("lui-fd-side-nav-wrapper")[0]&&(document.getElementsByClassName("lui-fd-side-nav-wrapper")[0].setAttribute("style","overflow-y:hidden;"),window.setTimeout(function(){document.getElementsByClassName("lui-fd-side-nav-wrapper")[0].setAttribute("style","overflow-y:auto;")}))),this.isSemiCollapsed}}const _i=new C2;let y2=class{constructor(){this.documentTitle=fr()}hideAppLoadingIndicator(){const e=document.querySelector(h2.cssSelector);e&&(e.classList.add("hidden"),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},500))}showAlert(e){if(le.isFunction(Luigi.showAlert))return Luigi.showAlert(e);console.error("Luigi.ux().showAlert() is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}showConfirmationModal(e){if(le.isFunction(Luigi.showConfirmationModal))return Luigi.showConfirmationModal(e);console.error("Luigi.ux().showConfirmationModal() is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}setDocumentTitle(e){this.documentTitle.set(e),Luigi.configChanged("settings.header")}getDocumentTitle(){return ol(this.documentTitle)}collapseLeftSideNav(e){_i.setCollapsed(e)}openUserSettings(){Luigi.openUserSettings()}closeUserSettings(){Luigi.closeUserSettings()}removeBackdrop(){new Xn().sendPostMessageToLuigiCore({msg:"luigi.remove-backdrop"})}getDirtyStatus(){return Luigi.getDirtyStatus()}};const Q_=new y2;let P2=class{openSearchField(){Luigi.openSearchField()}closeSearchField(){Luigi.closeSearchField()}clearSearchField(){Luigi.clearSearchField()}showSearchResult(e){Luigi.showSearchResult(e)}closeSearchResult(){Luigi.closeSearchResult()}getSearchString(){return Luigi.getGlobalSearchString()}setSearchString(e){Luigi.setGlobalSearchString(e)}setSearchInputPlaceholder(e){Luigi.setSearchInputPlaceholder(e)}};const Z_=new P2;let N2=class{constructor(){this.currentTheme}async getAvailableThemes(){return await ae.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){this.currentTheme=e,window.Luigi.__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t&&t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.currentTheme)return this.currentTheme;const e=ae.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!!ae.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=ae.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 l=getComputedStyle(document.documentElement).getPropertyValue("--"+n);l&&(window.Luigi.__cssVars[n]=l)})}catch(t){le.isFunction(ae.getConfigValue("settings.theming.variables.errorHandling"))?ae.getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else ae.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=()=>{const t=ae.getConfigValue("settings.theming");t&&t.nodeViewURLDecorator&&t.nodeViewURLDecorator.queryStringParameter&&Gr.add({type:"queryString",uid:"theming",key:t.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const n=this.getCurrentTheme(),l=t.nodeViewURLDecorator.queryStringParameter.value;return l?l(n):n}}),t&&t.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")};dn.doOnStoreChange(window.Luigi._store,()=>{e()},["settings.theming"])}};const X_=new N2;let T2=class{constructor(){this.featureToggleList=fr([])}setFeatureToggle(e,t=!1){this.isValid(e)&&(e.startsWith("!")&&!t||this.isDuplicatedOrDisabled(e)||ol(this.featureToggleList).push(e))}unsetFeatureToggle(e){if(!this.isValid(e))return;const t=ol(this.featureToggleList).indexOf(e);if(t===-1){console.warn("Feature toggle name is not in the list.");return}ol(this.featureToggleList).splice(t,1)}getActiveFeatureToggleList(){return[...ol(this.featureToggleList)].filter(e=>!e.startsWith("!"))}isValid(e){return le.isString(e)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(e){return ol(this.featureToggleList).includes(e)?(console.warn("Feature toggle name already exists"),!0):ol(this.featureToggleList).includes(`!${e}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}};const $_=new T2;let I2=class{constructor(){}getSearchParams(){const e={},t=new URL(location);if(ae.getConfigValue("routing.useHashRouting"))for(const[n,l]of new URLSearchParams(t.hash.split("?")[1]))e[n]=l;else for(const[n,l]of t.searchParams.entries())e[n]=l;return e}addSearchParams(e,t){if(!le.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location);ae.getConfigValue("routing.useHashRouting")?n.hash=we.addParamsOnHashRouting(e,n.hash):we.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),ae.configChanged()}addNodeParams(e,t){if(!le.isObject(e)){console.log("Params argument must be an object");return}const n=we.getContentViewParamPrefix(),l=new URL(location);ae.getConfigValue("routing.useHashRouting")?l.hash=we.addParamsOnHashRouting(e,l.hash,n):we.modifySearchParams(e,l.searchParams,n),this.handleBrowserHistory(t,l),ae.configChanged()}sanitizeUrl(e){return new URL(location).origin===new URL(e).origin?e:void 0}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)}getAnchor(){const{hash:e}=new URL(location);return ae.getConfigValue("routing.useHashRouting")&&e.split("#").length===2?"":e.split("#").pop()}setAnchor(e){if(ae.getConfigValue("routing.useHashRouting")){const{hash:t}=new URL(location),n=t.split("#"),r=n.length>2?n.slice(0,-1):n;window.location.hash=[...r,e].join("#")}else window.location.hash=e}};const x_=new I2,ae=as,pi=K_,Hi=j_,ep=J_,yt=Y_,Yr=Q_,L2=Z_,Do=X_,Uo=$_,ul=x_;window.Luigi=as;window.Luigi.auth=()=>K_;window.Luigi.elements=()=>j_;window.Luigi.navigation=()=>J_;window.Luigi.i18n=()=>Y_;window.Luigi.customMessages=()=>k2;window.Luigi.ux=()=>Q_;window.Luigi.globalSearch=()=>Z_;window.Luigi.theming=()=>X_;window.Luigi.featureToggles=()=>$_;window.Luigi.routing=()=>x_;class A2{constructor(){this.iframeNavFallbackTimeout=2e3,this.timeoutHandle}getActiveIframe(e){return[...e.children].filter(n=>n.tagName==="IFRAME").find(le.isElementVisible)}setActiveIframeToPrevious(e){const t=Ee.getMainIframes(),n=this.getPreservedViewsInDom(t);if(n.length===0)return;const l=this.getActiveIframe(e);Ee.hideElementChildren(e),l&&e.removeChild(l),n[0].pv=void 0,n[0].style.display="block"}removeInactiveIframes(e){Array.from(e.children).forEach(n=>{!le.isElementVisible(n)&&!n.vg&&n.tagName==="IFRAME"&&e.removeChild(n)})}hasIsolatedView(e,t,n){return e||n&&e!==!1&&!t}getPreservedViewsInDom(e){return e.filter(t=>t.pv)}canCache(e){const t=oe.getViewGroupSettings(e);return t&&t.preloadUrl}notifyInactiveIframes(){const e={msg:"luigi-client.inactive-microfrontend",context:JSON.stringify({}),nodeParams:JSON.stringify({}),pathParams:JSON.stringify({}),internal:JSON.stringify({currentLocale:yt.getCurrentLocale()})};Ee.sendMessageToVisibleIframes(e)}switchActiveIframe(e,t,n){const l=this.getActiveIframe(e);if(l!==t){let r=!1;Array.from(e.children).forEach(o=>{if(o===l)if(n)e.removeChild(o);else{const c=oe.getViewGroupSettings(o.vg);if(c&&this.notifyInactiveIframes(),o.style.display="none",c.preloadUrl){const g={msg:"luigi.navigate",viewUrl:c.preloadUrl,context:JSON.stringify({}),nodeParams:JSON.stringify({}),pathParams:JSON.stringify({}),internal:JSON.stringify({currentLocale:yt.getCurrentLocale()})};Ee.sendMessageToIframe(o,g)}}o===t&&(r=!0)}),t&&(t.style.display="block",r||e.insertBefore(t,e.firstChild))}return t}setOkResponseHandler(e,t,n){this.timeoutHandle=setTimeout(async()=>{e.navigateOk?e.navigateOk=void 0:(Ee.removeIframe(e.iframe,n),e.iframe=void 0,e.isFallbackFrame=!0,console.info("navigate: luigi-client did not respond, using fallback by replacing iframe"),await this.navigateIframe(e,t,n))},this.iframeNavFallbackTimeout)}checkIframe(e,t,n,l,r){this.timeoutHandle=setTimeout(()=>{t.get().showLoadingIndicator&&(e.viewUrl?(n=e.viewUrl,t.set({viewUrl:n}),this.iframeNavFallbackTimeout=0,this.setOkResponseHandler(l,t,r)):oe.handleUnresponsiveClient(e))},e.timeout)}initHandshakeFailed(e){if(!(e&&e.iframe&&e.iframe.luigi))return!0;const t=e.iframe.luigi.clientVersion;return e.iframe.luigi.initOk===void 0?!0:!t||le.semverCompare("1.1.1",t)!==-1?!1:!e.iframe.luigi.initOk}async navigateIframe(e,t,n){clearTimeout(this.timeoutHandle);const l=t.get();let r=l.viewUrl;r&&(r=we.substituteViewUrl(r,l));const a=Ee.isSameViewGroup(e,t),o=this.hasIsolatedView(l.previousNodeValues.isolateView,a,e.isolateAllViews),c=this.hasIsolatedView(l.isolateView,a,e.isolateAllViews),g=Ee.canReuseIframe(e,t);let d=this.getActiveIframe(n);const h=Ee.getMainIframes(),p=this.getPreservedViewsInDom(h);let b,m=!1;if(p.length>0&&(b=p.shift(),b===d&&(m=!0,d=void 0,e.iframe=void 0)),!m&&!t.get().isNavigateBack){d&&o&&(d=this.switchActiveIframe(n,void 0,!0)),d&&c&&(d=this.switchActiveIframe(n,void 0,!d.vg));let v;if(!c&&l.viewGroup){const y=Ee.getMainIframes().filter(P=>P.vg===l.viewGroup);y.length>0&&(v=y[0],d=this.switchActiveIframe(n,v,d&&!d.vg))}d&&!v&&(d.vg?d=this.switchActiveIframe(n,void 0,!1):g||(d=this.switchActiveIframe(n,void 0,!0))),e.iframe=d}if(!e.iframe||this.initHandshakeFailed(e)){if(e.iframe&&n.removeChild(e.iframe),m?(this.notifyInactiveIframes(),Ee.hideElementChildren(n)):Ee.removeElementChildren(n),l.viewUrl){le.getConfigValueFromObject(l,"currentNode.loadingIndicator.enabled")!==!1?t.set({showLoadingIndicator:!0}):t.set({showLoadingIndicator:!1}),e.navigateOk=void 0;const v=l.viewGroup&&!c&&this.canCache(l.viewGroup);e.iframe=Ee.createIframe(r,v?l.viewGroup:void 0,t.get().currentNode,"main",l),n.insertBefore(e.iframe,n.firstChild),e.builderCompatibilityMode?e.iframe.addEventListener("load",()=>{e.iframe._ready=!0;const y=["init",JSON.stringify(l.context)];Ee.sendMessageToIframe(e.iframe,y)}):e.iframe.addEventListener("load",()=>{e.iframe._ready=!0});const C=l.currentNode.pageErrorHandler;C?this.checkIframe(C,t,r,e,n):e.defaultPageErrorHandler&&this.checkIframe(e.defaultPageErrorHandler,t,r,e,n)}}else{t.set({showLoadingIndicator:!1});const v=t.get().goBackContext;e.iframe.style.display="block",e.iframe.luigi.nextViewUrl=r,e.iframe.luigi.nextClientPermissions=t.get().currentNode.clientPermissions,e.iframe.vg=this.canCache(l.viewGroup)?l.viewGroup:void 0,e.iframe.luigi.currentNode=l.currentNode;const C=await t.prepareInternalData(e),y={msg:"luigi.navigate",viewUrl:r,context:JSON.stringify(Object.assign({},l.context,{goBackContext:v})),nodeParams:JSON.stringify(Object.assign({},l.nodeParams)),pathParams:JSON.stringify(Object.assign({},l.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(e.iframe.luigi.currentNode))),internal:JSON.stringify(C)};l.isNavigationSyncEnabled?(Ee.getVisibleIframes().forEach(T=>{T!==e.iframe&&(T.userSettingsGroup?Luigi.readUserSettings().then(E=>{Ee.sendMessageToIframe(T,{msg:"luigi.navigate",context:{userSettingsData:E[T.userSettingsGroup]},internal:Ee.applyCoreStateData(T.luigi._lastUpdatedMessage.internal)})}):Ee.sendMessageToIframe(T,{msg:"luigi.navigate",context:T.luigi._lastUpdatedMessage.context,nodeParams:T.luigi._lastUpdatedMessage.nodeParams,pathParams:JSON.stringify(Object.assign({},T.luigi.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(e.iframe.luigi.currentNode))),internal:Ee.applyCoreStateData(T.luigi._lastUpdatedMessage.internal)}))}),Ee.sendMessageToIframe(e.iframe,y),this.setOkResponseHandler(e,t,n)):t.set({isNavigationSyncEnabled:!0}),t.set({goBackContext:void 0,isNavigateBack:!1})}}}const oi=new A2;class E2{constructor(){this.preloadBatchSize=1,this.shouldPreload=!1}preloadViewGroups(e=3,t){if(ae.getConfigValue("navigation.preloadViewGroups")===!1)return;const l=oe.getAllViewGroupSettings();if(!l)return;const r=Ee.getIframeContainer(),a=Ee.getMainIframes(),o=new Date().getTime();if(a.filter(h=>h.luigi&&h.luigi.preloading&&o-h.luigi.createdAt<3e4).length>0){console.debug("skipping view group preloading (busy)");return}const g=a.map(h=>h.vg).filter(Boolean),d=Object.entries(l).filter(([h,p])=>!g.includes(h)).filter(([h,p])=>p&&p.preloadUrl);t&&d.forEach(([h,p])=>{p.loadOnStartup&&this.preloadIframeOnBackground(p,h,r)}),!t&&d.filter((h,p)=>p<e).forEach(([h,p])=>{console.debug("preloading view group "+h+" - "+p.preloadUrl),this.preloadIframeOnBackground(p,h,r)})}preloadIframeOnBackground(e,t,n){const l=Ee.createIframe(e.preloadUrl,t,null,"main");l.style.display="none",l.luigi.preloading=!0,n.appendChild(l)}preload(e){this.shouldPreload&&setTimeout(()=>{this.preloadViewGroups(this.preloadBatchSize,e)},e),this.shouldPreload=!0}viewGroupLoaded(e){if(e.luigi.preloading){const t=new Date().getTime()-e.luigi.createdAt;let n=1;t<500?n=3:t<1e3&&(n=2),this.preloadBatchSize=n,console.debug("preload batch size: "+this.preloadBatchSize),setTimeout(()=>{e.luigi.preloading=!1},this.preloadBatchSize>2?500:1e3)}}}const sr=new E2;class R2{async getNavigationPath(e,t=""){try{const n=le.getTrimmedUrl(t);if(!e)return console.error("No navigation nodes provided in the configuration."),[{}];let l;if(zn.hasRootNode()&&(l=zn.getRootNode().node),!l){const h=await e;le.isObject(h)?(l=h,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:h},l.children=await this.getChildren(l),zn.setRootNode(l)}const r=n.split("/"),o={...ae.getConfigValue("navigation.globalContext")||{},...l.context||{}},c=await this.buildNode(r,[l],l.children,o),g=c.navigationPath.filter(h=>h.pathSegment).map(h=>h.pathSegment);c.isExistingRoute=!n||r.length===g.length;const d=n.split("/");return c.matchedPath=d.filter((h,p)=>g[p]&&g[p].startsWith(":")||g[p]===h).join("/"),c}catch(n){console.error("Failed to load top navigation nodes.",n)}}async getChildren(e,t){if(!e)return[];let n=[];if(zn.hasChildren(e)){let r=zn.getChildren(e);r&&(n=r.children)}else try{n=await ls.getConfigValueFromObjectAsync(e,"children",t||e.context),n==null&&(n=[]),n=n.map(r=>this.getExpandStructuralPathSegment(r)).map(r=>this.bindChildToParent(r,e))||[]}catch(r){console.error("Could not lazy-load children for node",r)}let l=this.getAccessibleNodes(e,n,t);return zn.setChildren(e,{children:n,filteredChildren:l}),l}async getFilteredChildren(e){return zn.hasChildren(e)?Mt.getChildrenFromCache(e):await Mt.getChildren(e)}getChildrenFromCache(e){let t=zn.getChildren(e);return t?t.filteredChildren:[]}getAccessibleNodes(e,t,n){return t?t.filter(l=>oe.isNodeAccessPermitted(l,e,n)):[]}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},l=(r,a)=>{const o=r.shift();let c={};return r.length?(c.pathSegment=o,a.hideFromNav&&(c.hideFromNav=a.hideFromNav),c.children=[l(r,a)]):(c=n,c.pathSegment=o),c};return l(t,e)}return e}async buildNode(e,t,n,l,r={}){l.parentNavigationContexts||(l.parentNavigationContexts=[]);let a={navigationPath:t,context:l,pathParams:r};if(e.length>0&&n&&n.length>0){const o=e[0],c=this.findMatchingNode(o,n);if(c){t.push(c);let g=oe.applyContext(l,c.context,c.navigationContext);c.pathSegment.startsWith(":")&&(r[c.pathSegment.replace(":","")]=dr.sanitizeParam(o)),g=we.substituteDynamicParamsInObject(g,r);try{this.buildVirtualTree(c,e,r);let d=await this.getChildren(c,g);const h=e.slice(1);a=this.buildNode(h,t,d,g,r)}catch(d){console.error("Error getting nodes children",d)}}}return a}buildVirtualViewUrl(e,t,n){let l="";for(const r in t)r.startsWith("virtualSegment")&&(l+=":"+r+"/");return n?(l+=":virtualSegment_"+n+"/",e+"/"+l):e}buildVirtualTree(e,t,n){const l=e.virtualTree,r=e._virtualTree,a=e._virtualViewUrl||e.viewUrl;if((l||r)&&t[0]){let o=e._virtualPathIndex;if(l&&(o=0,e.keepSelectedForChildren=!0),o>50)return;o++;const g=["_*","virtualTree","parent","children","keepSelectedForChildren","navigationContext"],d=le.removeProperties(e,g);Object.assign(d,{pathSegment:":virtualSegment_"+o,label:":virtualSegment_"+o,viewUrl:le.trimTrailingSlash(this.buildVirtualViewUrl(a,n,o)),_virtualTree:!0,_virtualPathIndex:o,_virtualViewUrl:a});const h=Array.isArray(e.children)&&e.children.length>0?e.children[0]._virtualTree:!1;e.children&&!h&&console.warn(`Found both virtualTree and children nodes defined on a navigation node.
1
+ var Yw=Object.defineProperty;var Qw=(i,e,t)=>e in i?Yw(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Hf=(i,e,t)=>(Qw(i,typeof e!="symbol"?e+"":e,t),t);function We(){}function Zw(i,e){for(const t in e)i[t]=e[t];return i}function Xw(i){return i&&typeof i=="object"&&typeof i.then=="function"}function F_(i){return i()}function Wf(){return Object.create(null)}function Ye(i){i.forEach(F_)}function bi(i){return typeof i=="function"}function At(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Xa;function Xe(i,e){return Xa||(Xa=document.createElement("a")),Xa.href=e,i===Xa.href}function $w(i){return Object.keys(i).length===0}function Mo(i,...e){if(i==null)return We;const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function ol(i){let e;return Mo(i,t=>e=t)(),e}function wi(i,e,t){i.$$.on_destroy.push(Mo(e,t))}function U_(i,e,t,n){if(i){const l=B_(i,e,t,n);return i[0](l)}}function B_(i,e,t,n){return i[1]&&n?Zw(t.ctx.slice(),i[1](n(e))):t.ctx}function H_(i,e,t,n){if(i[2]&&n){const l=i[2](n(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],a=Math.max(e.dirty.length,l.length);for(let o=0;o<a;o+=1)r[o]=e.dirty[o]|l[o];return r}return e.dirty|l}return e.dirty}function W_(i,e,t,n,l,r){if(l){const a=B_(e,t,n,r);i.p(a,l)}}function z_(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function $n(i){return i??""}function q_(i){return i&&bi(i.destroy)?i.destroy:We}function w(i,e){i.appendChild(e)}function A(i,e,t){i.insertBefore(e,t||null)}function L(i){i.parentNode&&i.parentNode.removeChild(i)}function ht(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function S(i){return document.createElement(i)}function xw(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Le(i){return document.createTextNode(i)}function W(){return Le(" ")}function Ce(){return Le("")}function te(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function wt(i){return function(e){return e.preventDefault(),i.call(this,e)}}function Ut(i){return function(e){return e.stopPropagation(),i.call(this,e)}}function f(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function e2(i){return Array.from(i.childNodes)}function Ae(i,e){e=""+e,i.wholeText!==e&&(i.data=e)}function zf(i,e){i.value=e??""}function Vn(i,e,t,n){t===null?i.style.removeProperty(e):i.style.setProperty(e,t,n?"important":"")}function jt(i,e,t){i.classList[t?"add":"remove"](e)}function t2(i,e,{bubbles:t=!1,cancelable:n=!1}={}){const l=document.createEvent("CustomEvent");return l.initCustomEvent(i,t,n,e),l}class hr{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=xw(t.nodeName):this.e=S(t.nodeName),this.t=t,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)A(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(L)}}let zr;function Bi(i){zr=i}function hl(){if(!zr)throw new Error("Function called outside component initialization");return zr}function qn(i){hl().$$.before_update.push(i)}function $t(i){hl().$$.on_mount.push(i)}function jr(i){hl().$$.after_update.push(i)}function Jr(i){hl().$$.on_destroy.push(i)}function Jt(){const i=hl();return(e,t,{cancelable:n=!1}={})=>{const l=i.$$.callbacks[e];if(l){const r=t2(e,t,{cancelable:n});return l.slice().forEach(a=>{a.call(i,r)}),!r.defaultPrevented}return!0}}function Br(i,e){return hl().$$.context.set(i,e),e}function vt(i){return hl().$$.context.get(i)}function Ol(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Wr=[],Je=[],es=[],Ao=[],n2=Promise.resolve();let Eo=!1;function i2(){Eo||(Eo=!0,n2.then(Fo))}function Ro(i){es.push(i)}function mt(i){Ao.push(i)}const To=new Set;let $a=0;function Fo(){const i=zr;do{for(;$a<Wr.length;){const e=Wr[$a];$a++,Bi(e),l2(e.$$)}for(Bi(null),Wr.length=0,$a=0;Je.length;)Je.pop()();for(let e=0;e<es.length;e+=1){const t=es[e];To.has(t)||(To.add(t),t())}es.length=0}while(Wr.length);for(;Ao.length;)Ao.pop()();Eo=!1,To.clear(),Bi(i)}function l2(i){if(i.fragment!==null){i.update(),Ye(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Ro)}}const ts=new Set;let Ml;function ke(){Ml={r:0,c:[],p:Ml}}function Se(){Ml.r||Ye(Ml.c),Ml=Ml.p}function R(i,e){i&&i.i&&(ts.delete(i),i.i(e))}function U(i,e,t,n){if(i&&i.o){if(ts.has(i))return;ts.add(i),Ml.c.push(()=>{ts.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function is(i,e){const t=e.token={};function n(l,r,a,o){if(e.token!==t)return;e.resolved=o;let c=e.ctx;a!==void 0&&(c=c.slice(),c[a]=o);const g=l&&(e.current=l)(c);let d=!1;e.block&&(e.blocks?e.blocks.forEach((h,p)=>{p!==r&&h&&(ke(),U(h,1,1,()=>{e.blocks[p]===h&&(e.blocks[p]=null)}),Se())}):e.block.d(1),g.c(),R(g,1),g.m(e.mount(),e.anchor),d=!0),e.block=g,e.blocks&&(e.blocks[r]=g),d&&Fo()}if(Xw(i)){const l=hl();if(i.then(r=>{Bi(l),n(e.then,1,e.value,r),Bi(null)},r=>{if(Bi(l),n(e.catch,2,e.error,r),Bi(null),!e.hasCatch)throw r}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,i),!0;e.resolved=i}}function G_(i,e,t){const n=e.slice(),{resolved:l}=i;i.current===i.then&&(n[i.value]=l),i.current===i.catch&&(n[i.error]=l),i.block.p(n,t)}const gl=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function bt(i,e,t,n){const l=i.$$.props[e];l!==void 0&&(i.$$.bound[l]=t,n===void 0&&t(i.$$.ctx[l]))}function Ue(i){i&&i.c()}function Me(i,e,t,n){const{fragment:l,after_update:r}=i.$$;l&&l.m(e,t),n||Ro(()=>{const a=i.$$.on_mount.map(F_).filter(bi);i.$$.on_destroy?i.$$.on_destroy.push(...a):Ye(a),i.$$.on_mount=[]}),r.forEach(Ro)}function Fe(i,e){const t=i.$$;t.fragment!==null&&(Ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function r2(i,e){i.$$.dirty[0]===-1&&(Wr.push(i),i2(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Dt(i,e,t,n,l,r,a,o=[-1]){const c=zr;Bi(i);const g=i.$$={fragment:null,ctx:[],props:r,update:We,not_equal:l,bound:Wf(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Wf(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};a&&a(g.root);let d=!1;if(g.ctx=t?t(i,e.props||{},(h,p,...b)=>{const m=b.length?b[0]:p;return g.ctx&&l(g.ctx[h],g.ctx[h]=m)&&(!g.skip_bound&&g.bound[h]&&g.bound[h](m),d&&r2(i,h)),p}):[],g.update(),d=!0,Ye(g.before_update),g.fragment=n?n(g.ctx):!1,e.target){if(e.hydrate){const h=e2(e.target);g.fragment&&g.fragment.l(h),h.forEach(L)}else g.fragment&&g.fragment.c();e.intro&&R(i.$$.fragment),Me(i,e.target,e.anchor,e.customElement),Fo()}Bi(c)}class Vt{$destroy(){Fe(this,1),this.$destroy=We}$on(e,t){if(!bi(t))return We;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const l=n.indexOf(t);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!$w(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}class a2{constructor(){this.handles={},this.keyExistencyTimeout=2e4,this.keyExistencyCheckInterval=50}wrapAsPromise(e){return new Promise(t=>{t(e)})}applyFunctionPromisified(e,t){return e=e.apply(this,t),le.isPromise(e)?e:this.wrapAsPromise(e)}getConfigValueFromObjectAsync(e,t,...n){let l=le.getConfigValueFromObject(e,t);return le.isFunction(l)?this.applyFunctionPromisified(l,n):this.wrapAsPromise(l)}}const ls=new a2;class s2{convertCustomMessageInternalToUser(e){return e.data}convertCustomMessageUserToInternal(e){return{msg:"custom",data:e}}}const rs=new s2;class o2{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&&t.hasOwnProperty("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)){let t=this.getChildren(e).children;for(let n=0;n<t.length;n++)this.deleteNodesRecursively(t[n])}this.dataManagement.delete(e)}}const zn=new o2;let u2=class{constructor(){this.configReadyCallback=function(){},this.initialized=!1,this.USER_SETTINGS_KEY="luigi.preferences.userSettings"}setConfigCallbacks(e){this.configReadyCallback=e}async setConfig(e){this.config=e,window.Luigi._store.update(()=>({config:e})),this._configModificationTimestamp=new Date,this.initialized||(this.initialized=!0,this.configReadyCallback().then(async()=>{q2.luigiAfterInit(),await this.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}))}getConfig(){return this.config}configChanged(...e){const t=dn.optimizeScope(e);t.length>0?t.forEach(n=>{window.Luigi._store.fire(n,{current:window.Luigi._store})}):window.Luigi._store.update(n=>n)}setErrorMessage(e){var t=document.createTextNode(e),n=document.createElement("div");n.setAttribute("class","fd-ui"),n.setAttribute("style","text-align: center;");var l=document.createElement("div");l.setAttribute("class","fd-message-strip fd-message-strip--error"),l.setAttribute("style","max-width: 800px; display: inline-block; margin-top: 40px;"),l.appendChild(t),n.appendChild(l),Hi.getLuigiContainer().appendChild(n)}getConfigValue(e){return le.getConfigValueFromObject(this.getConfig(),e)}getConfigBooleanValue(e){const t=le.getConfigValueFromObject(this.getConfig(),e);return t===!0||t==="true"}getConfigValueAsync(e,...t){return ls.getConfigValueFromObjectAsync(this.getConfig(),e,t)}async executeConfigFnAsync(e,t=!1,...n){const l=this.getConfigValue(e);if(le.isFunction(l))try{return await ls.applyFunctionPromisified(l,n)}catch(r){if(t)return Promise.reject(r)}return Promise.resolve(void 0)}isAuthorizationEnabled(){return pi.isAuthorizationEnabled()}unload(){this.initialized=!1,fn.unload(),On.removeAllEventListeners();const e=Hi.getLuigiContainer();for(;e.firstChild;)e.removeChild(e.lastChild)}async readUserSettings(){const e=await this.getConfigValueAsync("userSettings"),t=e||await this.getConfigValueAsync("settings.userSettings");if(t&&le.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"),l=n||await this.getConfigValueAsync("settings.userSettings");if(l&&le.isFunction(l.storeUserSettings))return l.storeUserSettings(e,t);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(e)),this.configChanged()}reset(){const e=this.getConfig();this.unload(),this.setConfig(e)}clearNavigationCache(){zn.deleteCache();const e=t=>{t&&t.forEach&&t.forEach(n=>{n.titleResolver&&n.titleResolver._cache&&(n.titleResolver._cache=void 0),n.children&&e(n.children)})};e(this.getConfig().navigation.nodes)}setGlobalContext(e,t){this.config&&this.config.navigation&&(this.config.navigation.globalContext=e,t||this.configChanged("navigation"))}getGlobalContext(){var e,t;return((t=(e=this.config)==null?void 0:e.navigation)==null?void 0:t.globalContext)||{}}updateContextValues(e){const t=Ee.getMicrofrontendIframes();t&&t.length>0&&t.forEach(n=>{n.luigi&&Ee.sendMessageToIframe(n,{msg:"luigi.navigate",context:JSON.stringify(Object.assign({},JSON.parse(n.luigi._lastUpdatedMessage.context),e)),nodeParams:n.luigi._lastUpdatedMessage.nodeParams,pathParams:JSON.stringify(Object.assign({},n.luigi.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(n.luigi.currentNode))),internal:Ee.applyCoreStateData(JSON.parse(n.luigi._lastUpdatedMessage.internal))})}),document.querySelector(".wcContainer")&&document.querySelectorAll("[lui_web_component=true]").forEach(l=>{l.context=Object.assign({},l.context,e)})}};const as=new u2;let f2=class{constructor(){}isAuthorizationEnabled(){return!!ae.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&fn.startAuthorization()}logout(){this.isAuthorizationEnabled()&&fn.logout()}async handleAuthEvent(e,t,n,l){const r=await ae.executeConfigFnAsync("auth.events."+e,!1,t,n);let a=r===void 0||!!r;if(a&&l){window.location.href=l;return}return a}get store(){return ae.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:()=>ui.getStorageKey(),getStorageType:()=>ui.getStorageType(),getAuthData:()=>ui.getAuthData(),setAuthData:e=>ui.setAuthData(e),removeAuthData:()=>ui.removeAuthData(),setNewlyAuthorized:()=>ui.setNewlyAuthorized()}}};const K_=new f2,sn={desktopMinWidth:600},c2=[{type:"main",selector:".iframeContainer iframe"},{type:"split-view",selector:".iframeSplitViewCnt iframe"},{type:"modal",selector:".iframeModalCtn._modal iframe"},{type:"drawer",selector:".iframeModalCtn._drawer iframe"},{type:"user-settings",selector:".iframeUserSettingsCtn iframe"}],d2={cssSelector:"[luigi-app-root]"},h2={cssSelector:"[luigi-app-loading-indicator]"};let g2=class{getLuigiContainer(){return this.getCustomLuigiContainer()||this.getDefaultLuigiContainer()}isCustomLuigiContainer(){return this.getLuigiContainer()===this.getCustomLuigiContainer()}getCustomLuigiContainer(){return document.querySelector(d2.cssSelector)}getDefaultLuigiContainer(){return document.querySelector("body")}getShellbar(){return document.getElementsByClassName("lui-shellbar-wrapper")[0]}getShellbarActions(){return document.getElementsByClassName("lui-shellbar_group--actions")[0]}getMicrofrontends(){return Ee.getMicrofrontendsInDom()}getMicrofrontendIframes(){return Ee.getMicrofrontendIframes()}getCurrentMicrofrontendIframe(){return Ee.getCurrentMicrofrontendIframe()}getNavFooterContainer(){return document.getElementsByClassName("lui-side-nav__footer")[0]}};const j_=new g2;class _2{constructor(){this.promises={}}setPromise(e,t){this.promises[e]=t}getPromise(e){return this.promises[e]}}class Xn extends _2{constructor(e){super(),Object.assign(this,e),this.options={preserveView:!1,nodeParams:{},errorSkipNavigation:!1,fromContext:null,fromClosestContext:!1,relative:!1,link:""}}async navigate(e,t,n,l,r){if(this.options.errorSkipNavigation)return this.options.errorSkipNavigation=!1,Promise.reject(new Error("navigation skipped"));this.options.preserveView=t;const a=e[0]!=="/";if(e==="/"&&(n||l||r))return console.warn("Navigation with an absolute path prevented."),Promise.reject(new Error("Navigation with an absolute path prevented."));const o=le.createRemotePromise(),c={msg:"luigi.navigation.open",params:Object.assign(this.options,{link:e,relative:a,modal:n,splitView:l,drawer:r}),remotePromiseId:o.id};return this.sendPostMessageToLuigiCore(c),o}openAsModal(e,t={},n){if(le.isFunction(n)){const l=le.createRemotePromise();l.then(r=>{n(r)}),t.onClosePromiseId=l.id}return this.navigate(e,!0,t)}openAsDrawer(e,t={}){return this.navigate(e,!0,void 0,void 0,t)}openAsSplitView(e,t={}){return this.navigate(e,!0,void 0,t),Luigi.splitView.splitViewHandle}fromContext(e){return this.options.fromContext=e,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this}withParams(e){return e&&Object.assign(this.options.nodeParams,e),this}pathExists(e){if(le.isFunction(Luigi.pathExists))return Luigi.pathExists(e);console.error("Luigi.navigation().pathExists(path) is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}hasBack(){return Luigi.hasBack()}goBack(e){this.sendPostMessageToLuigiCore({msg:"luigi.navigation.back",goBackContext:e&&JSON.stringify(e)})}sendPostMessageToLuigiCore(e){window.postMessage(e,"*")}}class p2{constructor(){}updateTopNavigation(){window.postMessage({msg:"luigi.navigation.update-badge-counters"},"*")}navigate(e,t,n,l,r){return new Xn().navigate(e,t,n,l,r)}openAsModal(e,t,n){return new Xn().openAsModal(e,t,n)}openAsSplitView(e,t={}){if(e==="/"){console.warn("Navigation with an absolute path prevented.");return}return new Xn().openAsSplitView(e,t)}openAsDrawer(e,t){return new Xn().openAsDrawer(e,t)}fromContext(e){return new Xn().fromContext(e)}fromClosestContext(){return new Xn().fromClosestContext()}fromVirtualTreeRoot(){return new Xn().fromVirtualTreeRoot()}withParams(e){return new Xn().withParams(e)}pathExists(e){return new Xn().pathExists(e)}hasBack(){return new Xn().hasBack()}goBack(e){return new Xn().goBack(e)}}const J_=new p2,m2={luigi:{unsavedChangesAlert:{header:"Unsaved changes detected",body:"Unsaved changes will be lost. Do you want to continue?"},confirmationModal:{header:"Confirmation",body:"Are you sure you want to do this?"},button:{dismiss:"No",confirm:"Yes"},requestedRouteNotFound:"Could not find the requested route {route}.",notExactTargetNode:"Could not map the exact target node for the requested route {route}.",navigation:{up:"Up"}}},b2=m2;class v2{constructor(){this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.translationTable=b2,this.listeners={}}_init(){dn.doOnStoreChange(window.Luigi._store,()=>{this._initCustomImplementation()},["settings"])}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(e){e&&(sessionStorage.setItem(this.currentLocaleStorageKey,e),this._notifyLocaleChange(e))}addCurrentLocaleChangeListener(e){if(le.isFunction(e)){const t=le.getRandomId();return this.listeners[t]=e,t}else console.error("Provided locale change listener is not a function.")}removeCurrentLocaleChangeListener(e){e&&this.listeners[e]?delete this.listeners[e]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}_notifyLocaleChange(e){Object.getOwnPropertyNames(this.listeners).forEach(t=>{this.listeners[t](e)}),as.configChanged()}_initCustomImplementation(){this.translationImpl=as.getConfigValue("settings.customTranslationImplementation"),le.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}getTranslation(e,t=void 0,n=void 0){if(!e)return"";if(this.translationImpl){const r=this.translationImpl.getTranslation(e,t,n);if(r!==e)return r}const l=this.findTranslation(e,this.translationTable,t);return l||e}findTranslation(e,t,n){let l=e.split(".");for(let r=0;r<l.length;r++){let a=l[r];if(t.hasOwnProperty(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("{"+dr.escapeKeyForRegexp(n)+"}","gi"),t[n])}),e}}const Y_=new v2;class w2{sendToAll(e){const t=rs.convertCustomMessageUserToInternal(e);Ee.getMicrofrontendsInDom().map(n=>n.container).map(n=>Ee.sendMessageToIframe(n,t))}send(e,t){const n=rs.convertCustomMessageUserToInternal(t);Ee.getMicrofrontendsInDom().filter(l=>l.id===e).map(l=>l.container).map(l=>Ee.sendMessageToIframe(l,n))}}const k2=new w2,ar=[];function S2(i,e){return{subscribe:fr(i,e).subscribe}}function fr(i,e=We){let t;const n=new Set;function l(o){if(At(i,o)&&(i=o,t)){const c=!ar.length;for(const g of n)g[1](),ar.push(g,i);if(c){for(let g=0;g<ar.length;g+=2)ar[g][0](ar[g+1]);ar.length=0}}}function r(o){l(o(i))}function a(o,c=We){const g=[o,c];return n.add(g),n.size===1&&(t=e(l)||We),o(i),()=>{n.delete(g),n.size===0&&(t(),t=null)}}return{set:l,update:r,subscribe:a}}class C2{initial(){this.responsiveNavSetting=ae.getConfigValue("settings.responsiveNavigation");const e=this.responsiveNavSetting==="semiCollapsible"||this.responsiveNavSetting==="Fiori3";JSON.parse(localStorage.getItem(oe.COL_NAV_KEY))!==!1&&e&&(this.isSemiCollapsed=this.getCollapsed()),this.semiCollapsible=!!e;let t=this.isSemiCollapsed===void 0;return this.semiCollapsible&&window.innerWidth!==0&&window.innerWidth<sn.desktopMinWidth?this.isSemiCollapsed=t?!0:this.getCollapsed():this.isSemiCollapsed=t?!1:this.getCollapsed(),this.setCollapsed(this.isSemiCollapsed),this.previousWindowWidth=window.innerWidth,{isSemiCollapsed:this.isSemiCollapsed,semiCollapsible:this.semiCollapsible}}onValueChanged(e){this.valueChangedFns?this.valueChangedFns.push(e):this.valueChangedFns=[e]}onResize(e){const t=window.innerWidth!==0&&window.innerWidth<sn.desktopMinWidth&&this.previousWindowWidth>=sn.desktopMinWidth,n=window.innerWidth!==0&&window.innerWidth>sn.desktopMinWidth&&this.previousWindowWidth>=sn.desktopMinWidth;return t&&this.setCollapsed(!0,!1),!this.isStoredCollapsed()&&n&&this.setCollapsed(!1,!1),e=this.closePopupMenu(e),{isSemiCollapsed:this.isSemiCollapsed,selectedCategory:e}}setCollapsed(e,t=!0){document.body.classList.remove("semiCollapsed"),e&&document.body.classList.add("semiCollapsed"),this.isSemiCollapsed=e,t&&localStorage.setItem(oe.COL_NAV_KEY,e),this.valueChangedFns instanceof Array&&this.valueChangedFns.forEach(n=>n({isSemiCollapsed:this.isSemiCollapsed}))}isStoredCollapsed(){return JSON.parse(localStorage.getItem(oe.COL_NAV_KEY))}getCollapsed(){return this.isStoredCollapsed()?!0:this.isSemiCollapsed}closePopupMenu(e){var t;return e&&(e=null,(t=document.getElementsByClassName("fd-app__sidebar")[0])==null||t.classList.remove("isBlocked")),e}buttonClicked(e){return this.closePopupMenu(),this.getCollapsed()?this.setCollapsed(!1):(this.setCollapsed(!0),document.getElementsByClassName("lui-fd-side-nav-wrapper")[0]&&(document.getElementsByClassName("lui-fd-side-nav-wrapper")[0].setAttribute("style","overflow-y:hidden;"),window.setTimeout(function(){document.getElementsByClassName("lui-fd-side-nav-wrapper")[0].setAttribute("style","overflow-y:auto;")}))),this.isSemiCollapsed}}const _i=new C2;let y2=class{constructor(){this.documentTitle=fr()}hideAppLoadingIndicator(){const e=document.querySelector(h2.cssSelector);e&&(e.classList.add("hidden"),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},500))}showAlert(e){if(le.isFunction(Luigi.showAlert))return Luigi.showAlert(e);console.error("Luigi.ux().showAlert() is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}showConfirmationModal(e){if(le.isFunction(Luigi.showConfirmationModal))return Luigi.showConfirmationModal(e);console.error("Luigi.ux().showConfirmationModal() is only available inside your configuration, after the configuration was initialized with Luigi.setConfig().")}setDocumentTitle(e){this.documentTitle.set(e),Luigi.configChanged("settings.header")}getDocumentTitle(){return ol(this.documentTitle)}collapseLeftSideNav(e){_i.setCollapsed(e)}openUserSettings(){Luigi.openUserSettings()}closeUserSettings(){Luigi.closeUserSettings()}removeBackdrop(){new Xn().sendPostMessageToLuigiCore({msg:"luigi.remove-backdrop"})}getDirtyStatus(){return Luigi.getDirtyStatus()}getCurrentTheme(){return Luigi.theming().getCurrentTheme()}};const Q_=new y2;let P2=class{openSearchField(){Luigi.openSearchField()}closeSearchField(){Luigi.closeSearchField()}clearSearchField(){Luigi.clearSearchField()}showSearchResult(e){Luigi.showSearchResult(e)}closeSearchResult(){Luigi.closeSearchResult()}getSearchString(){return Luigi.getGlobalSearchString()}setSearchString(e){Luigi.setGlobalSearchString(e)}setSearchInputPlaceholder(e){Luigi.setSearchInputPlaceholder(e)}};const Z_=new P2;let N2=class{constructor(){this.currentTheme}async getAvailableThemes(){return await ae.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(e){this.currentTheme=e,window.Luigi.__cssVars=void 0}async getThemeObject(e){const t=await this.getAvailableThemes();return t&&t.find(n=>n.id===e)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.currentTheme)return this.currentTheme;const e=ae.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!!ae.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const e=ae.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 l=getComputedStyle(document.documentElement).getPropertyValue("--"+n);l&&(window.Luigi.__cssVars[n]=l)})}catch(t){le.isFunction(ae.getConfigValue("settings.theming.variables.errorHandling"))?ae.getConfigValue("settings.theming.variables.errorHandling")(t):console.error("CSS variables file error: ",t)}else ae.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=()=>{const t=ae.getConfigValue("settings.theming");t&&t.nodeViewURLDecorator&&t.nodeViewURLDecorator.queryStringParameter&&Gr.add({type:"queryString",uid:"theming",key:t.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const n=this.getCurrentTheme(),l=t.nodeViewURLDecorator.queryStringParameter.value;return l?l(n):n}}),t&&t.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")};dn.doOnStoreChange(window.Luigi._store,()=>{e()},["settings.theming"])}};const X_=new N2;let T2=class{constructor(){this.featureToggleList=fr([])}setFeatureToggle(e,t=!1){this.isValid(e)&&(e.startsWith("!")&&!t||this.isDuplicatedOrDisabled(e)||ol(this.featureToggleList).push(e))}unsetFeatureToggle(e){if(!this.isValid(e))return;const t=ol(this.featureToggleList).indexOf(e);if(t===-1){console.warn("Feature toggle name is not in the list.");return}ol(this.featureToggleList).splice(t,1)}getActiveFeatureToggleList(){return[...ol(this.featureToggleList)].filter(e=>!e.startsWith("!"))}isValid(e){return le.isString(e)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(e){return ol(this.featureToggleList).includes(e)?(console.warn("Feature toggle name already exists"),!0):ol(this.featureToggleList).includes(`!${e}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}};const $_=new T2;let I2=class{constructor(){}getSearchParams(){const e={},t=new URL(location);if(ae.getConfigValue("routing.useHashRouting"))for(const[n,l]of new URLSearchParams(t.hash.split("?")[1]))e[n]=l;else for(const[n,l]of t.searchParams.entries())e[n]=l;return e}addSearchParams(e,t){if(!le.isObject(e)){console.log("Params argument must be an object");return}const n=new URL(location);ae.getConfigValue("routing.useHashRouting")?n.hash=we.addParamsOnHashRouting(e,n.hash):we.modifySearchParams(e,n.searchParams),this.handleBrowserHistory(t,n),ae.configChanged()}addNodeParams(e,t){if(!le.isObject(e)){console.log("Params argument must be an object");return}const n=we.getContentViewParamPrefix(),l=new URL(location);ae.getConfigValue("routing.useHashRouting")?l.hash=we.addParamsOnHashRouting(e,l.hash,n):we.modifySearchParams(e,l.searchParams,n),this.handleBrowserHistory(t,l),ae.configChanged()}sanitizeUrl(e){return new URL(location).origin===new URL(e).origin?e:void 0}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)}getAnchor(){const{hash:e}=new URL(location);return ae.getConfigValue("routing.useHashRouting")&&e.split("#").length===2?"":e.split("#").pop()}setAnchor(e){if(ae.getConfigValue("routing.useHashRouting")){const{hash:t}=new URL(location),n=t.split("#"),r=n.length>2?n.slice(0,-1):n;window.location.hash=[...r,e].join("#")}else window.location.hash=e}};const x_=new I2,ae=as,pi=K_,Hi=j_,ep=J_,yt=Y_,Yr=Q_,L2=Z_,Do=X_,Uo=$_,ul=x_;window.Luigi=as;window.Luigi.auth=()=>K_;window.Luigi.elements=()=>j_;window.Luigi.navigation=()=>J_;window.Luigi.i18n=()=>Y_;window.Luigi.customMessages=()=>k2;window.Luigi.ux=()=>Q_;window.Luigi.globalSearch=()=>Z_;window.Luigi.theming=()=>X_;window.Luigi.featureToggles=()=>$_;window.Luigi.routing=()=>x_;class A2{constructor(){this.iframeNavFallbackTimeout=2e3,this.timeoutHandle}getActiveIframe(e){return[...e.children].filter(n=>n.tagName==="IFRAME").find(le.isElementVisible)}setActiveIframeToPrevious(e){const t=Ee.getMainIframes(),n=this.getPreservedViewsInDom(t);if(n.length===0)return;const l=this.getActiveIframe(e);Ee.hideElementChildren(e),l&&e.removeChild(l),n[0].pv=void 0,n[0].style.display="block"}removeInactiveIframes(e){Array.from(e.children).forEach(n=>{!le.isElementVisible(n)&&!n.vg&&n.tagName==="IFRAME"&&e.removeChild(n)})}hasIsolatedView(e,t,n){return e||n&&e!==!1&&!t}getPreservedViewsInDom(e){return e.filter(t=>t.pv)}canCache(e){const t=oe.getViewGroupSettings(e);return t&&t.preloadUrl}notifyInactiveIframes(){const e={msg:"luigi-client.inactive-microfrontend",context:JSON.stringify({}),nodeParams:JSON.stringify({}),pathParams:JSON.stringify({}),internal:JSON.stringify({currentLocale:yt.getCurrentLocale()})};Ee.sendMessageToVisibleIframes(e)}switchActiveIframe(e,t,n){const l=this.getActiveIframe(e);if(l!==t){let r=!1;Array.from(e.children).forEach(o=>{if(o===l)if(n)e.removeChild(o);else{const c=oe.getViewGroupSettings(o.vg);if(c&&this.notifyInactiveIframes(),o.style.display="none",c.preloadUrl){const g={msg:"luigi.navigate",viewUrl:c.preloadUrl,context:JSON.stringify({}),nodeParams:JSON.stringify({}),pathParams:JSON.stringify({}),internal:JSON.stringify({currentLocale:yt.getCurrentLocale()})};Ee.sendMessageToIframe(o,g)}}o===t&&(r=!0)}),t&&(t.style.display="block",r||e.insertBefore(t,e.firstChild))}return t}setOkResponseHandler(e,t,n){this.timeoutHandle=setTimeout(async()=>{e.navigateOk?e.navigateOk=void 0:(Ee.removeIframe(e.iframe,n),e.iframe=void 0,e.isFallbackFrame=!0,console.info("navigate: luigi-client did not respond, using fallback by replacing iframe"),await this.navigateIframe(e,t,n))},this.iframeNavFallbackTimeout)}checkIframe(e,t,n,l,r){this.timeoutHandle=setTimeout(()=>{t.get().showLoadingIndicator&&(e.viewUrl?(n=e.viewUrl,t.set({viewUrl:n}),this.iframeNavFallbackTimeout=0,this.setOkResponseHandler(l,t,r)):oe.handleUnresponsiveClient(e))},e.timeout)}initHandshakeFailed(e){if(!(e&&e.iframe&&e.iframe.luigi))return!0;const t=e.iframe.luigi.clientVersion;return e.iframe.luigi.initOk===void 0?!0:!t||le.semverCompare("1.1.1",t)!==-1?!1:!e.iframe.luigi.initOk}async navigateIframe(e,t,n){clearTimeout(this.timeoutHandle);const l=t.get();let r=l.viewUrl;r&&(r=we.substituteViewUrl(r,l));const a=Ee.isSameViewGroup(e,t),o=this.hasIsolatedView(l.previousNodeValues.isolateView,a,e.isolateAllViews),c=this.hasIsolatedView(l.isolateView,a,e.isolateAllViews),g=Ee.canReuseIframe(e,t);let d=this.getActiveIframe(n);const h=Ee.getMainIframes(),p=this.getPreservedViewsInDom(h);let b,m=!1;if(p.length>0&&(b=p.shift(),b===d&&(m=!0,d=void 0,e.iframe=void 0)),!m&&!t.get().isNavigateBack){d&&o&&(d=this.switchActiveIframe(n,void 0,!0)),d&&c&&(d=this.switchActiveIframe(n,void 0,!d.vg));let v;if(!c&&l.viewGroup){const y=Ee.getMainIframes().filter(P=>P.vg===l.viewGroup);y.length>0&&(v=y[0],d=this.switchActiveIframe(n,v,d&&!d.vg))}d&&!v&&(d.vg?d=this.switchActiveIframe(n,void 0,!1):g||(d=this.switchActiveIframe(n,void 0,!0))),e.iframe=d}if(!e.iframe||this.initHandshakeFailed(e)){if(e.iframe&&n.removeChild(e.iframe),m?(this.notifyInactiveIframes(),Ee.hideElementChildren(n)):Ee.removeElementChildren(n),l.viewUrl){le.getConfigValueFromObject(l,"currentNode.loadingIndicator.enabled")!==!1?t.set({showLoadingIndicator:!0}):t.set({showLoadingIndicator:!1}),e.navigateOk=void 0;const v=l.viewGroup&&!c&&this.canCache(l.viewGroup);e.iframe=Ee.createIframe(r,v?l.viewGroup:void 0,t.get().currentNode,"main",l),n.insertBefore(e.iframe,n.firstChild),e.builderCompatibilityMode?e.iframe.addEventListener("load",()=>{e.iframe._ready=!0;const y=["init",JSON.stringify(l.context)];Ee.sendMessageToIframe(e.iframe,y)}):e.iframe.addEventListener("load",()=>{e.iframe._ready=!0});const C=l.currentNode.pageErrorHandler;C?this.checkIframe(C,t,r,e,n):e.defaultPageErrorHandler&&this.checkIframe(e.defaultPageErrorHandler,t,r,e,n)}}else{t.set({showLoadingIndicator:!1});const v=t.get().goBackContext;e.iframe.style.display="block",e.iframe.luigi.nextViewUrl=r,e.iframe.luigi.nextClientPermissions=t.get().currentNode.clientPermissions,e.iframe.vg=this.canCache(l.viewGroup)?l.viewGroup:void 0,e.iframe.luigi.currentNode=l.currentNode;const C=await t.prepareInternalData(e),y={msg:"luigi.navigate",viewUrl:r,context:JSON.stringify(Object.assign({},l.context,{goBackContext:v})),nodeParams:JSON.stringify(Object.assign({},l.nodeParams)),pathParams:JSON.stringify(Object.assign({},l.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(e.iframe.luigi.currentNode))),internal:JSON.stringify(C)};l.isNavigationSyncEnabled?(Ee.getVisibleIframes().forEach(T=>{T!==e.iframe&&(T.userSettingsGroup?Luigi.readUserSettings().then(E=>{Ee.sendMessageToIframe(T,{msg:"luigi.navigate",context:{userSettingsData:E[T.userSettingsGroup]},internal:Ee.applyCoreStateData(T.luigi._lastUpdatedMessage.internal)})}):Ee.sendMessageToIframe(T,{msg:"luigi.navigate",context:T.luigi._lastUpdatedMessage.context,nodeParams:T.luigi._lastUpdatedMessage.nodeParams,pathParams:JSON.stringify(Object.assign({},T.luigi.pathParams)),searchParams:JSON.stringify(Object.assign({},we.prepareSearchParamsForClient(e.iframe.luigi.currentNode))),internal:Ee.applyCoreStateData(T.luigi._lastUpdatedMessage.internal)}))}),Ee.sendMessageToIframe(e.iframe,y),this.setOkResponseHandler(e,t,n)):t.set({isNavigationSyncEnabled:!0}),t.set({goBackContext:void 0,isNavigateBack:!1})}}}const oi=new A2;class E2{constructor(){this.preloadBatchSize=1,this.shouldPreload=!1}preloadViewGroups(e=3,t){if(ae.getConfigValue("navigation.preloadViewGroups")===!1)return;const l=oe.getAllViewGroupSettings();if(!l)return;const r=Ee.getIframeContainer(),a=Ee.getMainIframes(),o=new Date().getTime();if(a.filter(h=>h.luigi&&h.luigi.preloading&&o-h.luigi.createdAt<3e4).length>0){console.debug("skipping view group preloading (busy)");return}const g=a.map(h=>h.vg).filter(Boolean),d=Object.entries(l).filter(([h,p])=>!g.includes(h)).filter(([h,p])=>p&&p.preloadUrl);t&&d.forEach(([h,p])=>{p.loadOnStartup&&this.preloadIframeOnBackground(p,h,r)}),!t&&d.filter((h,p)=>p<e).forEach(([h,p])=>{console.debug("preloading view group "+h+" - "+p.preloadUrl),this.preloadIframeOnBackground(p,h,r)})}preloadIframeOnBackground(e,t,n){const l=Ee.createIframe(e.preloadUrl,t,null,"main");l.style.display="none",l.luigi.preloading=!0,n.appendChild(l)}preload(e){this.shouldPreload&&setTimeout(()=>{this.preloadViewGroups(this.preloadBatchSize,e)},e),this.shouldPreload=!0}viewGroupLoaded(e){if(e.luigi.preloading){const t=new Date().getTime()-e.luigi.createdAt;let n=1;t<500?n=3:t<1e3&&(n=2),this.preloadBatchSize=n,console.debug("preload batch size: "+this.preloadBatchSize),setTimeout(()=>{e.luigi.preloading=!1},this.preloadBatchSize>2?500:1e3)}}}const sr=new E2;class R2{async getNavigationPath(e,t=""){try{const n=le.getTrimmedUrl(t);if(!e)return console.error("No navigation nodes provided in the configuration."),[{}];let l;if(zn.hasRootNode()&&(l=zn.getRootNode().node),!l){const h=await e;le.isObject(h)?(l=h,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:h},l.children=await this.getChildren(l),zn.setRootNode(l)}const r=n.split("/"),o={...ae.getConfigValue("navigation.globalContext")||{},...l.context||{}},c=await this.buildNode(r,[l],l.children,o),g=c.navigationPath.filter(h=>h.pathSegment).map(h=>h.pathSegment);c.isExistingRoute=!n||r.length===g.length;const d=n.split("/");return c.matchedPath=d.filter((h,p)=>g[p]&&g[p].startsWith(":")||g[p]===h).join("/"),c}catch(n){console.error("Failed to load top navigation nodes.",n)}}async getChildren(e,t){if(!e)return[];let n=[];if(zn.hasChildren(e)){let r=zn.getChildren(e);r&&(n=r.children)}else try{n=await ls.getConfigValueFromObjectAsync(e,"children",t||e.context),n==null&&(n=[]),n=n.map(r=>this.getExpandStructuralPathSegment(r)).map(r=>this.bindChildToParent(r,e))||[]}catch(r){console.error("Could not lazy-load children for node",r)}let l=this.getAccessibleNodes(e,n,t);return zn.setChildren(e,{children:n,filteredChildren:l}),l}async getFilteredChildren(e){return zn.hasChildren(e)?Mt.getChildrenFromCache(e):await Mt.getChildren(e)}getChildrenFromCache(e){let t=zn.getChildren(e);return t?t.filteredChildren:[]}getAccessibleNodes(e,t,n){return t?t.filter(l=>oe.isNodeAccessPermitted(l,e,n)):[]}bindChildToParent(e,t){return t&&t.pathSegment&&(e.parent=t),e}getExpandStructuralPathSegment(e){if(e&&e.pathSegment&&e.pathSegment.indexOf("/")!==-1){const t=e.pathSegment.split("/"),n={...e},l=(r,a)=>{const o=r.shift();let c={};return r.length?(c.pathSegment=o,a.hideFromNav&&(c.hideFromNav=a.hideFromNav),c.children=[l(r,a)]):(c=n,c.pathSegment=o),c};return l(t,e)}return e}async buildNode(e,t,n,l,r={}){l.parentNavigationContexts||(l.parentNavigationContexts=[]);let a={navigationPath:t,context:l,pathParams:r};if(e.length>0&&n&&n.length>0){const o=e[0],c=this.findMatchingNode(o,n);if(c){t.push(c);let g=oe.applyContext(l,c.context,c.navigationContext);c.pathSegment.startsWith(":")&&(r[c.pathSegment.replace(":","")]=dr.sanitizeParam(o)),g=we.substituteDynamicParamsInObject(g,r);try{this.buildVirtualTree(c,e,r);let d=await this.getChildren(c,g);const h=e.slice(1);a=this.buildNode(h,t,d,g,r)}catch(d){console.error("Error getting nodes children",d)}}}return a}buildVirtualViewUrl(e,t,n){let l="";for(const r in t)r.startsWith("virtualSegment")&&(l+=":"+r+"/");return n?(l+=":virtualSegment_"+n+"/",e+"/"+l):e}buildVirtualTree(e,t,n){const l=e.virtualTree,r=e._virtualTree,a=e._virtualViewUrl||e.viewUrl;if((l||r)&&t[0]){let o=e._virtualPathIndex;if(l&&(o=0,e.keepSelectedForChildren=!0),o>50)return;o++;const g=["_*","virtualTree","parent","children","keepSelectedForChildren","navigationContext"],d=le.removeProperties(e,g);Object.assign(d,{pathSegment:":virtualSegment_"+o,label:":virtualSegment_"+o,viewUrl:le.trimTrailingSlash(this.buildVirtualViewUrl(a,n,o)),_virtualTree:!0,_virtualPathIndex:o,_virtualViewUrl:a});const h=Array.isArray(e.children)&&e.children.length>0?e.children[0]._virtualTree:!1;e.children&&!h&&console.warn(`Found both virtualTree and children nodes defined on a navigation node.
2
2
  Children nodes are redundant and ignored when virtualTree is enabled.
3
3
  Please refer to documentation`),e.children=[d]}}findMatchingNode(e,t){let n=null;const l=t.filter(a=>!!a.pathSegment).length,r=t.filter(a=>a.pathSegment&&a.pathSegment.startsWith(":")).length;return e=e.includes("#")?e.split("#").shift():e,l>1&&(r===1&&(console.warn(`Invalid node setup detected.
4
4
  Static and dynamic nodes cannot be used together on the same level. Static node gets cleaned up.