@luigi-project/core-modular 0.0.4-dev.202603260051 → 0.0.4-dev.202603270053
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 +3 -3
- package/luigi.js.map +1 -1
- package/package.json +1 -1
package/luigi.js
CHANGED
|
@@ -17,12 +17,12 @@ __p += '`),ee&&(L+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+L+`return __p
|
|
20
|
-
}`;var Y=Il(function(){return ne(g,F+"return "+L).apply(r,v)});if(Y.source=L,Ca(Y))throw Y;return Y}function Dv(e){return ie(e).toLowerCase()}function Mv(e){return ie(e).toUpperCase()}function Fv(e,t,s){if(e=ie(e),e&&(s||t===r))return Fo(e);if(!e||!(t=rt(t)))return e;var o=yt(e),f=yt(t),g=ko(o,f),v=Wo(o,f)+1;return an(o,g,v).join("")}function kv(e,t,s){if(e=ie(e),e&&(s||t===r))return e.slice(0,Vo(e)+1);if(!e||!(t=rt(t)))return e;var o=yt(e),f=Wo(o,yt(t))+1;return an(o,0,f).join("")}function Wv(e,t,s){if(e=ie(e),e&&(s||t===r))return e.replace(Cs,"");if(!e||!(t=rt(t)))return e;var o=yt(e),f=ko(o,yt(t));return an(o,f).join("")}function Hv(e,t){var s=Ce,o=Te;if(he(t)){var f="separator"in t?t.separator:f;s="length"in t?K(t.length):s,o="omission"in t?rt(t.omission):o}e=ie(e);var g=e.length;if(Qn(e)){var v=yt(e);g=v.length}if(s>=g)return e;var m=s-qn(o);if(m<1)return o;var w=v?an(v,0,m).join(""):e.slice(0,m);if(f===r)return w+o;if(v&&(m+=w.length-m),Ta(f)){if(e.slice(m).search(f)){var R,b=w;for(f.global||(f=ks(f.source,ie(so.exec(f))+"g")),f.lastIndex=0;R=f.exec(b);)var L=R.index;w=w.slice(0,L===r?m:L)}}else if(e.indexOf(rt(f),m)!=m){var U=w.lastIndexOf(f);U>-1&&(w=w.slice(0,U))}return w+o}function Vv(e){return e=ie(e),e&&Jc.test(e)?e.replace(no,vh):e}var Bv=jn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ra=xu("toUpperCase");function Pl(e,t,s){return e=ie(e),t=s?r:t,t===r?hh(e)?wh(e):rh(e):e.match(t)||[]}var Il=X(function(e,t){try{return tt(e,r,t)}catch(s){return Ca(s)?s:new G(s)}}),Gv=Qt(function(e,t){return ct(t,function(s){s=Ut(s),Bt(e,s,wa(e[s],e))}),e});function Qv(e){var t=e==null?0:e.length,s=H();return e=t?ce(e,function(o){if(typeof o[1]!="function")throw new ft(l);return[s(o[0]),o[1]]}):[],X(function(o){for(var f=-1;++f<t;){var g=e[f];if(tt(g[0],this,o))return tt(g[1],this,o)}})}function qv(e){return vg(gt(e,P))}function ba(e){return function(){return e}}function zv(e,t){return e==null||e!==e?t:e}var Kv=Nu(),Yv=Nu(!0);function Ye(e){return e}function Pa(e){return uu(typeof e=="function"?e:gt(e,P))}function Xv(e){return cu(gt(e,P))}function Zv(e,t){return fu(e,gt(t,P))}var Jv=X(function(e,t){return function(s){return Dr(s,e,t)}}),jv=X(function(e,t){return function(s){return Dr(e,s,t)}});function Ia(e,t,s){var o=Ae(t),f=Ii(t,o);s==null&&!(he(t)&&(f.length||!o.length))&&(s=t,t=e,e=this,f=Ii(t,Ae(t)));var g=!(he(s)&&"chain"in s)||!!s.chain,v=zt(e);return ct(f,function(m){var w=t[m];e[m]=w,v&&(e.prototype[m]=function(){var R=this.__chain__;if(g||R){var b=e(this.__wrapped__),L=b.__actions__=qe(this.__actions__);return L.push({func:w,args:arguments,thisArg:e}),b.__chain__=R,b}return w.apply(e,jt([this.value()],arguments))})}),e}function em(){return Pe._===this&&(Pe._=Rh),this}function xa(){}function tm(e){return e=K(e),X(function(t){return hu(t,e)})}var nm=oa(ce),rm=oa(Oo),im=oa(Ns);function xl(e){return da(e)?Os(Ut(e)):$g(e)}function sm(e){return function(t){return e==null?r:bn(e,t)}}var am=$u(),om=$u(!0);function La(){return[]}function Na(){return!1}function um(){return{}}function lm(){return""}function cm(){return!0}function fm(e,t){if(e=K(e),e<1||e>et)return[];var s=Qe,o=Ne(e,Qe);t=H(t),e-=Qe;for(var f=Ds(o,t);++s<e;)t(s);return f}function hm(e){return z(e)?ce(e,Ut):it(e)?[e]:qe(Xu(ie(e)))}function gm(e){var t=++yh;return ie(e)+t}var dm=Ui(function(e,t){return e+t},0),pm=ua("ceil"),_m=Ui(function(e,t){return e/t},1),vm=ua("floor");function mm(e){return e&&e.length?Pi(e,Ye,zs):r}function Sm(e,t){return e&&e.length?Pi(e,H(t,2),zs):r}function wm(e){return Do(e,Ye)}function Em(e,t){return Do(e,H(t,2))}function Cm(e){return e&&e.length?Pi(e,Ye,Zs):r}function Tm(e,t){return e&&e.length?Pi(e,H(t,2),Zs):r}var ym=Ui(function(e,t){return e*t},1),Am=ua("round"),Rm=Ui(function(e,t){return e-t},0);function bm(e){return e&&e.length?Us(e,Ye):0}function Pm(e,t){return e&&e.length?Us(e,H(t,2)):0}return h.after=Xp,h.ary=ol,h.assign=M_,h.assignIn=El,h.assignInWith=Ki,h.assignWith=F_,h.at=k_,h.before=ul,h.bind=wa,h.bindAll=Gv,h.bindKey=ll,h.castArray=u_,h.chain=il,h.chunk=vd,h.compact=md,h.concat=Sd,h.cond=Qv,h.conforms=qv,h.constant=ba,h.countBy=bp,h.create=W_,h.curry=cl,h.curryRight=fl,h.debounce=hl,h.defaults=H_,h.defaultsDeep=V_,h.defer=Zp,h.delay=Jp,h.difference=wd,h.differenceBy=Ed,h.differenceWith=Cd,h.drop=Td,h.dropRight=yd,h.dropRightWhile=Ad,h.dropWhile=Rd,h.fill=bd,h.filter=Ip,h.flatMap=Np,h.flatMapDeep=Op,h.flatMapDepth=$p,h.flatten=el,h.flattenDeep=Pd,h.flattenDepth=Id,h.flip=jp,h.flow=Kv,h.flowRight=Yv,h.fromPairs=xd,h.functions=Y_,h.functionsIn=X_,h.groupBy=Up,h.initial=Nd,h.intersection=Od,h.intersectionBy=$d,h.intersectionWith=Ud,h.invert=J_,h.invertBy=j_,h.invokeMap=Mp,h.iteratee=Pa,h.keyBy=Fp,h.keys=Ae,h.keysIn=Ke,h.map=Vi,h.mapKeys=tv,h.mapValues=nv,h.matches=Xv,h.matchesProperty=Zv,h.memoize=Gi,h.merge=rv,h.mergeWith=Cl,h.method=Jv,h.methodOf=jv,h.mixin=Ia,h.negate=Qi,h.nthArg=tm,h.omit=iv,h.omitBy=sv,h.once=e_,h.orderBy=kp,h.over=nm,h.overArgs=t_,h.overEvery=rm,h.overSome=im,h.partial=Ea,h.partialRight=gl,h.partition=Wp,h.pick=av,h.pickBy=Tl,h.property=xl,h.propertyOf=sm,h.pull=kd,h.pullAll=nl,h.pullAllBy=Wd,h.pullAllWith=Hd,h.pullAt=Vd,h.range=am,h.rangeRight=om,h.rearg=n_,h.reject=Bp,h.remove=Bd,h.rest=r_,h.reverse=ma,h.sampleSize=Qp,h.set=uv,h.setWith=lv,h.shuffle=qp,h.slice=Gd,h.sortBy=Yp,h.sortedUniq=Zd,h.sortedUniqBy=Jd,h.split=Nv,h.spread=i_,h.tail=jd,h.take=ep,h.takeRight=tp,h.takeRightWhile=np,h.takeWhile=rp,h.tap=mp,h.throttle=s_,h.thru=Hi,h.toArray=ml,h.toPairs=yl,h.toPairsIn=Al,h.toPath=hm,h.toPlainObject=wl,h.transform=cv,h.unary=a_,h.union=ip,h.unionBy=sp,h.unionWith=ap,h.uniq=op,h.uniqBy=up,h.uniqWith=lp,h.unset=fv,h.unzip=Sa,h.unzipWith=rl,h.update=hv,h.updateWith=gv,h.values=nr,h.valuesIn=dv,h.without=cp,h.words=Pl,h.wrap=o_,h.xor=fp,h.xorBy=hp,h.xorWith=gp,h.zip=dp,h.zipObject=pp,h.zipObjectDeep=_p,h.zipWith=vp,h.entries=yl,h.entriesIn=Al,h.extend=El,h.extendWith=Ki,Ia(h,h),h.add=dm,h.attempt=Il,h.camelCase=mv,h.capitalize=Rl,h.ceil=pm,h.clamp=pv,h.clone=l_,h.cloneDeep=f_,h.cloneDeepWith=h_,h.cloneWith=c_,h.conformsTo=g_,h.deburr=bl,h.defaultTo=zv,h.divide=_m,h.endsWith=Sv,h.eq=Rt,h.escape=wv,h.escapeRegExp=Ev,h.every=Pp,h.find=xp,h.findIndex=Ju,h.findKey=B_,h.findLast=Lp,h.findLastIndex=ju,h.findLastKey=G_,h.floor=vm,h.forEach=sl,h.forEachRight=al,h.forIn=Q_,h.forInRight=q_,h.forOwn=z_,h.forOwnRight=K_,h.get=ya,h.gt=d_,h.gte=p_,h.has=Z_,h.hasIn=Aa,h.head=tl,h.identity=Ye,h.includes=Dp,h.indexOf=Ld,h.inRange=_v,h.invoke=ev,h.isArguments=xn,h.isArray=z,h.isArrayBuffer=__,h.isArrayLike=ze,h.isArrayLikeObject=pe,h.isBoolean=v_,h.isBuffer=on,h.isDate=m_,h.isElement=S_,h.isEmpty=w_,h.isEqual=E_,h.isEqualWith=C_,h.isError=Ca,h.isFinite=T_,h.isFunction=zt,h.isInteger=dl,h.isLength=qi,h.isMap=pl,h.isMatch=y_,h.isMatchWith=A_,h.isNaN=R_,h.isNative=b_,h.isNil=I_,h.isNull=P_,h.isNumber=_l,h.isObject=he,h.isObjectLike=de,h.isPlainObject=Vr,h.isRegExp=Ta,h.isSafeInteger=x_,h.isSet=vl,h.isString=zi,h.isSymbol=it,h.isTypedArray=tr,h.isUndefined=L_,h.isWeakMap=N_,h.isWeakSet=O_,h.join=Dd,h.kebabCase=Cv,h.last=pt,h.lastIndexOf=Md,h.lowerCase=Tv,h.lowerFirst=yv,h.lt=$_,h.lte=U_,h.max=mm,h.maxBy=Sm,h.mean=wm,h.meanBy=Em,h.min=Cm,h.minBy=Tm,h.stubArray=La,h.stubFalse=Na,h.stubObject=um,h.stubString=lm,h.stubTrue=cm,h.multiply=ym,h.nth=Fd,h.noConflict=em,h.noop=xa,h.now=Bi,h.pad=Av,h.padEnd=Rv,h.padStart=bv,h.parseInt=Pv,h.random=vv,h.reduce=Hp,h.reduceRight=Vp,h.repeat=Iv,h.replace=xv,h.result=ov,h.round=Am,h.runInContext=S,h.sample=Gp,h.size=zp,h.snakeCase=Lv,h.some=Kp,h.sortedIndex=Qd,h.sortedIndexBy=qd,h.sortedIndexOf=zd,h.sortedLastIndex=Kd,h.sortedLastIndexBy=Yd,h.sortedLastIndexOf=Xd,h.startCase=Ov,h.startsWith=$v,h.subtract=Rm,h.sum=bm,h.sumBy=Pm,h.template=Uv,h.times=fm,h.toFinite=Kt,h.toInteger=K,h.toLength=Sl,h.toLower=Dv,h.toNumber=_t,h.toSafeInteger=D_,h.toString=ie,h.toUpper=Mv,h.trim=Fv,h.trimEnd=kv,h.trimStart=Wv,h.truncate=Hv,h.unescape=Vv,h.uniqueId=gm,h.upperCase=Bv,h.upperFirst=Ra,h.each=sl,h.eachRight=al,h.first=tl,Ia(h,(function(){var e={};return Ot(h,function(t,s){re.call(h.prototype,s)||(e[s]=t)}),e})(),{chain:!1}),h.VERSION=a,ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){h[e].placeholder=h}),ct(["drop","take"],function(e,t){j.prototype[e]=function(s){s=s===r?1:we(K(s),0);var o=this.__filtered__&&!t?new j(this):this.clone();return o.__filtered__?o.__takeCount__=Ne(s,o.__takeCount__):o.__views__.push({size:Ne(s,Qe),type:e+(o.__dir__<0?"Right":"")}),o},j.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ct(["filter","map","takeWhile"],function(e,t){var s=t+1,o=s==ut||s==En;j.prototype[e]=function(f){var g=this.clone();return g.__iteratees__.push({iteratee:H(f,3),type:s}),g.__filtered__=g.__filtered__||o,g}}),ct(["head","last"],function(e,t){var s="take"+(t?"Right":"");j.prototype[e]=function(){return this[s](1).value()[0]}}),ct(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");j.prototype[e]=function(){return this.__filtered__?new j(this):this[s](1)}}),j.prototype.compact=function(){return this.filter(Ye)},j.prototype.find=function(e){return this.filter(e).head()},j.prototype.findLast=function(e){return this.reverse().find(e)},j.prototype.invokeMap=X(function(e,t){return typeof e=="function"?new j(this):this.map(function(s){return Dr(s,e,t)})}),j.prototype.reject=function(e){return this.filter(Qi(H(e)))},j.prototype.slice=function(e,t){e=K(e);var s=this;return s.__filtered__&&(e>0||t<0)?new j(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=K(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(Qe)},Ot(j.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),f=h[o?"take"+(t=="last"?"Right":""):t],g=o||/^find/.test(t);f&&(h.prototype[t]=function(){var v=this.__wrapped__,m=o?[1]:arguments,w=v instanceof j,R=m[0],b=w||z(v),L=function(Z){var ee=f.apply(h,jt([Z],m));return o&&U?ee[0]:ee};b&&s&&typeof R=="function"&&R.length!=1&&(w=b=!1);var U=this.__chain__,F=!!this.__actions__.length,V=g&&!U,Y=w&&!F;if(!g&&b){v=Y?v:new j(this);var B=e.apply(v,m);return B.__actions__.push({func:Hi,args:[L],thisArg:r}),new ht(B,U)}return V&&Y?e.apply(this,m):(B=this.thru(L),V?o?B.value()[0]:B.value():B)})}),ct(["pop","push","shift","sort","splice","unshift"],function(e){var t=gi[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var f=arguments;if(o&&!this.__chain__){var g=this.value();return t.apply(z(g)?g:[],f)}return this[s](function(v){return t.apply(z(v)?v:[],f)})}}),Ot(j.prototype,function(e,t){var s=h[t];if(s){var o=s.name+"";re.call(Xn,o)||(Xn[o]=[]),Xn[o].push({name:t,func:s})}}),Xn[$i(r,q).name]=[{name:"wrapper",func:r}],j.prototype.clone=Vh,j.prototype.reverse=Bh,j.prototype.value=Gh,h.prototype.at=Sp,h.prototype.chain=wp,h.prototype.commit=Ep,h.prototype.next=Cp,h.prototype.plant=yp,h.prototype.reverse=Ap,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=Rp,h.prototype.first=h.prototype.head,Ir&&(h.prototype[Ir]=Tp),h}),zn=Eh();Cn?((Cn.exports=zn)._=zn,Ps._=zn):Pe._=zn}).call(xm)})(Br,Br.exports)),Br.exports}var Ol=Lm();const W={getRandomId:()=>window.crypto.getRandomValues(new Uint32Array(1))[0],isPromise:i=>i&&W.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=>W.isString(i)?i.replace(/^\/+/g,""):"",trimTrailingSlash:i=>W.isString(i)?i.replace(/\/+$/,""):"",isElementVisible:i=>i?window.getComputedStyle(i).getPropertyValue("display")!=="none":!1,getNodeList:(i,n=!1)=>{const r=[];return i&&Array.from(document.querySelectorAll(i)).forEach(u=>{n?W.isElementVisible(u)&&r.push(u):r.push(u)}),r},prependOrigin:i=>{if(!i||i.startsWith("http"))return i;const n=i.startsWith("/");return i.length?window.location.origin+(n?"":"/")+i:window.location.origin},getConfigValueFromObject:(i,n)=>{let r=0,a=i;const u=n.split(".");for(;a&&r<u.length;)a=a[u[r++]];return a},getConfigBooleanValue:(i,n)=>{const r=W.getConfigValueFromObject(i,n);return r===!0||r==="true"},getUrlParameter:i=>new URLSearchParams(window.location.search).get(i),removeProperties(i,n){const r={};if(!(n instanceof Array)||!n.length)return console.error("[ERROR] removeProperties requires second parameter: array of keys to remove from object."),i;for(const a in i)if(i.hasOwnProperty(a)){const u=n.filter(l=>a.includes(l)).length===0,c=n.filter(l=>l.endsWith("*")).map(l=>l.slice(0,-1)).filter(l=>a.startsWith(l)).length===0;u&&c&&(r[a]=i[a])}return r},replaceVars(i,n,r,a=!0){let u=i;return n&&(a?u=Ol.replace(u,/{([\s\S]+?)}/g,c=>{let l=c.slice(1,-1).trim();return l.indexOf(r)===0&&(l=l.substring(r.length)),Ol.get(n,l,c)}):Object.entries(n).forEach(c=>{u=u.replace(new RegExp(this.escapeRegExp(r+c[0]),"g"),encodeURIComponent(c[1]))})),a&&(u=u.replace(new RegExp("\\{"+this.escapeRegExp(r)+"[^\\}]+\\}","g"),"")),u},escapeRegExp(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},hasHashOrSlash:i=>!!(i&&i.search(/^[#\/].*$/)===0),getPathWithoutHashOrSlash:i=>{for(;W.hasHashOrSlash(i);)i=i.substring(1,i.length);return i}},cr={wrapAsPromise:i=>new Promise(n=>{n(i)}),applyFunctionPromisified:(i,n)=>(i=i.apply(void 0,n),W.isPromise(i)?i:cr.wrapAsPromise(i)),getConfigValueFromObjectAsync:(i,n,...r)=>{const a=W.getConfigValueFromObject(i,n);return W.isFunction(a)?cr.applyFunctionPromisified(a,r):cr.wrapAsPromise(a)}};class Nm{setErrorMessage(n){this.getLuigi().getEngine()?._connector?.showFatalError(n)}getLuigi(){return window.Luigi}getConfigValue(n){return this.getLuigi().getConfigValue(n)}getConfigValueAsync(n){return this.getLuigi().getConfigValueAsync(n)}async executeConfigFnAsync(n,r=!1,...a){const u=this.getConfigValue(n);if(W.isFunction(u))try{return await cr.applyFunctionPromisified(u,a)}catch(c){if(r)return Promise.reject(c)}return Promise.resolve(void 0)}}const Xe=new Nm;class Om{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=Xe.getConfigValue("auth.storage")||this._defaultStorage),this._storageType}getAuthData(){return this._getStore(this.getStorageKey())}setAuthData(n){this._setStore(this.getStorageKey(),n)}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(n){return window[n]}_setStore(n,r){switch(this.getStorageType()){case"localStorage":case"sessionStorage":r!==void 0?this._getWebStorage(this.getStorageType()).setItem(n,JSON.stringify(r)):this._getWebStorage(this.getStorageType()).removeItem(n);break;case"none":this._internalStorage[n]=r;break;default:console.error(this._invalidStorageMsg)}}_getStore(n){try{switch(this.getStorageType()){case"localStorage":case"sessionStorage":return JSON.parse(this._getWebStorage(this.getStorageType()).getItem(n));case"none":return this._internalStorage[n];default:console.error(this._invalidStorageMsg)}}catch{console.warn("Error parsing authorization data. Auto-logout might not work!")}}}const Pt=new Om;class $m{isAuthorizationEnabled(){return!!Xe.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&fr.startAuthorization()}logout(){this.isAuthorizationEnabled()&&fr.logout()}async handleAuthEvent(n,r,a,u){const c=await Xe.executeConfigFnAsync("auth.events."+n,!1,r,a),l=c===void 0||!!c;if(l&&u){window.location.href=u;return}return l}get store(){return Xe.getLuigi()?.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:()=>Pt.getStorageKey(),getStorageType:()=>Pt.getStorageType(),getAuthData:()=>Pt.getAuthData(),setAuthData:n=>Pt.setAuthData(n),removeAuthData:()=>Pt.removeAuthData(),setNewlyAuthorized:()=>{Pt.setNewlyAuthorized(),fr.resetExpirationChecks()}}}}const ar=new $m;class Um{getStoredAuthData(){return Pt.getAuthData()}isLoggedIn(){const n=this.getStoredAuthData();return!!(n&&n.accessTokenExpirationDate>Number(new Date))}parseUrlAuthErrors(){const n=W.getUrlParameter("error"),r=W.getUrlParameter("errorDescription");if(n)return{error:n,errorDescription:r}}async handleUrlAuthErrors(n,r,a){return r?await ar.handleAuthEvent("onAuthError",n,{error:r,errorDescription:a},n.logoutUrl+"?post_logout_redirect_uri="+n.post_logout_redirect_uri+"&error="+encodeURIComponent(r)+"&errorDescription="+encodeURIComponent(a||"")):!0}}const On=new Um;class Dm{constructor(){this._userInfoStore=rs({}),this._loggedInStore=rs(!1)}setUserInfo(n){this._userInfoStore.set(n)}setLoggedIn(n){this._loggedInStore.set(n)}getUserInfoStore(){return this._userInfoStore}getLoggedInStore(){return this._loggedInStore}async init(){const n=Xe.getConfigValue("auth.use");if(!n)return Promise.resolve(!0);const r=Xe.getConfigValue(`auth.${n}`),a=On.parseUrlAuthErrors()||{};if(await On.handleUrlAuthErrors(r,a.error,a.errorDescription))return this.idpProviderInstance=this.getIdpProviderInstance(n,r),W.isPromise(this.idpProviderInstance)?this.idpProviderInstance.then(c=>(this.idpProviderInstance=c,this.checkAuth(r))).catch(c=>{const l=`Error: ${c.message||c}`;console.error(l,c.message&&c),Xe.setErrorMessage(l)}):this.checkAuth(r)}async checkAuth(n){const r=On.getStoredAuthData();if(!r||!On.isLoggedIn()){if(Xe.getConfigValue("auth.disableAutoLogin"))return;let u=!0;return r&&(u=await ar.handleAuthEvent("onAuthExpired",n)),u?this.startAuthorization():void 0}this.idpProviderInstance.settings&&W.isFunction(this.idpProviderInstance.settings.userInfoFn)?this.idpProviderInstance.settings.userInfoFn(this.idpProviderInstance.settings,r).then(u=>{this.setUserInfo(u),this.setLoggedIn(!0)}):W.isFunction(this.idpProviderInstance.userInfo)?this.idpProviderInstance.userInfo(n).then(u=>{this.setUserInfo(u),this.setLoggedIn(!0)}):(this.setLoggedIn(!0),this.setUserInfo(jl(this._userInfoStore))),W.isFunction(Xe.getConfigValue("auth.events.onAuthSuccessful"))&&Pt.isNewlyAuthorized()&&await ar.handleAuthEvent("onAuthSuccessful",n,r),Pt.removeNewlyAuthorized(),W.isFunction(this.idpProviderInstance.setTokenExpirationAction)&&this.idpProviderInstance.setTokenExpirationAction(),W.isFunction(this.idpProviderInstance.setTokenExpireSoonAction)&&this.idpProviderInstance.setTokenExpireSoonAction()}async startAuthorization(){if(this.idpProviderInstance)return this.idpProviderInstance.login().then(n=>{Pt.setNewlyAuthorized(),n&&console.error(n)})}logout(){const n=On.getStoredAuthData(),r=async c=>{await ar.handleAuthEvent("onLogout",this.idpProviderInstance.settings,void 0,c),Pt.removeAuthData()},a=Xe.getConfigValue(`auth.${Xe.getConfigValue("auth.use")}.logoutFn`),u=Xe.getConfigValueAsync("navigation.profile.logout.customLogoutFn");W.isFunction(a)?a(this.idpProviderInstance.settings,n,r):W.isFunction(this.idpProviderInstance.logout)?this.idpProviderInstance.logout(n,r):u&&W.isFunction(u)?u(n,r):r(this.idpProviderInstance.settings.logoutUrl)}createIdpProviderException(n){return{message:n,name:"IdpProviderException"}}async getIdpProviderInstance(n,r){const a=W.getConfigValueFromObject(r,"idpProvider");if(a){const c=await new a(r);return["login"].forEach(l=>{if(!W.isFunction(c[l]))throw this.createIdpProviderException(`${l} function does not exist in custom IDP Provider ${n}`)}),c}if(W.isFunction(Xe.getConfigValue("auth.events.onAuthConfigError")))await ar.handleAuthEvent("onAuthConfigError",{idpProviderName:n,type:"IdpProviderException"});else throw this.createIdpProviderException(`IDP Provider ${n} does not exist.`)}unload(){this.idpProviderInstance&&W.isFunction(this.idpProviderInstance.unload)&&this.idpProviderInstance.unload()}resetExpirationChecks(){this.idpProviderInstance&&W.isFunction(this.idpProviderInstance.resetExpirationChecks)&&this.idpProviderInstance.resetExpirationChecks()}}const fr=new Dm,Mm={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"}}},Fm=Mm,is={sanitizeHtml(i=""){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/javascript:/g,"")},restoreSanitizedBrs(i=""){return i.replace(/<br\/>/g,"<br>").replace(/<br \/>/g,"<br>").replace(/<br>/g,"<br>").replace(/<br >/g,"<br>")},restoreSanitizedElements(i=""){let n=i;const r=["i","b","br","mark","strong","em","small","del","ins","sub","sup"];for(let a=0;a<r.length;a++){const u=new RegExp(`<${r[a]}/>`,"g"),c=new RegExp(`<${r[a]} />`,"g"),l=new RegExp(`<${r[a]}>`,"g"),d=new RegExp(`<${r[a]} >`,"g"),p=new RegExp(`</${r[a]}[/]>`,"g"),_=new RegExp(`</${r[a]} [/]>`,"g"),A=new RegExp(`<[/]${r[a]}>`,"g"),P=new RegExp(`<[/]${r[a]} >`,"g");n=n.replace(u,`<${r[a]}>`).replace(c,`<${r[a]}>`).replace(l,`<${r[a]}>`).replace(d,`<${r[a]}>`).replace(p,`</${r[a]}>`).replace(_,`</${r[a]}>`).replace(A,`</${r[a]}>`).replace(P,`</${r[a]}>`)}return n},sanatizeHtmlExceptTextFormatting(i=""){return this.restoreSanitizedElements(this.sanitizeHtml(i))},sanitizeParam(i=""){return String(i).replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},escapeKeyForRegexp(i=""){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},processTextAndLinks(i="",n,r){const u={sanitizedText:this.restoreSanitizedBrs(this.sanitizeHtml(i)),links:[]};return n?Object.entries(n).reduce((c,[l,d])=>{const p=`_luigi_alert_${r}_link_${this.sanitizeParam(l)}`,_=this.restoreSanitizedBrs(this.sanitizeHtml(d.text)),A=`<a id="${p}">${_}</a>`,P=this.escapeKeyForRegexp(l),E=new RegExp(`({${P}})`,"g");return{sanitizedText:c.sanitizedText.replace(E,A),links:c.links.concat({elemId:p,url:d.url?encodeURI(this.sanitizeHtml(d.url)):void 0,dismissKey:d.dismissKey?encodeURI(this.sanitizeHtml(d.dismissKey)):void 0})}},u):u}};class km{constructor(n){this.luigi=n,this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.listeners={},this.translationTable=Fm}_init(){this._initCustomImplementation(),this.addCurrentLocaleChangeListener(n=>{this.broadcastLocaleToAllContainers(n)})}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(n,r){if(!r?.clientPermissions?.changeCurrentLocale){console.error('Current locale change declined from client, as client permission "changeCurrentLocale" is not set for this view.');return}n&&(r&&(r.locale=n),sessionStorage.setItem(this.currentLocaleStorageKey,n),this._notifyLocaleChange(n)),this.luigi.getEngine()._connector?.setCurrentLocale(n)}addCurrentLocaleChangeListener(n){let r=null;return W.isFunction(n)?(r=W.getRandomId(),this.listeners[r]=n):console.error("Provided locale change listener is not a function."),r}removeCurrentLocaleChangeListener(n){n&&this.listeners[n]?delete this.listeners[n]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}getTranslation(n,r=void 0,a=void 0){if(!n)return"";if(this.translationImpl){const c=this.translationImpl.getTranslation(n,r,a);if(c!==n)return c}const u=this.findTranslation(n,this.translationTable,r);return u||n}_notifyLocaleChange(n){Object.getOwnPropertyNames(this.listeners).forEach(r=>{this.listeners[Number(r)](n)}),this.luigi.configChanged()}_initCustomImplementation(){this.translationImpl=this.luigi.getConfigValue("settings.customTranslationImplementation"),W.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}broadcastLocaleToAllContainers(n){const r=W.getNodeList("luigi-container[lui_container]");r?.length&&n&&r.forEach(a=>{a.locale=n,a.updateContext({locale:n})})}findTranslation(n,r,a){const u=n.split(".");for(let c=0;c<u.length;c++){const l=u[c];if(Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="object")r=r[l];else return a?this.findInterpolations(r[l],a):r[l]}}findInterpolations(n,r){return typeof n!="string"||!n.trim()||Object.keys(r).forEach(a=>{n=n.replace(new RegExp("{"+is.escapeKeyForRegexp(a)+"}","gi"),r[a])}),n}}class Wm{constructor(n){this.luigi=n}getShellbar(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarElement()||null}getShellbarActions(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarActions()||null}getLuigiContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getLuigiContainer()||null}getNavFooterContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getNavFooterContainer()||null}}const Hm={luigiAfterInit:async i=>{W.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await Xe.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class Vm{constructor(){this.featureToggleList=new Set}setFeatureToggle(n,r=!1){this.isValid(n)&&(n.startsWith("!")&&!r||this.isDuplicatedOrDisabled(n)||this.featureToggleList.add(n))}unsetFeatureToggle(n){if(this.isValid(n)){if(!this.featureToggleList.has(n)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(n)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(r=>!r.startsWith("!"))}isValid(n){return W.isString(n)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(n){return this.featureToggleList.has(n)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${n}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class pn{constructor(n){this.luigi=n,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const n=[...this._modalStack];for(const{onInternalClose:r}of n)try{typeof r=="function"&&r()}catch(a){console.warn("onInternalClose threw an error",a)}this.clearModalStack()}registerModal(n){n&&this._modalStack.push(n)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(n){if(this._modalStack.length>0){const r=this._modalStack[0];r.modalsettings={...r.modalsettings,...n}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){this._modalStack.pop()}}const xe={normalizePath:i=>{if(!i||i.length<=0)return i;let n=i;return n.startsWith("#")&&(n=n.substring(1)),n.startsWith("/")&&(n=n.substring(1)),n},segmentMatches:(i,n,r)=>!!(i===n||n.startsWith(":")&&r&&r[n.substr(1)]===i),checkMatch:(i,n,r)=>{let a=!0;return W.trimTrailingSlash(W.trimLeadingSlash(i)).split("/").forEach((u,c)=>{a&&(c+1>=n.length||!n[c+1]?.pathSegment||!xe.segmentMatches(u,n[c+1]?.pathSegment??"",r??{}))&&(a=!1)}),a},checkVisibleForFeatureToggles:(i,n)=>{if(i?.visibleForFeatureToggles){const r=n?.getActiveFeatureToggleList()||[];for(const a of i.visibleForFeatureToggles)if(a.startsWith("!")){if(r.includes(a.slice(1)))return!1}else if(!r.includes(a))return!1}return!0},generateTooltipText:(i,n,r)=>{let a=i?.tooltipText;switch(a===void 0&&(a=r.getConfigValue("navigation.defaults.tooltipText")),a){case void 0:return n;case!1:return"";default:return r.i18n().getTranslation(a)}},isNodeAccessPermitted:(i,n,r,a)=>{if(a.auth().isAuthorizationEnabled()){const l=On.isLoggedIn(),d=i.anonymousAccess;if(l&&d==="exclusive"||!l&&d!=="exclusive"&&d!==!0)return!1}const u=a.featureToggles();if(!xe.checkVisibleForFeatureToggles(i,u))return!1;const c=a.getConfigValue("navigation.nodeAccessibilityResolver");return typeof c!="function"?!0:c(i,n,r)},updateHeaderTitle:(i,n)=>{const r=i?.items;if(r&&n){let a="";return[...r].sort((u,c)=>(c.link||"").localeCompare(u.link||"")).some(u=>{let c=!1;if(c=xe.checkMatch(u.link||"",n.nodesInPath??[]),!c&&u.selectionConditions&&u.selectionConditions.route&&(c=xe.checkMatch(u.selectionConditions.route,n.nodesInPath??[]),c&&(u.selectionConditions.contextCriteria||[]).forEach(l=>{c=c&&n?.selectedNode?.context?.[l.key]===l.value})),c)return a=u.title||"",!0}),a}},buildPath(i,n){return i.map(a=>{const u=a.pathSegment;if(u?.startsWith(":")){const c=u.slice(1),l=n?.pathParams?.[c];if(l!=null)return encodeURIComponent(String(l))}return u}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let n="";return i.forEach(r=>{r&&(n+=(n?"_":"")+encodeURIComponent(r.toLowerCase().split(" ").join("")))}),n},findVirtualTreeRootNode(i){if(i.virtualTree)return i;if(i.parent)return xe.findVirtualTreeRootNode(i.parent)}};class _n{constructor(){this.dataManagement=new Map}setChildren(n,r){this.dataManagement.set(n,r),this.navPath=""}getChildren(n){return n?this.dataManagement.get(n):{}}hasChildren(n){const r=this.getChildren(n);return!!(r&&Object.prototype.hasOwnProperty.call(r,"children"))}setRootNode(n){this.dataManagement.set("_luigiRootNode",{node:n})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(n){if(this.hasChildren(n)){const r=this.getChildren(n).children;for(let a=0;a<r.length;a++)this.deleteNodesRecursively(r[a])}this.dataManagement.delete(n)}}const k={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,n,r){let a=n;const[u,c]=a.split("?"),l=new URLSearchParams(c);return this.modifySearchParams(i,l,r),a=u,l.toString()!==""&&(a+=`?${l.toString()}`),a},modifySearchParams(i,n,r){for(const[a,u]of Object.entries(i)){const c=r?`${r}${a}`:a;n.set(c,u),u===void 0&&n.delete(c)}},filterNodeParams(i,n){const r={},a=this.getContentViewParamPrefix(n);return i&&Object.entries(i).forEach(u=>{if(u[0].startsWith(a)){const c=u[0].substr(a.length);r[c]=u[1]}}),this.sanitizeParamsMap(r)},getContentViewParamPrefix(i){let n=i?.getConfigValue("routing.nodeParamPrefix");return n===!1?n="":n||(n=this.defaultContentViewParamPrefix),n},sanitizeParamsMap(i){return Object.entries(i).reduce((n,r)=>(n[is.sanitizeParam(r[0])]=is.sanitizeParam(r[1]),n),{})},prepareSearchParamsForClient(i,n){const r={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(a=>{a in n.routing().getSearchParams()&&i.clientPermissions?.urlParameters&&i.clientPermissions.urlParameters[a]?.read===!0&&(r[a]=n.routing().getSearchParams()[a])}),r},getCurrentPath(i){if(i){const n=xe.normalizePath(location.hash),[r,a]=n.split("?");return{path:r,query:a}}else return{path:xe.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,n){return this.getQueryParams(n)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return k.getLocation().search?k.parseParams(k.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=k.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?k.parseParams(k.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let n=i.getConfigValue("routing.modalPathParam");return n||(n=this.defaultModalViewParamName),n},parseParams(i){const n=new URLSearchParams(i),r=new Map;for(const[a,u]of n.entries())r.set(a,u);return Object.fromEntries(r)},getModalParamsFromPath(i){const n=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return n&&JSON.parse(n)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,n){const r=new URLSearchParams(i);return r.delete(n),r.delete(`${n}Params`),r.toString()},handleHistoryState(i,n){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:n},i},encodeParams(i){const n=[];for(const r in i)n.push(encodeURIComponent(r)+"="+encodeURIComponent(i[r]));return n.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,n){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const a=n.getConfigValue("navigation.validWebcomponentUrls");if(a?.length>0)for(const u of a)try{if(new RegExp(u).test(i))return!0}catch(c){console.error(c)}return!1}return!0},setFeatureToggles(i,n,r){const a=this.sanitizeParamsMap(this.parseParams(n.split("?")[1]));let u;if(a[i]&&(u=a[i]),!u)return;const c=u.split(",");c.length>0&&c[0]!==""&&c.forEach(l=>r?.setFeatureToggle(l,!0))},substituteDynamicParamsInObject(i,n,r=":",a=!1){return Object.entries(i).map(([u,c])=>{const l=a?Object.keys(n).find(d=>c&&c.indexOf(r+d)>=0):Object.keys(n).find(d=>c===r+d);return[u,l?a?c.replace(r+l,n[l]):n[l]:c]}).reduce((u,[c,l])=>Object.assign(u,{[c]:l}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,n){return this.isDynamicNode(i)&&i.pathSegment?n[i.pathSegment.substring(1)]:void 0},getNodePath(i,n){return!i||n?i?this.buildRoute(i,i.pathSegment?"/"+i.pathSegment:"",n):"":`${i.parent?this.getNodePath(i.parent):""}/${i.pathSegment}`},buildRoute(i,n,r){return i.parent?this.buildRoute(i.parent,`/${i.parent.pathSegment}${n}`,r):n+(r?"?"+r:"")},substituteViewUrl(i,n,r){return i=W.replaceVars(i,n,":",!1),i},getSubPath(i,n){return W.replaceVars(k.getNodePath(i),n,":",!1)},concatenatePath(i,n){let r=W.getPathWithoutHashOrSlash(i);return r?(n&&(r.endsWith("/")&&(r=r.substring(0,r.length-1)),n.startsWith("/")||(r+="/"),r+=n),r):n}},Oa={logout:{label:"Sign Out",icon:"log"}};class Bm{constructor(){this.services=new Map}register(n,r,a=!0){this.services.set(n,{factory:r,singleton:a})}get(n){const r=this.services.get(n);if(!r)throw new Error(`Service '${n}' is not registered.`);return r.singleton?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const te=new Bm;class vn{constructor(n){this.luigi=n}getModalService(){return this.modalService||(this.modalService=te.get(pn)),this.modalService}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=te.get(_n)),this.nodeDataManagementService}async getPathData(n){const r=this.luigi.getConfig();let a=n.split("/");a?.length>0&&a[0]===""&&(a=a.slice(1));let c=r.navigation?.globalContext||{},l;if(this.getNodeDataManagementService().hasRootNode())l=this.getNodeDataManagementService().getRootNode().node;else{let _=await this.luigi.getConfigValueAsync("navigation.nodes");typeof _=="object"&&!Array.isArray(_)?(l=_,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:_},l.children=await this.getChildren(l,c),l.children=this.prepareRootNodes(l.children||[],c),this.getNodeDataManagementService().setRootNode(l)}let d={};const p={selectedNodeChildren:l.children,nodesInPath:[l],rootNodes:l.children,pathParams:d};if(l.viewUrl&&a.length===0)p.selectedNode=l;else for(const _ of a)if(p.selectedNodeChildren){const A=this.findMatchingNode(_,p.selectedNodeChildren||[]);if(!A){console.warn("No matching node found for segment:",_);break}const P=A.context||{},E=xe.mergeContext(c,P);let T=E;if(A.pathSegment?.startsWith(":")&&(d[A.pathSegment.replace(":","")]=is.sanitizeParam(_),T=k.substituteDynamicParamsInObject(E,d)),c=T,A.context=T,p.selectedNode=A,p.selectedNode&&p.nodesInPath?.push(p.selectedNode),A.virtualTree||A._virtualTree){const I=this.buildVirtualTree(A,_,d);I&&I.length>0&&(A.children=I)}p.selectedNodeChildren=await this.getChildren(A,c)}return p}findMatchingNode(n,r){let a;const u=r.filter(l=>!!l.pathSegment).length,c=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":")).length;if(u>1&&(c===1&&(console.warn(`Invalid node setup detected.
|
|
20
|
+
}`;var Y=Il(function(){return ne(g,F+"return "+L).apply(r,v)});if(Y.source=L,Ca(Y))throw Y;return Y}function Dv(e){return ie(e).toLowerCase()}function Mv(e){return ie(e).toUpperCase()}function Fv(e,t,s){if(e=ie(e),e&&(s||t===r))return Fo(e);if(!e||!(t=rt(t)))return e;var o=yt(e),f=yt(t),g=ko(o,f),v=Wo(o,f)+1;return an(o,g,v).join("")}function kv(e,t,s){if(e=ie(e),e&&(s||t===r))return e.slice(0,Vo(e)+1);if(!e||!(t=rt(t)))return e;var o=yt(e),f=Wo(o,yt(t))+1;return an(o,0,f).join("")}function Wv(e,t,s){if(e=ie(e),e&&(s||t===r))return e.replace(Cs,"");if(!e||!(t=rt(t)))return e;var o=yt(e),f=ko(o,yt(t));return an(o,f).join("")}function Hv(e,t){var s=Ce,o=Te;if(he(t)){var f="separator"in t?t.separator:f;s="length"in t?K(t.length):s,o="omission"in t?rt(t.omission):o}e=ie(e);var g=e.length;if(Qn(e)){var v=yt(e);g=v.length}if(s>=g)return e;var m=s-qn(o);if(m<1)return o;var w=v?an(v,0,m).join(""):e.slice(0,m);if(f===r)return w+o;if(v&&(m+=w.length-m),Ta(f)){if(e.slice(m).search(f)){var R,b=w;for(f.global||(f=ks(f.source,ie(so.exec(f))+"g")),f.lastIndex=0;R=f.exec(b);)var L=R.index;w=w.slice(0,L===r?m:L)}}else if(e.indexOf(rt(f),m)!=m){var U=w.lastIndexOf(f);U>-1&&(w=w.slice(0,U))}return w+o}function Vv(e){return e=ie(e),e&&Jc.test(e)?e.replace(no,vh):e}var Bv=jn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ra=xu("toUpperCase");function Pl(e,t,s){return e=ie(e),t=s?r:t,t===r?hh(e)?wh(e):rh(e):e.match(t)||[]}var Il=X(function(e,t){try{return tt(e,r,t)}catch(s){return Ca(s)?s:new G(s)}}),Gv=Qt(function(e,t){return ct(t,function(s){s=Ut(s),Bt(e,s,wa(e[s],e))}),e});function Qv(e){var t=e==null?0:e.length,s=H();return e=t?ce(e,function(o){if(typeof o[1]!="function")throw new ft(l);return[s(o[0]),o[1]]}):[],X(function(o){for(var f=-1;++f<t;){var g=e[f];if(tt(g[0],this,o))return tt(g[1],this,o)}})}function qv(e){return vg(gt(e,P))}function ba(e){return function(){return e}}function zv(e,t){return e==null||e!==e?t:e}var Kv=Nu(),Yv=Nu(!0);function Ye(e){return e}function Pa(e){return uu(typeof e=="function"?e:gt(e,P))}function Xv(e){return cu(gt(e,P))}function Zv(e,t){return fu(e,gt(t,P))}var Jv=X(function(e,t){return function(s){return Dr(s,e,t)}}),jv=X(function(e,t){return function(s){return Dr(e,s,t)}});function Ia(e,t,s){var o=Ae(t),f=Ii(t,o);s==null&&!(he(t)&&(f.length||!o.length))&&(s=t,t=e,e=this,f=Ii(t,Ae(t)));var g=!(he(s)&&"chain"in s)||!!s.chain,v=zt(e);return ct(f,function(m){var w=t[m];e[m]=w,v&&(e.prototype[m]=function(){var R=this.__chain__;if(g||R){var b=e(this.__wrapped__),L=b.__actions__=qe(this.__actions__);return L.push({func:w,args:arguments,thisArg:e}),b.__chain__=R,b}return w.apply(e,jt([this.value()],arguments))})}),e}function em(){return Pe._===this&&(Pe._=Rh),this}function xa(){}function tm(e){return e=K(e),X(function(t){return hu(t,e)})}var nm=oa(ce),rm=oa(Oo),im=oa(Ns);function xl(e){return da(e)?Os(Ut(e)):$g(e)}function sm(e){return function(t){return e==null?r:bn(e,t)}}var am=$u(),om=$u(!0);function La(){return[]}function Na(){return!1}function um(){return{}}function lm(){return""}function cm(){return!0}function fm(e,t){if(e=K(e),e<1||e>et)return[];var s=Qe,o=Ne(e,Qe);t=H(t),e-=Qe;for(var f=Ds(o,t);++s<e;)t(s);return f}function hm(e){return z(e)?ce(e,Ut):it(e)?[e]:qe(Xu(ie(e)))}function gm(e){var t=++yh;return ie(e)+t}var dm=Ui(function(e,t){return e+t},0),pm=ua("ceil"),_m=Ui(function(e,t){return e/t},1),vm=ua("floor");function mm(e){return e&&e.length?Pi(e,Ye,zs):r}function Sm(e,t){return e&&e.length?Pi(e,H(t,2),zs):r}function wm(e){return Do(e,Ye)}function Em(e,t){return Do(e,H(t,2))}function Cm(e){return e&&e.length?Pi(e,Ye,Zs):r}function Tm(e,t){return e&&e.length?Pi(e,H(t,2),Zs):r}var ym=Ui(function(e,t){return e*t},1),Am=ua("round"),Rm=Ui(function(e,t){return e-t},0);function bm(e){return e&&e.length?Us(e,Ye):0}function Pm(e,t){return e&&e.length?Us(e,H(t,2)):0}return h.after=Xp,h.ary=ol,h.assign=M_,h.assignIn=El,h.assignInWith=Ki,h.assignWith=F_,h.at=k_,h.before=ul,h.bind=wa,h.bindAll=Gv,h.bindKey=ll,h.castArray=u_,h.chain=il,h.chunk=vd,h.compact=md,h.concat=Sd,h.cond=Qv,h.conforms=qv,h.constant=ba,h.countBy=bp,h.create=W_,h.curry=cl,h.curryRight=fl,h.debounce=hl,h.defaults=H_,h.defaultsDeep=V_,h.defer=Zp,h.delay=Jp,h.difference=wd,h.differenceBy=Ed,h.differenceWith=Cd,h.drop=Td,h.dropRight=yd,h.dropRightWhile=Ad,h.dropWhile=Rd,h.fill=bd,h.filter=Ip,h.flatMap=Np,h.flatMapDeep=Op,h.flatMapDepth=$p,h.flatten=el,h.flattenDeep=Pd,h.flattenDepth=Id,h.flip=jp,h.flow=Kv,h.flowRight=Yv,h.fromPairs=xd,h.functions=Y_,h.functionsIn=X_,h.groupBy=Up,h.initial=Nd,h.intersection=Od,h.intersectionBy=$d,h.intersectionWith=Ud,h.invert=J_,h.invertBy=j_,h.invokeMap=Mp,h.iteratee=Pa,h.keyBy=Fp,h.keys=Ae,h.keysIn=Ke,h.map=Vi,h.mapKeys=tv,h.mapValues=nv,h.matches=Xv,h.matchesProperty=Zv,h.memoize=Gi,h.merge=rv,h.mergeWith=Cl,h.method=Jv,h.methodOf=jv,h.mixin=Ia,h.negate=Qi,h.nthArg=tm,h.omit=iv,h.omitBy=sv,h.once=e_,h.orderBy=kp,h.over=nm,h.overArgs=t_,h.overEvery=rm,h.overSome=im,h.partial=Ea,h.partialRight=gl,h.partition=Wp,h.pick=av,h.pickBy=Tl,h.property=xl,h.propertyOf=sm,h.pull=kd,h.pullAll=nl,h.pullAllBy=Wd,h.pullAllWith=Hd,h.pullAt=Vd,h.range=am,h.rangeRight=om,h.rearg=n_,h.reject=Bp,h.remove=Bd,h.rest=r_,h.reverse=ma,h.sampleSize=Qp,h.set=uv,h.setWith=lv,h.shuffle=qp,h.slice=Gd,h.sortBy=Yp,h.sortedUniq=Zd,h.sortedUniqBy=Jd,h.split=Nv,h.spread=i_,h.tail=jd,h.take=ep,h.takeRight=tp,h.takeRightWhile=np,h.takeWhile=rp,h.tap=mp,h.throttle=s_,h.thru=Hi,h.toArray=ml,h.toPairs=yl,h.toPairsIn=Al,h.toPath=hm,h.toPlainObject=wl,h.transform=cv,h.unary=a_,h.union=ip,h.unionBy=sp,h.unionWith=ap,h.uniq=op,h.uniqBy=up,h.uniqWith=lp,h.unset=fv,h.unzip=Sa,h.unzipWith=rl,h.update=hv,h.updateWith=gv,h.values=nr,h.valuesIn=dv,h.without=cp,h.words=Pl,h.wrap=o_,h.xor=fp,h.xorBy=hp,h.xorWith=gp,h.zip=dp,h.zipObject=pp,h.zipObjectDeep=_p,h.zipWith=vp,h.entries=yl,h.entriesIn=Al,h.extend=El,h.extendWith=Ki,Ia(h,h),h.add=dm,h.attempt=Il,h.camelCase=mv,h.capitalize=Rl,h.ceil=pm,h.clamp=pv,h.clone=l_,h.cloneDeep=f_,h.cloneDeepWith=h_,h.cloneWith=c_,h.conformsTo=g_,h.deburr=bl,h.defaultTo=zv,h.divide=_m,h.endsWith=Sv,h.eq=Rt,h.escape=wv,h.escapeRegExp=Ev,h.every=Pp,h.find=xp,h.findIndex=Ju,h.findKey=B_,h.findLast=Lp,h.findLastIndex=ju,h.findLastKey=G_,h.floor=vm,h.forEach=sl,h.forEachRight=al,h.forIn=Q_,h.forInRight=q_,h.forOwn=z_,h.forOwnRight=K_,h.get=ya,h.gt=d_,h.gte=p_,h.has=Z_,h.hasIn=Aa,h.head=tl,h.identity=Ye,h.includes=Dp,h.indexOf=Ld,h.inRange=_v,h.invoke=ev,h.isArguments=xn,h.isArray=z,h.isArrayBuffer=__,h.isArrayLike=ze,h.isArrayLikeObject=pe,h.isBoolean=v_,h.isBuffer=on,h.isDate=m_,h.isElement=S_,h.isEmpty=w_,h.isEqual=E_,h.isEqualWith=C_,h.isError=Ca,h.isFinite=T_,h.isFunction=zt,h.isInteger=dl,h.isLength=qi,h.isMap=pl,h.isMatch=y_,h.isMatchWith=A_,h.isNaN=R_,h.isNative=b_,h.isNil=I_,h.isNull=P_,h.isNumber=_l,h.isObject=he,h.isObjectLike=de,h.isPlainObject=Vr,h.isRegExp=Ta,h.isSafeInteger=x_,h.isSet=vl,h.isString=zi,h.isSymbol=it,h.isTypedArray=tr,h.isUndefined=L_,h.isWeakMap=N_,h.isWeakSet=O_,h.join=Dd,h.kebabCase=Cv,h.last=pt,h.lastIndexOf=Md,h.lowerCase=Tv,h.lowerFirst=yv,h.lt=$_,h.lte=U_,h.max=mm,h.maxBy=Sm,h.mean=wm,h.meanBy=Em,h.min=Cm,h.minBy=Tm,h.stubArray=La,h.stubFalse=Na,h.stubObject=um,h.stubString=lm,h.stubTrue=cm,h.multiply=ym,h.nth=Fd,h.noConflict=em,h.noop=xa,h.now=Bi,h.pad=Av,h.padEnd=Rv,h.padStart=bv,h.parseInt=Pv,h.random=vv,h.reduce=Hp,h.reduceRight=Vp,h.repeat=Iv,h.replace=xv,h.result=ov,h.round=Am,h.runInContext=S,h.sample=Gp,h.size=zp,h.snakeCase=Lv,h.some=Kp,h.sortedIndex=Qd,h.sortedIndexBy=qd,h.sortedIndexOf=zd,h.sortedLastIndex=Kd,h.sortedLastIndexBy=Yd,h.sortedLastIndexOf=Xd,h.startCase=Ov,h.startsWith=$v,h.subtract=Rm,h.sum=bm,h.sumBy=Pm,h.template=Uv,h.times=fm,h.toFinite=Kt,h.toInteger=K,h.toLength=Sl,h.toLower=Dv,h.toNumber=_t,h.toSafeInteger=D_,h.toString=ie,h.toUpper=Mv,h.trim=Fv,h.trimEnd=kv,h.trimStart=Wv,h.truncate=Hv,h.unescape=Vv,h.uniqueId=gm,h.upperCase=Bv,h.upperFirst=Ra,h.each=sl,h.eachRight=al,h.first=tl,Ia(h,(function(){var e={};return Ot(h,function(t,s){re.call(h.prototype,s)||(e[s]=t)}),e})(),{chain:!1}),h.VERSION=a,ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){h[e].placeholder=h}),ct(["drop","take"],function(e,t){j.prototype[e]=function(s){s=s===r?1:we(K(s),0);var o=this.__filtered__&&!t?new j(this):this.clone();return o.__filtered__?o.__takeCount__=Ne(s,o.__takeCount__):o.__views__.push({size:Ne(s,Qe),type:e+(o.__dir__<0?"Right":"")}),o},j.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ct(["filter","map","takeWhile"],function(e,t){var s=t+1,o=s==ut||s==En;j.prototype[e]=function(f){var g=this.clone();return g.__iteratees__.push({iteratee:H(f,3),type:s}),g.__filtered__=g.__filtered__||o,g}}),ct(["head","last"],function(e,t){var s="take"+(t?"Right":"");j.prototype[e]=function(){return this[s](1).value()[0]}}),ct(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");j.prototype[e]=function(){return this.__filtered__?new j(this):this[s](1)}}),j.prototype.compact=function(){return this.filter(Ye)},j.prototype.find=function(e){return this.filter(e).head()},j.prototype.findLast=function(e){return this.reverse().find(e)},j.prototype.invokeMap=X(function(e,t){return typeof e=="function"?new j(this):this.map(function(s){return Dr(s,e,t)})}),j.prototype.reject=function(e){return this.filter(Qi(H(e)))},j.prototype.slice=function(e,t){e=K(e);var s=this;return s.__filtered__&&(e>0||t<0)?new j(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=K(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(Qe)},Ot(j.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),f=h[o?"take"+(t=="last"?"Right":""):t],g=o||/^find/.test(t);f&&(h.prototype[t]=function(){var v=this.__wrapped__,m=o?[1]:arguments,w=v instanceof j,R=m[0],b=w||z(v),L=function(Z){var ee=f.apply(h,jt([Z],m));return o&&U?ee[0]:ee};b&&s&&typeof R=="function"&&R.length!=1&&(w=b=!1);var U=this.__chain__,F=!!this.__actions__.length,V=g&&!U,Y=w&&!F;if(!g&&b){v=Y?v:new j(this);var B=e.apply(v,m);return B.__actions__.push({func:Hi,args:[L],thisArg:r}),new ht(B,U)}return V&&Y?e.apply(this,m):(B=this.thru(L),V?o?B.value()[0]:B.value():B)})}),ct(["pop","push","shift","sort","splice","unshift"],function(e){var t=gi[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var f=arguments;if(o&&!this.__chain__){var g=this.value();return t.apply(z(g)?g:[],f)}return this[s](function(v){return t.apply(z(v)?v:[],f)})}}),Ot(j.prototype,function(e,t){var s=h[t];if(s){var o=s.name+"";re.call(Xn,o)||(Xn[o]=[]),Xn[o].push({name:t,func:s})}}),Xn[$i(r,q).name]=[{name:"wrapper",func:r}],j.prototype.clone=Vh,j.prototype.reverse=Bh,j.prototype.value=Gh,h.prototype.at=Sp,h.prototype.chain=wp,h.prototype.commit=Ep,h.prototype.next=Cp,h.prototype.plant=yp,h.prototype.reverse=Ap,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=Rp,h.prototype.first=h.prototype.head,Ir&&(h.prototype[Ir]=Tp),h}),zn=Eh();Cn?((Cn.exports=zn)._=zn,Ps._=zn):Pe._=zn}).call(xm)})(Br,Br.exports)),Br.exports}var Ol=Lm();const W={getRandomId:()=>window.crypto.getRandomValues(new Uint32Array(1))[0],isPromise:i=>i&&W.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=>W.isString(i)?i.replace(/^\/+/g,""):"",trimTrailingSlash:i=>W.isString(i)?i.replace(/\/+$/,""):"",isElementVisible:i=>i?window.getComputedStyle(i).getPropertyValue("display")!=="none":!1,getNodeList:(i,n=!1)=>{const r=[];return i&&Array.from(document.querySelectorAll(i)).forEach(u=>{n?W.isElementVisible(u)&&r.push(u):r.push(u)}),r},prependOrigin:i=>{if(!i||i.startsWith("http"))return i;const n=i.startsWith("/");return i.length?window.location.origin+(n?"":"/")+i:window.location.origin},getConfigValueFromObject:(i,n)=>{let r=0,a=i;const u=n.split(".");for(;a&&r<u.length;)a=a[u[r++]];return a},getConfigBooleanValue:(i,n)=>{const r=W.getConfigValueFromObject(i,n);return r===!0||r==="true"},getUrlParameter:i=>new URLSearchParams(window.location.search).get(i),removeProperties(i,n){const r={};if(!(n instanceof Array)||!n.length)return console.error("[ERROR] removeProperties requires second parameter: array of keys to remove from object."),i;for(const a in i)if(i.hasOwnProperty(a)){const u=n.filter(l=>a.includes(l)).length===0,c=n.filter(l=>l.endsWith("*")).map(l=>l.slice(0,-1)).filter(l=>a.startsWith(l)).length===0;u&&c&&(r[a]=i[a])}return r},replaceVars(i,n,r,a=!0){let u=i;return n&&(a?u=Ol.replace(u,/{([\s\S]+?)}/g,c=>{let l=c.slice(1,-1).trim();return l.indexOf(r)===0&&(l=l.substring(r.length)),Ol.get(n,l,c)}):Object.entries(n).forEach(c=>{u=u.replace(new RegExp(this.escapeRegExp(r+c[0]),"g"),encodeURIComponent(c[1]))})),a&&(u=u.replace(new RegExp("\\{"+this.escapeRegExp(r)+"[^\\}]+\\}","g"),"")),u},escapeRegExp(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},hasHashOrSlash:i=>!!(i&&i.search(/^[#\/].*$/)===0),getPathWithoutHashOrSlash:i=>{for(;W.hasHashOrSlash(i);)i=i.substring(1,i.length);return i}},cr={wrapAsPromise:i=>new Promise(n=>{n(i)}),applyFunctionPromisified:(i,n)=>(i=i.apply(void 0,n),W.isPromise(i)?i:cr.wrapAsPromise(i)),getConfigValueFromObjectAsync:(i,n,...r)=>{const a=W.getConfigValueFromObject(i,n);return W.isFunction(a)?cr.applyFunctionPromisified(a,r):cr.wrapAsPromise(a)}};class Nm{setErrorMessage(n){this.getLuigi().getEngine()?._connector?.showFatalError(n)}getLuigi(){return window.Luigi}getConfigValue(n){return this.getLuigi().getConfigValue(n)}getConfigValueAsync(n){return this.getLuigi().getConfigValueAsync(n)}async executeConfigFnAsync(n,r=!1,...a){const u=this.getConfigValue(n);if(W.isFunction(u))try{return await cr.applyFunctionPromisified(u,a)}catch(c){if(r)return Promise.reject(c)}return Promise.resolve(void 0)}}const Xe=new Nm;class Om{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=Xe.getConfigValue("auth.storage")||this._defaultStorage),this._storageType}getAuthData(){return this._getStore(this.getStorageKey())}setAuthData(n){this._setStore(this.getStorageKey(),n)}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(n){return window[n]}_setStore(n,r){switch(this.getStorageType()){case"localStorage":case"sessionStorage":r!==void 0?this._getWebStorage(this.getStorageType()).setItem(n,JSON.stringify(r)):this._getWebStorage(this.getStorageType()).removeItem(n);break;case"none":this._internalStorage[n]=r;break;default:console.error(this._invalidStorageMsg)}}_getStore(n){try{switch(this.getStorageType()){case"localStorage":case"sessionStorage":return JSON.parse(this._getWebStorage(this.getStorageType()).getItem(n));case"none":return this._internalStorage[n];default:console.error(this._invalidStorageMsg)}}catch{console.warn("Error parsing authorization data. Auto-logout might not work!")}}}const Pt=new Om;class $m{isAuthorizationEnabled(){return!!Xe.getConfigValue("auth.use")}login(){this.isAuthorizationEnabled()&&fr.startAuthorization()}logout(){this.isAuthorizationEnabled()&&fr.logout()}async handleAuthEvent(n,r,a,u){const c=await Xe.executeConfigFnAsync("auth.events."+n,!1,r,a),l=c===void 0||!!c;if(l&&u){window.location.href=u;return}return l}get store(){return Xe.getLuigi()?.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:()=>Pt.getStorageKey(),getStorageType:()=>Pt.getStorageType(),getAuthData:()=>Pt.getAuthData(),setAuthData:n=>Pt.setAuthData(n),removeAuthData:()=>Pt.removeAuthData(),setNewlyAuthorized:()=>{Pt.setNewlyAuthorized(),fr.resetExpirationChecks()}}}}const ar=new $m;class Um{getStoredAuthData(){return Pt.getAuthData()}isLoggedIn(){const n=this.getStoredAuthData();return!!(n&&n.accessTokenExpirationDate>Number(new Date))}parseUrlAuthErrors(){const n=W.getUrlParameter("error"),r=W.getUrlParameter("errorDescription");if(n)return{error:n,errorDescription:r}}async handleUrlAuthErrors(n,r,a){return r?await ar.handleAuthEvent("onAuthError",n,{error:r,errorDescription:a},n.logoutUrl+"?post_logout_redirect_uri="+n.post_logout_redirect_uri+"&error="+encodeURIComponent(r)+"&errorDescription="+encodeURIComponent(a||"")):!0}}const On=new Um;class Dm{constructor(){this._userInfoStore=rs({}),this._loggedInStore=rs(!1)}setUserInfo(n){this._userInfoStore.set(n)}setLoggedIn(n){this._loggedInStore.set(n)}getUserInfoStore(){return this._userInfoStore}getLoggedInStore(){return this._loggedInStore}async init(){const n=Xe.getConfigValue("auth.use");if(!n)return Promise.resolve(!0);const r=Xe.getConfigValue(`auth.${n}`),a=On.parseUrlAuthErrors()||{};if(await On.handleUrlAuthErrors(r,a.error,a.errorDescription))return this.idpProviderInstance=this.getIdpProviderInstance(n,r),W.isPromise(this.idpProviderInstance)?this.idpProviderInstance.then(c=>(this.idpProviderInstance=c,this.checkAuth(r))).catch(c=>{const l=`Error: ${c.message||c}`;console.error(l,c.message&&c),Xe.setErrorMessage(l)}):this.checkAuth(r)}async checkAuth(n){const r=On.getStoredAuthData();if(!r||!On.isLoggedIn()){if(Xe.getConfigValue("auth.disableAutoLogin"))return;let u=!0;return r&&(u=await ar.handleAuthEvent("onAuthExpired",n)),u?this.startAuthorization():void 0}this.idpProviderInstance.settings&&W.isFunction(this.idpProviderInstance.settings.userInfoFn)?this.idpProviderInstance.settings.userInfoFn(this.idpProviderInstance.settings,r).then(u=>{this.setUserInfo(u),this.setLoggedIn(!0)}):W.isFunction(this.idpProviderInstance.userInfo)?this.idpProviderInstance.userInfo(n).then(u=>{this.setUserInfo(u),this.setLoggedIn(!0)}):(this.setLoggedIn(!0),this.setUserInfo(jl(this._userInfoStore))),W.isFunction(Xe.getConfigValue("auth.events.onAuthSuccessful"))&&Pt.isNewlyAuthorized()&&await ar.handleAuthEvent("onAuthSuccessful",n,r),Pt.removeNewlyAuthorized(),W.isFunction(this.idpProviderInstance.setTokenExpirationAction)&&this.idpProviderInstance.setTokenExpirationAction(),W.isFunction(this.idpProviderInstance.setTokenExpireSoonAction)&&this.idpProviderInstance.setTokenExpireSoonAction()}async startAuthorization(){if(this.idpProviderInstance)return this.idpProviderInstance.login().then(n=>{Pt.setNewlyAuthorized(),n&&console.error(n)})}logout(){const n=On.getStoredAuthData(),r=async c=>{await ar.handleAuthEvent("onLogout",this.idpProviderInstance.settings,void 0,c),Pt.removeAuthData()},a=Xe.getConfigValue(`auth.${Xe.getConfigValue("auth.use")}.logoutFn`),u=Xe.getConfigValueAsync("navigation.profile.logout.customLogoutFn");W.isFunction(a)?a(this.idpProviderInstance.settings,n,r):W.isFunction(this.idpProviderInstance.logout)?this.idpProviderInstance.logout(n,r):u&&W.isFunction(u)?u(n,r):r(this.idpProviderInstance.settings.logoutUrl)}createIdpProviderException(n){return{message:n,name:"IdpProviderException"}}async getIdpProviderInstance(n,r){const a=W.getConfigValueFromObject(r,"idpProvider");if(a){const c=await new a(r);return["login"].forEach(l=>{if(!W.isFunction(c[l]))throw this.createIdpProviderException(`${l} function does not exist in custom IDP Provider ${n}`)}),c}if(W.isFunction(Xe.getConfigValue("auth.events.onAuthConfigError")))await ar.handleAuthEvent("onAuthConfigError",{idpProviderName:n,type:"IdpProviderException"});else throw this.createIdpProviderException(`IDP Provider ${n} does not exist.`)}unload(){this.idpProviderInstance&&W.isFunction(this.idpProviderInstance.unload)&&this.idpProviderInstance.unload()}resetExpirationChecks(){this.idpProviderInstance&&W.isFunction(this.idpProviderInstance.resetExpirationChecks)&&this.idpProviderInstance.resetExpirationChecks()}}const fr=new Dm,Mm={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"}}},Fm=Mm,is={sanitizeHtml(i=""){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/javascript:/gi,"").replace(/data:/gi,"").replace(/vbscript:/gi,"")},restoreSanitizedBrs(i=""){return i.replace(/<br\/>/g,"<br>").replace(/<br \/>/g,"<br>").replace(/<br>/g,"<br>").replace(/<br >/g,"<br>")},restoreSanitizedElements(i=""){let n=i;const r=["i","b","br","mark","strong","em","small","del","ins","sub","sup"];for(let a=0;a<r.length;a++){const u=new RegExp(`<${r[a]}/>`,"g"),c=new RegExp(`<${r[a]} />`,"g"),l=new RegExp(`<${r[a]}>`,"g"),d=new RegExp(`<${r[a]} >`,"g"),p=new RegExp(`</${r[a]}[/]>`,"g"),_=new RegExp(`</${r[a]} [/]>`,"g"),A=new RegExp(`<[/]${r[a]}>`,"g"),P=new RegExp(`<[/]${r[a]} >`,"g");n=n.replace(u,`<${r[a]}>`).replace(c,`<${r[a]}>`).replace(l,`<${r[a]}>`).replace(d,`<${r[a]}>`).replace(p,`</${r[a]}>`).replace(_,`</${r[a]}>`).replace(A,`</${r[a]}>`).replace(P,`</${r[a]}>`)}return n},sanatizeHtmlExceptTextFormatting(i=""){return this.restoreSanitizedElements(this.sanitizeHtml(i))},sanitizeParam(i=""){return String(i).replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},escapeKeyForRegexp(i=""){return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},processTextAndLinks(i="",n,r){const u={sanitizedText:this.restoreSanitizedBrs(this.sanitizeHtml(i)),links:[]};return n?Object.entries(n).reduce((c,[l,d])=>{const p=`_luigi_alert_${r}_link_${this.sanitizeParam(l)}`,_=this.restoreSanitizedBrs(this.sanitizeHtml(d.text)),A=`<a id="${p}">${_}</a>`,P=this.escapeKeyForRegexp(l),E=new RegExp(`({${P}})`,"g");return{sanitizedText:c.sanitizedText.replace(E,A),links:c.links.concat({elemId:p,url:d.url?encodeURI(this.sanitizeHtml(d.url)):void 0,dismissKey:d.dismissKey?encodeURI(this.sanitizeHtml(d.dismissKey)):void 0})}},u):u}};class km{constructor(n){this.luigi=n,this.currentLocaleStorageKey="luigi.currentLocale",this.defaultLocale="en",this.listeners={},this.translationTable=Fm}_init(){this._initCustomImplementation(),this.addCurrentLocaleChangeListener(n=>{this.broadcastLocaleToAllContainers(n)})}getCurrentLocale(){return sessionStorage.getItem(this.currentLocaleStorageKey)||this.defaultLocale}setCurrentLocale(n,r){if(!r?.clientPermissions?.changeCurrentLocale){console.error('Current locale change declined from client, as client permission "changeCurrentLocale" is not set for this view.');return}n&&(r&&(r.locale=n),sessionStorage.setItem(this.currentLocaleStorageKey,n),this._notifyLocaleChange(n)),this.luigi.getEngine()._connector?.setCurrentLocale(n)}addCurrentLocaleChangeListener(n){let r=null;return W.isFunction(n)?(r=W.getRandomId(),this.listeners[r]=n):console.error("Provided locale change listener is not a function."),r}removeCurrentLocaleChangeListener(n){n&&this.listeners[n]?delete this.listeners[n]:console.error("Unable to remove locale change listener - no listener registered for given ID.")}getTranslation(n,r=void 0,a=void 0){if(!n)return"";if(this.translationImpl){const c=this.translationImpl.getTranslation(n,r,a);if(c!==n)return c}const u=this.findTranslation(n,this.translationTable,r);return u||n}_notifyLocaleChange(n){Object.getOwnPropertyNames(this.listeners).forEach(r=>{this.listeners[Number(r)](n)}),this.luigi.configChanged()}_initCustomImplementation(){this.translationImpl=this.luigi.getConfigValue("settings.customTranslationImplementation"),W.isFunction(this.translationImpl)&&(this.translationImpl=this.translationImpl())}broadcastLocaleToAllContainers(n){const r=W.getNodeList("luigi-container[lui_container]");r?.length&&n&&r.forEach(a=>{a.locale=n,a.updateContext({locale:n})})}findTranslation(n,r,a){const u=n.split(".");for(let c=0;c<u.length;c++){const l=u[c];if(Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="object")r=r[l];else return a?this.findInterpolations(r[l],a):r[l]}}findInterpolations(n,r){return typeof n!="string"||!n.trim()||Object.keys(r).forEach(a=>{n=n.replace(new RegExp("{"+is.escapeKeyForRegexp(a)+"}","gi"),r[a])}),n}}class Wm{constructor(n){this.luigi=n}getShellbar(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarElement()||null}getShellbarActions(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getShellbarActions()||null}getLuigiContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getLuigiContainer()||null}getNavFooterContainer(){return this.luigi.getEngine()._connector?.getCoreAPISupportedElements().getNavFooterContainer()||null}}const Hm={luigiAfterInit:async i=>{W.getConfigBooleanValue(i.getConfig(),"settings.appLoadingIndicator.hideAutomatically")&&setTimeout(()=>{i.ux().hideAppLoadingIndicator()},0),await Xe.executeConfigFnAsync("lifecycleHooks.luigiAfterInit")}};class Vm{constructor(){this.featureToggleList=new Set}setFeatureToggle(n,r=!1){this.isValid(n)&&(n.startsWith("!")&&!r||this.isDuplicatedOrDisabled(n)||this.featureToggleList.add(n))}unsetFeatureToggle(n){if(this.isValid(n)){if(!this.featureToggleList.has(n)){console.warn("Feature toggle name is not in the list.");return}this.featureToggleList.delete(n)}}getActiveFeatureToggleList(){return[...Array.from(this.featureToggleList)].filter(r=>!r.startsWith("!"))}isValid(n){return W.isString(n)?!0:(console.warn("Feature toggle name is not valid or not of type 'string'"),!1)}isDuplicatedOrDisabled(n){return this.featureToggleList.has(n)?(console.warn("Feature toggle name already exists"),!0):this.featureToggleList.has(`!${n}`)?(console.warn("Disabled feature toggle can not be activated"),!0):!1}}class pn{constructor(n){this.luigi=n,this._modalStack=[],this.modalSettings={}}async closeModals(){if(this._modalStack.length===0)return;const n=[...this._modalStack];for(const{onInternalClose:r}of n)try{typeof r=="function"&&r()}catch(a){console.warn("onInternalClose threw an error",a)}this.clearModalStack()}registerModal(n){n&&this._modalStack.push(n)}getModalSettings(){return this._modalStack.length>0?this._modalStack[0].modalsettings||{}:{}}getModalStackLength(){return this._modalStack.length}updateFirstModalSettings(n){if(this._modalStack.length>0){const r=this._modalStack[0];r.modalsettings={...r.modalsettings,...n}}}clearModalStack(){this._modalStack=[]}removeLastModalFromStack(){this._modalStack.pop()}}const xe={normalizePath:i=>{if(!i||i.length<=0)return i;let n=i;return n.startsWith("#")&&(n=n.substring(1)),n.startsWith("/")&&(n=n.substring(1)),n},segmentMatches:(i,n,r)=>!!(i===n||n.startsWith(":")&&r&&r[n.substr(1)]===i),checkMatch:(i,n,r)=>{let a=!0;return W.trimTrailingSlash(W.trimLeadingSlash(i)).split("/").forEach((u,c)=>{a&&(c+1>=n.length||!n[c+1]?.pathSegment||!xe.segmentMatches(u,n[c+1]?.pathSegment??"",r??{}))&&(a=!1)}),a},checkVisibleForFeatureToggles:(i,n)=>{if(i?.visibleForFeatureToggles){const r=n?.getActiveFeatureToggleList()||[];for(const a of i.visibleForFeatureToggles)if(a.startsWith("!")){if(r.includes(a.slice(1)))return!1}else if(!r.includes(a))return!1}return!0},generateTooltipText:(i,n,r)=>{let a=i?.tooltipText;switch(a===void 0&&(a=r.getConfigValue("navigation.defaults.tooltipText")),a){case void 0:return n;case!1:return"";default:return r.i18n().getTranslation(a)}},isNodeAccessPermitted:(i,n,r,a)=>{if(a.auth().isAuthorizationEnabled()){const l=On.isLoggedIn(),d=i.anonymousAccess;if(l&&d==="exclusive"||!l&&d!=="exclusive"&&d!==!0)return!1}const u=a.featureToggles();if(!xe.checkVisibleForFeatureToggles(i,u))return!1;const c=a.getConfigValue("navigation.nodeAccessibilityResolver");return typeof c!="function"?!0:c(i,n,r)},updateHeaderTitle:(i,n)=>{const r=i?.items;if(r&&n){let a="";return[...r].sort((u,c)=>(c.link||"").localeCompare(u.link||"")).some(u=>{let c=!1;if(c=xe.checkMatch(u.link||"",n.nodesInPath??[]),!c&&u.selectionConditions&&u.selectionConditions.route&&(c=xe.checkMatch(u.selectionConditions.route,n.nodesInPath??[]),c&&(u.selectionConditions.contextCriteria||[]).forEach(l=>{c=c&&n?.selectedNode?.context?.[l.key]===l.value})),c)return a=u.title||"",!0}),a}},buildPath(i,n){return i.map(a=>{const u=a.pathSegment;if(u?.startsWith(":")){const c=u.slice(1),l=n?.pathParams?.[c];if(l!=null)return encodeURIComponent(String(l))}return u}).join("/")},mergeContext(...i){return Object.assign({},...i)},prepareForTests(...i){let n="";return i.forEach(r=>{r&&(n+=(n?"_":"")+encodeURIComponent(r.toLowerCase().split(" ").join("")))}),n},findVirtualTreeRootNode(i){if(i.virtualTree)return i;if(i.parent)return xe.findVirtualTreeRootNode(i.parent)}};class _n{constructor(){this.dataManagement=new Map}setChildren(n,r){this.dataManagement.set(n,r),this.navPath=""}getChildren(n){return n?this.dataManagement.get(n):{}}hasChildren(n){const r=this.getChildren(n);return!!(r&&Object.prototype.hasOwnProperty.call(r,"children"))}setRootNode(n){this.dataManagement.set("_luigiRootNode",{node:n})}getRootNode(){return this.dataManagement.get("_luigiRootNode")}hasRootNode(){return!!this.getRootNode()}deleteCache(){this.dataManagement.clear()}deleteNodesRecursively(n){if(this.hasChildren(n)){const r=this.getChildren(n).children;for(let a=0;a<r.length;a++)this.deleteNodesRecursively(r[a])}this.dataManagement.delete(n)}}const k={defaultContentViewParamPrefix:"~",defaultQueryParamSeparator:"?",defaultModalViewParamName:"modal",addParamsOnHashRouting(i,n,r){let a=n;const[u,c]=a.split("?"),l=new URLSearchParams(c);return this.modifySearchParams(i,l,r),a=u,l.toString()!==""&&(a+=`?${l.toString()}`),a},modifySearchParams(i,n,r){for(const[a,u]of Object.entries(i)){const c=r?`${r}${a}`:a;n.set(c,u),u===void 0&&n.delete(c)}},filterNodeParams(i,n){const r=Object.create(null),a=this.getContentViewParamPrefix(n);return i&&Object.entries(i).forEach(u=>{if(u[0].startsWith(a)){const c=u[0].substr(a.length);r[c]=u[1]}}),this.sanitizeParamsMap(r)},getContentViewParamPrefix(i){let n=i?.getConfigValue("routing.nodeParamPrefix");return n===!1?n="":n||(n=this.defaultContentViewParamPrefix),n},sanitizeParamsMap(i){return Object.entries(i).reduce((n,r)=>(n[is.sanitizeParam(r[0])]=is.sanitizeParam(r[1]),n),{})},prepareSearchParamsForClient(i,n){const r={};return i&&i.clientPermissions&&i.clientPermissions.urlParameters&&Object.keys(i.clientPermissions.urlParameters).forEach(a=>{a in n.routing().getSearchParams()&&i.clientPermissions?.urlParameters&&i.clientPermissions.urlParameters[a]?.read===!0&&(r[a]=n.routing().getSearchParams()[a])}),r},getCurrentPath(i){if(i){const n=xe.normalizePath(location.hash),[r,a]=n.split("?");return{path:r,query:a}}else return{path:xe.normalizePath(location.pathname),query:location.search}},getModalPathFromPath(i){return this.getQueryParam(this.getModalViewParamName(i),i)},getQueryParam(i,n){return this.getQueryParams(n)[i]},getQueryParams(i){return i.getConfigValue("routing.useHashRouting")?this.getLocationHashQueryParams():this.getLocationSearchQueryParams()},getLocationSearchQueryParams(){return k.getLocation().search?k.parseParams(k.getLocation().search.slice(1)):{}},getLocation(){return location},getLocationHashQueryParams(){const i=k.getLocation().hash.indexOf(this.defaultQueryParamSeparator);return i!==-1?k.parseParams(k.getLocation().hash.slice(i+1)):{}},getModalViewParamName(i){let n=i.getConfigValue("routing.modalPathParam");return n||(n=this.defaultModalViewParamName),n},parseParams(i){const n=new URLSearchParams(i),r=new Map;for(const[a,u]of n.entries())r.set(a,u);return Object.fromEntries(r)},getModalParamsFromPath(i){const n=this.getQueryParam(`${this.getModalViewParamName(i)}Params`,i);return n&&JSON.parse(n)},getHashQueryParamSeparator(){return this.defaultQueryParamSeparator},getURLWithoutModalData(i,n){const r=new URLSearchParams(i);return r.delete(n),r.delete(`${n}Params`),r.toString()},handleHistoryState(i,n){return i&&i.modalHistoryLength?i.modalHistoryLength+=1:i={modalHistoryLength:1,historygap:history.length,pathBeforeHistory:n},i},encodeParams(i){const n=[];for(const r in i)n.push(encodeURIComponent(r)+"="+encodeURIComponent(i[r]));return n.join("&")},getLastNodeObject(i){return(i.nodesInPath?[...i.nodesInPath].pop():{})||{}},checkWCUrl(i,n){if(i.indexOf("://")>0||i.trim().indexOf("//")===0){if(new URL(i).host===window.location.host)return!0;const a=n.getConfigValue("navigation.validWebcomponentUrls");if(a?.length>0)for(const u of a)try{if(new RegExp(u).test(i))return!0}catch(c){console.error(c)}return!1}return!0},setFeatureToggles(i,n,r){const a=this.sanitizeParamsMap(this.parseParams(n.split("?")[1]));let u;if(a[i]&&(u=a[i]),!u)return;const c=u.split(",");c.length>0&&c[0]!==""&&c.forEach(l=>r?.setFeatureToggle(l,!0))},substituteDynamicParamsInObject(i,n,r=":",a=!1){return Object.entries(i).map(([u,c])=>{const l=a?Object.keys(n).find(d=>c&&c.indexOf(r+d)>=0):Object.keys(n).find(d=>c===r+d);return[u,l?a?c.replace(r+l,n[l]):n[l]:c]}).reduce((u,[c,l])=>Object.assign(u,{[c]:l}),{})},isDynamicNode(i){return typeof i.pathSegment=="string"&&i.pathSegment.length>0&&i.pathSegment[0]===":"},getDynamicNodeValue(i,n){return this.isDynamicNode(i)&&i.pathSegment?n[i.pathSegment.substring(1)]:void 0},getNodePath(i,n){return!i||n?i?this.buildRoute(i,i.pathSegment?"/"+i.pathSegment:"",n):"":`${i.parent?this.getNodePath(i.parent):""}/${i.pathSegment}`},buildRoute(i,n,r){return i.parent?this.buildRoute(i.parent,`/${i.parent.pathSegment}${n}`,r):n+(r?"?"+r:"")},substituteViewUrl(i,n,r){return i=W.replaceVars(i,n,":",!1),i},getSubPath(i,n){return W.replaceVars(k.getNodePath(i),n,":",!1)},concatenatePath(i,n){let r=W.getPathWithoutHashOrSlash(i);return r?(n&&(r.endsWith("/")&&(r=r.substring(0,r.length-1)),n.startsWith("/")||(r+="/"),r+=n),r):n}},Oa={logout:{label:"Sign Out",icon:"log"}};class Bm{constructor(){this.services=new Map}register(n,r,a=!0){this.services.set(n,{factory:r,singleton:a})}get(n){const r=this.services.get(n);if(!r)throw new Error(`Service '${n}' is not registered.`);return r.singleton?(r.instance||(r.instance=r.factory()),r.instance):r.factory()}}const te=new Bm;class vn{constructor(n){this.luigi=n}getModalService(){return this.modalService||(this.modalService=te.get(pn)),this.modalService}getNodeDataManagementService(){return this.nodeDataManagementService||(this.nodeDataManagementService=te.get(_n)),this.nodeDataManagementService}async getPathData(n){const r=this.luigi.getConfig();let a=n.split("/");a?.length>0&&a[0]===""&&(a=a.slice(1));let c=r.navigation?.globalContext||{},l;if(this.getNodeDataManagementService().hasRootNode())l=this.getNodeDataManagementService().getRootNode().node;else{let _=await this.luigi.getConfigValueAsync("navigation.nodes");typeof _=="object"&&!Array.isArray(_)?(l=_,l.pathSegment&&(l.pathSegment="",console.warn("Root node must have an empty path segment. Provided path segment will be ignored."))):l={children:_},l.children=await this.getChildren(l,c),l.children=this.prepareRootNodes(l.children||[],c),this.getNodeDataManagementService().setRootNode(l)}let d={};const p={selectedNodeChildren:l.children,nodesInPath:[l],rootNodes:l.children,pathParams:d};if(l.viewUrl&&a.length===0)p.selectedNode=l;else for(const _ of a)if(p.selectedNodeChildren){const A=this.findMatchingNode(_,p.selectedNodeChildren||[]);if(!A){console.warn("No matching node found for segment:",_);break}const P=A.context||{},E=xe.mergeContext(c,P);let T=E;if(A.pathSegment?.startsWith(":")&&(d[A.pathSegment.replace(":","")]=is.sanitizeParam(_),T=k.substituteDynamicParamsInObject(E,d)),c=T,A.context=T,p.selectedNode=A,p.selectedNode&&p.nodesInPath?.push(p.selectedNode),A.virtualTree||A._virtualTree){const I=this.buildVirtualTree(A,_,d);I&&I.length>0&&(A.children=I)}p.selectedNodeChildren=await this.getChildren(A,c)}return p}findMatchingNode(n,r){let a;const u=r.filter(l=>!!l.pathSegment).length,c=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":")).length;if(u>1&&(c===1&&(console.warn(`Invalid node setup detected.
|
|
21
21
|
Static and dynamic nodes cannot be used together on the same level. Static node gets cleaned up.
|
|
22
22
|
Remove the static node from the configuration to resolve this warning.
|
|
23
23
|
Affected pathSegment:`,n,"Children:",r),r=r.filter(l=>l.pathSegment&&l.pathSegment.startsWith(":"))),c>1)){console.error(`Invalid node setup detected.
|
|
24
24
|
Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
|
|
25
|
-
Invalid Children:`,r);return}return r.some(l=>{if(l.pathSegment===n||l.pathSegment&&l.pathSegment.startsWith(":"))return a=l,!0}),a}buildNavItems(n,r,a){const u={},c=[];return n?.forEach(l=>{if(xe.isNodeAccessPermitted(l,this.getParentNode(a.selectedNode,a),a?.selectedNode?.context||{},this.luigi))if(l.category){const d=l.category.id||l.category.label||l.category,p=this.luigi.i18n().getTranslation(l.category.label||l.category.id||l.category);let _=u[d];_||(_={category:{altText:l.category.altText||"",icon:l.category.icon,id:d,label:p,nodes:[],tooltip:this.resolveTooltipText(l.category,p)}},u[d]=_,c.push(_)),_.category?.nodes?.push({node:l,selected:l===r,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,altText:l.altText,icon:l.icon})}else c.push({altText:l.altText,icon:l.icon,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,node:l,selected:l===r})}),c}async shouldRedirect(n,r){const a=r??await this.getPathData(n);if(n=="")return a?.nodesInPath?.[0].viewUrl?void 0:a?.rootNodes?.[0]?.pathSegment;if(a?.selectedNode&&!a.selectedNode.viewUrl&&a.selectedNode.children?.length)return n+"/"+a.selectedNode.children[0].pathSegment}async getCurrentNode(n){const r=await this.getPathData(n),a=r.selectedNode;if(!(!a||!xe.isNodeAccessPermitted(a,this.getParentNode(r.selectedNode,r),r?.selectedNode?.context||{},this.luigi)))return a}async getPathParams(n){return(await this.getPathData(n)).pathParams}getTruncatedChildren(n){let r=!1,a=!1,u=[];return n.slice().reverse().forEach(c=>{(!r||c.tabNav)&&(c.tabNav===!1&&(a=!0),c.keepSelectedForChildren===!1?r=!0:(c.keepSelectedForChildren||c.tabNav&&!a)&&(r=!0,u=[])),u.push(c)}),u.reverse()}applyNavGroups(n){const r={},a=[],c=[];return n.forEach(l=>{if(l.node)c.push(l);else if(l.category){const d=l.category.id;d&&d.indexOf("::")>0?a.push(l):(l.category.isGroup,r[d]=l,c.push(l))}}),a.forEach(l=>{const d=l.category?.id.split("::")[0]||"",p=r[d];p&&p.category&&(p.category.isGroup||(p.category.isGroup=!0),p.category.nodes||(p.category.nodes=[]),p.category.nodes.push(l))}),c.filter(l=>{if(l.category?.isGroup&&l.category?.nodes&&l.category?.nodes.length>0){for(let d=0;d<l.category?.nodes.length;d++){const p=l.category?.nodes[d];if(p.node&&!p.node.hideFromNav&&p.node.label||p.category?.nodes&&p.category.nodes.filter(_=>!_.node?.hideFromNav&&_.node?.label).length>0)return!0}return!1}return!0})}async getLeftNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{items:[],basePath:"",selectedNode:{},navClick:void 0};let u=[];const c=[];let l="";a.nodesInPath?.forEach(T=>{T.children&&(T.tabNav||(l+="/"+(T.pathSegment||"")),c.push(T))});const d=this.getTruncatedChildren(a.nodesInPath??[]);let p=[...d].pop(),_=a.selectedNode;(p?.keepSelectedForChildren||p?.tabNav)&&(_=p,d.pop(),p=[...d].pop());let A,P=_;_?a.rootNodes.includes(_)?(A=_,P=void 0):_.tabNav||_.keepSelectedForChildren?A=p:A=[...c].pop():(A=[...c].pop(),P=void 0);let E=await this.getChildren(A,A?.context||{})||[];return u=this.buildNavItems(E,P,a),u=this.applyNavGroups(u),{selectedNode:_||{},items:u,basePath:l.replace(/\/\/+/g,"/"),sideNavFooterText:this.luigi.getConfig().settings?.sideNavFooterText,navClick:T=>T.node&&this.navItemClick(T.node,a)}}navItemClick(n,r){let a=k.getNodePath(n),u=r?.pathParams;if(a=W.replaceVars(a,u||{},":",!1),!a&&a!==""){console.error("Navigation error: could not build path for the node. Check if pathSegment is defined for all nodes in the path and if there are no duplicate pathSegments on the same level.");return}this.luigi.navigation().navigate(a)}async getTopNavData(n,r){const a=this.luigi.getConfig(),u=r??await this.getPathData(n),c=a.navigation?.profile?.items?.length?JSON.parse(JSON.stringify(a.navigation.profile.items)):[],l=a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),d=xe.updateHeaderTitle(l,u);c?.length&&c.map(T=>({...T,label:this.luigi.i18n().getTranslation(T.label||"")}));const p=this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.label)||Oa.logout.label,_=T=>{if(T.openNodeInModal&&!T.externalLink?.url)this.luigi.navigation().openAsModal(T.link||"",T.openNodeInModal===!0?{}:T.openNodeInModal);else if(T.link)this.luigi.navigation().navigate(T.link);else if(T.externalLink?.url)if(T.externalLink.sameWindow)window.location.href=T.externalLink.url;else{const I=window.open(T.externalLink.url,"_blank","noopener noreferrer");I&&(I.opener=null,I.focus())}},A={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&On.isLoggedIn(),items:c,itemClick:_,logout:{altText:this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.altText)||Oa.logout.label,label:p,icon:a.navigation?.profile?.logout?.icon||Oa.logout.icon,testId:a.navigation?.profile?.logout?.testId||xe.prepareForTests(p),doLogout:()=>{fr.logout()}},onUserInfoUpdate:T=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(I=>{I?T(I):fr.getUserInfoStore().subscribe($=>{T($)})})}},P=u.selectedNode,E=P&&u.rootNodes.includes(P)?P:void 0;return{appTitle:d||a.settings?.header?.title,logo:a.settings?.header?.logo,topNodes:this.buildNavItems(u.rootNodes,E,u),productSwitcher:a.navigation?.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||a.navigation?.profile?A:void 0,appSwitcher:a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),navClick:T=>T.node&&this.navItemClick(T.node,u)}}getParentNode(n,r){if(n&&n===r.nodesInPath?.[r.nodesInPath.length-1])return r.nodesInPath[r.nodesInPath.length-2]}getAppSwitcherData(n,r){const a=n,u=a?.showMainAppEntry;if(a&&a.items&&u){const c={title:this.luigi.i18n().getTranslation(r.title||""),subTitle:r.subTitle,link:"/"};if(a.items?.map(l=>({...l,title:this.luigi.i18n().getTranslation(l.title||"")})),a.items.some(l=>l.link===c.link))return a;a.items.unshift(c)}return a}async getTabNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{};const u=a?.selectedNode;let c;if(!u)return{};if(!u.tabNav&&(c=this.getParentNode(u,a),c&&!c.tabNav))return{};let l="";a.nodesInPath?.forEach(_=>{_.children&&(l+="/"+(_.pathSegment||""))});const d=c?this.getTruncatedChildren(c.children??[]):this.getTruncatedChildren(u.children??[]),p=this.buildNavItems(d,u,a);return{selectedNode:u,items:p,basePath:l.replace(/\/\/+/g,"/"),navClick:_=>_.node&&this.navItemClick(_.node,a)}}onNodeChange(n,r){const a=this.luigi.getConfigValue("navigation.nodeChangeHook");W.isFunction(a)?a(n,r):a!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(n){const r=await this.getPathData(n);return{nodeObject:k.getLastNodeObject(r),pathData:r}}async shouldPreventNavigation(n){return!!(n?.onNodeActivation&&(W.isFunction(n.onNodeActivation)||W.isAsyncFunction(n.onNodeActivation))&&await n.onNodeActivation(n)===!1)}async shouldPreventNavigationForPath(n){const{nodeObject:r}=await this.extractDataFromPath(n);return!!await this.shouldPreventNavigation(r)}async openViewInNewTab(n){if(await this.shouldPreventNavigationForPath(n))return;this.luigi.getConfigValue("routing.useHashRouting")&&(n="#"+n),window.open(n,"_blank","noopener,noreferrer")}resolveTooltipText(n,r){return xe.generateTooltipText(n,r,this.luigi)}prepareRootNodes(n,r){const a=n;return a.length&&a.forEach(u=>{u.isRootNode=!0}),a}getAccessibleNodes(n,r,a){return r?r.filter(u=>xe.isNodeAccessPermitted(u,n,a,this.luigi)):[]}async handleNavigationRequest(n,r){const{path:a,preserveView:u,modalSettings:c,newTab:l,withoutSync:d,preventContextUpdate:p,preventHistoryEntry:_,options:A}=n;let P=await this.buildPath(a,A||{});const E=P.replace(/\/\/+/g,"/"),T=_?"replaceState":"pushState";if(c)c.keepPrevious||this.getModalService().closeModals(),this.luigi.navigation().openAsModal(E,c,r);else{const I={detail:{preventContextUpdate:!!p,preventHistoryEntry:!!_,withoutSync:!!d}};if(await te.get(pn).closeModals(),l){await this.openViewInNewTab(P);return}const $=this.luigi.getConfigValue("routing.disableBrowserHistory")?"replaceState":T;if(this.luigi.getConfig().routing?.useHashRouting)if(!d&&$!=="replaceState")location.hash=E;else{const M=new CustomEvent("hashchange",I);window.history[$]({path:"/#"+E},"","/#"+E),window.dispatchEvent(M)}else{const M=new CustomEvent("popstate",I);window.history[$]({path:E},"",E),window.dispatchEvent(M)}}}async getChildren(n,r={}){const a=te.get(_n);if(!n)return[];let u=[];if(a.hasChildren(n)){let l=a.getChildren(n);l&&(u=l.children)}else try{u=await cr.getConfigValueFromObjectAsync(n,"children",r||n.context),u==null&&(u=[]),u=u.map(l=>this.getExpandStructuralPathSegment(l)).map(l=>this.bindChildToParent(l,n))||[]}catch(l){console.error("Could not lazy-load children for node",l)}let c=this.getAccessibleNodes(n,u,r);return a.setChildren(n,{children:u,filteredChildren:c}),c}getExpandStructuralPathSegment(n){if(n&&n.pathSegment&&n.pathSegment.indexOf("/")!==-1){const r=n.pathSegment.split("/"),a={...n},u=(c,l)=>{const d=c.shift();let p={};return c.length?(p.pathSegment=d,l.hideFromNav&&(p.hideFromNav=l.hideFromNav),p.children=[u(c,l)]):(p=a,p.pathSegment=d),p};return u(r,n)}return n}bindChildToParent(n,r){return r&&r.pathSegment&&(n.parent=r),n}buildVirtualTree(n,r,a){const u=n.virtualTree,c=n._virtualTree,l=n._virtualViewUrl||n.viewUrl;if((u||c)&&r){let d=typeof n._virtualPathIndex=="number"?n._virtualPathIndex:void 0;u&&(d=void 0,n.keepSelectedForChildren=!0);const p=50;if(typeof d=="number"&&d>p)return;const _=(d??0)+1;if(_>p)return;const A=["_*","virtualTree","parent","children","keepSelectedForChildren","navigationContext"],P=W.removeProperties(n,A);Object.assign(P,{pathSegment:":virtualSegment_"+_,label:":virtualSegment_"+_,viewUrl:W.trimTrailingSlash(this.buildVirtualViewUrl(l||"",a,_)),_virtualTree:!0,_virtualPathIndex:_,_virtualViewUrl:l});const E=Array.isArray(n.children)&&n.children.length>0?n.children[0]._virtualTree:!1;return n.children&&!E&&console.warn(`Found both virtualTree and children nodes defined on a navigation node.
|
|
25
|
+
Invalid Children:`,r);return}return r.some(l=>{if(l.pathSegment===n||l.pathSegment&&l.pathSegment.startsWith(":"))return a=l,!0}),a}buildNavItems(n,r,a){const u={},c=[];return n?.forEach(l=>{if(xe.isNodeAccessPermitted(l,this.getParentNode(a.selectedNode,a),a?.selectedNode?.context||{},this.luigi))if(l.category){const d=l.category.id||l.category.label||l.category,p=this.luigi.i18n().getTranslation(l.category.label||l.category.id||l.category);let _=u[d];_||(_={category:{altText:l.category.altText||"",icon:l.category.icon,id:d,label:p,nodes:[],tooltip:this.resolveTooltipText(l.category,p)}},u[d]=_,c.push(_)),_.category?.nodes?.push({node:l,selected:l===r,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,altText:l.altText,icon:l.icon})}else c.push({altText:l.altText,icon:l.icon,label:l.label?this.luigi.i18n().getTranslation(l.label):void 0,tooltip:l.label?this.resolveTooltipText(l,l.label):void 0,node:l,selected:l===r})}),c}async shouldRedirect(n,r){const a=r??await this.getPathData(n);if(n=="")return a?.nodesInPath?.[0].viewUrl?void 0:a?.rootNodes?.[0]?.pathSegment;if(a?.selectedNode&&!a.selectedNode.viewUrl&&a.selectedNode.children?.length)return n+"/"+a.selectedNode.children[0].pathSegment}async getCurrentNode(n){const r=await this.getPathData(n),a=r.selectedNode;if(!(!a||!xe.isNodeAccessPermitted(a,this.getParentNode(r.selectedNode,r),r?.selectedNode?.context||{},this.luigi)))return a}async getPathParams(n){return(await this.getPathData(n)).pathParams}getTruncatedChildren(n){let r=!1,a=!1,u=[];return n.slice().reverse().forEach(c=>{(!r||c.tabNav)&&(c.tabNav===!1&&(a=!0),c.keepSelectedForChildren===!1?r=!0:(c.keepSelectedForChildren||c.tabNav&&!a)&&(r=!0,u=[])),u.push(c)}),u.reverse()}applyNavGroups(n){const r={},a=[],c=[];return n.forEach(l=>{if(l.node)c.push(l);else if(l.category){const d=l.category.id;d&&d.indexOf("::")>0?a.push(l):(l.category.isGroup,r[d]=l,c.push(l))}}),a.forEach(l=>{const d=l.category?.id.split("::")[0]||"",p=r[d];p&&p.category&&(p.category.isGroup||(p.category.isGroup=!0),p.category.nodes||(p.category.nodes=[]),p.category.nodes.push(l))}),c.filter(l=>{if(l.category?.isGroup&&l.category?.nodes&&l.category?.nodes.length>0){for(let d=0;d<l.category?.nodes.length;d++){const p=l.category?.nodes[d];if(p.node&&!p.node.hideFromNav&&p.node.label||p.category?.nodes&&p.category.nodes.filter(_=>!_.node?.hideFromNav&&_.node?.label).length>0)return!0}return!1}return!0})}async getLeftNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{items:[],basePath:"",selectedNode:{},navClick:void 0};let u=[];const c=[];let l="";a.nodesInPath?.forEach(T=>{T.children&&(T.tabNav||(l+="/"+(T.pathSegment||"")),c.push(T))});const d=this.getTruncatedChildren(a.nodesInPath??[]);let p=[...d].pop(),_=a.selectedNode;(p?.keepSelectedForChildren||p?.tabNav)&&(_=p,d.pop(),p=[...d].pop());let A,P=_;_?a.rootNodes.includes(_)?(A=_,P=void 0):_.tabNav||_.keepSelectedForChildren?A=p:A=[...c].pop():(A=[...c].pop(),P=void 0);let E=await this.getChildren(A,A?.context||{})||[];return u=this.buildNavItems(E,P,a),u=this.applyNavGroups(u),{selectedNode:_||{},items:u,basePath:l.replace(/\/\/+/g,"/"),sideNavFooterText:this.luigi.getConfig().settings?.sideNavFooterText,navClick:T=>T.node&&this.navItemClick(T.node,a)}}navItemClick(n,r){let a=k.getNodePath(n),u=r?.pathParams;if(a=W.replaceVars(a,u||{},":",!1),!a&&a!==""){console.error("Navigation error: could not build path for the node. Check if pathSegment is defined for all nodes in the path and if there are no duplicate pathSegments on the same level.");return}this.luigi.navigation().navigate(a)}async getTopNavData(n,r){const a=this.luigi.getConfig(),u=r??await this.getPathData(n),c=a.navigation?.profile?.items?.length?JSON.parse(JSON.stringify(a.navigation.profile.items)):[],l=a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),d=xe.updateHeaderTitle(l,u);c?.length&&c.map(T=>({...T,label:this.luigi.i18n().getTranslation(T.label||"")}));const p=this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.label)||Oa.logout.label,_=T=>{if(T.openNodeInModal&&!T.externalLink?.url)this.luigi.navigation().openAsModal(T.link||"",T.openNodeInModal===!0?{}:T.openNodeInModal);else if(T.link)this.luigi.navigation().navigate(T.link);else if(T.externalLink?.url)if(T.externalLink.sameWindow)window.location.href=T.externalLink.url;else{const I=window.open(T.externalLink.url,"_blank","noopener noreferrer");I&&(I.opener=null,I.focus())}},A={authEnabled:this.luigi.auth().isAuthorizationEnabled(),signedIn:this.luigi.auth().isAuthorizationEnabled()&&On.isLoggedIn(),items:c,itemClick:_,logout:{altText:this.luigi.i18n().getTranslation(a.navigation?.profile?.logout?.altText)||Oa.logout.label,label:p,icon:a.navigation?.profile?.logout?.icon||Oa.logout.icon,testId:a.navigation?.profile?.logout?.testId||xe.prepareForTests(p),doLogout:()=>{fr.logout()}},onUserInfoUpdate:T=>{this.luigi.getConfigValueAsync("navigation.profile.staticUserInfoFn").then(I=>{I?T(I):fr.getUserInfoStore().subscribe($=>{T($)})})}},P=u.selectedNode,E=P&&u.rootNodes.includes(P)?P:void 0;return{appTitle:d||a.settings?.header?.title,logo:a.settings?.header?.logo,topNodes:this.buildNavItems(u.rootNodes,E,u),productSwitcher:a.navigation?.productSwitcher,profile:this.luigi.auth().isAuthorizationEnabled()||a.navigation?.profile?A:void 0,appSwitcher:a.navigation?.appSwitcher&&this.getAppSwitcherData(a.navigation?.appSwitcher,a.settings?.header),navClick:T=>T.node&&this.navItemClick(T.node,u)}}getParentNode(n,r){if(n&&n===r.nodesInPath?.[r.nodesInPath.length-1])return r.nodesInPath[r.nodesInPath.length-2]}getAppSwitcherData(n,r){const a=n,u=a?.showMainAppEntry;if(a&&a.items&&u){const c={title:this.luigi.i18n().getTranslation(r.title||""),subTitle:r.subTitle,link:"/"};if(a.items?.map(l=>({...l,title:this.luigi.i18n().getTranslation(l.title||"")})),a.items.some(l=>l.link===c.link))return a;a.items.unshift(c)}return a}async getTabNavData(n,r){const a=r??await this.getPathData(n);if(n===""&&a?.nodesInPath?.[0].viewUrl)return{};const u=a?.selectedNode;let c;if(!u)return{};if(!u.tabNav&&(c=this.getParentNode(u,a),c&&!c.tabNav))return{};let l="";a.nodesInPath?.forEach(_=>{_.children&&(l+="/"+(_.pathSegment||""))});const d=c?this.getTruncatedChildren(c.children??[]):this.getTruncatedChildren(u.children??[]),p=this.buildNavItems(d,u,a);return{selectedNode:u,items:p,basePath:l.replace(/\/\/+/g,"/"),navClick:_=>_.node&&this.navItemClick(_.node,a)}}onNodeChange(n,r){const a=this.luigi.getConfigValue("navigation.nodeChangeHook");W.isFunction(a)?a(n,r):a!==void 0&&console.warn("nodeChangeHook is not a function!")}async extractDataFromPath(n){const r=await this.getPathData(n);return{nodeObject:k.getLastNodeObject(r),pathData:r}}async shouldPreventNavigation(n){return!!(n?.onNodeActivation&&(W.isFunction(n.onNodeActivation)||W.isAsyncFunction(n.onNodeActivation))&&await n.onNodeActivation(n)===!1)}async shouldPreventNavigationForPath(n){const{nodeObject:r}=await this.extractDataFromPath(n);return!!await this.shouldPreventNavigation(r)}async openViewInNewTab(n){if(await this.shouldPreventNavigationForPath(n))return;this.luigi.getConfigValue("routing.useHashRouting")&&(n="#"+n);let a;try{if(a=new URL(n,window.location.origin),a.origin!==window.location.origin)return}catch{return}window.open(a.toString(),"_blank","noopener,noreferrer")}resolveTooltipText(n,r){return xe.generateTooltipText(n,r,this.luigi)}prepareRootNodes(n,r){const a=n;return a.length&&a.forEach(u=>{u.isRootNode=!0}),a}getAccessibleNodes(n,r,a){return r?r.filter(u=>xe.isNodeAccessPermitted(u,n,a,this.luigi)):[]}async handleNavigationRequest(n,r){const{path:a,preserveView:u,modalSettings:c,newTab:l,withoutSync:d,preventContextUpdate:p,preventHistoryEntry:_,options:A}=n;let P=await this.buildPath(a,A||{});const E=P.replace(/\/\/+/g,"/"),T=_?"replaceState":"pushState";if(c)c.keepPrevious||this.getModalService().closeModals(),this.luigi.navigation().openAsModal(E,c,r);else{const I={detail:{preventContextUpdate:!!p,preventHistoryEntry:!!_,withoutSync:!!d}};if(await te.get(pn).closeModals(),l){await this.openViewInNewTab(P);return}const $=this.luigi.getConfigValue("routing.disableBrowserHistory")?"replaceState":T;if(this.luigi.getConfig().routing?.useHashRouting)if(!d&&$!=="replaceState")location.hash=E;else{const M=new CustomEvent("hashchange",I);window.history[$]({path:"/#"+E},"","/#"+E),window.dispatchEvent(M)}else{const M=new CustomEvent("popstate",I);window.history[$]({path:E},"",E),window.dispatchEvent(M)}}}async getChildren(n,r={}){const a=te.get(_n);if(!n)return[];let u=[];if(a.hasChildren(n)){let l=a.getChildren(n);l&&(u=l.children)}else try{u=await cr.getConfigValueFromObjectAsync(n,"children",r||n.context),u==null&&(u=[]),u=u.map(l=>this.getExpandStructuralPathSegment(l)).map(l=>this.bindChildToParent(l,n))||[]}catch(l){console.error("Could not lazy-load children for node",l)}let c=this.getAccessibleNodes(n,u,r);return a.setChildren(n,{children:u,filteredChildren:c}),c}getExpandStructuralPathSegment(n){if(n&&n.pathSegment&&n.pathSegment.indexOf("/")!==-1){const r=n.pathSegment.split("/"),a={...n},u=(c,l)=>{const d=c.shift();let p={};return c.length?(p.pathSegment=d,l.hideFromNav&&(p.hideFromNav=l.hideFromNav),p.children=[u(c,l)]):(p=a,p.pathSegment=d),p};return u(r,n)}return n}bindChildToParent(n,r){return r&&r.pathSegment&&(n.parent=r),n}buildVirtualTree(n,r,a){const u=n.virtualTree,c=n._virtualTree,l=n._virtualViewUrl||n.viewUrl;if((u||c)&&r){let d=typeof n._virtualPathIndex=="number"?n._virtualPathIndex:void 0;u&&(d=void 0,n.keepSelectedForChildren=!0);const p=50;if(typeof d=="number"&&d>p)return;const _=(d??0)+1;if(_>p)return;const A=["_*","virtualTree","parent","children","keepSelectedForChildren","navigationContext"],P=W.removeProperties(n,A);Object.assign(P,{pathSegment:":virtualSegment_"+_,label:":virtualSegment_"+_,viewUrl:W.trimTrailingSlash(this.buildVirtualViewUrl(l||"",a,_)),_virtualTree:!0,_virtualPathIndex:_,_virtualViewUrl:l});const E=Array.isArray(n.children)&&n.children.length>0?n.children[0]._virtualTree:!1;return n.children&&!E&&console.warn(`Found both virtualTree and children nodes defined on a navigation node.
|
|
26
26
|
Children nodes are redundant and ignored when virtualTree is enabled.
|
|
27
27
|
Please refer to documentation`),[P]}}buildVirtualViewUrl(n,r,a){let u="";for(const c in r)c.startsWith("virtualSegment")&&(u+=":"+c+"/");return a?(u+=":virtualSegment_"+a+"/",n+"/"+u):n}async buildPath(n,r){const{fromVirtualTreeRoot:a,fromContext:u,fromClosestContext:c,fromParent:l,relative:d,nodeParams:p}=r,_=this.luigi.getConfigValue("routing.useHashRouting"),{path:A,query:P}=k.getCurrentPath(_),E=A+(P?"?"+P:""),T=await this.getPathData(E),I=T.nodesInPath;let $=n;if(I===void 0)return console.warn("No nodes in path found for current path:",E),$;if(a){$="";const M=[...I].map((q,oe)=>q.virtualTree?oe:-1).filter(q=>q!==-1).pop();I.forEach((q,oe)=>{q.pathSegment&&(M===void 0||oe<=M)&&($+="/"+q.pathSegment)}),$+="/"+n}else if(u){const M=u,q=[...I].reverse().find(oe=>M===oe.navigationContext);$=k.concatenatePath(k.getSubPath(q,T.pathParams),n)}else if(c){const M=[...I].reverse().find(q=>q.navigationContext&&q.navigationContext.length>0);$=k.concatenatePath(k.getSubPath(M,T.pathParams),n)}else l?$=k.concatenatePath(k.getSubPath(T.selectedNode?.parent,T.pathParams),n):d&&($=k.concatenatePath(k.getSubPath(T.selectedNode,T.pathParams),n));return p&&Object.keys(p).length>0&&($+=$.includes("?")?"&":"?",Object.entries(p).forEach((M,q)=>{$+=encodeURIComponent(k.getContentViewParamPrefix(this.luigi)+M[0])+"="+encodeURIComponent(M[1])+(q<Object.keys(p).length-1?"&":"")})),$}}function cn(){}function ec(i){return i()}function $l(){return Object.create(null)}function ss(i){i.forEach(ec)}function tc(i){return typeof i=="function"}function nc(i,n){return i!=i?n==n:i!==n||i&&typeof i=="object"||typeof i=="function"}let Xi,Yr;function Ul(i,n){return i===n||(Xi||(Xi=document.createElement("a")),Xi.href=n,i===Xi.href)}function Gm(i,n,r){const a=(function(u){if(!u)return document;const c=u.getRootNode?u.getRootNode():u.ownerDocument;return c&&c.host?c:u.ownerDocument})(i);if(!a.getElementById(n)){const u=dr("style");u.id=n,u.textContent=r,(function(c,l){(function(d,p){d.appendChild(p)})(c.head||c,l),l.sheet})(a,u)}}function Un(i,n,r){i.insertBefore(n,r||null)}function fn(i){i.parentNode&&i.parentNode.removeChild(i)}function dr(i){return document.createElement(i)}function rc(i){return document.createTextNode(i)}function mt(i,n,r){r==null?i.removeAttribute(n):i.getAttribute(n)!==r&&i.setAttribute(n,r)}function Qr(i){Yr=i}function ic(){if(!Yr)throw new Error("Function called outside component initialization");return Yr}function sc(i){ic().$$.on_mount.push(i)}const ir=[],Xr=[];let hr=[];const Dl=[],Qm=Promise.resolve();let Ma=!1;function Fa(i){hr.push(i)}const $a=new Set;let rr=0;function Q(){if(rr!==0)return;const i=Yr;do{try{for(;rr<ir.length;){const n=ir[rr];rr++,Qr(n),qm(n.$$)}}catch(n){throw ir.length=0,rr=0,n}for(Qr(null),ir.length=0,rr=0;Xr.length;)Xr.pop()();for(let n=0;n<hr.length;n+=1){const r=hr[n];$a.has(r)||($a.add(r),r())}hr.length=0}while(ir.length);for(;Dl.length;)Dl.pop()();Ma=!1,$a.clear(),Qr(i)}function qm(i){if(i.fragment!==null){i.update(),ss(i.before_update);const n=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,n),i.after_update.forEach(Fa)}}const zm=new Set;function Km(i,n){const r=i.$$;r.fragment!==null&&((function(a){const u=[],c=[];hr.forEach((l=>a.indexOf(l)===-1?u.push(l):c.push(l))),c.forEach((l=>l())),hr=u})(r.after_update),ss(r.on_destroy),r.fragment&&r.fragment.d(n),r.on_destroy=r.fragment=null,r.ctx=[])}function Ym(i,n){i.$$.dirty[0]===-1&&(ir.push(i),Ma||(Ma=!0,Qm.then(Q)),i.$$.dirty.fill(0)),i.$$.dirty[n/31|0]|=1<<n%31}function ac(i,n,r,a,u,c,l=null,d=[-1]){const p=Yr;Qr(i);const _=i.$$={fragment:null,ctx:[],props:c,update:cn,not_equal:u,bound:$l(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(p?p.$$.context:[])),callbacks:$l(),dirty:d,skip_bound:!1,root:n.target||p.$$.root};l&&l(_.root);let A=!1;if(_.ctx=r?r(i,n.props||{},((T,I,...$)=>{const M=$.length?$[0]:I;return _.ctx&&u(_.ctx[T],_.ctx[T]=M)&&(!_.skip_bound&&_.bound[T]&&_.bound[T](M),A&&Ym(i,T)),I})):[],_.update(),A=!0,ss(_.before_update),_.fragment=!!a&&a(_.ctx),n.target){if(n.hydrate){const T=(function(I){return Array.from(I.childNodes)})(n.target);_.fragment&&_.fragment.l(T),T.forEach(fn)}else _.fragment&&_.fragment.c();n.intro&&(P=i.$$.fragment)&&P.i&&(zm.delete(P),P.i(E)),(function(T,I,$){const{fragment:M,after_update:q}=T.$$;M&&M.m(I,$),Fa((()=>{const oe=T.$$.on_mount.map(ec).filter(tc);T.$$.on_destroy?T.$$.on_destroy.push(...oe):ss(oe),T.$$.on_mount=[]})),q.forEach(Fa)})(i,n.target,n.anchor),Q()}var P,E;Qr(p)}let oc;function es(i,n,r,a){const u=r[i]?.type;if(n=u==="Boolean"&&typeof n!="boolean"?n!=null:n,!a||!r[i])return n;if(a==="toAttribute")switch(u){case"Object":case"Array":return n==null?null:JSON.stringify(n);case"Boolean":return n?"":null;case"Number":return n??null;default:return n}else switch(u){case"Object":case"Array":return n&&JSON.parse(n);case"Boolean":default:return n;case"Number":return n!=null?+n:n}}function uc(i,n,r,a,u,c){let l=class extends oc{constructor(){super(i,r,u),this.$$p_d=n}static get observedAttributes(){return Object.keys(n).map((d=>(n[d].attribute||d).toLowerCase()))}};return Object.keys(n).forEach((d=>{Object.defineProperty(l.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(p){p=es(d,p,n),this.$$d[d]=p,this.$$c?.$set({[d]:p})}})})),a.forEach((d=>{Object.defineProperty(l.prototype,d,{get(){return this.$$c?.[d]}})})),c&&(l=c(l)),i.element=l,l}typeof HTMLElement=="function"&&(oc=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(i,n,r){super(),this.$$ctor=i,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(i,n,r){if(this.$$l[i]=this.$$l[i]||[],this.$$l[i].push(n),this.$$c){const a=this.$$c.$on(i,n);this.$$l_u.set(n,a)}super.addEventListener(i,n,r)}removeEventListener(i,n,r){if(super.removeEventListener(i,n,r),this.$$c){const a=this.$$l_u.get(n);a&&(a(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let n=function(c){return()=>{let l;return{c:function(){l=dr("slot"),c!=="default"&&mt(l,"name",c)},m:function(d,p){Un(d,l,p)},d:function(d){d&&fn(l)}}}};var i=n;if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},a=(function(c){const l={};return c.childNodes.forEach((d=>{l[d.slot||"default"]=!0})),l})(this);for(const c of this.$$s)c in a&&(r[c]=[n(c)]);for(const c of this.attributes){const l=this.$$g_p(c.name);l in this.$$d||(this.$$d[l]=es(l,c.value,this.$$p_d,"toProp"))}for(const c in this.$$p_d)c in this.$$d||this[c]===void 0||(this.$$d[c]=this[c],delete this[c]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$scope:{ctx:[]}}});const u=()=>{this.$$r=!0;for(const c in this.$$p_d)if(this.$$d[c]=this.$$c.$$.ctx[this.$$c.$$.props[c]],this.$$p_d[c].reflect){const l=es(c,this.$$d[c],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[c].attribute||c):this.setAttribute(this.$$p_d[c].attribute||c,l)}this.$$r=!1};this.$$c.$$.after_update.push(u),u();for(const c in this.$$l)for(const l of this.$$l[c]){const d=this.$$c.$on(c,l);this.$$l_u.set(l,d)}this.$$l={}}}attributeChangedCallback(i,n,r){this.$$r||(i=this.$$g_p(i),this.$$d[i]=es(i,r,this.$$p_d,"toProp"),this.$$c?.$set({[i]:this.$$d[i]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(i){return Object.keys(this.$$p_d).find((n=>this.$$p_d[n].attribute===i||!this.$$p_d[n].attribute&&n.toLowerCase()===i))||i}});class lc{$$=void 0;$$set=void 0;$destroy(){Km(this,1),this.$destroy=cn}$on(n,r){if(!tc(r))return cn;const a=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return a.push(r),()=>{const u=a.indexOf(r);u!==-1&&a.splice(u,1)}}$set(n){var r;this.$$set&&(r=n,Object.keys(r).length!==0)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}var J;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"})(J||(J={}));class Xm extends Event{constructor(n,r,a,u){super(n),this.detail=r,this.payload=a||r||{},this.callbackFn=u}callback(n){this.callbackFn&&this.callbackFn(n)}}const N={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 Ga{isVisible(n){return!!(n.offsetWidth||n.offsetHeight||n.getClientRects().length)}sendCustomMessageToIframe(n,r,a){const u=a||"custom";if(n?.iframe?.contentWindow){const c=new URL(n.iframe.src);u==="custom"?n.iframe.contentWindow.postMessage({msg:u,data:r},c.origin):n.iframe.contentWindow.postMessage({msg:u,...r},c.origin)}else console.error("Message target could not be resolved")}dispatchWithPayload(n,r,a,u,c){this.dispatch(n,r,a,c,u)}dispatch(n,r,a,u,c){const l=new Xm(n,a,c,u);r.dispatchEvent(l)}getTargetContainer(n){let r;return globalThis.__luigi_container_manager.container.forEach((a=>{a.iframeHandle?.iframe&&a.iframeHandle.iframe.contentWindow===n.source&&(r=a)})),r}getContainerManager(){return globalThis.__luigi_container_manager||(globalThis.__luigi_container_manager={container:[],messageListener:n=>{const r=this.getTargetContainer(n),a=r?.iframeHandle?.iframe?.contentWindow;if(a&&a===n.source)switch(n.data.msg){case J.CUSTOM_MESSAGE:{const u=n.data.data,c=u.id;delete u.id,this.dispatch(N.CUSTOM_MESSAGE,r,{id:c,_metaData:{},data:u})}break;case J.GET_CONTEXT:a.postMessage({msg:J.SEND_CONTEXT_HANDSHAKE,context:r.context||{},internal:{thirdPartyCookieCheck:{disabled:r.skipCookieCheck==="true"},currentTheme:r.theme,currentLocale:r.locale,activeFeatureToggleList:r.activeFeatureToggleList||[],cssVariables:r.cssVariables||{},anchor:r.anchor||"",userSettings:r.userSettings||null,drawer:r.drawer||!1,modal:r.modal||!1,viewStackSize:r.viewStackSize||0,isNavigateBack:r.isNavigateBack||!1},authData:r.authData||{},nodeParams:r.nodeParams||{},searchParams:r.searchParams||{},pathParams:r.pathParams||{}},n.origin);break;case J.NAVIGATION_REQUEST:this.dispatch(N.NAVIGATION_REQUEST,r,n.data.params,(u=>{a.postMessage({msg:J.CLOSE_MODAL_ANSWER,data:u},n.origin)}));break;case J.ALERT_REQUEST:this.dispatchWithPayload(N.ALERT_REQUEST,r,n,n.data?.data?.settings,(u=>{r.notifyAlertClosed(n.data?.data?.settings?.id,u)}));break;case J.INITIALIZED:this.dispatch(N.INITIALIZED,r,n.data?.params||{});break;case J.ADD_SEARCH_PARAMS_REQUEST:this.dispatch(N.ADD_SEARCH_PARAMS_REQUEST,r,{data:n.data.data,keepBrowserHistory:n.data.keepBrowserHistory});break;case J.ADD_NODE_PARAMS_REQUEST:this.dispatch(N.ADD_NODE_PARAMS_REQUEST,r,{data:n.data.data,keepBrowserHistory:n.data.keepBrowserHistory});break;case J.SHOW_CONFIRMATION_MODAL_REQUEST:this.dispatchWithPayload(N.SHOW_CONFIRMATION_MODAL_REQUEST,r,n.data.data,n.data.data?.settings,(u=>{r.notifyConfirmationModalClosed(u)}));break;case J.SHOW_LOADING_INDICATOR_REQUEST:this.dispatch(N.SHOW_LOADING_INDICATOR_REQUEST,r,n);break;case J.HIDE_LOADING_INDICATOR_REQUEST:this.dispatch(N.HIDE_LOADING_INDICATOR_REQUEST,r,n);break;case J.SET_CURRENT_LOCALE_REQUEST:this.dispatchWithPayload(N.SET_CURRENT_LOCALE_REQUEST,r,n,n.data.data);break;case J.LOCAL_STORAGE_SET_REQUEST:this.dispatchWithPayload(N.LOCAL_STORAGE_SET_REQUEST,r,n,n.data.data?.params);break;case J.RUNTIME_ERROR_HANDLING_REQUEST:this.dispatch(N.RUNTIME_ERROR_HANDLING_REQUEST,r,n);break;case J.SET_ANCHOR_LINK_REQUEST:this.dispatchWithPayload(N.SET_ANCHOR_LINK_REQUEST,r,n,n.data.anchor);break;case J.SET_THIRD_PARTY_COOKIES_REQUEST:this.dispatch(N.SET_THIRD_PARTY_COOKIES_REQUEST,r,n);break;case J.BACK_NAVIGATION_REQUEST:{let u=n.data?.goBackContext||{};if(typeof u=="string")try{u=JSON.parse(u)}catch(c){console.warn(c)}this.dispatch(N.GO_BACK_REQUEST,r,u),this.dispatch(N.BACK_NAVIGATION_REQUEST,r,n)}break;case J.GET_CURRENT_ROUTE_REQUEST:this.dispatchWithPayload(N.GET_CURRENT_ROUTE_REQUEST,r,n,n.data.data,(u=>{a.postMessage({msg:J.SEND_CURRENT_ROUTE_ANSWER,data:{correlationId:n.data?.data?.id,route:u}},n.origin)}));break;case J.NAVIGATION_COMPLETED_REPORT:this.dispatch(N.NAVIGATION_COMPLETED_REPORT,r,n);break;case J.UPDATE_MODAL_PATH_DATA_REQUEST:this.dispatchWithPayload(N.UPDATE_MODAL_PATH_DATA_REQUEST,r,n,n.data.params);break;case J.UPDATE_MODAL_SETTINGS:this.dispatchWithPayload(N.UPDATE_MODAL_SETTINGS_REQUEST,r,n,{addHistoryEntry:n.data.addHistoryEntry,updatedModalSettings:n.data.updatedModalSettings});break;case J.CHECK_PATH_EXISTS_REQUEST:this.dispatchWithPayload(N.CHECK_PATH_EXISTS_REQUEST,r,n,n.data.data,(u=>{a.postMessage({msg:J.SEND_PATH_EXISTS_ANSWER,data:{correlationId:n.data?.data?.id,pathExists:u}},n.origin)}));break;case J.SET_DIRTY_STATUS_REQUEST:this.dispatchWithPayload(N.SET_DIRTY_STATUS_REQUEST,r,n,{dirty:n.data.dirty});break;case J.SET_VIEW_GROUP_DATA_REQUEST:this.dispatch(N.SET_VIEW_GROUP_DATA_REQUEST,r,n.data.data);break;case J.ADD_BACKDROP_REQUEST:this.dispatch(N.ADD_BACKDROP_REQUEST,r,n);break;case J.REMOVE_BACKDROP_REQUEST:this.dispatch(N.REMOVE_BACKDROP_REQUEST,r,n);break;case J.CLOSE_CURRENT_MODAL_REQUEST:this.dispatch(N.CLOSE_CURRENT_MODAL_REQUEST,r,n)}}},window.addEventListener("message",globalThis.__luigi_container_manager.messageListener)),globalThis.__luigi_container_manager}registerContainer(n){this.getContainerManager().container.push(n)}}const ln=new Ga,sr=new class{constructor(){this.updateContext=(i,n,r,a,u,c)=>{if(r){const l=n||{};ln.sendCustomMessageToIframe(r,{context:i,nodeParams:a||{},pathParams:u||{},searchParams:c||{},internal:l,withoutSync:!0},J.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update context on inexisting iframe")},this.updateViewUrl=(i,n,r,a)=>{if(a){const u=r||{};ln.sendCustomMessageToIframe(a,{context:n,internal:u,withoutSync:!1,viewUrl:i},J.SEND_CONTEXT_OBJECT)}else console.warn("Attempting to update route on inexisting iframe")},this.updateAuthData=(i,n)=>{i&&n?ln.sendCustomMessageToIframe(i,{authData:n},J.AUTH_SET_TOKEN):console.warn("Attempting to update auth data on inexisting iframe or authData")},this.sendCustomMessage=(i,n,r,a,u)=>{if(r&&n._luigi_mfe_webcomponent)ln.dispatch(i,n._luigi_mfe_webcomponent,u);else{const c={...u};c.id&&console.warn('Property "id" is reserved and can not be used in custom message data'),c.id=i,ln.sendCustomMessageToIframe(a,c)}},this.notifyConfirmationModalClosed=(i,n)=>{const r={data:{confirmed:i}};ln.sendCustomMessageToIframe(n,r,J.CONFIRMATION_MODAL_CLOSED)}}notifyAlertClosed(i,n,r){const a=n?{id:i,dismissKey:n}:{id:i};ln.sendCustomMessageToIframe(r,a,J.ALERT_CLOSED)}},Ml=i=>{if(!i)return;const n=i;return n.forEach(((r,a)=>{n[a]=r+(r.indexOf(";")!=-1?"":";"),n[a]=i[a].replaceAll('"',"'")})),n.join(" ")};class pr{constructor(n){n?(this.rendererObject=n,this.config=n.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(n){return document.createElement("div")}attachCompoundItem(n,r){n.appendChild(r)}}class Zm extends pr{constructor(n){super(n||{use:{}}),n&&n.use&&n.use.extends&&(this.superRenderer=cc({use:n.use.extends,config:n.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(n){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(n,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(n):super.createCompoundItemContainer(n)}attachCompoundItem(n,r){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(n,r,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(n,r):super.attachCompoundItem(n,r)}}class Jm extends pr{createCompoundContainer(){const n="__lui_compound_"+new Date().getTime(),r=document.createElement("div");r.classList.add(n);let a="";return this.config.layouts&&this.config.layouts.forEach((u=>{if(u.minWidth||u.maxWidth){let c="@media only screen ";u.minWidth!=null&&(c+=`and (min-width: ${u.minWidth}px) `),u.maxWidth!=null&&(c+=`and (max-width: ${u.maxWidth}px) `),c+=`{
|
|
28
28
|
.${n} {
|
|
@@ -51,5 +51,5 @@ Please refer to documentation`),[P]}}buildVirtualViewUrl(n,r,a){let u="";for(con
|
|
|
51
51
|
|
|
52
52
|
main.lui-isolated {
|
|
53
53
|
line-height: 0;
|
|
54
|
-
}`,r=rc(" "),a=dr("iframe"),Ul(a.src,u=i[3])||mt(a,"src",u),mt(a,"title",i[1]),mt(a,"allow",c=Ml(i[0])),mt(a,"sandbox",l=i[2]?i[2].join(" "):void 0)},m(d,p){Un(d,n,p),Un(d,r,p),Un(d,a,p),i[28](a)},p(d,p){8&p[0]&&!Ul(a.src,u=d[3])&&mt(a,"src",u),2&p[0]&&mt(a,"title",d[1]),1&p[0]&&c!==(c=Ml(d[0]))&&mt(a,"allow",c),4&p[0]&&l!==(l=d[2]?d[2].join(" "):void 0)&&mt(a,"sandbox",l)},d(d){d&&(fn(n),fn(r),fn(a)),i[28](null)}}}function jm(i){let n,r,a=i[5]&&Wl(i);return{c(){n=dr("main"),a&&a.c(),mt(n,"class",r=i[4]?void 0:"lui-isolated")},m(u,c){Un(u,n,c),a&&a.m(n,null),i[29](n)},p(u,c){u[5]?a?a.p(u,c):(a=Wl(u),a.c(),a.m(n,null)):a&&(a.d(1),a=null),16&c[0]&&r!==(r=u[4]?void 0:"lui-isolated")&&mt(n,"class",r)},i:cn,o:cn,d(u){u&&fn(n),a&&a.d(),i[29](null)}}}function eS(i,n,r){let{activeFeatureToggleList:a}=n,{allowRules:u}=n,{anchor:c}=n,{authData:l}=n,{clientPermissions:d}=n,{context:p}=n,{deferInit:_}=n,{dirtyStatus:A}=n,{documentTitle:P}=n,{hasBack:E}=n,{label:T}=n,{locale:I}=n,{noShadow:$}=n,{nodeParams:M}=n,{pathParams:q}=n,{sandboxRules:oe}=n,{searchParams:fe}=n,{skipCookieCheck:Je}=n,{skipInitCheck:Ee}=n,{theme:je}=n,{userSettings:be}=n,{viewurl:Ge}=n,{webcomponent:Le}=n;const Ce={};let Te,O,Zt=!1;const ut=new fc,Fe=x=>{if(!Zt){x.sendCustomMessage=(ge,ye)=>{sr.sendCustomMessage(ge,x.getNoShadow()?x:Te,!!Le,Ce,ye)},x.updateContext=(ge,ye)=>{if(r(8,p=ge),Le)(x.getNoShadow()?x:Te)._luigi_mfe_webcomponent.context=ge;else{const Qe={...ye||{},activeFeatureToggleList:x.activeFeatureToggleList||[],currentLocale:x.locale,currentTheme:x.theme,userSettings:x.userSettings||null,cssVariables:x.cssVariables||{},anchor:x.anchor||"",drawer:x.drawer||!1,modal:x.modal||!1,viewStackSize:x.viewStackSize||0,isNavigateBack:x.isNavigateBack||!1};sr.updateContext(ge,Qe,Ce,M,q,fe)}},x.closeAlert=(ge,ye)=>{x.notifyAlertClosed(ge,ye)},x.notifyAlertClosed=(ge,ye)=>{x.isConnected&&(Le?ut.resolveAlert(ge,ye):sr.notifyAlertClosed(ge,ye,Ce))},x.notifyConfirmationModalClosed=ge=>{x.isConnected&&(Le?ut.notifyConfirmationModalClosed(!!ge):sr.notifyConfirmationModalClosed(!!ge,Ce))},ln.registerContainer(x),ut.thisComponent=x;const et=qr.resolveContext(p);if(x.updateViewUrl=(ge,ye)=>{ge?.length&&sr.updateViewUrl(ge,qr.resolveContext(p),ye,Ce)},Le&&Le!="false"){x.getNoShadow()?x.innerHTML="":(r(7,Te.innerHTML="",Te),x.attachShadow({mode:"open"}).append(Te));const ge=qr.checkWebcomponentValue(Le);ut.renderWebComponent(Ge,x.getNoShadow()?x:Te,et,typeof ge=="object"?{webcomponent:ge}:{})}else x.getNoShadow()||(x.innerHTML="",x.attachShadow({mode:"open"}).append(Te));Ee?(x.initialized=!0,setTimeout((()=>{ut.dispatchLuigiEvent(N.INITIALIZED,{})}))):Le&&(x.getNoShadow()?x:Te).addEventListener("wc_ready",(()=>{(x.getNoShadow()?x:Te)._luigi_mfe_webcomponent?.deferLuigiClientWCInit||(x.initialized=!0,ut.dispatchLuigiEvent(N.INITIALIZED,{}))})),r(5,Zt=!0),x.containerInitialized=!0}};var En;return sc((async()=>{r(27,O=Te.parentNode),r(27,O.iframeHandle=Ce,O),r(27,O.init=()=>{Fe(O)},O),!_&&Ge&&Fe(O)})),En=async()=>{},ic().$$.on_destroy.push(En),i.$$set=x=>{"activeFeatureToggleList"in x&&r(9,a=x.activeFeatureToggleList),"allowRules"in x&&r(0,u=x.allowRules),"anchor"in x&&r(10,c=x.anchor),"authData"in x&&r(11,l=x.authData),"clientPermissions"in x&&r(12,d=x.clientPermissions),"context"in x&&r(8,p=x.context),"deferInit"in x&&r(13,_=x.deferInit),"dirtyStatus"in x&&r(14,A=x.dirtyStatus),"documentTitle"in x&&r(15,P=x.documentTitle),"hasBack"in x&&r(16,E=x.hasBack),"label"in x&&r(1,T=x.label),"locale"in x&&r(17,I=x.locale),"noShadow"in x&&r(18,$=x.noShadow),"nodeParams"in x&&r(19,M=x.nodeParams),"pathParams"in x&&r(20,q=x.pathParams),"sandboxRules"in x&&r(2,oe=x.sandboxRules),"searchParams"in x&&r(21,fe=x.searchParams),"skipCookieCheck"in x&&r(22,Je=x.skipCookieCheck),"skipInitCheck"in x&&r(23,Ee=x.skipInitCheck),"theme"in x&&r(24,je=x.theme),"userSettings"in x&&r(25,be=x.userSettings),"viewurl"in x&&r(3,Ge=x.viewurl),"webcomponent"in x&&r(4,Le=x.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!Zt&&Ge&&!_&&O&&Fe(O)},[u,T,oe,Ge,Le,Zt,Ce,Te,p,a,c,l,d,_,A,P,E,I,$,M,q,fe,Je,Ee,je,be,()=>a&&u&&c&&l&&d&&A&&P&&E&&I&&$&&M&&q&&oe&&fe&&Je&&Ee&&je&&be,O,function(x){Xr[x?"unshift":"push"]((()=>{Ce.iframe=x,r(6,Ce)}))},function(x){Xr[x?"unshift":"push"]((()=>{Te=x,r(7,Te)}))}]}class hc extends lc{constructor(n){super(),ac(this,n,eS,jm,nc,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),Q()}get allowRules(){return this.$$.ctx[0]}set allowRules(n){this.$$set({allowRules:n}),Q()}get anchor(){return this.$$.ctx[10]}set anchor(n){this.$$set({anchor:n}),Q()}get authData(){return this.$$.ctx[11]}set authData(n){this.$$set({authData:n}),Q()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(n){this.$$set({clientPermissions:n}),Q()}get context(){return this.$$.ctx[8]}set context(n){this.$$set({context:n}),Q()}get deferInit(){return this.$$.ctx[13]}set deferInit(n){this.$$set({deferInit:n}),Q()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),Q()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(n){this.$$set({documentTitle:n}),Q()}get hasBack(){return this.$$.ctx[16]}set hasBack(n){this.$$set({hasBack:n}),Q()}get label(){return this.$$.ctx[1]}set label(n){this.$$set({label:n}),Q()}get locale(){return this.$$.ctx[17]}set locale(n){this.$$set({locale:n}),Q()}get noShadow(){return this.$$.ctx[18]}set noShadow(n){this.$$set({noShadow:n}),Q()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(n){this.$$set({nodeParams:n}),Q()}get pathParams(){return this.$$.ctx[20]}set pathParams(n){this.$$set({pathParams:n}),Q()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(n){this.$$set({sandboxRules:n}),Q()}get searchParams(){return this.$$.ctx[21]}set searchParams(n){this.$$set({searchParams:n}),Q()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(n){this.$$set({skipCookieCheck:n}),Q()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),Q()}get theme(){return this.$$.ctx[24]}set theme(n){this.$$set({theme:n}),Q()}get userSettings(){return this.$$.ctx[25]}set userSettings(n){this.$$set({userSettings:n}),Q()}get viewurl(){return this.$$.ctx[3]}set viewurl(n){this.$$set({viewurl:n}),Q()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(n){this.$$set({webcomponent:n}),Q()}get unwarn(){return this.$$.ctx[26]}}function tS(i){Gm(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function nS(i){let n;return{c(){n=dr("main"),mt(n,"class","svelte-1buc46y")},m(r,a){Un(r,n,a),i[21](n)},p:cn,i:cn,o:cn,d(r){r&&fn(n),i[21](null)}}}function rS(i,n,r){let a,u,{activeFeatureToggleList:c}=n,{anchor:l}=n,{clientPermissions:d}=n,{compoundConfig:p}=n,{context:_}=n,{deferInit:A}=n,{dirtyStatus:P}=n,{documentTitle:E}=n,{hasBack:T}=n,{locale:I}=n,{noShadow:$}=n,{nodeParams:M}=n,{pathParams:q}=n,{searchParams:oe}=n,{skipInitCheck:fe}=n,{theme:Je}=n,{userSettings:Ee}=n,{viewurl:je}=n,{webcomponent:be}=n,Ge=!1;const Le=new Ga,Ce=new fc,Te=O=>{if(!p||Ge)return;O.updateContext=(Fe,En)=>{const x=O.getNoShadow()?O:a;x._luigi_mfe_webcomponent.context=Fe,r(1,_=Fe);const et=x._luigi_mfe_webcomponent;et&&et.querySelectorAll("[lui_web_component]")?.forEach((ye=>{const Qe=ye.context||{};ye.context=Object.assign(Qe,Fe)}))};const Zt=qr.resolveContext(_);r(2,A=!1),O.notifyAlertClosed=(Fe,En)=>{O.isConnected&&Ce.resolveAlert(Fe,En)},O.notifyConfirmationModalClosed=Fe=>{O.isConnected&&Ce.notifyConfirmationModalClosed(!!Fe)};const ut={compound:p,viewUrl:je,webcomponent:qr.checkWebcomponentValue(be)||!0};O.getNoShadow()?O.innerHTML="":(r(0,a.innerHTML="",a),O.attachShadow({mode:"open"}).append(a)),Ce.renderWebComponentCompound(ut,O.getNoShadow()?O:a,Zt).then((Fe=>{u=Fe,fe||!ut.viewUrl?(O.initialized=!0,setTimeout((()=>{Ce.dispatchLuigiEvent(N.INITIALIZED,{})}))):u.LuigiClient&&!u.deferLuigiClientWCInit&&(O.initialized=!0,Ce.dispatchLuigiEvent(N.INITIALIZED,{}))})),Ge=!0,O.containerInitialized=!0};return sc((async()=>{const O=a.getRootNode()===document?a.parentNode:a.getRootNode().host;O.init=()=>{Te(O)},A||Te(O),Le.registerContainer(O),Ce.thisComponent=O})),i.$$set=O=>{"activeFeatureToggleList"in O&&r(3,c=O.activeFeatureToggleList),"anchor"in O&&r(4,l=O.anchor),"clientPermissions"in O&&r(5,d=O.clientPermissions),"compoundConfig"in O&&r(6,p=O.compoundConfig),"context"in O&&r(1,_=O.context),"deferInit"in O&&r(2,A=O.deferInit),"dirtyStatus"in O&&r(7,P=O.dirtyStatus),"documentTitle"in O&&r(8,E=O.documentTitle),"hasBack"in O&&r(9,T=O.hasBack),"locale"in O&&r(10,I=O.locale),"noShadow"in O&&r(11,$=O.noShadow),"nodeParams"in O&&r(12,M=O.nodeParams),"pathParams"in O&&r(13,q=O.pathParams),"searchParams"in O&&r(14,oe=O.searchParams),"skipInitCheck"in O&&r(15,fe=O.skipInitCheck),"theme"in O&&r(16,Je=O.theme),"userSettings"in O&&r(17,Ee=O.userSettings),"viewurl"in O&&r(18,je=O.viewurl),"webcomponent"in O&&r(19,be=O.webcomponent)},[a,_,A,c,l,d,p,P,E,T,I,$,M,q,oe,fe,Je,Ee,je,be,()=>c&&l&&d&&P&&E&&T&&I&&$&&M&&q&&oe&&fe&&Je&&Ee,function(O){Xr[O?"unshift":"push"]((()=>{a=O,r(0,a)}))}]}uc(hc,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{sendCustomMessage=n("sendCustomMessage");updateContext=n("updateContext");updateViewUrl=n("updateViewUrl");closeAlert=n("closeAlert");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.error("Error in super.attributeChangedCallback",c)}this.containerInitialized&&(r==="context"&&this.updateContext(JSON.parse(u)),r==="auth-data"&&sr.updateAuthData(this.iframeHandle,JSON.parse(u)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class Vl extends lc{constructor(n){super(),ac(this,n,rS,nS,nc,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},tS)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),Q()}get anchor(){return this.$$.ctx[4]}set anchor(n){this.$$set({anchor:n}),Q()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(n){this.$$set({clientPermissions:n}),Q()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(n){this.$$set({compoundConfig:n}),Q()}get context(){return this.$$.ctx[1]}set context(n){this.$$set({context:n}),Q()}get deferInit(){return this.$$.ctx[2]}set deferInit(n){this.$$set({deferInit:n}),Q()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),Q()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(n){this.$$set({documentTitle:n}),Q()}get hasBack(){return this.$$.ctx[9]}set hasBack(n){this.$$set({hasBack:n}),Q()}get locale(){return this.$$.ctx[10]}set locale(n){this.$$set({locale:n}),Q()}get noShadow(){return this.$$.ctx[11]}set noShadow(n){this.$$set({noShadow:n}),Q()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(n){this.$$set({nodeParams:n}),Q()}get pathParams(){return this.$$.ctx[13]}set pathParams(n){this.$$set({pathParams:n}),Q()}get searchParams(){return this.$$.ctx[14]}set searchParams(n){this.$$set({searchParams:n}),Q()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),Q()}get theme(){return this.$$.ctx[16]}set theme(n){this.$$set({theme:n}),Q()}get userSettings(){return this.$$.ctx[17]}set userSettings(n){this.$$set({userSettings:n}),Q()}get viewurl(){return this.$$.ctx[18]}set viewurl(n){this.$$set({viewurl:n}),Q()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(n){this.$$set({webcomponent:n}),Q()}get unwarn(){return this.$$.ctx[20]}}uc(Vl,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{updateContext=n("updateContext");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.warn("Error in attributeChangedCallback",c)}this.containerInitialized&&r==="context"&&this.updateContext(JSON.parse(u))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",hc.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",Vl.element);class _r{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(n){this.decorators=this.decorators.filter(r=>r.uid!==n.uid).concat(n)}applyDecorators(n,r){if(!n)return n;const a=new URL(W.prependOrigin(n)),u=this.decorators.filter(c=>c.type==="queryString");for(let c=0;c<u.length;c++){const l=u[c];a.searchParams.has(l.key)&&a.searchParams.delete(l.key);const d=l.valueFn();a.searchParams.append(l.key,d)}return r&&(a.search=decodeURIComponent(a.search)),a.href}}const Ua=async(i,n,r)=>{const a=await n.readUserSettings(),c=i.userSettingsGroup&&typeof a=="object"&&a!==null&&i.userSettingsGroup?a[i.userSettingsGroup]:null,l=r?.nodeParams||{},d=r?.pathParams||{},p=r?.searchParams||{};if(i.webcomponent&&i.viewUrl&&!k.checkWCUrl(i.viewUrl,n))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const _=document.createElement("luigi-compound-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.compoundConfig=i.compound,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=xe.findVirtualTreeRootNode(i),n.getEngine()._comm.addListeners(_,n),_}else{const _=document.createElement("luigi-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.cssVariables=await n.theming().getCSSVariables(),_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=xe.findVirtualTreeRootNode(i),gc(_,n),dc(_,n),n.getEngine()._comm.addListeners(_,n),_}},gc=(i,n)=>{const r=n.getConfigValue("settings.customSandboxRules");if(!r?.length)return;const a=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],u=r?[...new Set([...a,...r])]:a;i.sandboxRules=u},dc=(i,n)=>{const r=n.getConfigValue("settings.allowRules");r?.length&&(r.forEach((a,u)=>{r[u]=a+(a.indexOf(";")!=-1?"":";")}),i.allowRules=r)},Ue={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{console.log("Init UI..."),Ue.navService=te.get(vn),Ue.routingService=te.get(Dn),Ue.luigi=i,i.getEngine()._connector?.renderMainLayout()},update:async i=>{const n=Ue.routingService.getCurrentRoute();if(!n)return;const r=!i||i.length===0;(r||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&Ue.luigi.getEngine()._connector?.renderTopNav(await Ue.navService.getTopNavData(n.path)),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(te.get(_n).deleteCache(),Ue.luigi.getEngine()._connector?.renderLeftNav(await Ue.navService.getLeftNavData(n.path)),Ue.luigi.getEngine()._connector?.renderTabNav(await Ue.navService.getTabNavData(n.path))),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(te.get(_n).deleteCache(),n.node&&Ue.updateMainContent(n.node,Ue.luigi))},updateMainContent:async(i,n,r,a,u)=>{const c=await n.readUserSettings(),d=i.userSettingsGroup&&typeof c=="object"&&c!==null&&i.userSettingsGroup?c[i.userSettingsGroup]:null,p=n.getEngine()._connector?.getContainerWrapper();n.getEngine()._connector?.hideLoadingIndicator(p);const _=r?.nodeParams||{},A=r?.pathParams||{},P=r?.searchParams||{};if(i&&p){let E,T;if((i.virtualTree||i._virtualTree)&&(T=xe.findVirtualTreeRootNode(i)),[...p.childNodes].forEach(I=>{I.tagName?.indexOf("LUIGI-")===0&&(I.viewGroup&&i.viewGroup!==I.viewGroup?I.style.display="none":I.viewGroup||I.virtualTree&&T===I.virtualTreeRootNode?E=I:I.remove())}),E)a||(E.style.display="block",E.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,A,n),i.decodeViewUrl??!1):"",E.nodeParams=_,E.pathParams=A,E.clientPermissions=i.clientPermissions,E.searchParams=P,E.locale=n.i18n().getCurrentLocale(),E.theme=n.theming().getCurrentTheme(),E.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),E.userSettingsGroup=i.userSettingsGroup,E.userSettings=d,gc(E,n),dc(E,n)),u||E.updateContext(i.context||{});else{const I=await Ua(i,n,r);p?.appendChild(I);const $=n.getEngine()._connector;i.loadingIndicator?.enabled!==!1&&$?.showLoadingIndicator(p)}}},openModal:async(i,n,r,a)=>{const u=await Ua(n,i),c=te.get(Dn),l=te.get(pn);let d=!1,p,_;const P=new Promise(I=>{p=()=>{d||(d=!0,I(),l.removeLastModalFromStack())},_=()=>{p&&p(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},u.addEventListener(N.CLOSE_CURRENT_MODAL_REQUEST,_)}),E={closePromise:P,resolveFn:p,onCloseRequestHandler:_,onInternalClose:()=>{try{E.resolveFn&&E.resolveFn()}catch(I){console.warn("onInternalClose failed",I)}},modalsettings:r};l.registerModal(E),i.getEngine()._connector?.renderModal(u,r,()=>{a?.(),l.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},()=>P);const T=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&T?.showLoadingIndicator(u.parentElement)},updateModalSettings:(i,n,r)=>{const a=te.get(pn);if(a.getModalStackLength()===0)return;a.updateFirstModalSettings(i);const u=te.get(Dn),c=k.getModalPathFromPath(r);c&&u.updateModalDataInUrl(c,a.getModalSettings(),n),r.getEngine()._connector?.updateModalSettings(a.getModalSettings())},openDrawer:async(i,n,r,a)=>{const u=await Ua(n,i);i.getEngine()._connector?.renderDrawer(u,r,a);const c=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&c?.showLoadingIndicator(u.parentElement)}};class Dn{constructor(n){this.luigi=n}getNavigationService(){return this.navigationService||(this.navigationService=te.get(vn)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const n=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||n).filter(a=>location.href.match(a)).length!==0}enableRouting(){const n=this.luigi.getConfig();console.log("Init Routing...",n.routing),n.routing?.useHashRouting?(window.addEventListener("hashchange",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(k.getCurrentPath(!0),u,a)}),this.handleRouteChange(k.getCurrentPath(!0))):(window.addEventListener("popstate",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(k.getCurrentPath(),u,a)}),this.handleRouteChange(k.getCurrentPath()))}async handleRouteChange(n,r=!1,a=!1){const u=n.path,c=n.query,l=u+(c?"?"+c:""),d=new URLSearchParams(c),p={};if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(l),await this.shouldShowModalPathInUrl(n),d.forEach((T,I)=>{p[I]=T}),this.checkInvalidateCache(this.previousPathData,u);const _=await this.getNavigationService().getPathData(u);this.previousPathData=_;const A=k.filterNodeParams(p,this.luigi),P=await this.getNavigationService().shouldRedirect(u,_);if(P){this.luigi.navigation().navigate(P);return}this.currentRoute={raw:window.location.href,path:u,nodeParams:A},this.luigi.getEngine()._connector?.renderTopNav(await this.getNavigationService().getTopNavData(u,_)),this.luigi.getEngine()._connector?.renderLeftNav(await this.getNavigationService().getLeftNavData(u,_)),this.luigi.getEngine()._connector?.renderTabNav(await this.getNavigationService().getTabNavData(u,_));const E=_?.selectedNode??await this.getNavigationService().getCurrentNode(u);if(E){const T={nodeParams:A||{},pathParams:_?.pathParams||{},searchParams:k.prepareSearchParamsForClient(E,this.luigi)};this.currentRoute.node=E,this.getNavigationService().onNodeChange(this.previousNode,E),this.previousNode=E,Ue.updateMainContent(E,this.luigi,T,r,a)}}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(n){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(n)}async handleBookmarkableModalPath(n){const r=te.get(vn),a=te.get(pn),u=new URLSearchParams(n?.query||""),c=k.getModalViewParamName(this.luigi),l=u.get(c);if(l){const d=u.get(`${c}Params`);try{const p=JSON.parse(d||"{}"),{nodeObject:_}=await r.extractDataFromPath(l);document.querySelector(".lui-modal luigi-container")?this.luigi.getEngine()._connector?.updateModalSettings(p):this.luigi.navigation().openAsModal(l,p||_.openNodeInModal)}catch(p){console.error("Error parsing modal settings from URL parameters",p)}}else{a.closeModals();return}}appendModalDataToUrl(n,r){const a=k.getHashQueryParamSeparator(),u=k.getQueryParams(this.luigi),c=k.getModalViewParamName(this.luigi),l=u[c],d=new URL(location.href),p=this.luigi.getConfigValue("routing.useHashRouting");let _=history.state,A,P;if(p){let[E,T]=d.hash.split("?");A=E,P=k.getURLWithoutModalData(T,c),P&&(A+="?"+P)}else A=d.pathname,P=k.getURLWithoutModalData(d.search,c),P&&(A+="?"+k.getURLWithoutModalData(d.search,c));if(_=k.handleHistoryState(_,A),l!==n){if(u[c]=n,r&&Object.keys(r).length&&(u[`${c}Params`]=JSON.stringify(r)),p){const E=location.hash.indexOf(a);E!==-1&&(d.hash=d.hash.slice(0,E)),d.hash=`${d.hash}${a}${k.encodeParams(u)}`}else d.search=`?${k.encodeParams(u)}`;history.pushState(_,"",d.href)}else{const E=new URL(d);if(p){let T=E.hash.split("?")[0];E.hash=T,P&&(E.hash+="?"+P)}else E.search=P;history.replaceState({},"",E.href),history.pushState(_,"",d.href)}}removeModalDataFromUrl(n){const r=k.getQueryParams(this.luigi),a=k.getModalViewParamName(this.luigi);let u=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let l={};r[a]&&(l[a]=r[a]),r[`${a}Params`]&&(l[`${a}Params`]=r[`${a}Params`]);let d=k.encodeParams(l);u.hash.includes(`?${d}`)?u.hash=u.hash.replace(`?${d}`,""):u.hash.includes(`&${d}`)&&(u.hash=u.hash.replace(`&${d}`,""))}else{let l=new URLSearchParams(u.search.slice(1));l.delete(a),l.delete(`${a}Params`);let d="";Array.from(l.keys()).forEach(p=>{d+=(d===""?"?":"&")+p+"="+l.get(p)}),u.search=d}if(history.state&&history.state.modalHistoryLength>=0&&n){history.state.modalHistoryLength;const l=history.state.pathBeforeHistory;let d=!1;if(window.addEventListener("popstate",p=>{d?(history.replaceState({},"",l),history.pushState({},"",l),history.back()):(history.pushState({},"",l),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const p=history.length-1;d=!0,history.go(-p),window.Luigi.preventLoadingModalData=!0}else{const p=history.state.modalHistoryLength;history.go(-p)}}else history.pushState({},"",u.href)}setFeatureToggle(n){const r=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),a=this.luigi.featureToggles();r&&typeof n=="string"&&k.setFeatureToggles(r,n,a)}updateModalDataInUrl(n,r,a){let u=k.getHashQueryParamSeparator();const c=k.getQueryParams(this.luigi),l=k.getModalViewParamName(this.luigi);c[l]=n,r&&Object.keys(r).length&&(c[`${l}Params`]=JSON.stringify(r));const d=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const _=location.hash.indexOf(u);_!==-1&&(d.hash=d.hash.slice(0,_)),d.hash=`${d.hash}${u}${k.encodeParams(c)}`}else d.search=`?${k.encodeParams(c)}`;a?history.pushState(window.state,"",d.href):history.replaceState(window.state,"",d.href)}checkInvalidateCache(n,r){if(!n)return;const a=te.get(_n);let u=r.split("/");if(n.nodesInPath&&n.nodesInPath.length>0){let c=n.nodesInPath.slice(1),l=!0;for(let d=0;d<c.length;d++){let p=u.length>d?u[d]:void 0,_=c[d];if(p!==_.pathSegment||!l)if(k.isDynamicNode(_)){if(!l||p!==k.getDynamicNodeValue(_,n.pathParams)){a.deleteNodesRecursively(_);break}}else l=!1}}else a.deleteCache()}}class iS{constructor(n){this.hashRouting=!1,this.options={fromContext:null,fromClosestContext:!1,fromVirtualTreeRoot:!1,fromParent:!1,nodeParams:{}},this.navigate=async(r,a,u,c,l)=>{const d=r[0]!=="/";this.options.relative=d;const p={modalSettings:u,newTab:!1,options:this.options,path:r,preserveView:a,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(p,void 0)},this.openAsModal=async(r,a,u)=>{a?.keepPrevious||await this.modalService.closeModals();const c=r.replace(/\/\/+/g,"/"),l=await this.navService.getCurrentNode(c),d=a||{};d.title||(d.title=l.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(c,d),this.luigi.getEngine()._ui.openModal(this.luigi,l,d,u)},this.openAsDrawer=async(r,a,u)=>{const c=r.replace(/\/\/+/g,"/"),l=await this.navService.getCurrentNode(c),d=a||{};d.title||(d.title=l.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,l,d,u)},this.runTimeErrorHandler=async r=>{const{path:a}=k.getCurrentPath(this.luigi.getConfig().routing?.useHashRouting),u=await this.navService.getCurrentNode(a),c=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");u?.runTimeErrorHandler?.errorFn&&W.isFunction(u?.runTimeErrorHandler?.errorFn)?u.runTimeErrorHandler.errorFn(r,u):c?.errorFn&&W.isFunction(c.errorFn)&&c.errorFn(r,u)},this.luigi=n,this.hashRouting=n.getConfig().routing?.useHashRouting,this.navService=te.get(vn),this.routingService=te.get(Dn),this.modalService=te.get(pn)}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this.options.fromParent=!1,this}fromContext(n){return this.options.fromContext=n,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this.options.fromParent=!1,this}fromParent(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!1,this.options.fromParent=!0,this}withParams(n){return n&&Object.assign(this.options.nodeParams??{},n),this}}class sS{constructor(n){this.luigi=n}addSearchParams(n,r=!1){if(!W.isObject(n)){console.log("Params argument must be an object");return}const a=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?a.hash=k.addParamsOnHashRouting(n,a.hash):k.modifySearchParams(n,a.searchParams),this.handleBrowserHistory(r,a),this.luigi.configChanged()}getSearchParams(){const n={},r=["__proto__","constructor","prototype"],a=new URL(location.href);let u;if(this.luigi.getConfigValue("routing.useHashRouting")){const c=a.hash.split("?")[1];u=c?new URLSearchParams(c).entries():[]}else u=a.searchParams.entries();for(const[c,l]of u){if(r.some(d=>c===d)){console.warn(`Blocked because of potentially dangerous query param: ${c}`);continue}n[c]=l}return n}handleBrowserHistory(n,r){const a=this.sanitizeUrl(r.href);if(!a){console.warn("invalid url: "+a);return}n?window.history.pushState({},"",a):window.history.replaceState({},"",a)}sanitizeUrl(n){return new URL(location.href).origin===new URL(n).origin?n:void 0}addNodeParams(n,r){if(!W.isObject(n)){console.log("Params argument must be an object");return}const a=k.getContentViewParamPrefix(this.luigi),u=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?u.hash=k.addParamsOnHashRouting(n,u.hash,a):k.modifySearchParams(n,u.searchParams,a),this.handleBrowserHistory(r,u),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}class aS{#e;#o="";constructor(n){this.#e=n}async getAvailableThemes(){return await this.#e.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(n){this.#o=n,this.#e.__cssVars=void 0}async getThemeObject(n){return(await this.getAvailableThemes())?.find(a=>a.id===n)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.#o)return this.#o;const n=this.#e.getConfigValue("settings.theming");return n.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",n),n.defaultTheme}isThemingAvailable(){return!!this.#e.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const n=this.#e.getConfigValue("settings.theming.variables.file");if(n)try{const r=await fetch(n);window.Luigi.__cssVars=(await r.json()).root,Object.keys(window.Luigi.__cssVars).forEach(a=>{const u=getComputedStyle(document.documentElement).getPropertyValue("--"+a);u&&(window.Luigi.__cssVars[a]=u)})}catch(r){W.isFunction(this.#e.getConfigValue("settings.theming.variables.errorHandling"))?this.#e.getConfigValue("settings.theming.variables.errorHandling")(r):console.error("CSS variables file error: ",r)}else this.#e.getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(r=>{window.Luigi.__cssVars[r]=getComputedStyle(document.documentElement).getPropertyValue("--"+r)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const n=te.get(_r);(()=>{const a=this.#e.getConfigValue("settings.theming");a&&a.nodeViewURLDecorator&&a.nodeViewURLDecorator.queryStringParameter&&n.add({type:"queryString",uid:"theming",key:a.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const u=this.getCurrentTheme(),c=a.nodeViewURLDecorator.queryStringParameter.value;return c?c(u):u}}),a&&a.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}class as{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(n,r){if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const a=new Set;a.add(r),this.unsavedChanges={dirtySet:a}}this.unsavedChanges.persistUrl=window.location.href,n?this.unsavedChanges.dirtySet?.add(r):this.unsavedChanges.dirtySet?.delete(r)}clearDirtyState(n){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(n?this.unsavedChanges.dirtySet.delete(n):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let Bl;const Re={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),Re.luigi=i,Re.documentTitle=rs(void 0),Bl=te.get(as)},processAlert:(i,n,r)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");const a={openFromClient:n,close:()=>{i.id&&r.notifyAlertClosed(i.id)},link:u=>{if(i.links){const c=i.links[u];if(c&&(c.url&&Re.luigi?.navigation().navigate(c.url),c.dismissKey&&i.id))return r.notifyAlertClosed(i.id,c.dismissKey),!0}return!1}};Re.luigi.getEngine()._connector?.renderAlert(i,a)},handleConfirmationModalRequest:(i,n)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:Re.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:Re.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:Re.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:Re.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),Re.luigi.getEngine()._connector?.renderConfirmationModal(i,{confirm(){n.notifyConfirmationModalClosed(!0)},dismiss(){n.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,n)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");Bl.updateDirtyStatus(i,n)}};class oS{processUserSettingGroups(n,r){const a=[],u=n?.userSettingGroups,c=r?.userSettings?.userSettingGroups,l=u||c;if(W.isObject(l)){for(const d in l){const p={};p[d]=l[d],a.push(p)}return a}return a}getUserSettingsIframesInDom(){const n=document.querySelector(".iframeUserSettingsCtn");return n?[...n.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(n=>{n.style.display="none"})}findActiveCustomUserSettingsIframe(n){const r=document.querySelectorAll("[userSettingsGroup]");for(let a=0;a<r.length;a++)if(r[a].contentWindow===n)return r[a];return null}}const uS=new oS;class lS{constructor(n){this.dirtyStatusService=te.get(as),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=r=>new Promise(a=>{r.id||(r.id=W.getRandomId().toString());const u={openFromClient:!1,close:()=>{a(!0)},link:c=>{if(r.links){const l=r.links[c];if(l&&(l.url&&this.luigi?.navigation().navigate(l.url),l.dismissKey))return a(l.dismissKey),!0}return!1}};this.luigi.getEngine()._connector?.renderAlert(r,u)}),this.showConfirmationModal=r=>(r&&(r={...r,header:this.luigi.i18n().getTranslation(r.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(r.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(r.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(r.buttonConfirm||"luigi.button.confirm")}),new Promise((a,u)=>{this.luigi.getEngine()._connector?.renderConfirmationModal(r,{confirm(){a(!0)},dismiss(){u()}})})),this.processUserSettingGroups=()=>{const r=this.luigi.getConfigValue("userSettings"),a=this.luigi.getConfigValue("settings");return uS.processUserSettingGroups(r,a)},this.openUserSettings=r=>{this.luigi.getEngine()._connector?.openUserSettings(r)},this.closeUserSettings=()=>{this.luigi.getEngine()._connector?.closeUserSettings()},this.setDocumentTitle=r=>{this.luigi.getEngine()._ux?.documentTitle?.set(r),this.luigi.getEngine()._connector?.setDocumentTitle(r)},this.getDocumentTitle=()=>jl(this.luigi.getEngine()._ux?.documentTitle)||window.document.title||"",this.hideAppLoadingIndicator=()=>{const r=document.querySelector(this.appLoadingIndicatorSelector);r&&(r.classList.add("hidden"),setTimeout(()=>{r.parentNode?.removeChild(r)},500))},this.showLoadingIndicator=r=>this.luigi.getEngine()._connector?.showLoadingIndicator(r),this.hideLoadingIndicator=r=>this.luigi.getEngine()._connector?.hideLoadingIndicator(r),this.addBackdrop=()=>this.luigi.getEngine()._connector?.addBackdrop(),this.removeBackdrop=()=>this.luigi.getEngine()._connector?.removeBackdrop(),this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=n}}class cS{constructor(n){this.engine=n,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=r=>{this.config=r,this.setConfigCallback(this.getConfigReadyCallback()),fr.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Hm.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...r)=>{this.getEngine()._ui.update(r)},this.i18n=()=>(this._i18n||(this._i18n=new km(this)),this._i18n),this.elements=()=>(this._elements||(this._elements=new Wm(this)),this._elements),this.navigation=()=>new iS(this),this.ux=()=>new lS(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new Vm),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new sS(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new aS(this)),this._theming),this.auth=()=>ar,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(n){return W.getConfigValueFromObject(this.getConfig(),n)}getConfigValueAsync(n,...r){return cr.getConfigValueFromObjectAsync(this.getConfig(),n,r)}clearNavigationCache(){te.get(_n).deleteCache()}async readUserSettings(){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&W.isFunction(r.readUserSettings))return r.readUserSettings();const a=localStorage.getItem(this.USER_SETTINGS_KEY);return a&&JSON.parse(a)}async storeUserSettings(n,r){const a=await this.getConfigValueAsync("userSettings"),u=a||await this.getConfigValueAsync("settings.userSettings");if(u&&W.isFunction(u.storeUserSettings))return u.storeUserSettings(n,r);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(n)),this.configChanged()}createConfigStore(){const n=rs({}),r={};let a=[];return{subscribe:u=>{a.push(n.subscribe(u))},reset:u=>{n.update(u)},subscribeToScope:(u,c)=>{let l=r[c];l||(l=new Set,r[c]=l),l.add(u)},fire:(u,c)=>{const l=r[u];l&&[...l].forEach(d=>{d(c)})},clear:()=>{a.forEach(u=>{u()}),a=[]}}}getConfigReadyCallback(){return new Promise(n=>{this.i18n()._init(),n()})}setConfigCallback(n){this.configReadyCallback=n}}const ka=!1;var fS=Array.isArray,hS=Array.prototype.indexOf,vr=Array.prototype.includes,gS=Array.from,dS=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,pS=Object.prototype,_S=Array.prototype,vS=Object.getPrototypeOf,Gl=Object.isExtensible;const mS=()=>{};function SS(i){for(var n=0;n<i.length;n++)i[n]()}function wS(){var i,n,r=new Promise((a,u)=>{i=a,n=u});return{promise:r,resolve:i,reject:n}}const Be=2,jr=4,os=8,Qa=1<<24,Sn=16,wn=32,Wn=64,Wa=128,wt=512,De=1024,Me=2048,Lt=4096,hn=8192,Mn=16384,ei=32768,us=65536,Ql=1<<17,ES=1<<18,cs=1<<19,CS=1<<20,kn=65536,Ha=1<<21,pc=1<<22,Zr=1<<23,Da=Symbol("$state"),qa=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function TS(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function yS(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function AS(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function RS(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function bS(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ve=Symbol();function PS(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function IS(i){return i===this.v}let za=!1,xS=!1;function LS(){za=!0}let Nt=null;function ls(i){Nt=i}function NS(i,n=!1,r){Nt={p:Nt,i:!1,c:null,e:null,s:i,x:null,l:za&&!n?{s:null,u:null,$:[]}:null}}function OS(i){var n=Nt,r=n.e;if(r!==null){n.e=null;for(var a of r)YS(a)}return n.i=!0,Nt=n.p,{}}function fs(){return!za||Nt!==null&&Nt.l===null}let or=[];function $S(){var i=or;or=[],SS(i)}function gr(i){if(or.length===0){var n=or;queueMicrotask(()=>{n===or&&$S()})}or.push(i)}function _c(i){var n=ve;if(n===null)return ae.f|=Zr,i;if((n.f&ei)===0&&(n.f&jr)===0)throw i;ur(i,n)}function ur(i,n){for(;n!==null;){if((n.f&Wa)!==0){if((n.f&ei)===0)throw i;try{n.b.error(i);return}catch(r){i=r}}n=n.parent}throw i}const US=-7169;function me(i,n){i.f=i.f&US|n}function Ka(i){(i.f&wt)!==0||i.deps===null?me(i,De):me(i,Lt)}function vc(i){if(i!==null)for(const n of i)(n.f&Be)===0||(n.f&kn)===0||(n.f^=kn,vc(n.deps))}function mc(i,n,r){(i.f&Me)!==0?n.add(i):(i.f&Lt)!==0&&r.add(i),vc(i.deps),me(i,De)}const Zi=new Set;let $e=null,It=null,St=[],Ya=null,mr=null,DS=1;class gn{id=DS++;current=new Map;previous=new Map;#e=new Set;#o=new Set;#i=0;#u=0;#r=null;#s=new Set;#t=new Set;#n=new Map;is_fork=!1;#a=!1;#c(){return this.is_fork||this.#u>0}skip_effect(n){this.#n.has(n)||this.#n.set(n,{d:[],m:[]})}unskip_effect(n){var r=this.#n.get(n);if(r){this.#n.delete(n);for(var a of r.d)me(a,Me),Mt(a);for(a of r.m)me(a,Lt),Mt(a)}}process(n){St=[],this.apply();var r=mr=[],a=[];for(const u of n)this.#l(u,r,a);if(mr=null,this.#c()){this.#f(a),this.#f(r);for(const[u,c]of this.#n)Ec(u,c)}else{$e=null;for(const u of this.#e)u(this);this.#e.clear(),this.#i===0&&this.#h(),ql(a),ql(r),this.#s.clear(),this.#t.clear(),this.#r?.resolve()}It=null}#l(n,r,a){n.f^=De;for(var u=n.first;u!==null;){var c=u.f,l=(c&(wn|Wn))!==0,d=l&&(c&De)!==0,p=(c&hn)!==0,_=d||this.#n.has(u);if(!_&&u.fn!==null){l?p||(u.f^=De):(c&jr)!==0?r.push(u):(c&(os|Qa))!==0&&p?a.push(u):ni(u)&&(wr(u),(c&Sn)!==0&&(this.#t.add(u),p&&me(u,Me)));var A=u.first;if(A!==null){u=A;continue}}for(;u!==null;){var P=u.next;if(P!==null){u=P;break}u=u.parent}}}#f(n){for(var r=0;r<n.length;r+=1)mc(n[r],this.#s,this.#t)}capture(n,r){r!==Ve&&!this.previous.has(n)&&this.previous.set(n,r),(n.f&Zr)===0&&(this.current.set(n,n.v),It?.set(n,n.v))}activate(){$e=this,this.apply()}deactivate(){$e===this&&($e=null,It=null)}flush(){if(St.length>0)$e=this,MS();else if(this.#i===0&&!this.is_fork){for(const n of this.#e)n(this);this.#e.clear(),this.#h(),this.#r?.resolve()}this.deactivate()}discard(){for(const n of this.#o)n(this);this.#o.clear()}#h(){if(Zi.size>1){this.previous.clear();var n=$e,r=It,a=!0;for(const c of Zi){if(c===this){a=!1;continue}const l=[];for(const[p,_]of this.current){if(c.current.has(p))if(a&&_!==c.current.get(p))c.current.set(p,_);else continue;l.push(p)}if(l.length===0)continue;const d=[...c.current.keys()].filter(p=>!this.current.has(p));if(d.length>0){var u=St;St=[];const p=new Set,_=new Map;for(const A of l)Sc(A,d,p,_);if(St.length>0){$e=c,c.apply();for(const A of St)c.#l(A,[],[]);c.deactivate()}St=u}}$e=n,It=r}this.#n.clear(),Zi.delete(this)}increment(n){this.#i+=1,n&&(this.#u+=1)}decrement(n){this.#i-=1,n&&(this.#u-=1),!this.#a&&(this.#a=!0,gr(()=>{this.#a=!1,this.#c()?St.length>0&&this.flush():this.revive()}))}revive(){for(const n of this.#s)this.#t.delete(n),me(n,Me),Mt(n);for(const n of this.#t)me(n,Lt),Mt(n);this.flush()}oncommit(n){this.#e.add(n)}ondiscard(n){this.#o.add(n)}settled(){return(this.#r??=wS()).promise}static ensure(){if($e===null){const n=$e=new gn;Zi.add($e),gr(()=>{$e===n&&n.flush()})}return $e}apply(){}}function MS(){var i=null;try{for(var n=0;St.length>0;){var r=gn.ensure();if(n++>1e3){var a,u;FS()}r.process(St),dn.clear()}}finally{St=[],Ya=null,mr=null}}function FS(){try{TS()}catch(i){ur(i,Ya)}}let Xt=null;function ql(i){var n=i.length;if(n!==0){for(var r=0;r<n;){var a=i[r++];if((a.f&(Mn|hn))===0&&ni(a)&&(Xt=new Set,wr(a),a.deps===null&&a.first===null&&a.nodes===null&&a.teardown===null&&a.ac===null&&Nc(a),Xt?.size>0)){dn.clear();for(const u of Xt){if((u.f&(Mn|hn))!==0)continue;const c=[u];let l=u.parent;for(;l!==null;)Xt.has(l)&&(Xt.delete(l),c.push(l)),l=l.parent;for(let d=c.length-1;d>=0;d--){const p=c[d];(p.f&(Mn|hn))===0&&wr(p)}}Xt.clear()}}Xt=null}}function Sc(i,n,r,a){if(!r.has(i)&&(r.add(i),i.reactions!==null))for(const u of i.reactions){const c=u.f;(c&Be)!==0?Sc(u,n,r,a):(c&(pc|Sn))!==0&&(c&Me)===0&&wc(u,n,a)&&(me(u,Me),Mt(u))}}function wc(i,n,r){const a=r.get(i);if(a!==void 0)return a;if(i.deps!==null)for(const u of i.deps){if(vr.call(n,u))return!0;if((u.f&Be)!==0&&wc(u,n,r))return r.set(u,!0),!0}return r.set(i,!1),!1}function Mt(i){var n=Ya=i,r=n.b;if(r?.is_pending&&(i.f&(jr|os|Qa))!==0&&(i.f&ei)===0){r.defer_effect(i);return}for(;n.parent!==null;){n=n.parent;var a=n.f;if(mr!==null&&n===ve&&(i.f&os)===0)return;if((a&(Wn|wn))!==0){if((a&De)===0)return;n.f^=De}}St.push(n)}function Ec(i,n){if(!((i.f&wn)!==0&&(i.f&De)!==0)){(i.f&Me)!==0?n.d.push(i):(i.f&Lt)!==0&&n.m.push(i),me(i,De);for(var r=i.first;r!==null;)Ec(r,n),r=r.next}}function kS(i){let n=0,r=Za(0),a;return()=>{Ja()&&(lr(r),ZS(()=>(n===0&&(a=sw(()=>i(()=>Kr(r)))),n+=1,()=>{gr(()=>{n-=1,n===0&&(a?.(),a=void 0,Kr(r))})})))}}var WS=us|cs;function HS(i,n,r,a){new VS(i,n,r,a)}class VS{parent;is_pending=!1;transform_error;#e;#o=null;#i;#u;#r;#s=null;#t=null;#n=null;#a=null;#c=0;#l=0;#f=!1;#h=new Set;#d=new Set;#g=null;#S=kS(()=>(this.#g=Za(this.#c),()=>{this.#g=null}));constructor(n,r,a,u){this.#e=n,this.#i=r,this.#u=c=>{var l=ve;l.b=this,l.f|=Wa,a(c)},this.parent=ve.b,this.transform_error=u??this.parent?.transform_error??(c=>c),this.#r=JS(()=>{this.#v()},WS)}#w(){try{this.#s=Ln(()=>this.#u(this.#e))}catch(n){this.error(n)}}#E(n){const r=this.#i.failed;r&&(this.#n=Ln(()=>{r(this.#e,()=>n,()=>()=>{})}))}#C(){const n=this.#i.pending;n&&(this.is_pending=!0,this.#t=Ln(()=>n(this.#e)),gr(()=>{var r=this.#a=document.createDocumentFragment(),a=Pc();r.append(a),this.#s=this.#_(()=>(gn.ensure(),Ln(()=>this.#u(a)))),this.#l===0&&(this.#e.before(r),this.#a=null,ts(this.#t,()=>{this.#t=null}),this.#p())}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#c=0,this.#s=Ln(()=>{this.#u(this.#e)}),this.#l>0){var n=this.#a=document.createDocumentFragment();tw(this.#s,n);const r=this.#i.pending;this.#t=Ln(()=>r(this.#e))}else this.#p()}catch(r){this.error(r)}}#p(){this.is_pending=!1;for(const n of this.#h)me(n,Me),Mt(n);for(const n of this.#d)me(n,Lt),Mt(n);this.#h.clear(),this.#d.clear()}defer_effect(n){mc(n,this.#h,this.#d)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#_(n){var r=ve,a=ae,u=Nt;mn(this.#r),kt(this.#r),ls(this.#r.ctx);try{return n()}catch(c){return _c(c),null}finally{mn(r),kt(a),ls(u)}}#m(n){if(!this.has_pending_snippet()){this.parent&&this.parent.#m(n);return}this.#l+=n,this.#l===0&&(this.#p(),this.#t&&ts(this.#t,()=>{this.#t=null}),this.#a&&(this.#e.before(this.#a),this.#a=null))}update_pending_count(n){this.#m(n),this.#c+=n,!(!this.#g||this.#f)&&(this.#f=!0,gr(()=>{this.#f=!1,this.#g&&Ac(this.#g,this.#c)}))}get_effect_pending(){return this.#S(),lr(this.#g)}error(n){var r=this.#i.onerror;let a=this.#i.failed;if(!r&&!a)throw n;this.#s&&(Ft(this.#s),this.#s=null),this.#t&&(Ft(this.#t),this.#t=null),this.#n&&(Ft(this.#n),this.#n=null);var u=!1,c=!1;const l=()=>{if(u){PS();return}u=!0,c&&bS(),this.#n!==null&&ts(this.#n,()=>{this.#n=null}),this.#_(()=>{gn.ensure(),this.#v()})},d=p=>{try{c=!0,r?.(p,l),c=!1}catch(_){ur(_,this.#r&&this.#r.parent)}a&&(this.#n=this.#_(()=>{gn.ensure();try{return Ln(()=>{var _=ve;_.b=this,_.f|=Wa,a(this.#e,()=>p,()=>l)})}catch(_){return ur(_,this.#r.parent),null}}))};gr(()=>{var p;try{p=this.transform_error(n)}catch(_){ur(_,this.#r&&this.#r.parent);return}p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(d,_=>ur(_,this.#r&&this.#r.parent)):d(p)})}}function BS(i){var n=i.effects;if(n!==null){i.effects=null;for(var r=0;r<n.length;r+=1)Ft(n[r])}}function GS(i){for(var n=i.parent;n!==null;){if((n.f&Be)===0)return(n.f&Mn)===0?n:null;n=n.parent}return null}function Xa(i){var n,r=ve;mn(GS(i));try{i.f&=~kn,BS(i),n=Mc(i)}finally{mn(r)}return n}function Cc(i){var n=Xa(i);if(!i.equals(n)&&(i.wv=Uc(),(!$e?.is_fork||i.deps===null)&&(i.v=n,i.deps===null))){me(i,De);return}Sr||(It!==null?(Ja()||$e?.is_fork)&&It.set(i,n):Ka(i))}function QS(i){if(i.effects!==null)for(const n of i.effects)(n.teardown||n.ac)&&(n.teardown?.(),n.ac?.abort(qa),n.teardown=mS,n.ac=null,Jr(n,0),ja(n))}function Tc(i){if(i.effects!==null)for(const n of i.effects)n.teardown&&wr(n)}let Va=new Set;const dn=new Map;let yc=!1;function Za(i,n){var r={f:0,v:i,reactions:null,equals:IS,rv:0,wv:0};return r}function un(i,n){const r=Za(i);return nw(r),r}function Nn(i,n,r=!1){ae!==null&&(!xt||(ae.f&Ql)!==0)&&fs()&&(ae.f&(Be|Sn|pc|Ql))!==0&&(Et===null||!vr.call(Et,i))&&RS();let a=r?Gr(n):n;return Ac(i,a)}function Ac(i,n){if(!i.equals(n)){var r=i.v;Sr?dn.set(i,n):dn.set(i,r),i.v=n;var a=gn.ensure();if(a.capture(i,r),(i.f&Be)!==0){const u=i;(i.f&Me)!==0&&Xa(u),Ka(u)}i.wv=Uc(),Rc(i,Me),fs()&&ve!==null&&(ve.f&De)!==0&&(ve.f&(wn|Wn))===0&&(vt===null?rw([i]):vt.push(i)),!a.is_fork&&Va.size>0&&!yc&&qS()}return n}function qS(){yc=!1;for(const i of Va)(i.f&De)!==0&&me(i,Lt),ni(i)&&wr(i);Va.clear()}function Kr(i){Nn(i,i.v+1)}function Rc(i,n){var r=i.reactions;if(r!==null)for(var a=fs(),u=r.length,c=0;c<u;c++){var l=r[c],d=l.f;if(!(!a&&l===ve)){var p=(d&Me)===0;if(p&&me(l,n),(d&Be)!==0){var _=l;It?.delete(_),(d&kn)===0&&(d&wt&&(l.f|=kn),Rc(_,Lt))}else p&&((d&Sn)!==0&&Xt!==null&&Xt.add(l),Mt(l))}}}function Gr(i){if(typeof i!="object"||i===null||Da in i)return i;const n=vS(i);if(n!==pS&&n!==_S)return i;var r=new Map,a=fS(i),u=un(0),c=Fn,l=d=>{if(Fn===c)return d();var p=ae,_=Fn;kt(null),Yl(c);var A=d();return kt(p),Yl(_),A};return a&&r.set("length",un(i.length)),new Proxy(i,{defineProperty(d,p,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&yS();var A=r.get(p);return A===void 0?l(()=>{var P=un(_.value);return r.set(p,P),P}):Nn(A,_.value,!0),!0},deleteProperty(d,p){var _=r.get(p);if(_===void 0){if(p in d){const A=l(()=>un(Ve));r.set(p,A),Kr(u)}}else Nn(_,Ve),Kr(u);return!0},get(d,p,_){if(p===Da)return i;var A=r.get(p),P=p in d;if(A===void 0&&(!P||zr(d,p)?.writable)&&(A=l(()=>{var T=Gr(P?d[p]:Ve),I=un(T);return I}),r.set(p,A)),A!==void 0){var E=lr(A);return E===Ve?void 0:E}return Reflect.get(d,p,_)},getOwnPropertyDescriptor(d,p){var _=Reflect.getOwnPropertyDescriptor(d,p);if(_&&"value"in _){var A=r.get(p);A&&(_.value=lr(A))}else if(_===void 0){var P=r.get(p),E=P?.v;if(P!==void 0&&E!==Ve)return{enumerable:!0,configurable:!0,value:E,writable:!0}}return _},has(d,p){if(p===Da)return!0;var _=r.get(p),A=_!==void 0&&_.v!==Ve||Reflect.has(d,p);if(_!==void 0||ve!==null&&(!A||zr(d,p)?.writable)){_===void 0&&(_=l(()=>{var E=A?Gr(d[p]):Ve,T=un(E);return T}),r.set(p,_));var P=lr(_);if(P===Ve)return!1}return A},set(d,p,_,A){var P=r.get(p),E=p in d;if(a&&p==="length")for(var T=_;T<P.v;T+=1){var I=r.get(T+"");I!==void 0?Nn(I,Ve):T in d&&(I=l(()=>un(Ve)),r.set(T+"",I))}if(P===void 0)(!E||zr(d,p)?.writable)&&(P=l(()=>un(void 0)),Nn(P,Gr(_)),r.set(p,P));else{E=P.v!==Ve;var $=l(()=>Gr(_));Nn(P,$)}var M=Reflect.getOwnPropertyDescriptor(d,p);if(M?.set&&M.set.call(A,_),!E){if(a&&typeof p=="string"){var q=r.get("length"),oe=Number(p);Number.isInteger(oe)&&oe>=q.v&&Nn(q,oe+1)}Kr(u)}return!0},ownKeys(d){lr(u);var p=Reflect.ownKeys(d).filter(P=>{var E=r.get(P);return E===void 0||E.v!==Ve});for(var[_,A]of r)A.v!==Ve&&!(_ in d)&&p.push(_);return p},setPrototypeOf(){AS()}})}var zl,bc;function zS(){if(zl===void 0){zl=window;var i=Element.prototype,n=Node.prototype,r=Text.prototype;zr(n,"firstChild").get,bc=zr(n,"nextSibling").get,Gl(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Gl(r)&&(r.__t=void 0)}}function Pc(i=""){return document.createTextNode(i)}function Ic(i){return bc.call(i)}function xc(i){var n=ae,r=ve;kt(null),mn(null);try{return i()}finally{kt(n),mn(r)}}function KS(i,n){var r=n.last;r===null?n.last=n.first=i:(r.next=i,i.prev=r,n.last=i)}function ti(i,n){var r=ve;r!==null&&(r.f&hn)!==0&&(i|=hn);var a={ctx:Nt,deps:null,nodes:null,f:i|Me|wt,first:null,fn:n,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null},u=a;if((i&jr)!==0)mr!==null?mr.push(a):Mt(a);else if(n!==null){try{wr(a)}catch(l){throw Ft(a),l}u.deps===null&&u.teardown===null&&u.nodes===null&&u.first===u.last&&(u.f&cs)===0&&(u=u.first,(i&Sn)!==0&&(i&us)!==0&&u!==null&&(u.f|=us))}if(u!==null&&(u.parent=r,r!==null&&KS(u,r),ae!==null&&(ae.f&Be)!==0&&(i&Wn)===0)){var c=ae;(c.effects??=[]).push(u)}return a}function Ja(){return ae!==null&&!xt}function YS(i){return ti(jr|CS,i)}function XS(i){gn.ensure();const n=ti(Wn|cs,i);return(r={})=>new Promise(a=>{r.outro?ts(n,()=>{Ft(n),a(void 0)}):(Ft(n),a(void 0))})}function ZS(i,n=0){return ti(os|n,i)}function JS(i,n=0){var r=ti(Sn|n,i);return r}function Ln(i){return ti(wn|cs,i)}function Lc(i){var n=i.teardown;if(n!==null){const r=Sr,a=ae;Kl(!0),kt(null);try{n.call(null)}finally{Kl(r),kt(a)}}}function ja(i,n=!1){var r=i.first;for(i.first=i.last=null;r!==null;){const u=r.ac;u!==null&&xc(()=>{u.abort(qa)});var a=r.next;(r.f&Wn)!==0?r.parent=null:Ft(r,n),r=a}}function jS(i){for(var n=i.first;n!==null;){var r=n.next;(n.f&wn)===0&&Ft(n),n=r}}function Ft(i,n=!0){var r=!1;(n||(i.f&ES)!==0)&&i.nodes!==null&&i.nodes.end!==null&&(ew(i.nodes.start,i.nodes.end),r=!0),ja(i,n&&!r),Jr(i,0),me(i,Mn);var a=i.nodes&&i.nodes.t;if(a!==null)for(const c of a)c.stop();Lc(i);var u=i.parent;u!==null&&u.first!==null&&Nc(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=null}function ew(i,n){for(;i!==null;){var r=i===n?null:Ic(i);i.remove(),i=r}}function Nc(i){var n=i.parent,r=i.prev,a=i.next;r!==null&&(r.next=a),a!==null&&(a.prev=r),n!==null&&(n.first===i&&(n.first=a),n.last===i&&(n.last=r))}function ts(i,n,r=!0){var a=[];Oc(i,a,!0);var u=()=>{r&&Ft(i),n&&n()},c=a.length;if(c>0){var l=()=>--c||u();for(var d of a)d.out(l)}else u()}function Oc(i,n,r){if((i.f&hn)===0){i.f^=hn;var a=i.nodes&&i.nodes.t;if(a!==null)for(const d of a)(d.is_global||r)&&n.push(d);for(var u=i.first;u!==null;){var c=u.next,l=(u.f&us)!==0||(u.f&wn)!==0&&(i.f&Sn)!==0;Oc(u,n,l?r:!1),u=c}}}function tw(i,n){if(i.nodes)for(var r=i.nodes.start,a=i.nodes.end;r!==null;){var u=r===a?null:Ic(r);n.append(r),r=u}}let ns=!1,Sr=!1;function Kl(i){Sr=i}let ae=null,xt=!1;function kt(i){ae=i}let ve=null;function mn(i){ve=i}let Et=null;function nw(i){ae!==null&&(Et===null?Et=[i]:Et.push(i))}let Ze=null,ot=0,vt=null;function rw(i){vt=i}let $c=1,$n=0,Fn=$n;function Yl(i){Fn=i}function Uc(){return++$c}function ni(i){var n=i.f;if((n&Me)!==0)return!0;if(n&Be&&(i.f&=~kn),(n&Lt)!==0){for(var r=i.deps,a=r.length,u=0;u<a;u++){var c=r[u];if(ni(c)&&Cc(c),c.wv>i.wv)return!0}(n&wt)!==0&&It===null&&me(i,De)}return!1}function Dc(i,n,r=!0){var a=i.reactions;if(a!==null&&!(Et!==null&&vr.call(Et,i)))for(var u=0;u<a.length;u++){var c=a[u];(c.f&Be)!==0?Dc(c,n,!1):n===c&&(r?me(c,Me):(c.f&De)!==0&&me(c,Lt),Mt(c))}}function Mc(i){var n=Ze,r=ot,a=vt,u=ae,c=Et,l=Nt,d=xt,p=Fn,_=i.f;Ze=null,ot=0,vt=null,ae=(_&(wn|Wn))===0?i:null,Et=null,ls(i.ctx),xt=!1,Fn=++$n,i.ac!==null&&(xc(()=>{i.ac.abort(qa)}),i.ac=null);try{i.f|=Ha;var A=i.fn,P=A();i.f|=ei;var E=i.deps,T=$e?.is_fork;if(Ze!==null){var I;if(T||Jr(i,ot),E!==null&&ot>0)for(E.length=ot+Ze.length,I=0;I<Ze.length;I++)E[ot+I]=Ze[I];else i.deps=E=Ze;if(Ja()&&(i.f&wt)!==0)for(I=ot;I<E.length;I++)(E[I].reactions??=[]).push(i)}else!T&&E!==null&&ot<E.length&&(Jr(i,ot),E.length=ot);if(fs()&&vt!==null&&!xt&&E!==null&&(i.f&(Be|Lt|Me))===0)for(I=0;I<vt.length;I++)Dc(vt[I],i);if(u!==null&&u!==i){if($n++,u.deps!==null)for(let $=0;$<r;$+=1)u.deps[$].rv=$n;if(n!==null)for(const $ of n)$.rv=$n;vt!==null&&(a===null?a=vt:a.push(...vt))}return(i.f&Zr)!==0&&(i.f^=Zr),P}catch($){return _c($)}finally{i.f^=Ha,Ze=n,ot=r,vt=a,ae=u,Et=c,ls(l),xt=d,Fn=p}}function iw(i,n){let r=n.reactions;if(r!==null){var a=hS.call(r,i);if(a!==-1){var u=r.length-1;u===0?r=n.reactions=null:(r[a]=r[u],r.pop())}}if(r===null&&(n.f&Be)!==0&&(Ze===null||!vr.call(Ze,n))){var c=n;(c.f&wt)!==0&&(c.f^=wt,c.f&=~kn),Ka(c),QS(c),Jr(c,0)}}function Jr(i,n){var r=i.deps;if(r!==null)for(var a=n;a<r.length;a++)iw(i,r[a])}function wr(i){var n=i.f;if((n&Mn)===0){me(i,De);var r=ve,a=ns;ve=i,ns=!0;try{(n&(Sn|Qa))!==0?jS(i):ja(i),Lc(i);var u=Mc(i);i.teardown=typeof u=="function"?u:null,i.wv=$c;var c;ka&&xS&&(i.f&Me)!==0&&i.deps}finally{ns=a,ve=r}}}function lr(i){var n=i.f,r=(n&Be)!==0;if(ae!==null&&!xt){var a=ve!==null&&(ve.f&Mn)!==0;if(!a&&(Et===null||!vr.call(Et,i))){var u=ae.deps;if((ae.f&Ha)!==0)i.rv<$n&&(i.rv=$n,Ze===null&&u!==null&&u[ot]===i?ot++:Ze===null?Ze=[i]:Ze.push(i));else{(ae.deps??=[]).push(i);var c=i.reactions;c===null?i.reactions=[ae]:vr.call(c,ae)||c.push(ae)}}}if(Sr&&dn.has(i))return dn.get(i);if(r){var l=i;if(Sr){var d=l.v;return((l.f&De)===0&&l.reactions!==null||kc(l))&&(d=Xa(l)),dn.set(l,d),d}var p=(l.f&wt)===0&&!xt&&ae!==null&&(ns||(ae.f&wt)!==0),_=(l.f&ei)===0;ni(l)&&(p&&(l.f|=wt),Cc(l)),p&&!_&&(Tc(l),Fc(l))}if(It?.has(i))return It.get(i);if((i.f&Zr)!==0)throw i.v;return i.v}function Fc(i){if(i.f|=wt,i.deps!==null)for(const n of i.deps)(n.reactions??=[]).push(i),(n.f&Be)!==0&&(n.f&wt)===0&&(Tc(n),Fc(n))}function kc(i){if(i.v===Ve)return!0;if(i.deps===null)return!1;for(const n of i.deps)if(dn.has(n)||(n.f&Be)!==0&&kc(n))return!0;return!1}function sw(i){var n=xt;try{return xt=!0,i()}finally{xt=n}}const aw=["touchstart","touchmove"];function ow(i){return aw.includes(i)}const Ji=Symbol("events"),uw=new Set,Xl=new Set;let Zl=null;function Jl(i){var n=this,r=n.ownerDocument,a=i.type,u=i.composedPath?.()||[],c=u[0]||i.target;Zl=i;var l=0,d=Zl===i&&i[Ji];if(d){var p=u.indexOf(d);if(p!==-1&&(n===document||n===window)){i[Ji]=n;return}var _=u.indexOf(n);if(_===-1)return;p<=_&&(l=p)}if(c=u[l]||i.target,c!==n){dS(i,"currentTarget",{configurable:!0,get(){return c||r}});var A=ae,P=ve;kt(null),mn(null);try{for(var E,T=[];c!==null;){var I=c.assignedSlot||c.parentNode||c.host||null;try{var $=c[Ji]?.[a];$!=null&&(!c.disabled||i.target===c)&&$.call(c,i)}catch(M){E?T.push(M):E=M}if(i.cancelBubble||I===n||I===null)break;c=I}if(E){for(let M of T)queueMicrotask(()=>{throw M});throw E}}finally{i[Ji]=n,delete i.currentTarget,kt(A),mn(P)}}}function lw(i,n){return cw(i,n)}const ji=new Map;function cw(i,{target:n,anchor:r,props:a={},events:u,context:c,intro:l=!0,transformError:d}){zS();var p=void 0,_=XS(()=>{var A=r??n.appendChild(Pc());HS(A,{pending:()=>{}},T=>{NS({});var I=Nt;c&&(I.c=c),u&&(a.$$events=u),p=i(T,a)||{},OS()},d);var P=new Set,E=T=>{for(var I=0;I<T.length;I++){var $=T[I];if(!P.has($)){P.add($);var M=ow($);for(const fe of[n,document]){var q=ji.get(fe);q===void 0&&(q=new Map,ji.set(fe,q));var oe=q.get($);oe===void 0?(fe.addEventListener($,Jl,{passive:M}),q.set($,1)):q.set($,oe+1)}}}};return E(gS(uw)),Xl.add(E),()=>{for(var T of P)for(const M of[n,document]){var I=ji.get(M),$=I.get(T);--$==0?(M.removeEventListener(T,Jl),I.delete(T),I.size===0&&ji.delete(M)):I.set(T,$)}Xl.delete(E),A!==r&&A.parentNode?.removeChild(A)}});return fw.set(p,_),p}let fw=new WeakMap;const hw="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(hw);LS();function gw(i){}const Ba={init:i=>{te.get(Dn).enableRouting()},handlePageErrorHandler:(i,n,r)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)n.viewUrl=i.viewUrl,r.getEngine()._ui.updateMainContent(n,r);else if(i.errorFn)i.errorFn(n);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const a=i.redirectPath||"/";r.navigation().navigate(a)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const r=window.open(i.url,"_blank","noopener noreferrer");r&&(r.opener=null,r.focus())}},async addSearchParamsFromClient(i,n,r){const a=te.get(vn),u=k.getCurrentPath(r.getConfig().routing?.useHashRouting),c=await a.getCurrentNode(u.path),l={...i};if(c?.clientPermissions?.urlParameters){const d={};Object.keys(c.clientPermissions.urlParameters).forEach(p=>{p in l&&c.clientPermissions.urlParameters[p].write===!0&&(d[p]=l[p],delete l[p])});for(const p in l)console.warn(`No permission to add the search param "${p}" to the url`);Object.keys(d).length>0&&r.routing().addSearchParams(d,n)}}},Dt={luigi:{},init:i=>{console.log("Init communication..."),Dt.luigi=i},addListeners:(i,n)=>{i.addEventListener(N.INITIALIZED,r=>{Re.luigi?.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(N.NAVIGATION_REQUEST,r=>{const{link:a,preserveView:u,modal:c,newTab:l,withoutSync:d,preventContextUpdate:p,preventHistoryEntry:_,fromVirtualTreeRoot:A,fromContext:P,fromClosestContext:E,fromParent:T,relative:I,nodeParams:$}=r.detail,M={modalSettings:c,newTab:l,path:a,preserveView:u,preventContextUpdate:p,options:{fromVirtualTreeRoot:A,fromContext:P,fromClosestContext:E,fromParent:T,relative:I,nodeParams:$},preventHistoryEntry:_,withoutSync:d};te.get(vn).handleNavigationRequest(M,r.callbackFn)}),i.addEventListener(N.RUNTIME_ERROR_HANDLING_REQUEST,r=>{n.navigation().runTimeErrorHandler(r.payload?.data?.errorObj||{})}),i.addEventListener(N.ALERT_REQUEST,r=>{Re.processAlert(r.payload,!0,i)}),i.addEventListener(N.SHOW_CONFIRMATION_MODAL_REQUEST,r=>{Re.handleConfirmationModalRequest(r.payload,i)}),i.addEventListener(N.SET_DOCUMENT_TITLE_REQUEST,r=>{Dt.luigi.getEngine()._connector?.setDocumentTitle(r.detail.title)}),i.addEventListener(N.SHOW_LOADING_INDICATOR_REQUEST,r=>{Dt.luigi.getEngine()._connector?.showLoadingIndicator(i.parentNode)}),i.addEventListener(N.HIDE_LOADING_INDICATOR_REQUEST,r=>{Dt.luigi.getEngine()._connector?.hideLoadingIndicator(i.parentNode)}),i.addEventListener(N.ADD_BACKDROP_REQUEST,r=>{Dt.luigi.getEngine()._connector?.addBackdrop()}),i.addEventListener(N.REMOVE_BACKDROP_REQUEST,r=>{Dt.luigi.getEngine()._connector?.removeBackdrop()}),i.addEventListener(N.SET_DIRTY_STATUS_REQUEST,r=>{Re.handleDirtyStatusRequest(r.detail?.data?.dirty,r.detail?.source)}),i.addEventListener(N.ADD_NODE_PARAMS_REQUEST,r=>{n.routing().addNodeParams(r.payload.data,r.payload.keepBrowserHistory)}),i.addEventListener(N.OPEN_USER_SETTINGS_REQUEST,r=>{Dt.luigi.getEngine()._connector?.openUserSettings(r.detail)}),i.addEventListener(N.CLOSE_USER_SETTINGS_REQUEST,r=>{Dt.luigi.getEngine()._connector?.closeUserSettings()}),i.addEventListener(N.ADD_SEARCH_PARAMS_REQUEST,r=>{Ba.addSearchParamsFromClient(r.detail.data,r.detail.keepBrowserHistory,n)}),i.addEventListener(N.UPDATE_MODAL_SETTINGS_REQUEST,r=>{Ue.updateModalSettings(r.payload.updatedModalSettings,r.payload.addHistoryEntry,n)}),i.addEventListener(N.SET_CURRENT_LOCALE_REQUEST,r=>{n.i18n().setCurrentLocale(r.detail?.data?.data?.currentLocale,i)})}};class dw{constructor(){this._ui=Ue,this._comm=Dt,this._ux=Re,this._routing=Ba}bootstrap(n){this._app=lw(gw,{target:document.body}),this._connector=n}init(){const n=window.Luigi;te.register(as,()=>new as),te.register(vn,()=>new vn(n)),te.register(_n,()=>new _n),te.register(Dn,()=>new Dn(n)),te.register(_r,()=>new _r),te.register(pn,()=>new pn(n)),n.theming()._init(),Ue.init(n),Ba.init(n),Dt.init(n),Re.init(n)}}window.Luigi=new cS(new dw);
|
|
54
|
+
}`,r=rc(" "),a=dr("iframe"),Ul(a.src,u=i[3])||mt(a,"src",u),mt(a,"title",i[1]),mt(a,"allow",c=Ml(i[0])),mt(a,"sandbox",l=i[2]?i[2].join(" "):void 0)},m(d,p){Un(d,n,p),Un(d,r,p),Un(d,a,p),i[28](a)},p(d,p){8&p[0]&&!Ul(a.src,u=d[3])&&mt(a,"src",u),2&p[0]&&mt(a,"title",d[1]),1&p[0]&&c!==(c=Ml(d[0]))&&mt(a,"allow",c),4&p[0]&&l!==(l=d[2]?d[2].join(" "):void 0)&&mt(a,"sandbox",l)},d(d){d&&(fn(n),fn(r),fn(a)),i[28](null)}}}function jm(i){let n,r,a=i[5]&&Wl(i);return{c(){n=dr("main"),a&&a.c(),mt(n,"class",r=i[4]?void 0:"lui-isolated")},m(u,c){Un(u,n,c),a&&a.m(n,null),i[29](n)},p(u,c){u[5]?a?a.p(u,c):(a=Wl(u),a.c(),a.m(n,null)):a&&(a.d(1),a=null),16&c[0]&&r!==(r=u[4]?void 0:"lui-isolated")&&mt(n,"class",r)},i:cn,o:cn,d(u){u&&fn(n),a&&a.d(),i[29](null)}}}function eS(i,n,r){let{activeFeatureToggleList:a}=n,{allowRules:u}=n,{anchor:c}=n,{authData:l}=n,{clientPermissions:d}=n,{context:p}=n,{deferInit:_}=n,{dirtyStatus:A}=n,{documentTitle:P}=n,{hasBack:E}=n,{label:T}=n,{locale:I}=n,{noShadow:$}=n,{nodeParams:M}=n,{pathParams:q}=n,{sandboxRules:oe}=n,{searchParams:fe}=n,{skipCookieCheck:Je}=n,{skipInitCheck:Ee}=n,{theme:je}=n,{userSettings:be}=n,{viewurl:Ge}=n,{webcomponent:Le}=n;const Ce={};let Te,O,Zt=!1;const ut=new fc,Fe=x=>{if(!Zt){x.sendCustomMessage=(ge,ye)=>{sr.sendCustomMessage(ge,x.getNoShadow()?x:Te,!!Le,Ce,ye)},x.updateContext=(ge,ye)=>{if(r(8,p=ge),Le)(x.getNoShadow()?x:Te)._luigi_mfe_webcomponent.context=ge;else{const Qe={...ye||{},activeFeatureToggleList:x.activeFeatureToggleList||[],currentLocale:x.locale,currentTheme:x.theme,userSettings:x.userSettings||null,cssVariables:x.cssVariables||{},anchor:x.anchor||"",drawer:x.drawer||!1,modal:x.modal||!1,viewStackSize:x.viewStackSize||0,isNavigateBack:x.isNavigateBack||!1};sr.updateContext(ge,Qe,Ce,M,q,fe)}},x.closeAlert=(ge,ye)=>{x.notifyAlertClosed(ge,ye)},x.notifyAlertClosed=(ge,ye)=>{x.isConnected&&(Le?ut.resolveAlert(ge,ye):sr.notifyAlertClosed(ge,ye,Ce))},x.notifyConfirmationModalClosed=ge=>{x.isConnected&&(Le?ut.notifyConfirmationModalClosed(!!ge):sr.notifyConfirmationModalClosed(!!ge,Ce))},ln.registerContainer(x),ut.thisComponent=x;const et=qr.resolveContext(p);if(x.updateViewUrl=(ge,ye)=>{ge?.length&&sr.updateViewUrl(ge,qr.resolveContext(p),ye,Ce)},Le&&Le!="false"){x.getNoShadow()?x.innerHTML="":(r(7,Te.innerHTML="",Te),x.attachShadow({mode:"open"}).append(Te));const ge=qr.checkWebcomponentValue(Le);ut.renderWebComponent(Ge,x.getNoShadow()?x:Te,et,typeof ge=="object"?{webcomponent:ge}:{})}else x.getNoShadow()||(x.innerHTML="",x.attachShadow({mode:"open"}).append(Te));Ee?(x.initialized=!0,setTimeout((()=>{ut.dispatchLuigiEvent(N.INITIALIZED,{})}))):Le&&(x.getNoShadow()?x:Te).addEventListener("wc_ready",(()=>{(x.getNoShadow()?x:Te)._luigi_mfe_webcomponent?.deferLuigiClientWCInit||(x.initialized=!0,ut.dispatchLuigiEvent(N.INITIALIZED,{}))})),r(5,Zt=!0),x.containerInitialized=!0}};var En;return sc((async()=>{r(27,O=Te.parentNode),r(27,O.iframeHandle=Ce,O),r(27,O.init=()=>{Fe(O)},O),!_&&Ge&&Fe(O)})),En=async()=>{},ic().$$.on_destroy.push(En),i.$$set=x=>{"activeFeatureToggleList"in x&&r(9,a=x.activeFeatureToggleList),"allowRules"in x&&r(0,u=x.allowRules),"anchor"in x&&r(10,c=x.anchor),"authData"in x&&r(11,l=x.authData),"clientPermissions"in x&&r(12,d=x.clientPermissions),"context"in x&&r(8,p=x.context),"deferInit"in x&&r(13,_=x.deferInit),"dirtyStatus"in x&&r(14,A=x.dirtyStatus),"documentTitle"in x&&r(15,P=x.documentTitle),"hasBack"in x&&r(16,E=x.hasBack),"label"in x&&r(1,T=x.label),"locale"in x&&r(17,I=x.locale),"noShadow"in x&&r(18,$=x.noShadow),"nodeParams"in x&&r(19,M=x.nodeParams),"pathParams"in x&&r(20,q=x.pathParams),"sandboxRules"in x&&r(2,oe=x.sandboxRules),"searchParams"in x&&r(21,fe=x.searchParams),"skipCookieCheck"in x&&r(22,Je=x.skipCookieCheck),"skipInitCheck"in x&&r(23,Ee=x.skipInitCheck),"theme"in x&&r(24,je=x.theme),"userSettings"in x&&r(25,be=x.userSettings),"viewurl"in x&&r(3,Ge=x.viewurl),"webcomponent"in x&&r(4,Le=x.webcomponent)},i.$$.update=()=>{134225960&i.$$.dirty[0]&&!Zt&&Ge&&!_&&O&&Fe(O)},[u,T,oe,Ge,Le,Zt,Ce,Te,p,a,c,l,d,_,A,P,E,I,$,M,q,fe,Je,Ee,je,be,()=>a&&u&&c&&l&&d&&A&&P&&E&&I&&$&&M&&q&&oe&&fe&&Je&&Ee&&je&&be,O,function(x){Xr[x?"unshift":"push"]((()=>{Ce.iframe=x,r(6,Ce)}))},function(x){Xr[x?"unshift":"push"]((()=>{Te=x,r(7,Te)}))}]}class hc extends lc{constructor(n){super(),ac(this,n,eS,jm,nc,{activeFeatureToggleList:9,allowRules:0,anchor:10,authData:11,clientPermissions:12,context:8,deferInit:13,dirtyStatus:14,documentTitle:15,hasBack:16,label:1,locale:17,noShadow:18,nodeParams:19,pathParams:20,sandboxRules:2,searchParams:21,skipCookieCheck:22,skipInitCheck:23,theme:24,userSettings:25,viewurl:3,webcomponent:4,unwarn:26},null,[-1,-1])}get activeFeatureToggleList(){return this.$$.ctx[9]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),Q()}get allowRules(){return this.$$.ctx[0]}set allowRules(n){this.$$set({allowRules:n}),Q()}get anchor(){return this.$$.ctx[10]}set anchor(n){this.$$set({anchor:n}),Q()}get authData(){return this.$$.ctx[11]}set authData(n){this.$$set({authData:n}),Q()}get clientPermissions(){return this.$$.ctx[12]}set clientPermissions(n){this.$$set({clientPermissions:n}),Q()}get context(){return this.$$.ctx[8]}set context(n){this.$$set({context:n}),Q()}get deferInit(){return this.$$.ctx[13]}set deferInit(n){this.$$set({deferInit:n}),Q()}get dirtyStatus(){return this.$$.ctx[14]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),Q()}get documentTitle(){return this.$$.ctx[15]}set documentTitle(n){this.$$set({documentTitle:n}),Q()}get hasBack(){return this.$$.ctx[16]}set hasBack(n){this.$$set({hasBack:n}),Q()}get label(){return this.$$.ctx[1]}set label(n){this.$$set({label:n}),Q()}get locale(){return this.$$.ctx[17]}set locale(n){this.$$set({locale:n}),Q()}get noShadow(){return this.$$.ctx[18]}set noShadow(n){this.$$set({noShadow:n}),Q()}get nodeParams(){return this.$$.ctx[19]}set nodeParams(n){this.$$set({nodeParams:n}),Q()}get pathParams(){return this.$$.ctx[20]}set pathParams(n){this.$$set({pathParams:n}),Q()}get sandboxRules(){return this.$$.ctx[2]}set sandboxRules(n){this.$$set({sandboxRules:n}),Q()}get searchParams(){return this.$$.ctx[21]}set searchParams(n){this.$$set({searchParams:n}),Q()}get skipCookieCheck(){return this.$$.ctx[22]}set skipCookieCheck(n){this.$$set({skipCookieCheck:n}),Q()}get skipInitCheck(){return this.$$.ctx[23]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),Q()}get theme(){return this.$$.ctx[24]}set theme(n){this.$$set({theme:n}),Q()}get userSettings(){return this.$$.ctx[25]}set userSettings(n){this.$$set({userSettings:n}),Q()}get viewurl(){return this.$$.ctx[3]}set viewurl(n){this.$$set({viewurl:n}),Q()}get webcomponent(){return this.$$.ctx[4]}set webcomponent(n){this.$$set({webcomponent:n}),Q()}get unwarn(){return this.$$.ctx[26]}}function tS(i){Gm(i,"svelte-1buc46y","main.svelte-1buc46y{width:100%;height:100%;border:none}")}function nS(i){let n;return{c(){n=dr("main"),mt(n,"class","svelte-1buc46y")},m(r,a){Un(r,n,a),i[21](n)},p:cn,i:cn,o:cn,d(r){r&&fn(n),i[21](null)}}}function rS(i,n,r){let a,u,{activeFeatureToggleList:c}=n,{anchor:l}=n,{clientPermissions:d}=n,{compoundConfig:p}=n,{context:_}=n,{deferInit:A}=n,{dirtyStatus:P}=n,{documentTitle:E}=n,{hasBack:T}=n,{locale:I}=n,{noShadow:$}=n,{nodeParams:M}=n,{pathParams:q}=n,{searchParams:oe}=n,{skipInitCheck:fe}=n,{theme:Je}=n,{userSettings:Ee}=n,{viewurl:je}=n,{webcomponent:be}=n,Ge=!1;const Le=new Ga,Ce=new fc,Te=O=>{if(!p||Ge)return;O.updateContext=(Fe,En)=>{const x=O.getNoShadow()?O:a;x._luigi_mfe_webcomponent.context=Fe,r(1,_=Fe);const et=x._luigi_mfe_webcomponent;et&&et.querySelectorAll("[lui_web_component]")?.forEach((ye=>{const Qe=ye.context||{};ye.context=Object.assign(Qe,Fe)}))};const Zt=qr.resolveContext(_);r(2,A=!1),O.notifyAlertClosed=(Fe,En)=>{O.isConnected&&Ce.resolveAlert(Fe,En)},O.notifyConfirmationModalClosed=Fe=>{O.isConnected&&Ce.notifyConfirmationModalClosed(!!Fe)};const ut={compound:p,viewUrl:je,webcomponent:qr.checkWebcomponentValue(be)||!0};O.getNoShadow()?O.innerHTML="":(r(0,a.innerHTML="",a),O.attachShadow({mode:"open"}).append(a)),Ce.renderWebComponentCompound(ut,O.getNoShadow()?O:a,Zt).then((Fe=>{u=Fe,fe||!ut.viewUrl?(O.initialized=!0,setTimeout((()=>{Ce.dispatchLuigiEvent(N.INITIALIZED,{})}))):u.LuigiClient&&!u.deferLuigiClientWCInit&&(O.initialized=!0,Ce.dispatchLuigiEvent(N.INITIALIZED,{}))})),Ge=!0,O.containerInitialized=!0};return sc((async()=>{const O=a.getRootNode()===document?a.parentNode:a.getRootNode().host;O.init=()=>{Te(O)},A||Te(O),Le.registerContainer(O),Ce.thisComponent=O})),i.$$set=O=>{"activeFeatureToggleList"in O&&r(3,c=O.activeFeatureToggleList),"anchor"in O&&r(4,l=O.anchor),"clientPermissions"in O&&r(5,d=O.clientPermissions),"compoundConfig"in O&&r(6,p=O.compoundConfig),"context"in O&&r(1,_=O.context),"deferInit"in O&&r(2,A=O.deferInit),"dirtyStatus"in O&&r(7,P=O.dirtyStatus),"documentTitle"in O&&r(8,E=O.documentTitle),"hasBack"in O&&r(9,T=O.hasBack),"locale"in O&&r(10,I=O.locale),"noShadow"in O&&r(11,$=O.noShadow),"nodeParams"in O&&r(12,M=O.nodeParams),"pathParams"in O&&r(13,q=O.pathParams),"searchParams"in O&&r(14,oe=O.searchParams),"skipInitCheck"in O&&r(15,fe=O.skipInitCheck),"theme"in O&&r(16,Je=O.theme),"userSettings"in O&&r(17,Ee=O.userSettings),"viewurl"in O&&r(18,je=O.viewurl),"webcomponent"in O&&r(19,be=O.webcomponent)},[a,_,A,c,l,d,p,P,E,T,I,$,M,q,oe,fe,Je,Ee,je,be,()=>c&&l&&d&&P&&E&&T&&I&&$&&M&&q&&oe&&fe&&Je&&Ee,function(O){Xr[O?"unshift":"push"]((()=>{a=O,r(0,a)}))}]}uc(hc,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},allowRules:{type:"Array",reflect:!1,attribute:"allow-rules"},anchor:{type:"String",reflect:!1,attribute:"anchor"},authData:{type:"Object",reflect:!1,attribute:"auth-data"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},label:{type:"String",reflect:!1,attribute:"label"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow"},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},sandboxRules:{type:"Array",reflect:!1,attribute:"sandbox-rules"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipCookieCheck:{type:"String",reflect:!1,attribute:"skip-cookie-check"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{sendCustomMessage=n("sendCustomMessage");updateContext=n("updateContext");updateViewUrl=n("updateViewUrl");closeAlert=n("closeAlert");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.error("Error in super.attributeChangedCallback",c)}this.containerInitialized&&(r==="context"&&this.updateContext(JSON.parse(u)),r==="auth-data"&&sr.updateAuthData(this.iframeHandle,JSON.parse(u)))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}}));class Vl extends lc{constructor(n){super(),ac(this,n,rS,nS,nc,{activeFeatureToggleList:3,anchor:4,clientPermissions:5,compoundConfig:6,context:1,deferInit:2,dirtyStatus:7,documentTitle:8,hasBack:9,locale:10,noShadow:11,nodeParams:12,pathParams:13,searchParams:14,skipInitCheck:15,theme:16,userSettings:17,viewurl:18,webcomponent:19,unwarn:20},tS)}get activeFeatureToggleList(){return this.$$.ctx[3]}set activeFeatureToggleList(n){this.$$set({activeFeatureToggleList:n}),Q()}get anchor(){return this.$$.ctx[4]}set anchor(n){this.$$set({anchor:n}),Q()}get clientPermissions(){return this.$$.ctx[5]}set clientPermissions(n){this.$$set({clientPermissions:n}),Q()}get compoundConfig(){return this.$$.ctx[6]}set compoundConfig(n){this.$$set({compoundConfig:n}),Q()}get context(){return this.$$.ctx[1]}set context(n){this.$$set({context:n}),Q()}get deferInit(){return this.$$.ctx[2]}set deferInit(n){this.$$set({deferInit:n}),Q()}get dirtyStatus(){return this.$$.ctx[7]}set dirtyStatus(n){this.$$set({dirtyStatus:n}),Q()}get documentTitle(){return this.$$.ctx[8]}set documentTitle(n){this.$$set({documentTitle:n}),Q()}get hasBack(){return this.$$.ctx[9]}set hasBack(n){this.$$set({hasBack:n}),Q()}get locale(){return this.$$.ctx[10]}set locale(n){this.$$set({locale:n}),Q()}get noShadow(){return this.$$.ctx[11]}set noShadow(n){this.$$set({noShadow:n}),Q()}get nodeParams(){return this.$$.ctx[12]}set nodeParams(n){this.$$set({nodeParams:n}),Q()}get pathParams(){return this.$$.ctx[13]}set pathParams(n){this.$$set({pathParams:n}),Q()}get searchParams(){return this.$$.ctx[14]}set searchParams(n){this.$$set({searchParams:n}),Q()}get skipInitCheck(){return this.$$.ctx[15]}set skipInitCheck(n){this.$$set({skipInitCheck:n}),Q()}get theme(){return this.$$.ctx[16]}set theme(n){this.$$set({theme:n}),Q()}get userSettings(){return this.$$.ctx[17]}set userSettings(n){this.$$set({userSettings:n}),Q()}get viewurl(){return this.$$.ctx[18]}set viewurl(n){this.$$set({viewurl:n}),Q()}get webcomponent(){return this.$$.ctx[19]}set webcomponent(n){this.$$set({webcomponent:n}),Q()}get unwarn(){return this.$$.ctx[20]}}uc(Vl,{activeFeatureToggleList:{type:"Array",reflect:!1,attribute:"active-feature-toggle-list"},anchor:{type:"String",reflect:!1,attribute:"anchor"},clientPermissions:{type:"Object",reflect:!1,attribute:"client-permissions"},compoundConfig:{type:"Object",reflect:!1,attribute:"compound-config"},context:{type:"String",reflect:!1,attribute:"context"},deferInit:{type:"Boolean",attribute:"defer-init"},dirtyStatus:{type:"Boolean",reflect:!1,attribute:"dirty-status"},documentTitle:{type:"String",reflect:!1,attribute:"document-title"},hasBack:{type:"Boolean",reflect:!1,attribute:"has-back"},locale:{type:"String",reflect:!1,attribute:"locale"},noShadow:{type:"Boolean",attribute:"no-shadow",reflect:!1},nodeParams:{type:"Object",reflect:!1,attribute:"node-params"},pathParams:{type:"Object",reflect:!1,attribute:"path-params"},searchParams:{type:"Object",reflect:!1,attribute:"search-params"},skipInitCheck:{type:"Boolean",reflect:!1,attribute:"skip-init-check"},theme:{type:"String",reflect:!1,attribute:"theme"},userSettings:{type:"Object",reflect:!1,attribute:"user-settings"},viewurl:{type:"String",reflect:!1,attribute:"viewurl"},webcomponent:{type:"String",reflect:!1,attribute:"webcomponent"}},[],["unwarn"],!1,(i=>{let n=r=>()=>console.warn(r+" can't be called on luigi-container before its micro frontend is attached to the DOM.");return class extends i{updateContext=n("updateContext");notifyAlertClosed=n("notifyAlertClosed");notifyConfirmationModalClosed=n("notifyConfirmationModalClosed");attributeChangedCallback(r,a,u){try{super.attributeChangedCallback(r,a,u)}catch(c){console.warn("Error in attributeChangedCallback",c)}this.containerInitialized&&r==="context"&&this.updateContext(JSON.parse(u))}getNoShadow(){return this.hasAttribute("no-shadow")||this.noShadow}}})),customElements.get("luigi-container")||customElements.define("luigi-container",hc.element),customElements.get("luigi-compound-container")||customElements.define("luigi-compound-container",Vl.element);class _r{constructor(){this.decorators=[]}hasDecorators(){return this.decorators.length>0}add(n){this.decorators=this.decorators.filter(r=>r.uid!==n.uid).concat(n)}applyDecorators(n,r){if(!n)return n;const a=new URL(W.prependOrigin(n)),u=this.decorators.filter(c=>c.type==="queryString");for(let c=0;c<u.length;c++){const l=u[c];a.searchParams.has(l.key)&&a.searchParams.delete(l.key);const d=l.valueFn();a.searchParams.append(l.key,d)}return r&&(a.search=decodeURIComponent(a.search)),a.href}}const Ua=async(i,n,r)=>{const a=await n.readUserSettings(),c=i.userSettingsGroup&&typeof a=="object"&&a!==null&&i.userSettingsGroup?a[i.userSettingsGroup]:null,l=r?.nodeParams||{},d=r?.pathParams||{},p=r?.searchParams||{};if(i.webcomponent&&i.viewUrl&&!k.checkWCUrl(i.viewUrl,n))return console.warn(`View URL '${i.viewUrl}' not allowed to be included`),document.createElement("div");if(i.compound){const _=document.createElement("luigi-compound-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.compoundConfig=i.compound,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=xe.findVirtualTreeRootNode(i),n.getEngine()._comm.addListeners(_,n),_}else{const _=document.createElement("luigi-container");return _.setAttribute("lui_container","true"),_.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,d,n),i.decodeViewUrl??!1):"",_.webcomponent=i.webcomponent??!1,_.context=i.context,_.clientPermissions=i.clientPermissions??{},_.cssVariables=await n.theming().getCSSVariables(),_.nodeParams=l,_.pathParams=d,_.userSettingsGroup=i.userSettingsGroup,_.userSettings=c,_.searchParams=p,_.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),_.locale=n.i18n().getCurrentLocale(),_.theme=n.theming().getCurrentTheme(),_.viewGroup=i.viewGroup,_.virtualTree=i.virtualTree||i._virtualTree,_.virtualTreeRootNode=xe.findVirtualTreeRootNode(i),gc(_,n),dc(_,n),n.getEngine()._comm.addListeners(_,n),_}},gc=(i,n)=>{const r=n.getConfigValue("settings.customSandboxRules");if(!r?.length)return;const a=["allow-forms","allow-modals","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts"],u=r?[...new Set([...a,...r])]:a;i.sandboxRules=u},dc=(i,n)=>{const r=n.getConfigValue("settings.allowRules");r?.length&&(r.forEach((a,u)=>{r[u]=a+(a.indexOf(";")!=-1?"":";")}),i.allowRules=r)},Ue={navService:void 0,routingService:void 0,luigi:void 0,init:i=>{console.log("Init UI..."),Ue.navService=te.get(vn),Ue.routingService=te.get(Dn),Ue.luigi=i,i.getEngine()._connector?.renderMainLayout()},update:async i=>{const n=Ue.routingService.getCurrentRoute();if(!n)return;const r=!i||i.length===0;(r||i.includes("settings.header")||i.includes("settings")||i.includes("navigation")||i.includes("navigation.profile")||i.includes("navigation.contextSwitcher")||i.includes("navigation.productSwitcher"))&&Ue.luigi.getEngine()._connector?.renderTopNav(await Ue.navService.getTopNavData(n.path)),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings")||i.includes("settings.footer"))&&(te.get(_n).deleteCache(),Ue.luigi.getEngine()._connector?.renderLeftNav(await Ue.navService.getLeftNavData(n.path)),Ue.luigi.getEngine()._connector?.renderTabNav(await Ue.navService.getTabNavData(n.path))),(r||i.includes("navigation")||i.includes("navigation.nodes")||i.includes("navigation.viewgroupdata")||i.includes("settings.theming"))&&(te.get(_n).deleteCache(),n.node&&Ue.updateMainContent(n.node,Ue.luigi))},updateMainContent:async(i,n,r,a,u)=>{const c=await n.readUserSettings(),d=i.userSettingsGroup&&typeof c=="object"&&c!==null&&i.userSettingsGroup?c[i.userSettingsGroup]:null,p=n.getEngine()._connector?.getContainerWrapper();n.getEngine()._connector?.hideLoadingIndicator(p);const _=r?.nodeParams||{},A=r?.pathParams||{},P=r?.searchParams||{};if(i&&p){let E,T;if((i.virtualTree||i._virtualTree)&&(T=xe.findVirtualTreeRootNode(i)),[...p.childNodes].forEach(I=>{I.tagName?.indexOf("LUIGI-")===0&&(I.viewGroup&&i.viewGroup!==I.viewGroup?I.style.display="none":I.viewGroup||I.virtualTree&&T===I.virtualTreeRootNode?E=I:I.remove())}),E)a||(E.style.display="block",E.viewurl=i.viewUrl?te.get(_r).applyDecorators(k.substituteViewUrl(i.viewUrl,A,n),i.decodeViewUrl??!1):"",E.nodeParams=_,E.pathParams=A,E.clientPermissions=i.clientPermissions,E.searchParams=P,E.locale=n.i18n().getCurrentLocale(),E.theme=n.theming().getCurrentTheme(),E.activeFeatureToggleList=n.featureToggles().getActiveFeatureToggleList(),E.userSettingsGroup=i.userSettingsGroup,E.userSettings=d,gc(E,n),dc(E,n)),u||E.updateContext(i.context||{});else{const I=await Ua(i,n,r);p?.appendChild(I);const $=n.getEngine()._connector;i.loadingIndicator?.enabled!==!1&&$?.showLoadingIndicator(p)}}},openModal:async(i,n,r,a)=>{const u=await Ua(n,i),c=te.get(Dn),l=te.get(pn);let d=!1,p,_;const P=new Promise(I=>{p=()=>{d||(d=!0,I(),l.removeLastModalFromStack())},_=()=>{p&&p(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},u.addEventListener(N.CLOSE_CURRENT_MODAL_REQUEST,_)}),E={closePromise:P,resolveFn:p,onCloseRequestHandler:_,onInternalClose:()=>{try{E.resolveFn&&E.resolveFn()}catch(I){console.warn("onInternalClose failed",I)}},modalsettings:r};l.registerModal(E),i.getEngine()._connector?.renderModal(u,r,()=>{a?.(),l.removeLastModalFromStack(),i.getConfigValue("routing.showModalPathInUrl")&&l.getModalStackLength()===0&&c.removeModalDataFromUrl(!0)},()=>P);const T=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&T?.showLoadingIndicator(u.parentElement)},updateModalSettings:(i,n,r)=>{const a=te.get(pn);if(a.getModalStackLength()===0)return;a.updateFirstModalSettings(i);const u=te.get(Dn),c=k.getModalPathFromPath(r);c&&u.updateModalDataInUrl(c,a.getModalSettings(),n),r.getEngine()._connector?.updateModalSettings(a.getModalSettings())},openDrawer:async(i,n,r,a)=>{const u=await Ua(n,i);i.getEngine()._connector?.renderDrawer(u,r,a);const c=i.getEngine()._connector;n.loadingIndicator?.enabled!==!1&&c?.showLoadingIndicator(u.parentElement)}};class Dn{constructor(n){this.luigi=n}getNavigationService(){return this.navigationService||(this.navigationService=te.get(vn)),this.navigationService}shouldSkipRoutingForUrlPatterns(){const n=[/access_token=/,/id_token=/];return(this.luigi.getConfigValue("routing.skipRoutingForUrlPatterns")||n).filter(a=>location.href.match(a)).length!==0}enableRouting(){const n=this.luigi.getConfig();console.log("Init Routing...",n.routing),n.routing?.useHashRouting?(window.addEventListener("hashchange",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(k.getCurrentPath(!0),u,a)}),this.handleRouteChange(k.getCurrentPath(!0))):(window.addEventListener("popstate",r=>{const a=!!r?.detail?.preventContextUpdate,u=!!r?.detail?.withoutSync;this.handleRouteChange(k.getCurrentPath(),u,a)}),this.handleRouteChange(k.getCurrentPath()))}async handleRouteChange(n,r=!1,a=!1){const u=n.path,c=n.query,l=u+(c?"?"+c:""),d=new URLSearchParams(c),p=Object.create(null);if(this.shouldSkipRoutingForUrlPatterns())return;this.setFeatureToggle(l),await this.shouldShowModalPathInUrl(n),d.forEach((T,I)=>{p[I]=T}),this.checkInvalidateCache(this.previousPathData,u);const _=await this.getNavigationService().getPathData(u);this.previousPathData=_;const A=k.filterNodeParams(p,this.luigi),P=await this.getNavigationService().shouldRedirect(u,_);if(P){this.luigi.navigation().navigate(P);return}this.currentRoute={raw:window.location.href,path:u,nodeParams:A},this.luigi.getEngine()._connector?.renderTopNav(await this.getNavigationService().getTopNavData(u,_)),this.luigi.getEngine()._connector?.renderLeftNav(await this.getNavigationService().getLeftNavData(u,_)),this.luigi.getEngine()._connector?.renderTabNav(await this.getNavigationService().getTabNavData(u,_));const E=_?.selectedNode??await this.getNavigationService().getCurrentNode(u);if(E){const T={nodeParams:A||{},pathParams:_?.pathParams||{},searchParams:k.prepareSearchParamsForClient(E,this.luigi)};this.currentRoute.node=E,this.getNavigationService().onNodeChange(this.previousNode,E),this.previousNode=E,Ue.updateMainContent(E,this.luigi,T,r,a)}}getCurrentRoute(){return this.currentRoute}async shouldShowModalPathInUrl(n){this.luigi.getConfigValue("routing.showModalPathInUrl")&&await this.handleBookmarkableModalPath(n)}async handleBookmarkableModalPath(n){const r=te.get(vn),a=te.get(pn),u=new URLSearchParams(n?.query||""),c=k.getModalViewParamName(this.luigi),l=u.get(c);if(l){const d=u.get(`${c}Params`);try{const p=JSON.parse(d||"{}"),{nodeObject:_}=await r.extractDataFromPath(l);document.querySelector(".lui-modal luigi-container")?this.luigi.getEngine()._connector?.updateModalSettings(p):this.luigi.navigation().openAsModal(l,p||_.openNodeInModal)}catch(p){console.error("Error parsing modal settings from URL parameters",p)}}else{a.closeModals();return}}appendModalDataToUrl(n,r){const a=k.getHashQueryParamSeparator(),u=k.getQueryParams(this.luigi),c=k.getModalViewParamName(this.luigi),l=u[c],d=new URL(location.href),p=this.luigi.getConfigValue("routing.useHashRouting");let _=history.state,A,P;if(p){let[E,T]=d.hash.split("?");A=E,P=k.getURLWithoutModalData(T,c),P&&(A+="?"+P)}else A=d.pathname,P=k.getURLWithoutModalData(d.search,c),P&&(A+="?"+k.getURLWithoutModalData(d.search,c));if(_=k.handleHistoryState(_,A),l!==n){if(u[c]=n,r&&Object.keys(r).length&&(u[`${c}Params`]=JSON.stringify(r)),p){const E=location.hash.indexOf(a);E!==-1&&(d.hash=d.hash.slice(0,E)),d.hash=`${d.hash}${a}${k.encodeParams(u)}`}else d.search=`?${k.encodeParams(u)}`;history.pushState(_,"",d.href)}else{const E=new URL(d);if(p){let T=E.hash.split("?")[0];E.hash=T,P&&(E.hash+="?"+P)}else E.search=P;history.replaceState({},"",E.href),history.pushState(_,"",d.href)}}removeModalDataFromUrl(n){const r=k.getQueryParams(this.luigi),a=k.getModalViewParamName(this.luigi);let u=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){let l={};r[a]&&(l[a]=r[a]),r[`${a}Params`]&&(l[`${a}Params`]=r[`${a}Params`]);let d=k.encodeParams(l);u.hash.includes(`?${d}`)?u.hash=u.hash.replace(`?${d}`,""):u.hash.includes(`&${d}`)&&(u.hash=u.hash.replace(`&${d}`,""))}else{let l=new URLSearchParams(u.search.slice(1));l.delete(a),l.delete(`${a}Params`);let d="";Array.from(l.keys()).forEach(p=>{d+=(d===""?"?":"&")+p+"="+l.get(p)}),u.search=d}if(history.state&&history.state.modalHistoryLength>=0&&n){history.state.modalHistoryLength;const l=history.state.pathBeforeHistory;let d=!1;if(window.addEventListener("popstate",p=>{d?(history.replaceState({},"",l),history.pushState({},"",l),history.back()):(history.pushState({},"",l),history.back())},{once:!0}),history.state.historygap===history.length-history.state.modalHistoryLength)history.go(-history.state.modalHistoryLength);else if(history.state.modalHistoryLength>history.length){const p=history.length-1;d=!0,history.go(-p),window.Luigi.preventLoadingModalData=!0}else{const p=history.state.modalHistoryLength;history.go(-p)}}else history.pushState({},"",u.href)}setFeatureToggle(n){const r=this.luigi.getConfigValue("settings.featureToggles.queryStringParam"),a=this.luigi.featureToggles();r&&typeof n=="string"&&k.setFeatureToggles(r,n,a)}updateModalDataInUrl(n,r,a){let u=k.getHashQueryParamSeparator();const c=k.getQueryParams(this.luigi),l=k.getModalViewParamName(this.luigi);c[l]=n,r&&Object.keys(r).length&&(c[`${l}Params`]=JSON.stringify(r));const d=new URL(location.href);if(this.luigi.getConfigValue("routing.useHashRouting")){const _=location.hash.indexOf(u);_!==-1&&(d.hash=d.hash.slice(0,_)),d.hash=`${d.hash}${u}${k.encodeParams(c)}`}else d.search=`?${k.encodeParams(c)}`;a?history.pushState(window.state,"",d.href):history.replaceState(window.state,"",d.href)}checkInvalidateCache(n,r){if(!n)return;const a=te.get(_n);let u=r.split("/");if(n.nodesInPath&&n.nodesInPath.length>0){let c=n.nodesInPath.slice(1),l=!0;for(let d=0;d<c.length;d++){let p=u.length>d?u[d]:void 0,_=c[d];if(p!==_.pathSegment||!l)if(k.isDynamicNode(_)){if(!l||p!==k.getDynamicNodeValue(_,n.pathParams)){a.deleteNodesRecursively(_);break}}else l=!1}}else a.deleteCache()}}class iS{constructor(n){this.hashRouting=!1,this.options={fromContext:null,fromClosestContext:!1,fromVirtualTreeRoot:!1,fromParent:!1,nodeParams:{}},this.navigate=async(r,a,u,c,l)=>{const d=r[0]!=="/";this.options.relative=d;const p={modalSettings:u,newTab:!1,options:this.options,path:r,preserveView:a,preventContextUpdate:!1,preventHistoryEntry:!1,withoutSync:!1};this.navService.handleNavigationRequest(p,void 0)},this.openAsModal=async(r,a,u)=>{a?.keepPrevious||await this.modalService.closeModals();const c=r.replace(/\/\/+/g,"/"),l=await this.navService.getCurrentNode(c),d=a||{};d.title||(d.title=l.label),this.luigi.getConfigValue("routing.showModalPathInUrl")&&this.modalService.getModalStackLength()===0&&this.routingService.appendModalDataToUrl(c,d),this.luigi.getEngine()._ui.openModal(this.luigi,l,d,u)},this.openAsDrawer=async(r,a,u)=>{const c=r.replace(/\/\/+/g,"/"),l=await this.navService.getCurrentNode(c),d=a||{};d.title||(d.title=l.label),this.luigi.getEngine()._ui.openDrawer(this.luigi,l,d,u)},this.runTimeErrorHandler=async r=>{const{path:a}=k.getCurrentPath(this.luigi.getConfig().routing?.useHashRouting),u=await this.navService.getCurrentNode(a),c=this.luigi.getConfigValue("navigation.defaults.runTimeErrorHandler");u?.runTimeErrorHandler?.errorFn&&W.isFunction(u?.runTimeErrorHandler?.errorFn)?u.runTimeErrorHandler.errorFn(r,u):c?.errorFn&&W.isFunction(c.errorFn)&&c.errorFn(r,u)},this.luigi=n,this.hashRouting=n.getConfig().routing?.useHashRouting,this.navService=te.get(vn),this.routingService=te.get(Dn),this.modalService=te.get(pn)}fromVirtualTreeRoot(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!0,this.options.fromParent=!1,this}fromContext(n){return this.options.fromContext=n,this}fromClosestContext(){return this.options.fromContext=null,this.options.fromClosestContext=!0,this.options.fromParent=!1,this}fromParent(){return this.options.fromContext=null,this.options.fromClosestContext=!1,this.options.fromVirtualTreeRoot=!1,this.options.fromParent=!0,this}withParams(n){return n&&Object.assign(this.options.nodeParams??{},n),this}}class sS{constructor(n){this.luigi=n}addSearchParams(n,r=!1){if(!W.isObject(n)){console.log("Params argument must be an object");return}const a=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?a.hash=k.addParamsOnHashRouting(n,a.hash):k.modifySearchParams(n,a.searchParams),this.handleBrowserHistory(r,a),this.luigi.configChanged()}getSearchParams(){const n={},r=["__proto__","constructor","prototype"],a=new URL(location.href);let u;if(this.luigi.getConfigValue("routing.useHashRouting")){const c=a.hash.split("?")[1];u=c?new URLSearchParams(c).entries():[]}else u=a.searchParams.entries();for(const[c,l]of u){if(r.some(d=>c===d)){console.warn(`Blocked because of potentially dangerous query param: ${c}`);continue}n[c]=l}return n}handleBrowserHistory(n,r){const a=this.sanitizeUrl(r.href);if(!a){console.warn("invalid url: "+a);return}n?window.history.pushState({},"",a):window.history.replaceState({},"",a)}sanitizeUrl(n){return new URL(location.href).origin===new URL(n).origin?n:void 0}addNodeParams(n,r){if(!W.isObject(n)){console.log("Params argument must be an object");return}const a=k.getContentViewParamPrefix(this.luigi),u=new URL(location.href);this.luigi.getConfigValue("routing.useHashRouting")?u.hash=k.addParamsOnHashRouting(n,u.hash,a):k.modifySearchParams(n,u.searchParams,a),this.handleBrowserHistory(r,u),this.luigi.getConfigValue("routing.useHashRouting")?window.dispatchEvent(new HashChangeEvent("hashchange")):this.luigi.configChanged()}}class aS{#e;#o="";constructor(n){this.#e=n}async getAvailableThemes(){return await this.#e.getConfigValueAsync("settings.theming.themes")}setCurrentTheme(n){this.#o=n,this.#e.__cssVars=void 0}async getThemeObject(n){return(await this.getAvailableThemes())?.find(a=>a.id===n)}getCurrentTheme(){if(!this.isThemingAvailable())return!1;if(this.#o)return this.#o;const n=this.#e.getConfigValue("settings.theming");return n.defaultTheme||console.error("[Theming] getCurrentTheme() error. No theme set and no defaultTheme found in configuration",n),n.defaultTheme}isThemingAvailable(){return!!this.#e.getConfigValue("settings.theming")}async getCSSVariables(){if(!window.Luigi.__cssVars){const n=this.#e.getConfigValue("settings.theming.variables.file");if(n)try{const r=await fetch(n);window.Luigi.__cssVars=(await r.json()).root,Object.keys(window.Luigi.__cssVars).forEach(a=>{const u=getComputedStyle(document.documentElement).getPropertyValue("--"+a);u&&(window.Luigi.__cssVars[a]=u)})}catch(r){W.isFunction(this.#e.getConfigValue("settings.theming.variables.errorHandling"))?this.#e.getConfigValue("settings.theming.variables.errorHandling")(r):console.error("CSS variables file error: ",r)}else this.#e.getConfigValue("settings.theming.variables")==="fiori"&&window.__luigiThemeVars?(window.Luigi.__cssVars={},window.__luigiThemeVars.forEach(r=>{window.Luigi.__cssVars[r]=getComputedStyle(document.documentElement).getPropertyValue("--"+r)})):window.Luigi.__cssVars={}}return window.Luigi.__cssVars}_init(){const n=te.get(_r);(()=>{const a=this.#e.getConfigValue("settings.theming");a&&a.nodeViewURLDecorator&&a.nodeViewURLDecorator.queryStringParameter&&n.add({type:"queryString",uid:"theming",key:a.nodeViewURLDecorator.queryStringParameter.keyName,valueFn:()=>{const u=this.getCurrentTheme(),c=a.nodeViewURLDecorator.queryStringParameter.value;return c?c(u):u}}),a&&a.useFioriScrollbars===!0&&document.body.classList.add("fioriScrollbars")})()}}class as{constructor(){this.unsavedChanges={isDirty:!1,persistUrl:null}}updateDirtyStatus(n,r){if(!this.unsavedChanges.dirtySet||!(this.unsavedChanges.dirtySet instanceof Set)){const a=new Set;a.add(r),this.unsavedChanges={dirtySet:a}}this.unsavedChanges.persistUrl=window.location.href,n?this.unsavedChanges.dirtySet?.add(r):this.unsavedChanges.dirtySet?.delete(r)}clearDirtyState(n){this.unsavedChanges&&this.unsavedChanges.dirtySet&&(n?this.unsavedChanges.dirtySet.delete(n):this.unsavedChanges.dirtySet.clear())}readDirtyStatus(){return this.unsavedChanges.dirtySet?this.unsavedChanges.dirtySet.size>0:!!this.unsavedChanges.isDirty}}let Bl;const Re={luigi:void 0,documentTitle:void 0,init:i=>{console.log("ux init..."),Re.luigi=i,Re.documentTitle=rs(void 0),Bl=te.get(as)},processAlert:(i,n,r)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");const a={openFromClient:n,close:()=>{i.id&&r.notifyAlertClosed(i.id)},link:u=>{if(i.links){const c=i.links[u];if(c&&(c.url&&Re.luigi?.navigation().navigate(c.url),c.dismissKey&&i.id))return r.notifyAlertClosed(i.id,c.dismissKey),!0}return!1}};Re.luigi.getEngine()._connector?.renderAlert(i,a)},handleConfirmationModalRequest:(i,n)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");i&&(i={...i,header:Re.luigi.i18n().getTranslation(i.header||"luigi.confirmationModal.header"),body:Re.luigi.i18n().getTranslation(i.body||"luigi.confirmationModal.body"),buttonDismiss:Re.luigi.i18n().getTranslation(i.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:Re.luigi.i18n().getTranslation(i.buttonConfirm||"luigi.button.confirm")}),Re.luigi.getEngine()._connector?.renderConfirmationModal(i,{confirm(){n.notifyConfirmationModalClosed(!0)},dismiss(){n.notifyConfirmationModalClosed(!1)}})},handleDirtyStatusRequest:(i,n)=>{if(!Re.luigi)throw new Error("Luigi is not initialized.");Bl.updateDirtyStatus(i,n)}};class oS{processUserSettingGroups(n,r){const a=[],u=n?.userSettingGroups,c=r?.userSettings?.userSettingGroups,l=u||c;if(W.isObject(l)){for(const d in l){const p={};p[d]=l[d],a.push(p)}return a}return a}getUserSettingsIframesInDom(){const n=document.querySelector(".iframeUserSettingsCtn");return n?[...n.children]:[]}hideUserSettingsIframe(){this.getUserSettingsIframesInDom().forEach(n=>{n.style.display="none"})}findActiveCustomUserSettingsIframe(n){const r=document.querySelectorAll("[userSettingsGroup]");for(let a=0;a<r.length;a++)if(r[a].contentWindow===n)return r[a];return null}}const uS=new oS;class lS{constructor(n){this.dirtyStatusService=te.get(as),this.appLoadingIndicatorSelector="[luigi-app-loading-indicator]",this.showAlert=r=>new Promise(a=>{r.id||(r.id=W.getRandomId().toString());const u={openFromClient:!1,close:()=>{a(!0)},link:c=>{if(r.links){const l=r.links[c];if(l&&(l.url&&this.luigi?.navigation().navigate(l.url),l.dismissKey))return a(l.dismissKey),!0}return!1}};this.luigi.getEngine()._connector?.renderAlert(r,u)}),this.showConfirmationModal=r=>(r&&(r={...r,header:this.luigi.i18n().getTranslation(r.header||"luigi.confirmationModal.header"),body:this.luigi.i18n().getTranslation(r.body||"luigi.confirmationModal.body"),buttonDismiss:this.luigi.i18n().getTranslation(r.buttonDismiss||"luigi.button.dismiss"),buttonConfirm:this.luigi.i18n().getTranslation(r.buttonConfirm||"luigi.button.confirm")}),new Promise((a,u)=>{this.luigi.getEngine()._connector?.renderConfirmationModal(r,{confirm(){a(!0)},dismiss(){u()}})})),this.processUserSettingGroups=()=>{const r=this.luigi.getConfigValue("userSettings"),a=this.luigi.getConfigValue("settings");return uS.processUserSettingGroups(r,a)},this.openUserSettings=r=>{this.luigi.getEngine()._connector?.openUserSettings(r)},this.closeUserSettings=()=>{this.luigi.getEngine()._connector?.closeUserSettings()},this.setDocumentTitle=r=>{this.luigi.getEngine()._ux?.documentTitle?.set(r),this.luigi.getEngine()._connector?.setDocumentTitle(r)},this.getDocumentTitle=()=>jl(this.luigi.getEngine()._ux?.documentTitle)||window.document.title||"",this.hideAppLoadingIndicator=()=>{const r=document.querySelector(this.appLoadingIndicatorSelector);r&&(r.classList.add("hidden"),setTimeout(()=>{r.parentNode?.removeChild(r)},500))},this.showLoadingIndicator=r=>this.luigi.getEngine()._connector?.showLoadingIndicator(r),this.hideLoadingIndicator=r=>this.luigi.getEngine()._connector?.hideLoadingIndicator(r),this.addBackdrop=()=>this.luigi.getEngine()._connector?.addBackdrop(),this.removeBackdrop=()=>this.luigi.getEngine()._connector?.removeBackdrop(),this.getDirtyStatus=()=>this.dirtyStatusService.readDirtyStatus(),this.luigi=n}}class cS{constructor(n){this.engine=n,this.initialized=!1,this.configReadyCallback=function(){},this.USER_SETTINGS_KEY="luigi.preferences.userSettings",this.setConfig=r=>{this.config=r,this.setConfigCallback(this.getConfigReadyCallback()),fr.init().then(()=>{this.engine.init(),this.initialized||(this.initialized=!0,Hm.luigiAfterInit(this))})},this.getConfig=()=>this.config,this.configChanged=(...r)=>{this.getEngine()._ui.update(r)},this.i18n=()=>(this._i18n||(this._i18n=new km(this)),this._i18n),this.elements=()=>(this._elements||(this._elements=new Wm(this)),this._elements),this.navigation=()=>new iS(this),this.ux=()=>new lS(this),this.featureToggles=()=>(this._featureToggles||(this._featureToggles=new Vm),this._featureToggles),this.routing=()=>(this._routing||(this._routing=new sS(this)),this._routing),this.theming=()=>(this._theming||(this._theming=new aS(this)),this._theming),this.auth=()=>ar,this._store=this.createConfigStore()}getEngine(){return this.engine}getConfigValue(n){return W.getConfigValueFromObject(this.getConfig(),n)}getConfigValueAsync(n,...r){return cr.getConfigValueFromObjectAsync(this.getConfig(),n,r)}clearNavigationCache(){te.get(_n).deleteCache()}async readUserSettings(){const n=await this.getConfigValueAsync("userSettings"),r=n||await this.getConfigValueAsync("settings.userSettings");if(r&&W.isFunction(r.readUserSettings))return r.readUserSettings();const a=localStorage.getItem(this.USER_SETTINGS_KEY);return a&&JSON.parse(a)}async storeUserSettings(n,r){const a=await this.getConfigValueAsync("userSettings"),u=a||await this.getConfigValueAsync("settings.userSettings");if(u&&W.isFunction(u.storeUserSettings))return u.storeUserSettings(n,r);localStorage.setItem(this.USER_SETTINGS_KEY,JSON.stringify(n)),this.configChanged()}createConfigStore(){const n=rs({}),r={};let a=[];return{subscribe:u=>{a.push(n.subscribe(u))},reset:u=>{n.update(u)},subscribeToScope:(u,c)=>{let l=r[c];l||(l=new Set,r[c]=l),l.add(u)},fire:(u,c)=>{const l=r[u];l&&[...l].forEach(d=>{d(c)})},clear:()=>{a.forEach(u=>{u()}),a=[]}}}getConfigReadyCallback(){return new Promise(n=>{this.i18n()._init(),n()})}setConfigCallback(n){this.configReadyCallback=n}}const ka=!1;var fS=Array.isArray,hS=Array.prototype.indexOf,vr=Array.prototype.includes,gS=Array.from,dS=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,pS=Object.prototype,_S=Array.prototype,vS=Object.getPrototypeOf,Gl=Object.isExtensible;const mS=()=>{};function SS(i){for(var n=0;n<i.length;n++)i[n]()}function wS(){var i,n,r=new Promise((a,u)=>{i=a,n=u});return{promise:r,resolve:i,reject:n}}const Be=2,jr=4,os=8,Qa=1<<24,Sn=16,wn=32,Wn=64,Wa=128,wt=512,De=1024,Me=2048,Lt=4096,hn=8192,Mn=16384,ei=32768,us=65536,Ql=1<<17,ES=1<<18,cs=1<<19,CS=1<<20,kn=65536,Ha=1<<21,pc=1<<22,Zr=1<<23,Da=Symbol("$state"),qa=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function TS(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function yS(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function AS(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function RS(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function bS(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ve=Symbol();function PS(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function IS(i){return i===this.v}let za=!1,xS=!1;function LS(){za=!0}let Nt=null;function ls(i){Nt=i}function NS(i,n=!1,r){Nt={p:Nt,i:!1,c:null,e:null,s:i,x:null,l:za&&!n?{s:null,u:null,$:[]}:null}}function OS(i){var n=Nt,r=n.e;if(r!==null){n.e=null;for(var a of r)YS(a)}return n.i=!0,Nt=n.p,{}}function fs(){return!za||Nt!==null&&Nt.l===null}let or=[];function $S(){var i=or;or=[],SS(i)}function gr(i){if(or.length===0){var n=or;queueMicrotask(()=>{n===or&&$S()})}or.push(i)}function _c(i){var n=ve;if(n===null)return ae.f|=Zr,i;if((n.f&ei)===0&&(n.f&jr)===0)throw i;ur(i,n)}function ur(i,n){for(;n!==null;){if((n.f&Wa)!==0){if((n.f&ei)===0)throw i;try{n.b.error(i);return}catch(r){i=r}}n=n.parent}throw i}const US=-7169;function me(i,n){i.f=i.f&US|n}function Ka(i){(i.f&wt)!==0||i.deps===null?me(i,De):me(i,Lt)}function vc(i){if(i!==null)for(const n of i)(n.f&Be)===0||(n.f&kn)===0||(n.f^=kn,vc(n.deps))}function mc(i,n,r){(i.f&Me)!==0?n.add(i):(i.f&Lt)!==0&&r.add(i),vc(i.deps),me(i,De)}const Zi=new Set;let $e=null,It=null,St=[],Ya=null,mr=null,DS=1;class gn{id=DS++;current=new Map;previous=new Map;#e=new Set;#o=new Set;#i=0;#u=0;#r=null;#s=new Set;#t=new Set;#n=new Map;is_fork=!1;#a=!1;#c(){return this.is_fork||this.#u>0}skip_effect(n){this.#n.has(n)||this.#n.set(n,{d:[],m:[]})}unskip_effect(n){var r=this.#n.get(n);if(r){this.#n.delete(n);for(var a of r.d)me(a,Me),Mt(a);for(a of r.m)me(a,Lt),Mt(a)}}process(n){St=[],this.apply();var r=mr=[],a=[];for(const u of n)this.#l(u,r,a);if(mr=null,this.#c()){this.#f(a),this.#f(r);for(const[u,c]of this.#n)Ec(u,c)}else{$e=null;for(const u of this.#e)u(this);this.#e.clear(),this.#i===0&&this.#h(),ql(a),ql(r),this.#s.clear(),this.#t.clear(),this.#r?.resolve()}It=null}#l(n,r,a){n.f^=De;for(var u=n.first;u!==null;){var c=u.f,l=(c&(wn|Wn))!==0,d=l&&(c&De)!==0,p=(c&hn)!==0,_=d||this.#n.has(u);if(!_&&u.fn!==null){l?p||(u.f^=De):(c&jr)!==0?r.push(u):(c&(os|Qa))!==0&&p?a.push(u):ni(u)&&(wr(u),(c&Sn)!==0&&(this.#t.add(u),p&&me(u,Me)));var A=u.first;if(A!==null){u=A;continue}}for(;u!==null;){var P=u.next;if(P!==null){u=P;break}u=u.parent}}}#f(n){for(var r=0;r<n.length;r+=1)mc(n[r],this.#s,this.#t)}capture(n,r){r!==Ve&&!this.previous.has(n)&&this.previous.set(n,r),(n.f&Zr)===0&&(this.current.set(n,n.v),It?.set(n,n.v))}activate(){$e=this,this.apply()}deactivate(){$e===this&&($e=null,It=null)}flush(){if(St.length>0)$e=this,MS();else if(this.#i===0&&!this.is_fork){for(const n of this.#e)n(this);this.#e.clear(),this.#h(),this.#r?.resolve()}this.deactivate()}discard(){for(const n of this.#o)n(this);this.#o.clear()}#h(){if(Zi.size>1){this.previous.clear();var n=$e,r=It,a=!0;for(const c of Zi){if(c===this){a=!1;continue}const l=[];for(const[p,_]of this.current){if(c.current.has(p))if(a&&_!==c.current.get(p))c.current.set(p,_);else continue;l.push(p)}if(l.length===0)continue;const d=[...c.current.keys()].filter(p=>!this.current.has(p));if(d.length>0){var u=St;St=[];const p=new Set,_=new Map;for(const A of l)Sc(A,d,p,_);if(St.length>0){$e=c,c.apply();for(const A of St)c.#l(A,[],[]);c.deactivate()}St=u}}$e=n,It=r}this.#n.clear(),Zi.delete(this)}increment(n){this.#i+=1,n&&(this.#u+=1)}decrement(n){this.#i-=1,n&&(this.#u-=1),!this.#a&&(this.#a=!0,gr(()=>{this.#a=!1,this.#c()?St.length>0&&this.flush():this.revive()}))}revive(){for(const n of this.#s)this.#t.delete(n),me(n,Me),Mt(n);for(const n of this.#t)me(n,Lt),Mt(n);this.flush()}oncommit(n){this.#e.add(n)}ondiscard(n){this.#o.add(n)}settled(){return(this.#r??=wS()).promise}static ensure(){if($e===null){const n=$e=new gn;Zi.add($e),gr(()=>{$e===n&&n.flush()})}return $e}apply(){}}function MS(){var i=null;try{for(var n=0;St.length>0;){var r=gn.ensure();if(n++>1e3){var a,u;FS()}r.process(St),dn.clear()}}finally{St=[],Ya=null,mr=null}}function FS(){try{TS()}catch(i){ur(i,Ya)}}let Xt=null;function ql(i){var n=i.length;if(n!==0){for(var r=0;r<n;){var a=i[r++];if((a.f&(Mn|hn))===0&&ni(a)&&(Xt=new Set,wr(a),a.deps===null&&a.first===null&&a.nodes===null&&a.teardown===null&&a.ac===null&&Nc(a),Xt?.size>0)){dn.clear();for(const u of Xt){if((u.f&(Mn|hn))!==0)continue;const c=[u];let l=u.parent;for(;l!==null;)Xt.has(l)&&(Xt.delete(l),c.push(l)),l=l.parent;for(let d=c.length-1;d>=0;d--){const p=c[d];(p.f&(Mn|hn))===0&&wr(p)}}Xt.clear()}}Xt=null}}function Sc(i,n,r,a){if(!r.has(i)&&(r.add(i),i.reactions!==null))for(const u of i.reactions){const c=u.f;(c&Be)!==0?Sc(u,n,r,a):(c&(pc|Sn))!==0&&(c&Me)===0&&wc(u,n,a)&&(me(u,Me),Mt(u))}}function wc(i,n,r){const a=r.get(i);if(a!==void 0)return a;if(i.deps!==null)for(const u of i.deps){if(vr.call(n,u))return!0;if((u.f&Be)!==0&&wc(u,n,r))return r.set(u,!0),!0}return r.set(i,!1),!1}function Mt(i){var n=Ya=i,r=n.b;if(r?.is_pending&&(i.f&(jr|os|Qa))!==0&&(i.f&ei)===0){r.defer_effect(i);return}for(;n.parent!==null;){n=n.parent;var a=n.f;if(mr!==null&&n===ve&&(i.f&os)===0)return;if((a&(Wn|wn))!==0){if((a&De)===0)return;n.f^=De}}St.push(n)}function Ec(i,n){if(!((i.f&wn)!==0&&(i.f&De)!==0)){(i.f&Me)!==0?n.d.push(i):(i.f&Lt)!==0&&n.m.push(i),me(i,De);for(var r=i.first;r!==null;)Ec(r,n),r=r.next}}function kS(i){let n=0,r=Za(0),a;return()=>{Ja()&&(lr(r),ZS(()=>(n===0&&(a=sw(()=>i(()=>Kr(r)))),n+=1,()=>{gr(()=>{n-=1,n===0&&(a?.(),a=void 0,Kr(r))})})))}}var WS=us|cs;function HS(i,n,r,a){new VS(i,n,r,a)}class VS{parent;is_pending=!1;transform_error;#e;#o=null;#i;#u;#r;#s=null;#t=null;#n=null;#a=null;#c=0;#l=0;#f=!1;#h=new Set;#d=new Set;#g=null;#S=kS(()=>(this.#g=Za(this.#c),()=>{this.#g=null}));constructor(n,r,a,u){this.#e=n,this.#i=r,this.#u=c=>{var l=ve;l.b=this,l.f|=Wa,a(c)},this.parent=ve.b,this.transform_error=u??this.parent?.transform_error??(c=>c),this.#r=JS(()=>{this.#v()},WS)}#w(){try{this.#s=Ln(()=>this.#u(this.#e))}catch(n){this.error(n)}}#E(n){const r=this.#i.failed;r&&(this.#n=Ln(()=>{r(this.#e,()=>n,()=>()=>{})}))}#C(){const n=this.#i.pending;n&&(this.is_pending=!0,this.#t=Ln(()=>n(this.#e)),gr(()=>{var r=this.#a=document.createDocumentFragment(),a=Pc();r.append(a),this.#s=this.#_(()=>(gn.ensure(),Ln(()=>this.#u(a)))),this.#l===0&&(this.#e.before(r),this.#a=null,ts(this.#t,()=>{this.#t=null}),this.#p())}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#c=0,this.#s=Ln(()=>{this.#u(this.#e)}),this.#l>0){var n=this.#a=document.createDocumentFragment();tw(this.#s,n);const r=this.#i.pending;this.#t=Ln(()=>r(this.#e))}else this.#p()}catch(r){this.error(r)}}#p(){this.is_pending=!1;for(const n of this.#h)me(n,Me),Mt(n);for(const n of this.#d)me(n,Lt),Mt(n);this.#h.clear(),this.#d.clear()}defer_effect(n){mc(n,this.#h,this.#d)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#_(n){var r=ve,a=ae,u=Nt;mn(this.#r),kt(this.#r),ls(this.#r.ctx);try{return n()}catch(c){return _c(c),null}finally{mn(r),kt(a),ls(u)}}#m(n){if(!this.has_pending_snippet()){this.parent&&this.parent.#m(n);return}this.#l+=n,this.#l===0&&(this.#p(),this.#t&&ts(this.#t,()=>{this.#t=null}),this.#a&&(this.#e.before(this.#a),this.#a=null))}update_pending_count(n){this.#m(n),this.#c+=n,!(!this.#g||this.#f)&&(this.#f=!0,gr(()=>{this.#f=!1,this.#g&&Ac(this.#g,this.#c)}))}get_effect_pending(){return this.#S(),lr(this.#g)}error(n){var r=this.#i.onerror;let a=this.#i.failed;if(!r&&!a)throw n;this.#s&&(Ft(this.#s),this.#s=null),this.#t&&(Ft(this.#t),this.#t=null),this.#n&&(Ft(this.#n),this.#n=null);var u=!1,c=!1;const l=()=>{if(u){PS();return}u=!0,c&&bS(),this.#n!==null&&ts(this.#n,()=>{this.#n=null}),this.#_(()=>{gn.ensure(),this.#v()})},d=p=>{try{c=!0,r?.(p,l),c=!1}catch(_){ur(_,this.#r&&this.#r.parent)}a&&(this.#n=this.#_(()=>{gn.ensure();try{return Ln(()=>{var _=ve;_.b=this,_.f|=Wa,a(this.#e,()=>p,()=>l)})}catch(_){return ur(_,this.#r.parent),null}}))};gr(()=>{var p;try{p=this.transform_error(n)}catch(_){ur(_,this.#r&&this.#r.parent);return}p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(d,_=>ur(_,this.#r&&this.#r.parent)):d(p)})}}function BS(i){var n=i.effects;if(n!==null){i.effects=null;for(var r=0;r<n.length;r+=1)Ft(n[r])}}function GS(i){for(var n=i.parent;n!==null;){if((n.f&Be)===0)return(n.f&Mn)===0?n:null;n=n.parent}return null}function Xa(i){var n,r=ve;mn(GS(i));try{i.f&=~kn,BS(i),n=Mc(i)}finally{mn(r)}return n}function Cc(i){var n=Xa(i);if(!i.equals(n)&&(i.wv=Uc(),(!$e?.is_fork||i.deps===null)&&(i.v=n,i.deps===null))){me(i,De);return}Sr||(It!==null?(Ja()||$e?.is_fork)&&It.set(i,n):Ka(i))}function QS(i){if(i.effects!==null)for(const n of i.effects)(n.teardown||n.ac)&&(n.teardown?.(),n.ac?.abort(qa),n.teardown=mS,n.ac=null,Jr(n,0),ja(n))}function Tc(i){if(i.effects!==null)for(const n of i.effects)n.teardown&&wr(n)}let Va=new Set;const dn=new Map;let yc=!1;function Za(i,n){var r={f:0,v:i,reactions:null,equals:IS,rv:0,wv:0};return r}function un(i,n){const r=Za(i);return nw(r),r}function Nn(i,n,r=!1){ae!==null&&(!xt||(ae.f&Ql)!==0)&&fs()&&(ae.f&(Be|Sn|pc|Ql))!==0&&(Et===null||!vr.call(Et,i))&&RS();let a=r?Gr(n):n;return Ac(i,a)}function Ac(i,n){if(!i.equals(n)){var r=i.v;Sr?dn.set(i,n):dn.set(i,r),i.v=n;var a=gn.ensure();if(a.capture(i,r),(i.f&Be)!==0){const u=i;(i.f&Me)!==0&&Xa(u),Ka(u)}i.wv=Uc(),Rc(i,Me),fs()&&ve!==null&&(ve.f&De)!==0&&(ve.f&(wn|Wn))===0&&(vt===null?rw([i]):vt.push(i)),!a.is_fork&&Va.size>0&&!yc&&qS()}return n}function qS(){yc=!1;for(const i of Va)(i.f&De)!==0&&me(i,Lt),ni(i)&&wr(i);Va.clear()}function Kr(i){Nn(i,i.v+1)}function Rc(i,n){var r=i.reactions;if(r!==null)for(var a=fs(),u=r.length,c=0;c<u;c++){var l=r[c],d=l.f;if(!(!a&&l===ve)){var p=(d&Me)===0;if(p&&me(l,n),(d&Be)!==0){var _=l;It?.delete(_),(d&kn)===0&&(d&wt&&(l.f|=kn),Rc(_,Lt))}else p&&((d&Sn)!==0&&Xt!==null&&Xt.add(l),Mt(l))}}}function Gr(i){if(typeof i!="object"||i===null||Da in i)return i;const n=vS(i);if(n!==pS&&n!==_S)return i;var r=new Map,a=fS(i),u=un(0),c=Fn,l=d=>{if(Fn===c)return d();var p=ae,_=Fn;kt(null),Yl(c);var A=d();return kt(p),Yl(_),A};return a&&r.set("length",un(i.length)),new Proxy(i,{defineProperty(d,p,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&yS();var A=r.get(p);return A===void 0?l(()=>{var P=un(_.value);return r.set(p,P),P}):Nn(A,_.value,!0),!0},deleteProperty(d,p){var _=r.get(p);if(_===void 0){if(p in d){const A=l(()=>un(Ve));r.set(p,A),Kr(u)}}else Nn(_,Ve),Kr(u);return!0},get(d,p,_){if(p===Da)return i;var A=r.get(p),P=p in d;if(A===void 0&&(!P||zr(d,p)?.writable)&&(A=l(()=>{var T=Gr(P?d[p]:Ve),I=un(T);return I}),r.set(p,A)),A!==void 0){var E=lr(A);return E===Ve?void 0:E}return Reflect.get(d,p,_)},getOwnPropertyDescriptor(d,p){var _=Reflect.getOwnPropertyDescriptor(d,p);if(_&&"value"in _){var A=r.get(p);A&&(_.value=lr(A))}else if(_===void 0){var P=r.get(p),E=P?.v;if(P!==void 0&&E!==Ve)return{enumerable:!0,configurable:!0,value:E,writable:!0}}return _},has(d,p){if(p===Da)return!0;var _=r.get(p),A=_!==void 0&&_.v!==Ve||Reflect.has(d,p);if(_!==void 0||ve!==null&&(!A||zr(d,p)?.writable)){_===void 0&&(_=l(()=>{var E=A?Gr(d[p]):Ve,T=un(E);return T}),r.set(p,_));var P=lr(_);if(P===Ve)return!1}return A},set(d,p,_,A){var P=r.get(p),E=p in d;if(a&&p==="length")for(var T=_;T<P.v;T+=1){var I=r.get(T+"");I!==void 0?Nn(I,Ve):T in d&&(I=l(()=>un(Ve)),r.set(T+"",I))}if(P===void 0)(!E||zr(d,p)?.writable)&&(P=l(()=>un(void 0)),Nn(P,Gr(_)),r.set(p,P));else{E=P.v!==Ve;var $=l(()=>Gr(_));Nn(P,$)}var M=Reflect.getOwnPropertyDescriptor(d,p);if(M?.set&&M.set.call(A,_),!E){if(a&&typeof p=="string"){var q=r.get("length"),oe=Number(p);Number.isInteger(oe)&&oe>=q.v&&Nn(q,oe+1)}Kr(u)}return!0},ownKeys(d){lr(u);var p=Reflect.ownKeys(d).filter(P=>{var E=r.get(P);return E===void 0||E.v!==Ve});for(var[_,A]of r)A.v!==Ve&&!(_ in d)&&p.push(_);return p},setPrototypeOf(){AS()}})}var zl,bc;function zS(){if(zl===void 0){zl=window;var i=Element.prototype,n=Node.prototype,r=Text.prototype;zr(n,"firstChild").get,bc=zr(n,"nextSibling").get,Gl(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Gl(r)&&(r.__t=void 0)}}function Pc(i=""){return document.createTextNode(i)}function Ic(i){return bc.call(i)}function xc(i){var n=ae,r=ve;kt(null),mn(null);try{return i()}finally{kt(n),mn(r)}}function KS(i,n){var r=n.last;r===null?n.last=n.first=i:(r.next=i,i.prev=r,n.last=i)}function ti(i,n){var r=ve;r!==null&&(r.f&hn)!==0&&(i|=hn);var a={ctx:Nt,deps:null,nodes:null,f:i|Me|wt,first:null,fn:n,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null},u=a;if((i&jr)!==0)mr!==null?mr.push(a):Mt(a);else if(n!==null){try{wr(a)}catch(l){throw Ft(a),l}u.deps===null&&u.teardown===null&&u.nodes===null&&u.first===u.last&&(u.f&cs)===0&&(u=u.first,(i&Sn)!==0&&(i&us)!==0&&u!==null&&(u.f|=us))}if(u!==null&&(u.parent=r,r!==null&&KS(u,r),ae!==null&&(ae.f&Be)!==0&&(i&Wn)===0)){var c=ae;(c.effects??=[]).push(u)}return a}function Ja(){return ae!==null&&!xt}function YS(i){return ti(jr|CS,i)}function XS(i){gn.ensure();const n=ti(Wn|cs,i);return(r={})=>new Promise(a=>{r.outro?ts(n,()=>{Ft(n),a(void 0)}):(Ft(n),a(void 0))})}function ZS(i,n=0){return ti(os|n,i)}function JS(i,n=0){var r=ti(Sn|n,i);return r}function Ln(i){return ti(wn|cs,i)}function Lc(i){var n=i.teardown;if(n!==null){const r=Sr,a=ae;Kl(!0),kt(null);try{n.call(null)}finally{Kl(r),kt(a)}}}function ja(i,n=!1){var r=i.first;for(i.first=i.last=null;r!==null;){const u=r.ac;u!==null&&xc(()=>{u.abort(qa)});var a=r.next;(r.f&Wn)!==0?r.parent=null:Ft(r,n),r=a}}function jS(i){for(var n=i.first;n!==null;){var r=n.next;(n.f&wn)===0&&Ft(n),n=r}}function Ft(i,n=!0){var r=!1;(n||(i.f&ES)!==0)&&i.nodes!==null&&i.nodes.end!==null&&(ew(i.nodes.start,i.nodes.end),r=!0),ja(i,n&&!r),Jr(i,0),me(i,Mn);var a=i.nodes&&i.nodes.t;if(a!==null)for(const c of a)c.stop();Lc(i);var u=i.parent;u!==null&&u.first!==null&&Nc(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=null}function ew(i,n){for(;i!==null;){var r=i===n?null:Ic(i);i.remove(),i=r}}function Nc(i){var n=i.parent,r=i.prev,a=i.next;r!==null&&(r.next=a),a!==null&&(a.prev=r),n!==null&&(n.first===i&&(n.first=a),n.last===i&&(n.last=r))}function ts(i,n,r=!0){var a=[];Oc(i,a,!0);var u=()=>{r&&Ft(i),n&&n()},c=a.length;if(c>0){var l=()=>--c||u();for(var d of a)d.out(l)}else u()}function Oc(i,n,r){if((i.f&hn)===0){i.f^=hn;var a=i.nodes&&i.nodes.t;if(a!==null)for(const d of a)(d.is_global||r)&&n.push(d);for(var u=i.first;u!==null;){var c=u.next,l=(u.f&us)!==0||(u.f&wn)!==0&&(i.f&Sn)!==0;Oc(u,n,l?r:!1),u=c}}}function tw(i,n){if(i.nodes)for(var r=i.nodes.start,a=i.nodes.end;r!==null;){var u=r===a?null:Ic(r);n.append(r),r=u}}let ns=!1,Sr=!1;function Kl(i){Sr=i}let ae=null,xt=!1;function kt(i){ae=i}let ve=null;function mn(i){ve=i}let Et=null;function nw(i){ae!==null&&(Et===null?Et=[i]:Et.push(i))}let Ze=null,ot=0,vt=null;function rw(i){vt=i}let $c=1,$n=0,Fn=$n;function Yl(i){Fn=i}function Uc(){return++$c}function ni(i){var n=i.f;if((n&Me)!==0)return!0;if(n&Be&&(i.f&=~kn),(n&Lt)!==0){for(var r=i.deps,a=r.length,u=0;u<a;u++){var c=r[u];if(ni(c)&&Cc(c),c.wv>i.wv)return!0}(n&wt)!==0&&It===null&&me(i,De)}return!1}function Dc(i,n,r=!0){var a=i.reactions;if(a!==null&&!(Et!==null&&vr.call(Et,i)))for(var u=0;u<a.length;u++){var c=a[u];(c.f&Be)!==0?Dc(c,n,!1):n===c&&(r?me(c,Me):(c.f&De)!==0&&me(c,Lt),Mt(c))}}function Mc(i){var n=Ze,r=ot,a=vt,u=ae,c=Et,l=Nt,d=xt,p=Fn,_=i.f;Ze=null,ot=0,vt=null,ae=(_&(wn|Wn))===0?i:null,Et=null,ls(i.ctx),xt=!1,Fn=++$n,i.ac!==null&&(xc(()=>{i.ac.abort(qa)}),i.ac=null);try{i.f|=Ha;var A=i.fn,P=A();i.f|=ei;var E=i.deps,T=$e?.is_fork;if(Ze!==null){var I;if(T||Jr(i,ot),E!==null&&ot>0)for(E.length=ot+Ze.length,I=0;I<Ze.length;I++)E[ot+I]=Ze[I];else i.deps=E=Ze;if(Ja()&&(i.f&wt)!==0)for(I=ot;I<E.length;I++)(E[I].reactions??=[]).push(i)}else!T&&E!==null&&ot<E.length&&(Jr(i,ot),E.length=ot);if(fs()&&vt!==null&&!xt&&E!==null&&(i.f&(Be|Lt|Me))===0)for(I=0;I<vt.length;I++)Dc(vt[I],i);if(u!==null&&u!==i){if($n++,u.deps!==null)for(let $=0;$<r;$+=1)u.deps[$].rv=$n;if(n!==null)for(const $ of n)$.rv=$n;vt!==null&&(a===null?a=vt:a.push(...vt))}return(i.f&Zr)!==0&&(i.f^=Zr),P}catch($){return _c($)}finally{i.f^=Ha,Ze=n,ot=r,vt=a,ae=u,Et=c,ls(l),xt=d,Fn=p}}function iw(i,n){let r=n.reactions;if(r!==null){var a=hS.call(r,i);if(a!==-1){var u=r.length-1;u===0?r=n.reactions=null:(r[a]=r[u],r.pop())}}if(r===null&&(n.f&Be)!==0&&(Ze===null||!vr.call(Ze,n))){var c=n;(c.f&wt)!==0&&(c.f^=wt,c.f&=~kn),Ka(c),QS(c),Jr(c,0)}}function Jr(i,n){var r=i.deps;if(r!==null)for(var a=n;a<r.length;a++)iw(i,r[a])}function wr(i){var n=i.f;if((n&Mn)===0){me(i,De);var r=ve,a=ns;ve=i,ns=!0;try{(n&(Sn|Qa))!==0?jS(i):ja(i),Lc(i);var u=Mc(i);i.teardown=typeof u=="function"?u:null,i.wv=$c;var c;ka&&xS&&(i.f&Me)!==0&&i.deps}finally{ns=a,ve=r}}}function lr(i){var n=i.f,r=(n&Be)!==0;if(ae!==null&&!xt){var a=ve!==null&&(ve.f&Mn)!==0;if(!a&&(Et===null||!vr.call(Et,i))){var u=ae.deps;if((ae.f&Ha)!==0)i.rv<$n&&(i.rv=$n,Ze===null&&u!==null&&u[ot]===i?ot++:Ze===null?Ze=[i]:Ze.push(i));else{(ae.deps??=[]).push(i);var c=i.reactions;c===null?i.reactions=[ae]:vr.call(c,ae)||c.push(ae)}}}if(Sr&&dn.has(i))return dn.get(i);if(r){var l=i;if(Sr){var d=l.v;return((l.f&De)===0&&l.reactions!==null||kc(l))&&(d=Xa(l)),dn.set(l,d),d}var p=(l.f&wt)===0&&!xt&&ae!==null&&(ns||(ae.f&wt)!==0),_=(l.f&ei)===0;ni(l)&&(p&&(l.f|=wt),Cc(l)),p&&!_&&(Tc(l),Fc(l))}if(It?.has(i))return It.get(i);if((i.f&Zr)!==0)throw i.v;return i.v}function Fc(i){if(i.f|=wt,i.deps!==null)for(const n of i.deps)(n.reactions??=[]).push(i),(n.f&Be)!==0&&(n.f&wt)===0&&(Tc(n),Fc(n))}function kc(i){if(i.v===Ve)return!0;if(i.deps===null)return!1;for(const n of i.deps)if(dn.has(n)||(n.f&Be)!==0&&kc(n))return!0;return!1}function sw(i){var n=xt;try{return xt=!0,i()}finally{xt=n}}const aw=["touchstart","touchmove"];function ow(i){return aw.includes(i)}const Ji=Symbol("events"),uw=new Set,Xl=new Set;let Zl=null;function Jl(i){var n=this,r=n.ownerDocument,a=i.type,u=i.composedPath?.()||[],c=u[0]||i.target;Zl=i;var l=0,d=Zl===i&&i[Ji];if(d){var p=u.indexOf(d);if(p!==-1&&(n===document||n===window)){i[Ji]=n;return}var _=u.indexOf(n);if(_===-1)return;p<=_&&(l=p)}if(c=u[l]||i.target,c!==n){dS(i,"currentTarget",{configurable:!0,get(){return c||r}});var A=ae,P=ve;kt(null),mn(null);try{for(var E,T=[];c!==null;){var I=c.assignedSlot||c.parentNode||c.host||null;try{var $=c[Ji]?.[a];$!=null&&(!c.disabled||i.target===c)&&$.call(c,i)}catch(M){E?T.push(M):E=M}if(i.cancelBubble||I===n||I===null)break;c=I}if(E){for(let M of T)queueMicrotask(()=>{throw M});throw E}}finally{i[Ji]=n,delete i.currentTarget,kt(A),mn(P)}}}function lw(i,n){return cw(i,n)}const ji=new Map;function cw(i,{target:n,anchor:r,props:a={},events:u,context:c,intro:l=!0,transformError:d}){zS();var p=void 0,_=XS(()=>{var A=r??n.appendChild(Pc());HS(A,{pending:()=>{}},T=>{NS({});var I=Nt;c&&(I.c=c),u&&(a.$$events=u),p=i(T,a)||{},OS()},d);var P=new Set,E=T=>{for(var I=0;I<T.length;I++){var $=T[I];if(!P.has($)){P.add($);var M=ow($);for(const fe of[n,document]){var q=ji.get(fe);q===void 0&&(q=new Map,ji.set(fe,q));var oe=q.get($);oe===void 0?(fe.addEventListener($,Jl,{passive:M}),q.set($,1)):q.set($,oe+1)}}}};return E(gS(uw)),Xl.add(E),()=>{for(var T of P)for(const M of[n,document]){var I=ji.get(M),$=I.get(T);--$==0?(M.removeEventListener(T,Jl),I.delete(T),I.size===0&&ji.delete(M)):I.set(T,$)}Xl.delete(E),A!==r&&A.parentNode?.removeChild(A)}});return fw.set(p,_),p}let fw=new WeakMap;const hw="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(hw);LS();function gw(i){}const Ba={init:i=>{te.get(Dn).enableRouting()},handlePageErrorHandler:(i,n,r)=>{i&&i.timeout&&setTimeout(()=>{if(i.viewUrl)n.viewUrl=i.viewUrl,r.getEngine()._ui.updateMainContent(n,r);else if(i.errorFn)i.errorFn(n);else{console.warn("Something went wrong with a client! You will be redirected to another page.");const a=i.redirectPath||"/";r.navigation().navigate(a)}},i.timeout)},handleExternalLinkNavigation:i=>{if(i.url)if(i.sameWindow||!1)window.location.href=i.url;else{const r=window.open(i.url,"_blank","noopener noreferrer");r&&(r.opener=null,r.focus())}},async addSearchParamsFromClient(i,n,r){const a=te.get(vn),u=k.getCurrentPath(r.getConfig().routing?.useHashRouting),c=await a.getCurrentNode(u.path),l={...i};if(c?.clientPermissions?.urlParameters){const d={};Object.keys(c.clientPermissions.urlParameters).forEach(p=>{p in l&&c.clientPermissions.urlParameters[p].write===!0&&(d[p]=l[p],delete l[p])});for(const p in l)console.warn(`No permission to add the search param "${p}" to the url`);Object.keys(d).length>0&&r.routing().addSearchParams(d,n)}}},Dt={luigi:{},init:i=>{console.log("Init communication..."),Dt.luigi=i},addListeners:(i,n)=>{i.addEventListener(N.INITIALIZED,r=>{Re.luigi?.ux().hideLoadingIndicator(i.parentNode)}),i.addEventListener(N.NAVIGATION_REQUEST,r=>{const{link:a,preserveView:u,modal:c,newTab:l,withoutSync:d,preventContextUpdate:p,preventHistoryEntry:_,fromVirtualTreeRoot:A,fromContext:P,fromClosestContext:E,fromParent:T,relative:I,nodeParams:$}=r.detail,M={modalSettings:c,newTab:l,path:a,preserveView:u,preventContextUpdate:p,options:{fromVirtualTreeRoot:A,fromContext:P,fromClosestContext:E,fromParent:T,relative:I,nodeParams:$},preventHistoryEntry:_,withoutSync:d};te.get(vn).handleNavigationRequest(M,r.callbackFn)}),i.addEventListener(N.RUNTIME_ERROR_HANDLING_REQUEST,r=>{n.navigation().runTimeErrorHandler(r.payload?.data?.errorObj||{})}),i.addEventListener(N.ALERT_REQUEST,r=>{Re.processAlert(r.payload,!0,i)}),i.addEventListener(N.SHOW_CONFIRMATION_MODAL_REQUEST,r=>{Re.handleConfirmationModalRequest(r.payload,i)}),i.addEventListener(N.SET_DOCUMENT_TITLE_REQUEST,r=>{Dt.luigi.getEngine()._connector?.setDocumentTitle(r.detail.title)}),i.addEventListener(N.SHOW_LOADING_INDICATOR_REQUEST,r=>{Dt.luigi.getEngine()._connector?.showLoadingIndicator(i.parentNode)}),i.addEventListener(N.HIDE_LOADING_INDICATOR_REQUEST,r=>{Dt.luigi.getEngine()._connector?.hideLoadingIndicator(i.parentNode)}),i.addEventListener(N.ADD_BACKDROP_REQUEST,r=>{Dt.luigi.getEngine()._connector?.addBackdrop()}),i.addEventListener(N.REMOVE_BACKDROP_REQUEST,r=>{Dt.luigi.getEngine()._connector?.removeBackdrop()}),i.addEventListener(N.SET_DIRTY_STATUS_REQUEST,r=>{Re.handleDirtyStatusRequest(r.detail?.data?.dirty,r.detail?.source)}),i.addEventListener(N.ADD_NODE_PARAMS_REQUEST,r=>{n.routing().addNodeParams(r.payload.data,r.payload.keepBrowserHistory)}),i.addEventListener(N.OPEN_USER_SETTINGS_REQUEST,r=>{Dt.luigi.getEngine()._connector?.openUserSettings(r.detail)}),i.addEventListener(N.CLOSE_USER_SETTINGS_REQUEST,r=>{Dt.luigi.getEngine()._connector?.closeUserSettings()}),i.addEventListener(N.ADD_SEARCH_PARAMS_REQUEST,r=>{Ba.addSearchParamsFromClient(r.detail.data,r.detail.keepBrowserHistory,n)}),i.addEventListener(N.UPDATE_MODAL_SETTINGS_REQUEST,r=>{Ue.updateModalSettings(r.payload.updatedModalSettings,r.payload.addHistoryEntry,n)}),i.addEventListener(N.SET_CURRENT_LOCALE_REQUEST,r=>{n.i18n().setCurrentLocale(r.detail?.data?.data?.currentLocale,i)})}};class dw{constructor(){this._ui=Ue,this._comm=Dt,this._ux=Re,this._routing=Ba}bootstrap(n){this._app=lw(gw,{target:document.body}),this._connector=n}init(){const n=window.Luigi;te.register(as,()=>new as),te.register(vn,()=>new vn(n)),te.register(_n,()=>new _n),te.register(Dn,()=>new Dn(n)),te.register(_r,()=>new _r),te.register(pn,()=>new pn(n)),n.theming()._init(),Ue.init(n),Ba.init(n),Dt.init(n),Re.init(n)}}window.Luigi=new cS(new dw);
|
|
55
55
|
//# sourceMappingURL=luigi.js.map
|