@equinor/fusion-framework-cli 9.4.2 → 9.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @equinor/fusion-framework-app@7.1.10
9
+ - @equinor/fusion-framework-react-components-people-provider@1.1.3
10
+
3
11
  ## 9.4.2
4
12
 
5
13
  ### Patch Changes
@@ -410,7 +410,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
410
410
  class="progress">
411
411
  </circle>
412
412
  </svg>
413
- `}}C([I({type:String,reflect:!0})],zh.prototype,"size",void 0);C([I({type:String,reflect:!0})],zh.prototype,"color",void 0);zh.styles=Mz;const XE="fwc-circular-progress";let Tb=class extends zh{};Tb=C([N2(XE)],Tb);const Zz=id(Vh,YE);id(zh,XE);id(Fh,QE);const JE=({children:r,text:e})=>x.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100vw",height:"100vh",overflow:"hidden"},children:x.jsx(Zz,{text:e,children:r})});var Hz=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Oz=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Mf;class Lz{constructor(e,t={}){this.config=t,Mf.set(this,void 0),Hz(this,Mf,e,"f")}requireInstance(e){return Oz(this,Mf,"f").requireInstance(e)}setAppClient(e,t=1*60*1e3){this.config.client={getAppManifest:typeof e.getAppManifest=="function"?{key:({appKey:n})=>n,client:{fn:e.getAppManifest},expire:t}:e.getAppManifest,getAppManifests:typeof e.getAppManifests=="function"?{key:()=>"app_manifests",client:{fn:e.getAppManifests},expire:t}:e.getAppManifests,getAppConfig:typeof e.getAppConfig=="function"?{key:n=>JSON.stringify(n),client:{fn:e.getAppConfig},expire:t}:e.getAppConfig}}}Mf=new WeakMap;const $z=()=>({setManifest:Sr("set_manifest",(r,e)=>({payload:r,meta:{created:Date.now(),update:e}})),fetchManifest:eo("fetch_manifest",(r,e)=>({payload:r,meta:{update:e}}),r=>({payload:r}),r=>({payload:r})),setConfig:Sr("set_config",r=>({payload:r})),fetchConfig:eo("fetch_config",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),setModule:Sr("set_module",r=>({payload:r})),importApp:eo("import_app",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),setInstance:Sr("set_instance",r=>({payload:r})),initialize:eo("initialize_app",()=>({payload:null}),()=>({payload:null}),r=>({payload:r}))}),Ne=$z();VL();const Nz=r=>$h(Object.assign(Object.assign({},r),{status:new Set}),e=>e.addCase(Ne.setManifest,(t,n)=>{n.meta.update?t.manifest=Object.assign(Object.assign({},t.manifest),n.payload):t.manifest=n.payload}).addCase(Ne.setConfig,(t,n)=>{t.config=n.payload}).addCase(Ne.setModule,(t,n)=>{t.modules=n.payload}).addCase(Ne.setInstance,(t,n)=>{t.instance=n.payload}).addMatcher(WL,(t,n)=>{t.status.add(Z6(n))}).addMatcher(YL,(t,n)=>{t.status.delete(Z6(n))})),Dz="modulepreload",Vz=function(r){return"/"+r},Ib={},ek=function(e,t,n){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Vz(o),o in Ib)return;Ib[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let d=i.length-1;d>=0;d--){const u=i[d];if(u.href===o&&(!a||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":Dz,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((d,u)=>{l.addEventListener("load",d),l.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},Fz=r=>e=>e.pipe(Ye(Ne.fetchManifest.match),vt(t=>{const{payload:n,meta:{update:i}}=t,o=fr(r.getAppManifest(n)).pipe(Ye(a=>!!a),F5());return El(o.pipe(Le(a=>Ne.setManifest(a,i))),o.pipe(M2(),Le(a=>Ne.fetchManifest.success(a)))).pipe(Jt(a=>Vn(Ne.fetchManifest.failure(a))))})),zz=r=>e=>e.pipe(Ye(Ne.fetchConfig.match),vt(({payload:t})=>{const n=fr(r.getAppConfig(t)).pipe(Ye(i=>!!i),F5());return El(n.pipe(Le(i=>Ne.setConfig(i))),n.pipe(M2(),Le(i=>Ne.fetchConfig.success(i)))).pipe(Jt(i=>Vn(Ne.fetchConfig.failure(i))))})),Uz=()=>r=>r.pipe(Ye(Ne.importApp.match),vt(({payload:e})=>fr(ek(()=>import(e),[])).pipe(Le(Ne.importApp.success),Jt(t=>Vn(Ne.importApp.failure(t)))))),jz=(r,e)=>{const t=Nz(r),n=new O2(t);return n.addFlow(Fz(e)),n.addFlow(zz(e)),n.addFlow(Uz()),n};var Bz=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},xe=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qz=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Kg,we,tk;function du(){return Ye(r=>r!=null)}class Wz{get manifest$(){return xe(this,we,"f").pipe(Le(({manifest:e})=>e),du())}get config$(){return xe(this,we,"f").pipe(Le(({config:e})=>e),du())}get modules$(){return xe(this,we,"f").pipe(Le(({modules:e})=>e),du())}get instance$(){return xe(this,we,"f").pipe(Le(({instance:e})=>e),du())}get state(){return xe(this,we,"f").value}get appKey(){return xe(this,we,"f").value.appKey}get manifest(){return this.state.manifest}get manifestAsync(){return Ir(this.manifest$)}get config(){return this.state.config}get configAsync(){return Ir(this.config$)}get instance(){return xe(this,we,"f").value.instance}constructor(e,t){Kg.add(this),we.set(this,void 0),qz(this,we,jz(e,t.provider),"f");const{appKey:n}=e,{event:i}=t;i&&xe(this,Kg,"m",tk).call(this,i);const o=new Qr;i&&(o.add(()=>{i.dispatchEvent("onAppDispose",{detail:{appKey:n}})}),o.add(i.addEventListener("onAppModulesLoaded",a=>{a.detail.appKey===n&&xe(this,we,"f").next(Ne.setInstance(a.detail.modules))}))),this.dispose=()=>{o==null||o.unsubscribe(),xe(this,we,"f").value.instance&&xe(this,we,"f").value.instance.dispose(),xe(this,we,"f").complete()}}initialize(){return new De(e=>{xe(this,we,"f").next(Ne.initialize()),e.add(rH([this.getManifest(),this.getAppModule(),this.getConfig()]).subscribe({next:([t,n,i])=>e.next({manifest:t,script:n,config:i}),error:t=>{e.error(t),xe(this,we,"f").next(Ne.initialize.failure(t))},complete:()=>{xe(this,we,"f").next(Ne.initialize.success()),e.complete()}}))})}loadConfig(){xe(this,we,"f").next(Ne.fetchConfig(this.appKey))}loadManifest(e){xe(this,we,"f").next(Ne.fetchManifest(this.appKey,e))}updateManifest(e,t){xe(this,we,"f").next(Ne.setManifest(e,!t))}loadAppModule(e=!0){return Bz(this,void 0,void 0,function*(){const t=yield this.getManifestAsync(e);xe(this,we,"f").next(Ne.importApp(t.entry))})}getConfig(e=!1){return new De(t=>{if(xe(this,we,"f").value.config&&(t.next(xe(this,we,"f").value.config),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_config",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("fetch_config::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("fetch_config::failure",({payload:n})=>{t.error(Error("failed to load application config",{cause:n}))})),this.loadConfig()})}getConfigAsync(e=!0){return(e?Ir:wr)(this.getConfig(!e))}getManifest(e=!1){return new De(t=>{if(xe(this,we,"f").value.manifest&&(t.next(xe(this,we,"f").value.manifest),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_manifest",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("fetch_manifest::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("fetch_manifest::failure",({payload:n})=>{t.error(Error("failed to load application manifest",{cause:n}))})),this.loadManifest()})}getManifestAsync(e=!0){return(e?Ir:wr)(this.getManifest(!e))}getAppModule(e=!1){return new De(t=>{if(xe(this,we,"f").value.modules&&(t.next(xe(this,we,"f").value.modules),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_module",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("import_app::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("import_app::failure",({payload:n})=>{t.error(Error("failed to load application modules from script",{cause:n}))})),t.add(this.getManifest().subscribe(n=>Vn(xe(this,we,"f").next(Ne.importApp(n.entry)))))})}getAppModuleAsync(e=!0){return(e?Ir:wr)(this.getAppModule(!e))}}we=new WeakMap,Kg=new WeakSet,tk=function(e){const{appKey:t}=this;xe(this,we,"f").addEffect(Ne.fetchManifest.type,n=>{e.dispatchEvent("onAppManifestLoad",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchManifest.success.type,n=>{e.dispatchEvent("onAppManifestLoaded",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchManifest.failure.type,n=>{e.dispatchEvent("onAppManifestFailure",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.type,n=>{e.dispatchEvent("onAppConfigLoad",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.success.type,n=>{e.dispatchEvent("onAppConfigLoaded",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.failure.type,n=>{e.dispatchEvent("onAppConfigFailure",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.type,n=>{e.dispatchEvent("onAppScriptLoad",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.success.type,n=>{e.dispatchEvent("onAppScriptLoaded",{detail:{appKey:t,script:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.failure.type,n=>{e.dispatchEvent("onAppScriptFailure",{detail:{appKey:t,error:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.type,()=>{e.dispatchEvent("onAppInitialize",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.success.type,()=>{e.dispatchEvent("onAppInitialized",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.failure.type,({payload:n})=>{e.dispatchEvent("onAppInitializeFailure",{detail:{appKey:t,error:n},source:this})})};class Ha extends Error{static fromHttpResponse(e,t){switch(e.status){case 401:return new Ha("unauthorized","failed to load application manifest, request not authorized",t);case 404:return new Ha("not_found","application manifest not found",t)}return new Ha("unknown",`failed to load application manifest, status code ${e.status}`,t)}constructor(e,t,n){super(t,n),this.type=e}}class zs extends Error{static fromHttpResponse(e,t){switch(e.status){case 401:return new zs("unauthorized","failed to load application config, request not authorized",t);case 404:return new zs("not_found","application config not found",t)}return new zs("unknown",`failed to load application config, status code ${e.status}`,t)}constructor(e,t,n){super(t,n),this.type=e}}var Ur=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$1=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},uu,hu,fa,pa,Zf;class Gz{static compareAppManifest(e,t){return JSON.stringify(e)===JSON.stringify(t)}get current(){return Ur(this,fa,"f").value}get current$(){return Ur(this,fa,"f").pipe(bC((e,t)=>e&&t?e.appKey===t.appKey:e===t))}constructor(e){uu.set(this,void 0),hu.set(this,void 0),fa.set(this,void 0),pa.set(this,new Qr),Zf.set(this,void 0);const{event:t,config:n}=e;$1(this,Zf,t,"f"),$1(this,fa,new Xl(void 0),"f"),this.appClient=new Tr(n.client.getAppManifest),$1(this,uu,new Tr(n.client.getAppManifests),"f"),$1(this,hu,new Tr(n.client.getAppConfig),"f"),Ur(this,pa,"f").add(()=>this.appClient.complete()),Ur(this,pa,"f").add(()=>Ur(this,uu,"f").complete()),Ur(this,pa,"f").add(()=>Ur(this,hu,"f").complete()),Ur(this,pa,"f").add(this.current$.pipe(pg(),CC(()=>!!t)).subscribe(([i,o])=>{t==null||t.dispatchEvent("onCurrentAppChanged",{source:this,detail:{previous:i,next:o}})})),Ur(this,pa,"f").add(Ur(this,fa,"f").pipe(pg(),Le(([i])=>i),du()).subscribe(i=>i.dispose()))}getAppManifest(e){return Tr.extractQueryValue(this.appClient.query({appKey:e}).pipe(Jt(t=>{const{cause:n}=t;throw n instanceof Ha?n:n instanceof vg?Ha.fromHttpResponse(n.response,{cause:n}):new Ha("unknown","failed to load manifest",{cause:n})})))}getAllAppManifests(){return Tr.extractQueryValue(Ur(this,uu,"f").query())}getAppConfig(e,t){return Tr.extractQueryValue(Ur(this,hu,"f").query({appKey:e,tag:t}).pipe(Jt(n=>{const{cause:i}=n;throw i instanceof zs?i:i instanceof vg?zs.fromHttpResponse(i.response,{cause:i}):new zs("unknown","failed to load config",{cause:i})})))}setCurrentApp(e){const t=typeof e=="string"?this.createApp({appKey:e}):e;Ur(this,fa,"f").next(t)}clearCurrentApp(){Ur(this,fa,"f").next(null)}createApp(e){return console.warn(),new Wz(e,{provider:this,event:Ur(this,Zf,"f")})}dispose(){Ur(this,pa,"f").unsubscribe()}}uu=new WeakMap,hu=new WeakMap,fa=new WeakMap,pa=new WeakMap,Zf=new WeakMap;var Kz=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const Yg="app",Yz={name:Yg,configure:()=>new Qz,initialize:r=>Kz(void 0,void 0,void 0,function*(){const e=yield r.config.createConfig(r),t=yield r.requireInstance("event").catch(()=>{});return new Gz({config:e,event:t})}),dispose:r=>{r.instance.dispose()}};var N1=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},Ab=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hf;class Qz{constructor(){this.defaultExpireTime=1*60*1e3,Hf.set(this,[])}addConfigBuilder(e){Ab(this,Hf,"f").push(e)}_createHttpClient(e){return N1(this,void 0,void 0,function*(){const t=yield e.requireInstance("http");if(t.hasClient(Yg))return t.createClient(Yg);{const n=yield e.requireInstance("serviceDiscovery");try{return yield n.createClient("app")}catch{return yield n.createClient("portal")}}})}createConfig(e){var t;return N1(this,void 0,void 0,function*(){const n=yield Ab(this,Hf,"f").reduce((i,o)=>N1(this,void 0,void 0,function*(){const a=new Lz(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(t=n.client)!==null&&t!==void 0||(n.client=yield(()=>N1(this,void 0,void 0,function*(){const i=yield this._createHttpClient(e);return{getAppManifest:{client:{fn:({appKey:o})=>i.json$(`/api/apps/${o}`)},key:({appKey:o})=>o,expire:this.defaultExpireTime},getAppManifests:{client:{fn:()=>i.json$("/api/apps")},key:()=>"manifests",expire:this.defaultExpireTime},getAppConfig:{client:{fn:({appKey:o,tag:a})=>i.json$(`/api/apps/${o}/config${a?`?tag=${a}`:""}`)},key:o=>JSON.stringify(o),expire:this.defaultExpireTime}}}))()),n})}}Hf=new WeakMap;const Xz=(r,e)=>{r.addConfig({module:Yz,configure:t=>{e&&t.addConfigBuilder(e)}})},Jz="bookmarkId",eU=()=>new URLSearchParams(document.location.search).get(Jz);var tU=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rU=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Of;class nU{constructor(e,t={}){this.config=t,Of.set(this,void 0),tU(this,Of,e,"f")}requireInstance(e){return rU(this,Of,"f").requireInstance(e)}setSourceSystem(e){this.config.sourceSystem=e}setBookmarkIdResolver(e){this.config.resolveBookmarkId=e}serCustomBookmarkApiClient(e){this.config.clientConfiguration&&(this.config.clientConfiguration.client=e)}setContextIdResolver(e){this.config.getContextId=e}setCurrentAppIdResolver(e){this.config.getCurrentAppIdentification=e}setEventProvider(e){this.config.event=e}setBookmarkQueryClient(e){this.config.clientConfiguration&&(this.config.clientConfiguration.queryClientConfig={getAllBookmarks:typeof e.getAllBookmarks=="function"?{key:()=>"all-bookmarks",client:{fn:e.getAllBookmarks},validate:({args:n})=>n.isValid}:e.getAllBookmarks,getBookmarkById:typeof e.getBookmarkById=="function"?{key:({id:n})=>n,client:{fn:e.getBookmarkById},expire:6e4,validate:()=>!1}:e.getBookmarkById})}}Of=new WeakMap;var ls=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},Nm=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qg,Lf,rk;class iU{constructor(){Qg.add(this),this.defaultExpireTime=1*60*1e3,Lf.set(this,[])}addConfigBuilder(e){Nm(this,Lf,"f").push(e)}createConfig(e,t){return ls(this,void 0,void 0,function*(){const n=yield Nm(this,Lf,"f").reduce((o,a)=>ls(this,void 0,void 0,function*(){const s=new nU(e,yield o);return yield Promise.resolve(a(s)),Object.assign(o,s.config)}),Promise.resolve({})),i=yield this._getAppProvider(e);if(Nm(this,Qg,"m",rk).call(this,t,n),n.resolveBookmarkId||(n.resolveBookmarkId=eU),n.getCurrentAppIdentification||(n.getCurrentAppIdentification=()=>{var o;return(o=i.current)===null||o===void 0?void 0:o.appKey}),!n.getContextId){const o=yield this._getContextProvider(e);n.getContextId=()=>{var a;return(a=o.currentContext)===null||a===void 0?void 0:a.id}}if(!n.event){const o=yield this._getEventProvider(e);n.event=o}if(n.clientConfiguration=yield this._createClientConfiguration(e,n.clientConfiguration),!n.sourceSystem)throw Error("missing sourceSystem configuration");return n})}_createClientConfiguration(e,t={}){return ls(this,void 0,void 0,function*(){if(!t.client){const n=yield this._getServiceProvider(e);t.client=yield n.createBookmarksClient("fetch")}if(!t.queryClientConfig){const i=yield(yield this._getServiceProvider(e)).createBookmarksClient("json$");t.queryClientConfig=Object.assign({getBookmarkById:{client:{fn:o=>i.get("v1",o)},key:({id:o})=>o,expire:this.defaultExpireTime},getAllBookmarks:{client:{fn:()=>i.getAll("v1")},key:()=>"all-bookmarks",validate:({args:o})=>o.isValid,expire:this.defaultExpireTime}},i)}return t})}_getServiceProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("services"))return e.requireInstance("services");{const n=(t=e.ref)===null||t===void 0?void 0:t.services;if(n)return n;throw Error("[BookmarkConfigurator] No service provider configures [ServicesModule] ")}})}_getContextProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("context"))return e.requireInstance("context");{const n=(t=e.ref)===null||t===void 0?void 0:t.context;if(n)return n;throw Error("[BookmarkConfigurator] No context provider configures [ContextModule]")}})}_getAppProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("app"))return e.requireInstance("app");{const n=(t=e.ref)===null||t===void 0?void 0:t.app;if(n)return n;throw Error("[BookmarkConfigurator] No app provider configures [AppModule]")}})}_getEventProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("event"))return e.requireInstance("event");{const n=(t=e.ref)===null||t===void 0?void 0:t.event;if(n)return n;throw Error("[BookmarkConfigurator] No event provider configures [EventModule]")}})}}Lf=new WeakMap,Qg=new WeakSet,rk=function(e,t){e&&(t.clientConfiguration=e.config.clientConfiguration,t.sourceSystem=e.config.sourceSystem,t.getContextId=e.config.getContextId,t.getCurrentAppIdentification=e.config.getCurrentAppIdentification)};const qr={getAll:eo("getAll",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),delete:eo("delete",r=>({payload:r}),r=>({payload:r})),addFavorite:eo("addFavorite",r=>({payload:r}),r=>({payload:r})),removeFavorite:eo("removeFavorite",r=>({payload:r}),r=>({payload:r})),update:eo("update",r=>({payload:r}),r=>({payload:r})),create:eo("create",r=>({payload:r}),r=>({payload:r}),r=>({payload:r}))},oU={bookmarks:{}},aU=$h(oU,r=>{r.addCase(qr.create.success,(e,{payload:t})=>{e.bookmarks[t.id]=t}).addCase(qr.getAll.success,(e,{payload:t})=>{t.forEach(n=>{e.bookmarks[n.id]=n})}).addCase(qr.delete.success,(e,{payload:t})=>{delete e.bookmarks[t]}).addCase(qr.removeFavorite,(e,{payload:t})=>{delete e.bookmarks[t]}).addCase(qr.addFavorite,(e,{payload:t})=>{e.bookmarks[t.id]=t}).addCase(qr.update.success,(e,{payload:t})=>{e.bookmarks[t.id]=t})});var p3=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const sU=(r,e)=>t=>t.pipe(td(qr.getAll.type),vt(n=>r.query({isValid:n.payload}).pipe(M2(),Le(i=>qr.getAll.success(i.value.filter(o=>o.sourceSystem.identifier===e))),Jt(()=>Dt)))),cU=r=>e=>e.pipe(td(qr.create.type),vt(t=>p3(void 0,void 0,void 0,function*(){const n=yield r.post("v1",t.payload);return qr.create.success(yield n.json())}))),Rb=r=>e=>e.pipe(td(qr.update.type),vt(t=>p3(void 0,void 0,void 0,function*(){const n=yield r.patch("v1",t.payload);return qr.update.success(yield n.json())}))),lU=r=>e=>e.pipe(td(qr.delete.type),vt(t=>p3(void 0,void 0,void 0,function*(){return(yield r.delete("v1",{id:t.payload})).ok,qr.delete.success(t.payload)})));var ji=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},ds=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},he=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$f,Fc,Eo,Ti,Xn,Gp,Mo,Ct,Ao,nk,ik;class dU{constructor(e,t,n){$f.add(this),Fc.set(this,void 0),Eo.set(this,void 0),Ti.set(this,void 0),Xn.set(this,void 0),Gp.set(this,void 0),Mo.set(this,void 0),Ct.set(this,void 0),Ao.set(this,new Qr),ds(this,Xn,new Xl(void 0),"f"),ds(this,Ti,e.client,"f"),ds(this,Fc,new Tr(e.queryClientConfig.getBookmarkById),"f"),ds(this,Eo,new Tr(e.queryClientConfig.getAllBookmarks),"f"),ds(this,Gp,t,"f"),ds(this,Mo,n,"f"),ds(this,Ct,JL(qr,aU),"f"),he(this,$f,"m",ik).call(this),he(this,$f,"m",nk).call(this),n&&he(this,Ao,"f").add(he(this,Xn,"f").subscribe(i=>{n.dispatchEvent("onBookmarkChanged",{detail:i,canBubble:!0,source:this})}))}get currentBookmark$(){return he(this,Xn,"f").asObservable()}get bookmarks$(){return he(this,Ct,"f").subject.pipe(Le(e=>Object.values(e.bookmarks).map(t=>t)))}setCurrentBookmark(e){return ji(this,void 0,void 0,function*(){if(!e)return he(this,Xn,"f").next(void 0);if(typeof e=="string"){const t=yield this.resolverBookmarkAsync(e);return this.setBookmark(t)}else if(e!==he(this,Xn,"f").value)return this.setBookmark(e)})}setBookmark(e){return ji(this,void 0,void 0,function*(){he(this,Mo,"f")?(yield he(this,Mo,"f").dispatchEvent("onBookmarkChange",{detail:e,cancelable:!0,canBubble:!0,source:this})).canceled||he(this,Xn,"f").next(e):he(this,Xn,"f").next(e)})}resolverBookmark(e){return he(this,Fc,"f").query({id:e}).pipe(Le(t=>t.value))}resolverBookmarkAsync(e){return wr(this.resolverBookmark(e))}getAllBookmarks(e={isValid:!1}){const{isValid:t}=e;return new De(n=>{he(this,Ct,"f").dispatch.getAll(t),n.add(he(this,Ct,"f").subject.addEffect("getAll::success",i=>{var o;n.next(i.payload),n.complete(),(o=he(this,Mo,"f"))===null||o===void 0||o.dispatchEvent("onBookmarksChanged",{detail:i.payload,source:this})}))})}getAllBookmarksAsync(e={isValid:!1}){return ji(this,void 0,void 0,function*(){return wr(this.getAllBookmarks(e))})}getBookmarkById(e){return ji(this,void 0,void 0,function*(){return yield(yield he(this,Ti,"f").get("v1",{id:e})).json()})}createBookmark(e){return new De(t=>{he(this,Ct,"f").dispatch.create(e),t.add(he(this,Ct,"f").subject.addEffect("create::success",n=>{t.next(n.payload),t.complete()})),t.add(he(this,Ct,"f").subject.addEffect("create::failure",n=>{t.error(n.payload)}))})}createBookmarkAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.createBookmark(e))})}updateBookmark(e){return new De(t=>{he(this,Ct,"f").dispatch.update(e),t.add(he(this,Ct,"f").subject.addEffect("update::success",n=>{t.next(n.payload),t.complete(),he(this,Fc,"f").cache.invalidate(n.payload.id)}))})}updateBookmarkAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.updateBookmark(e))})}deleteBookmarkById(e){return new De(t=>{he(this,Ct,"f").dispatch.delete(e),t.add(he(this,Ct,"f").subject.addEffect("delete::success",n=>{t.next(n.payload),t.complete(),he(this,Fc,"f").cache.invalidate(n.payload)}))})}deleteBookmarkByIdAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.deleteBookmarkById(e))})}addBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){(yield he(this,Ti,"f").addFavorite("v1",{bookmarkId:e})).ok&&he(this,Xn,"f").value&&he(this,Ct,"f").dispatch.addFavorite(he(this,Xn,"f").value)})}removeBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){(yield he(this,Ti,"f").removeFavorite("v1",{bookmarkId:e})).ok&&he(this,Ct,"f").dispatch.removeFavorite(e)})}verifyBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){return!!(yield he(this,Ti,"f").verifyFavorite("v1",{bookmarkId:e})).ok})}dispose(){he(this,Ao,"f").unsubscribe()}}Fc=new WeakMap,Eo=new WeakMap,Ti=new WeakMap,Xn=new WeakMap,Gp=new WeakMap,Mo=new WeakMap,Ct=new WeakMap,Ao=new WeakMap,$f=new WeakSet,nk=function(){he(this,Ct,"f").subject.addEffect("create::success",e=>{var t;he(this,Eo,"f").cache.invalidate("all-bookmarks"),he(this,Xn,"f").next(e.payload),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkCreated",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("delete::success",e=>{var t;console.log("here"),he(this,Eo,"f").cache.invalidate("all-bookmarks"),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkDeleted",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("update::success",e=>{var t;he(this,Eo,"f").cache.invalidate("all-bookmarks"),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkUpdated",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("addFavorite::request",()=>{he(this,Eo,"f").cache.invalidate("all-bookmarks")}),he(this,Ct,"f").subject.addEffect("removeFavorite::request",()=>{he(this,Eo,"f").cache.invalidate("all-bookmarks")})},ik=function(){he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(sU(he(this,Eo,"f"),he(this,Gp,"f").identifier))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(cU(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(lU(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(Rb(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(Rb(he(this,Ti,"f"))))};var Qi=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},uU=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gi=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zc,bs,Nf,Xg,Jg,e4;class hU{get currentBookmark$(){return this._bookmarkClient.currentBookmark$}get bookmarks$(){return this._bookmarkClient.bookmarks$}constructor(e,t){zc.add(this),bs.set(this,void 0),Nf.set(this,new Qr),this.bookmarkCreators={},Xg.set(this,()=>{this.bookmarkCreators={}}),this.config=e,uU(this,bs,e.event,"f"),this._bookmarkClient=t?t._bookmarkClient:new dU(e.clientConfiguration,e.sourceSystem,e.event);const n=e.resolveBookmarkId&&e.resolveBookmarkId();n&&this._bookmarkClient.setCurrentBookmark(n),gi(this,bs,"f")&&gi(this,Nf,"f").add(gi(this,bs,"f").addEventListener("onCurrentAppChanged",gi(this,Xg,"f")))}getBookmarkById(e){return Qi(this,void 0,void 0,function*(){return yield this._bookmarkClient.getBookmarkById(e)})}setCurrentBookmark(e){return Qi(this,void 0,void 0,function*(){this._bookmarkClient.setCurrentBookmark(e)})}getAllBookmarks(){return this._bookmarkClient.getAllBookmarks()}getAllBookmarksAsync(){return Qi(this,void 0,void 0,function*(){return this._bookmarkClient.getAllBookmarksAsync()})}updateBookmark(e){return this._bookmarkClient.updateBookmark(e)}updateBookmarkAsync(e,t){return Qi(this,void 0,void 0,function*(){if(gi(this,zc,"m",e4).call(this)===e.appKey){if(t!=null&&t.updatePayload){const n=yield gi(this,zc,"m",Jg).call(this);e=Object.assign(Object.assign({},e),{payload:n})}return this._bookmarkClient.updateBookmarkAsync(e)}})}deleteBookmarkById(e){return this._bookmarkClient.deleteBookmarkById(e)}deleteBookmarkByIdAsync(e){return this._bookmarkClient.deleteBookmarkByIdAsync(e)}addBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){yield this._bookmarkClient.addBookmarkFavoriteAsync(e)})}removeBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){yield this._bookmarkClient.removeBookmarkFavoriteAsync(e)})}verifyBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){return yield this._bookmarkClient.verifyBookmarkFavoriteAsync(e)})}addStateCreator(e,t){var n;const i=t||"#creator";return gi(this,bs,"f")&&((n=gi(this,bs,"f"))===null||n===void 0||n.dispatchEvent("onAddCreator",{source:this,canBubble:!0,detail:{key:t,cb:e}})),this.bookmarkCreators[i]=e,()=>{delete this.bookmarkCreators[i]}}createBookmark(e){return Qi(this,void 0,void 0,function*(){const t=yield gi(this,zc,"m",Jg).call(this),n=this.config.getContextId&&this.config.getContextId(),i=gi(this,zc,"m",e4).call(this),o=Object.assign(Object.assign({},e),{appKey:i,contextId:n,sourceSystem:this.config.sourceSystem,payload:t});return this._bookmarkClient.createBookmarkAsync(o)})}dispose(){gi(this,Nf,"f").unsubscribe(),this._bookmarkClient.dispose()}}bs=new WeakMap,Nf=new WeakMap,Xg=new WeakMap,zc=new WeakSet,Jg=function(){return Qi(this,void 0,void 0,function*(){const e=this.bookmarkCreators;if(!e||Object.keys(e).length===0)throw Error("No creator registered on this BookmarkProvider");return typeof e["#creator"]=="function"?e["#creator"]():yield Object.entries(e).reduce((t,[n,i])=>Qi(this,void 0,void 0,function*(){return Object.assign(yield t,{[n]:yield i()})}),Promise.resolve({}))})},e4=function(){const e=this.config.getCurrentAppIdentification&&this.config.getCurrentAppIdentification();if(!e)throw new Error("There is noe current application selected, can't create bookmark.");return e};var fU=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const pU="bookmark",mU={name:pU,configure:()=>new iU,initialize:r=>fU(void 0,void 0,void 0,function*(){var e;const t=(e=r.ref)===null||e===void 0?void 0:e.bookmark,n=yield r.config.createConfig(r,t);return new hU(n,t)}),dispose:r=>{r.instance.dispose()}},vU=(r,e)=>{r.addConfig({module:mU,configure:t=>{e&&t.addConfigBuilder(e)}})};class gU{}/**
413
+ `}}C([I({type:String,reflect:!0})],zh.prototype,"size",void 0);C([I({type:String,reflect:!0})],zh.prototype,"color",void 0);zh.styles=Mz;const XE="fwc-circular-progress";let Tb=class extends zh{};Tb=C([N2(XE)],Tb);const Zz=id(Vh,YE);id(zh,XE);id(Fh,QE);const JE=({children:r,text:e})=>x.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100vw",height:"100vh",overflow:"hidden"},children:x.jsx(Zz,{text:e,children:r})});var Hz=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Oz=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Mf;class Lz{constructor(e,t={}){this.config=t,Mf.set(this,void 0),Hz(this,Mf,e,"f")}requireInstance(e){return Oz(this,Mf,"f").requireInstance(e)}setAppClient(e,t=1*60*1e3){this.config.client={getAppManifest:typeof e.getAppManifest=="function"?{key:({appKey:n})=>n,client:{fn:e.getAppManifest},expire:t}:e.getAppManifest,getAppManifests:typeof e.getAppManifests=="function"?{key:()=>"app_manifests",client:{fn:e.getAppManifests},expire:t}:e.getAppManifests,getAppConfig:typeof e.getAppConfig=="function"?{key:n=>JSON.stringify(n),client:{fn:e.getAppConfig},expire:t}:e.getAppConfig}}}Mf=new WeakMap;const $z=()=>({setManifest:Sr("set_manifest",(r,e)=>({payload:r,meta:{created:Date.now(),update:e}})),fetchManifest:eo("fetch_manifest",(r,e)=>({payload:r,meta:{update:e}}),r=>({payload:r}),r=>({payload:r})),setConfig:Sr("set_config",r=>({payload:r})),fetchConfig:eo("fetch_config",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),setModule:Sr("set_module",r=>({payload:r})),importApp:eo("import_app",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),setInstance:Sr("set_instance",r=>({payload:r})),initialize:eo("initialize_app",()=>({payload:null}),()=>({payload:null}),r=>({payload:r}))}),Ne=$z();VL();const Nz=r=>$h(Object.assign(Object.assign({},r),{status:new Set}),e=>e.addCase(Ne.setManifest,(t,n)=>{n.meta.update?t.manifest=Object.assign(Object.assign({},t.manifest),n.payload):t.manifest=n.payload}).addCase(Ne.setConfig,(t,n)=>{t.config=n.payload}).addCase(Ne.setModule,(t,n)=>{t.modules=n.payload}).addCase(Ne.setInstance,(t,n)=>{t.instance=n.payload}).addMatcher(WL,(t,n)=>{t.status.add(Z6(n))}).addMatcher(YL,(t,n)=>{t.status.delete(Z6(n))})),Dz="modulepreload",Vz=function(r){return"/"+r},Ib={},ek=function(e,t,n){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Vz(o),o in Ib)return;Ib[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!n)for(let d=i.length-1;d>=0;d--){const u=i[d];if(u.href===o&&(!a||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const l=document.createElement("link");if(l.rel=a?"stylesheet":Dz,a||(l.as="script",l.crossOrigin=""),l.href=o,document.head.appendChild(l),a)return new Promise((d,u)=>{l.addEventListener("load",d),l.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},Fz=r=>e=>e.pipe(Ye(Ne.fetchManifest.match),vt(t=>{const{payload:n,meta:{update:i}}=t,o=fr(r.getAppManifest(n)).pipe(Ye(a=>!!a),F5());return El(o.pipe(Le(a=>Ne.setManifest(a,i))),o.pipe(M2(),Le(a=>Ne.fetchManifest.success(a)))).pipe(Jt(a=>Vn(Ne.fetchManifest.failure(a))))})),zz=r=>e=>e.pipe(Ye(Ne.fetchConfig.match),vt(({payload:t})=>{const n=fr(r.getAppConfig(t)).pipe(Ye(i=>!!i),F5());return El(n.pipe(Le(i=>Ne.setConfig(i))),n.pipe(M2(),Le(i=>Ne.fetchConfig.success(i)))).pipe(Jt(i=>Vn(Ne.fetchConfig.failure(i))))})),Uz=()=>r=>r.pipe(Ye(Ne.importApp.match),vt(({payload:e})=>fr(ek(()=>import(e),[])).pipe(Le(Ne.importApp.success),Jt(t=>Vn(Ne.importApp.failure(t)))))),jz=(r,e)=>{const t=Nz(r),n=new O2(t);return n.addFlow(Fz(e)),n.addFlow(zz(e)),n.addFlow(Uz()),n};var Bz=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},xe=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qz=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Kg,we,tk;function du(){return Ye(r=>r!=null)}class Wz{get manifest$(){return xe(this,we,"f").pipe(Le(({manifest:e})=>e),du())}get config$(){return xe(this,we,"f").pipe(Le(({config:e})=>e),du())}get modules$(){return xe(this,we,"f").pipe(Le(({modules:e})=>e),du())}get instance$(){return xe(this,we,"f").pipe(Le(({instance:e})=>e),du())}get state(){return xe(this,we,"f").value}get appKey(){return xe(this,we,"f").value.appKey}get manifest(){return this.state.manifest}get manifestAsync(){return Ir(this.manifest$)}get config(){return this.state.config}get configAsync(){return Ir(this.config$)}get instance(){return xe(this,we,"f").value.instance}constructor(e,t){Kg.add(this),we.set(this,void 0),qz(this,we,jz(e,t.provider),"f");const{appKey:n}=e,{event:i}=t;i&&xe(this,Kg,"m",tk).call(this,i);const o=new Qr;i&&(o.add(()=>{i.dispatchEvent("onAppDispose",{detail:{appKey:n}})}),o.add(i.addEventListener("onAppModulesLoaded",a=>{a.detail.appKey===n&&xe(this,we,"f").next(Ne.setInstance(a.detail.modules))}))),this.dispose=()=>{o==null||o.unsubscribe(),xe(this,we,"f").value.instance&&xe(this,we,"f").value.instance.dispose(),xe(this,we,"f").complete()}}initialize(){return new De(e=>{xe(this,we,"f").next(Ne.initialize()),e.add(rH([this.getManifest(),this.getAppModule(),this.getConfig()]).subscribe({next:([t,n,i])=>e.next({manifest:t,script:n,config:i}),error:t=>{e.error(t),xe(this,we,"f").next(Ne.initialize.failure(t))},complete:()=>{xe(this,we,"f").next(Ne.initialize.success()),e.complete()}}))})}loadConfig(){xe(this,we,"f").next(Ne.fetchConfig(this.appKey))}loadManifest(e){xe(this,we,"f").next(Ne.fetchManifest(this.appKey,e))}updateManifest(e,t){xe(this,we,"f").next(Ne.setManifest(e,!t))}loadAppModule(e=!0){return Bz(this,void 0,void 0,function*(){const t=yield this.getManifestAsync(e);xe(this,we,"f").next(Ne.importApp(t.entry))})}getConfig(e=!1){return new De(t=>{if(xe(this,we,"f").value.config&&(t.next(xe(this,we,"f").value.config),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_config",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("fetch_config::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("fetch_config::failure",({payload:n})=>{t.error(Error("failed to load application config",{cause:n}))})),this.loadConfig()})}getConfigAsync(e=!0){return(e?Ir:wr)(this.getConfig(!e))}getManifest(e=!1){return new De(t=>{if(xe(this,we,"f").value.manifest&&(t.next(xe(this,we,"f").value.manifest),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_manifest",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("fetch_manifest::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("fetch_manifest::failure",({payload:n})=>{t.error(Error("failed to load application manifest",{cause:n}))})),this.loadManifest()})}getManifestAsync(e=!0){return(e?Ir:wr)(this.getManifest(!e))}getAppModule(e=!1){return new De(t=>{if(xe(this,we,"f").value.modules&&(t.next(xe(this,we,"f").value.modules),!e))return t.complete();t.add(xe(this,we,"f").addEffect("set_module",({payload:n})=>{t.next(n)})),t.add(xe(this,we,"f").addEffect("import_app::success",({payload:n})=>{t.next(n),t.complete()})),t.add(xe(this,we,"f").addEffect("import_app::failure",({payload:n})=>{t.error(Error("failed to load application modules from script",{cause:n}))})),t.add(this.getManifest().subscribe(n=>Vn(xe(this,we,"f").next(Ne.importApp(n.entry)))))})}getAppModuleAsync(e=!0){return(e?Ir:wr)(this.getAppModule(!e))}}we=new WeakMap,Kg=new WeakSet,tk=function(e){const{appKey:t}=this;xe(this,we,"f").addEffect(Ne.fetchManifest.type,()=>{e.dispatchEvent("onAppManifestLoad",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.fetchManifest.success.type,n=>{e.dispatchEvent("onAppManifestLoaded",{detail:{appKey:t,manifest:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchManifest.failure.type,n=>{e.dispatchEvent("onAppManifestFailure",{detail:{appKey:t,error:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.type,()=>{e.dispatchEvent("onAppConfigLoad",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.success.type,n=>{e.dispatchEvent("onAppConfigLoaded",{detail:{appKey:t,config:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.fetchConfig.failure.type,n=>{e.dispatchEvent("onAppConfigFailure",{detail:{appKey:t,error:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.type,()=>{e.dispatchEvent("onAppScriptLoad",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.success.type,n=>{e.dispatchEvent("onAppScriptLoaded",{detail:{appKey:t,script:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.importApp.failure.type,n=>{e.dispatchEvent("onAppScriptFailure",{detail:{appKey:t,error:n.payload},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.type,()=>{e.dispatchEvent("onAppInitialize",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.success.type,()=>{e.dispatchEvent("onAppInitialized",{detail:{appKey:t},source:this})}),xe(this,we,"f").addEffect(Ne.initialize.failure.type,({payload:n})=>{e.dispatchEvent("onAppInitializeFailure",{detail:{appKey:t,error:n},source:this})})};class Ha extends Error{static fromHttpResponse(e,t){switch(e.status){case 401:return new Ha("unauthorized","failed to load application manifest, request not authorized",t);case 404:return new Ha("not_found","application manifest not found",t)}return new Ha("unknown",`failed to load application manifest, status code ${e.status}`,t)}constructor(e,t,n){super(t,n),this.type=e}}class zs extends Error{static fromHttpResponse(e,t){switch(e.status){case 401:return new zs("unauthorized","failed to load application config, request not authorized",t);case 404:return new zs("not_found","application config not found",t)}return new zs("unknown",`failed to load application config, status code ${e.status}`,t)}constructor(e,t,n){super(t,n),this.type=e}}var Ur=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$1=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},uu,hu,fa,pa,Zf;class Gz{static compareAppManifest(e,t){return JSON.stringify(e)===JSON.stringify(t)}get current(){return Ur(this,fa,"f").value}get current$(){return Ur(this,fa,"f").pipe(bC((e,t)=>e&&t?e.appKey===t.appKey:e===t))}constructor(e){uu.set(this,void 0),hu.set(this,void 0),fa.set(this,void 0),pa.set(this,new Qr),Zf.set(this,void 0);const{event:t,config:n}=e;$1(this,Zf,t,"f"),$1(this,fa,new Xl(void 0),"f"),this.appClient=new Tr(n.client.getAppManifest),$1(this,uu,new Tr(n.client.getAppManifests),"f"),$1(this,hu,new Tr(n.client.getAppConfig),"f"),Ur(this,pa,"f").add(()=>this.appClient.complete()),Ur(this,pa,"f").add(()=>Ur(this,uu,"f").complete()),Ur(this,pa,"f").add(()=>Ur(this,hu,"f").complete()),Ur(this,pa,"f").add(this.current$.pipe(pg(),CC(()=>!!t)).subscribe(([i,o])=>{t==null||t.dispatchEvent("onCurrentAppChanged",{source:this,detail:{previous:i,next:o}})})),Ur(this,pa,"f").add(Ur(this,fa,"f").pipe(pg(),Le(([i])=>i),du()).subscribe(i=>i.dispose()))}getAppManifest(e){return Tr.extractQueryValue(this.appClient.query({appKey:e}).pipe(Jt(t=>{const{cause:n}=t;throw n instanceof Ha?n:n instanceof vg?Ha.fromHttpResponse(n.response,{cause:n}):new Ha("unknown","failed to load manifest",{cause:n})})))}getAllAppManifests(){return Tr.extractQueryValue(Ur(this,uu,"f").query())}getAppConfig(e,t){return Tr.extractQueryValue(Ur(this,hu,"f").query({appKey:e,tag:t}).pipe(Jt(n=>{const{cause:i}=n;throw i instanceof zs?i:i instanceof vg?zs.fromHttpResponse(i.response,{cause:i}):new zs("unknown","failed to load config",{cause:i})})))}setCurrentApp(e){const t=typeof e=="string"?this.createApp({appKey:e}):e;Ur(this,fa,"f").next(t)}clearCurrentApp(){Ur(this,fa,"f").next(null)}createApp(e){return console.warn(),new Wz(e,{provider:this,event:Ur(this,Zf,"f")})}dispose(){Ur(this,pa,"f").unsubscribe()}}uu=new WeakMap,hu=new WeakMap,fa=new WeakMap,pa=new WeakMap,Zf=new WeakMap;var Kz=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const Yg="app",Yz={name:Yg,configure:()=>new Qz,initialize:r=>Kz(void 0,void 0,void 0,function*(){const e=yield r.config.createConfig(r),t=yield r.requireInstance("event").catch(()=>{});return new Gz({config:e,event:t})}),dispose:r=>{r.instance.dispose()}};var N1=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},Ab=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hf;class Qz{constructor(){this.defaultExpireTime=1*60*1e3,Hf.set(this,[])}addConfigBuilder(e){Ab(this,Hf,"f").push(e)}_createHttpClient(e){return N1(this,void 0,void 0,function*(){const t=yield e.requireInstance("http");if(t.hasClient(Yg))return t.createClient(Yg);{const n=yield e.requireInstance("serviceDiscovery");try{return yield n.createClient("app")}catch{return yield n.createClient("portal")}}})}createConfig(e){var t;return N1(this,void 0,void 0,function*(){const n=yield Ab(this,Hf,"f").reduce((i,o)=>N1(this,void 0,void 0,function*(){const a=new Lz(e,yield i);return yield Promise.resolve(o(a)),Object.assign(i,a.config)}),Promise.resolve({}));return(t=n.client)!==null&&t!==void 0||(n.client=yield(()=>N1(this,void 0,void 0,function*(){const i=yield this._createHttpClient(e);return{getAppManifest:{client:{fn:({appKey:o})=>i.json$(`/api/apps/${o}`)},key:({appKey:o})=>o,expire:this.defaultExpireTime},getAppManifests:{client:{fn:()=>i.json$("/api/apps")},key:()=>"manifests",expire:this.defaultExpireTime},getAppConfig:{client:{fn:({appKey:o,tag:a})=>i.json$(`/api/apps/${o}/config${a?`?tag=${a}`:""}`)},key:o=>JSON.stringify(o),expire:this.defaultExpireTime}}}))()),n})}}Hf=new WeakMap;const Xz=(r,e)=>{r.addConfig({module:Yz,configure:t=>{e&&t.addConfigBuilder(e)}})},Jz="bookmarkId",eU=()=>new URLSearchParams(document.location.search).get(Jz);var tU=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rU=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Of;class nU{constructor(e,t={}){this.config=t,Of.set(this,void 0),tU(this,Of,e,"f")}requireInstance(e){return rU(this,Of,"f").requireInstance(e)}setSourceSystem(e){this.config.sourceSystem=e}setBookmarkIdResolver(e){this.config.resolveBookmarkId=e}serCustomBookmarkApiClient(e){this.config.clientConfiguration&&(this.config.clientConfiguration.client=e)}setContextIdResolver(e){this.config.getContextId=e}setCurrentAppIdResolver(e){this.config.getCurrentAppIdentification=e}setEventProvider(e){this.config.event=e}setBookmarkQueryClient(e){this.config.clientConfiguration&&(this.config.clientConfiguration.queryClientConfig={getAllBookmarks:typeof e.getAllBookmarks=="function"?{key:()=>"all-bookmarks",client:{fn:e.getAllBookmarks},validate:({args:n})=>n.isValid}:e.getAllBookmarks,getBookmarkById:typeof e.getBookmarkById=="function"?{key:({id:n})=>n,client:{fn:e.getBookmarkById},expire:6e4,validate:()=>!1}:e.getBookmarkById})}}Of=new WeakMap;var ls=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},Nm=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qg,Lf,rk;class iU{constructor(){Qg.add(this),this.defaultExpireTime=1*60*1e3,Lf.set(this,[])}addConfigBuilder(e){Nm(this,Lf,"f").push(e)}createConfig(e,t){return ls(this,void 0,void 0,function*(){const n=yield Nm(this,Lf,"f").reduce((o,a)=>ls(this,void 0,void 0,function*(){const s=new nU(e,yield o);return yield Promise.resolve(a(s)),Object.assign(o,s.config)}),Promise.resolve({})),i=yield this._getAppProvider(e);if(Nm(this,Qg,"m",rk).call(this,t,n),n.resolveBookmarkId||(n.resolveBookmarkId=eU),n.getCurrentAppIdentification||(n.getCurrentAppIdentification=()=>{var o;return(o=i.current)===null||o===void 0?void 0:o.appKey}),!n.getContextId){const o=yield this._getContextProvider(e);n.getContextId=()=>{var a;return(a=o.currentContext)===null||a===void 0?void 0:a.id}}if(!n.event){const o=yield this._getEventProvider(e);n.event=o}if(n.clientConfiguration=yield this._createClientConfiguration(e,n.clientConfiguration),!n.sourceSystem)throw Error("missing sourceSystem configuration");return n})}_createClientConfiguration(e,t={}){return ls(this,void 0,void 0,function*(){if(!t.client){const n=yield this._getServiceProvider(e);t.client=yield n.createBookmarksClient("fetch")}if(!t.queryClientConfig){const i=yield(yield this._getServiceProvider(e)).createBookmarksClient("json$");t.queryClientConfig=Object.assign({getBookmarkById:{client:{fn:o=>i.get("v1",o)},key:({id:o})=>o,expire:this.defaultExpireTime},getAllBookmarks:{client:{fn:()=>i.getAll("v1")},key:()=>"all-bookmarks",validate:({args:o})=>o.isValid,expire:this.defaultExpireTime}},i)}return t})}_getServiceProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("services"))return e.requireInstance("services");{const n=(t=e.ref)===null||t===void 0?void 0:t.services;if(n)return n;throw Error("[BookmarkConfigurator] No service provider configures [ServicesModule] ")}})}_getContextProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("context"))return e.requireInstance("context");{const n=(t=e.ref)===null||t===void 0?void 0:t.context;if(n)return n;throw Error("[BookmarkConfigurator] No context provider configures [ContextModule]")}})}_getAppProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("app"))return e.requireInstance("app");{const n=(t=e.ref)===null||t===void 0?void 0:t.app;if(n)return n;throw Error("[BookmarkConfigurator] No app provider configures [AppModule]")}})}_getEventProvider(e){var t;return ls(this,void 0,void 0,function*(){if(e.hasModule("event"))return e.requireInstance("event");{const n=(t=e.ref)===null||t===void 0?void 0:t.event;if(n)return n;throw Error("[BookmarkConfigurator] No event provider configures [EventModule]")}})}}Lf=new WeakMap,Qg=new WeakSet,rk=function(e,t){e&&(t.clientConfiguration=e.config.clientConfiguration,t.sourceSystem=e.config.sourceSystem,t.getContextId=e.config.getContextId,t.getCurrentAppIdentification=e.config.getCurrentAppIdentification)};const qr={getAll:eo("getAll",r=>({payload:r}),r=>({payload:r}),r=>({payload:r})),delete:eo("delete",r=>({payload:r}),r=>({payload:r})),addFavorite:eo("addFavorite",r=>({payload:r}),r=>({payload:r})),removeFavorite:eo("removeFavorite",r=>({payload:r}),r=>({payload:r})),update:eo("update",r=>({payload:r}),r=>({payload:r})),create:eo("create",r=>({payload:r}),r=>({payload:r}),r=>({payload:r}))},oU={bookmarks:{}},aU=$h(oU,r=>{r.addCase(qr.create.success,(e,{payload:t})=>{e.bookmarks[t.id]=t}).addCase(qr.getAll.success,(e,{payload:t})=>{t.forEach(n=>{e.bookmarks[n.id]=n})}).addCase(qr.delete.success,(e,{payload:t})=>{delete e.bookmarks[t]}).addCase(qr.removeFavorite,(e,{payload:t})=>{delete e.bookmarks[t]}).addCase(qr.addFavorite,(e,{payload:t})=>{e.bookmarks[t.id]=t}).addCase(qr.update.success,(e,{payload:t})=>{e.bookmarks[t.id]=t})});var p3=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const sU=(r,e)=>t=>t.pipe(td(qr.getAll.type),vt(n=>r.query({isValid:n.payload}).pipe(M2(),Le(i=>qr.getAll.success(i.value.filter(o=>o.sourceSystem.identifier===e))),Jt(()=>Dt)))),cU=r=>e=>e.pipe(td(qr.create.type),vt(t=>p3(void 0,void 0,void 0,function*(){const n=yield r.post("v1",t.payload);return qr.create.success(yield n.json())}))),Rb=r=>e=>e.pipe(td(qr.update.type),vt(t=>p3(void 0,void 0,void 0,function*(){const n=yield r.patch("v1",t.payload);return qr.update.success(yield n.json())}))),lU=r=>e=>e.pipe(td(qr.delete.type),vt(t=>p3(void 0,void 0,void 0,function*(){return(yield r.delete("v1",{id:t.payload})).ok,qr.delete.success(t.payload)})));var ji=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},ds=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},he=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$f,Fc,Eo,Ti,Xn,Gp,Mo,Ct,Ao,nk,ik;class dU{constructor(e,t,n){$f.add(this),Fc.set(this,void 0),Eo.set(this,void 0),Ti.set(this,void 0),Xn.set(this,void 0),Gp.set(this,void 0),Mo.set(this,void 0),Ct.set(this,void 0),Ao.set(this,new Qr),ds(this,Xn,new Xl(void 0),"f"),ds(this,Ti,e.client,"f"),ds(this,Fc,new Tr(e.queryClientConfig.getBookmarkById),"f"),ds(this,Eo,new Tr(e.queryClientConfig.getAllBookmarks),"f"),ds(this,Gp,t,"f"),ds(this,Mo,n,"f"),ds(this,Ct,JL(qr,aU),"f"),he(this,$f,"m",ik).call(this),he(this,$f,"m",nk).call(this),n&&he(this,Ao,"f").add(he(this,Xn,"f").subscribe(i=>{n.dispatchEvent("onBookmarkChanged",{detail:i,canBubble:!0,source:this})}))}get currentBookmark$(){return he(this,Xn,"f").asObservable()}get bookmarks$(){return he(this,Ct,"f").subject.pipe(Le(e=>Object.values(e.bookmarks).map(t=>t)))}setCurrentBookmark(e){return ji(this,void 0,void 0,function*(){if(!e)return he(this,Xn,"f").next(void 0);if(typeof e=="string"){const t=yield this.resolverBookmarkAsync(e);return this.setBookmark(t)}else if(e!==he(this,Xn,"f").value)return this.setBookmark(e)})}setBookmark(e){return ji(this,void 0,void 0,function*(){he(this,Mo,"f")?(yield he(this,Mo,"f").dispatchEvent("onBookmarkChange",{detail:e,cancelable:!0,canBubble:!0,source:this})).canceled||he(this,Xn,"f").next(e):he(this,Xn,"f").next(e)})}resolverBookmark(e){return he(this,Fc,"f").query({id:e}).pipe(Le(t=>t.value))}resolverBookmarkAsync(e){return wr(this.resolverBookmark(e))}getAllBookmarks(e={isValid:!1}){const{isValid:t}=e;return new De(n=>{he(this,Ct,"f").dispatch.getAll(t),n.add(he(this,Ct,"f").subject.addEffect("getAll::success",i=>{var o;n.next(i.payload),n.complete(),(o=he(this,Mo,"f"))===null||o===void 0||o.dispatchEvent("onBookmarksChanged",{detail:i.payload,source:this})}))})}getAllBookmarksAsync(e={isValid:!1}){return ji(this,void 0,void 0,function*(){return wr(this.getAllBookmarks(e))})}getBookmarkById(e){return ji(this,void 0,void 0,function*(){return yield(yield he(this,Ti,"f").get("v1",{id:e})).json()})}createBookmark(e){return new De(t=>{he(this,Ct,"f").dispatch.create(e),t.add(he(this,Ct,"f").subject.addEffect("create::success",n=>{t.next(n.payload),t.complete()})),t.add(he(this,Ct,"f").subject.addEffect("create::failure",n=>{t.error(n.payload)}))})}createBookmarkAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.createBookmark(e))})}updateBookmark(e){return new De(t=>{he(this,Ct,"f").dispatch.update(e),t.add(he(this,Ct,"f").subject.addEffect("update::success",n=>{t.next(n.payload),t.complete(),he(this,Fc,"f").cache.invalidate(n.payload.id)}))})}updateBookmarkAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.updateBookmark(e))})}deleteBookmarkById(e){return new De(t=>{he(this,Ct,"f").dispatch.delete(e),t.add(he(this,Ct,"f").subject.addEffect("delete::success",n=>{t.next(n.payload),t.complete(),he(this,Fc,"f").cache.invalidate(n.payload)}))})}deleteBookmarkByIdAsync(e){return ji(this,void 0,void 0,function*(){return wr(this.deleteBookmarkById(e))})}addBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){(yield he(this,Ti,"f").addFavorite("v1",{bookmarkId:e})).ok&&he(this,Xn,"f").value&&he(this,Ct,"f").dispatch.addFavorite(he(this,Xn,"f").value)})}removeBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){(yield he(this,Ti,"f").removeFavorite("v1",{bookmarkId:e})).ok&&he(this,Ct,"f").dispatch.removeFavorite(e)})}verifyBookmarkFavoriteAsync(e){return ji(this,void 0,void 0,function*(){return!!(yield he(this,Ti,"f").verifyFavorite("v1",{bookmarkId:e})).ok})}dispose(){he(this,Ao,"f").unsubscribe()}}Fc=new WeakMap,Eo=new WeakMap,Ti=new WeakMap,Xn=new WeakMap,Gp=new WeakMap,Mo=new WeakMap,Ct=new WeakMap,Ao=new WeakMap,$f=new WeakSet,nk=function(){he(this,Ct,"f").subject.addEffect("create::success",e=>{var t;he(this,Eo,"f").cache.invalidate("all-bookmarks"),he(this,Xn,"f").next(e.payload),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkCreated",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("delete::success",e=>{var t;console.log("here"),he(this,Eo,"f").cache.invalidate("all-bookmarks"),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkDeleted",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("update::success",e=>{var t;he(this,Eo,"f").cache.invalidate("all-bookmarks"),(t=he(this,Mo,"f"))===null||t===void 0||t.dispatchEvent("onBookmarkUpdated",{detail:e.payload,canBubble:!0,source:this})}),he(this,Ct,"f").subject.addEffect("addFavorite::request",()=>{he(this,Eo,"f").cache.invalidate("all-bookmarks")}),he(this,Ct,"f").subject.addEffect("removeFavorite::request",()=>{he(this,Eo,"f").cache.invalidate("all-bookmarks")})},ik=function(){he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(sU(he(this,Eo,"f"),he(this,Gp,"f").identifier))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(cU(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(lU(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(Rb(he(this,Ti,"f")))),he(this,Ao,"f").add(he(this,Ct,"f").subject.addFlow(Rb(he(this,Ti,"f"))))};var Qi=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})},uU=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gi=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zc,bs,Nf,Xg,Jg,e4;class hU{get currentBookmark$(){return this._bookmarkClient.currentBookmark$}get bookmarks$(){return this._bookmarkClient.bookmarks$}constructor(e,t){zc.add(this),bs.set(this,void 0),Nf.set(this,new Qr),this.bookmarkCreators={},Xg.set(this,()=>{this.bookmarkCreators={}}),this.config=e,uU(this,bs,e.event,"f"),this._bookmarkClient=t?t._bookmarkClient:new dU(e.clientConfiguration,e.sourceSystem,e.event);const n=e.resolveBookmarkId&&e.resolveBookmarkId();n&&this._bookmarkClient.setCurrentBookmark(n),gi(this,bs,"f")&&gi(this,Nf,"f").add(gi(this,bs,"f").addEventListener("onCurrentAppChanged",gi(this,Xg,"f")))}getBookmarkById(e){return Qi(this,void 0,void 0,function*(){return yield this._bookmarkClient.getBookmarkById(e)})}setCurrentBookmark(e){return Qi(this,void 0,void 0,function*(){this._bookmarkClient.setCurrentBookmark(e)})}getAllBookmarks(){return this._bookmarkClient.getAllBookmarks()}getAllBookmarksAsync(){return Qi(this,void 0,void 0,function*(){return this._bookmarkClient.getAllBookmarksAsync()})}updateBookmark(e){return this._bookmarkClient.updateBookmark(e)}updateBookmarkAsync(e,t){return Qi(this,void 0,void 0,function*(){if(gi(this,zc,"m",e4).call(this)===e.appKey){if(t!=null&&t.updatePayload){const n=yield gi(this,zc,"m",Jg).call(this);e=Object.assign(Object.assign({},e),{payload:n})}return this._bookmarkClient.updateBookmarkAsync(e)}})}deleteBookmarkById(e){return this._bookmarkClient.deleteBookmarkById(e)}deleteBookmarkByIdAsync(e){return this._bookmarkClient.deleteBookmarkByIdAsync(e)}addBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){yield this._bookmarkClient.addBookmarkFavoriteAsync(e)})}removeBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){yield this._bookmarkClient.removeBookmarkFavoriteAsync(e)})}verifyBookmarkFavoriteAsync(e){return Qi(this,void 0,void 0,function*(){return yield this._bookmarkClient.verifyBookmarkFavoriteAsync(e)})}addStateCreator(e,t){var n;const i=t||"#creator";return gi(this,bs,"f")&&((n=gi(this,bs,"f"))===null||n===void 0||n.dispatchEvent("onAddCreator",{source:this,canBubble:!0,detail:{key:t,cb:e}})),this.bookmarkCreators[i]=e,()=>{delete this.bookmarkCreators[i]}}createBookmark(e){return Qi(this,void 0,void 0,function*(){const t=yield gi(this,zc,"m",Jg).call(this),n=this.config.getContextId&&this.config.getContextId(),i=gi(this,zc,"m",e4).call(this),o=Object.assign(Object.assign({},e),{appKey:i,contextId:n,sourceSystem:this.config.sourceSystem,payload:t});return this._bookmarkClient.createBookmarkAsync(o)})}dispose(){gi(this,Nf,"f").unsubscribe(),this._bookmarkClient.dispose()}}bs=new WeakMap,Nf=new WeakMap,Xg=new WeakMap,zc=new WeakSet,Jg=function(){return Qi(this,void 0,void 0,function*(){const e=this.bookmarkCreators;if(!e||Object.keys(e).length===0)throw Error("No creator registered on this BookmarkProvider");return typeof e["#creator"]=="function"?e["#creator"]():yield Object.entries(e).reduce((t,[n,i])=>Qi(this,void 0,void 0,function*(){return Object.assign(yield t,{[n]:yield i()})}),Promise.resolve({}))})},e4=function(){const e=this.config.getCurrentAppIdentification&&this.config.getCurrentAppIdentification();if(!e)throw new Error("There is noe current application selected, can't create bookmark.");return e};var fU=globalThis&&globalThis.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(d){try{l(n.next(d))}catch(u){a(u)}}function c(d){try{l(n.throw(d))}catch(u){a(u)}}function l(d){d.done?o(d.value):i(d.value).then(s,c)}l((n=n.apply(r,e||[])).next())})};const pU="bookmark",mU={name:pU,configure:()=>new iU,initialize:r=>fU(void 0,void 0,void 0,function*(){var e;const t=(e=r.ref)===null||e===void 0?void 0:e.bookmark,n=yield r.config.createConfig(r,t);return new hU(n,t)}),dispose:r=>{r.instance.dispose()}},vU=(r,e)=>{r.addConfig({module:mU,configure:t=>{e&&t.addConfigBuilder(e)}})};class gU{}/**
414
414
  * @remix-run/router v1.9.0
415
415
  *
416
416
  * Copyright (c) Remix Software Inc.
@@ -32,7 +32,7 @@
32
32
  }
33
33
  </style>
34
34
 
35
- <script type="module" crossorigin src="/assets/index-a0837229.js"></script>
35
+ <script type="module" crossorigin src="/assets/index-330e26e1.js"></script>
36
36
 
37
37
  <body>
38
38
  <div id="root"></div>
@@ -1 +1 @@
1
- export declare const version = "9.4.2";
1
+ export declare const version = "9.4.3";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '9.4.2';
1
+ export const version = '9.4.3';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli",
3
- "version": "9.4.2",
3
+ "version": "9.4.3",
4
4
  "keywords": [
5
5
  "Fusion",
6
6
  "Fusion Framework",
@@ -51,8 +51,8 @@
51
51
  "vite-plugin-environment": "^1.1.3",
52
52
  "vite-plugin-restart": "^0.4.0",
53
53
  "vite-tsconfig-paths": "^4.2.0",
54
- "@equinor/fusion-framework-app": "^7.1.9",
55
54
  "@equinor/fusion-framework-react-components-people-provider": "^1.1.3",
55
+ "@equinor/fusion-framework-app": "^7.1.10",
56
56
  "@equinor/fusion-observable": "^8.1.2"
57
57
  },
58
58
  "devDependencies": {
@@ -80,19 +80,19 @@
80
80
  "styled-components": "^6.0.7",
81
81
  "types": "link:./types",
82
82
  "typescript": "^5.1.3",
83
- "@equinor/fusion-framework-app": "^7.1.9",
84
- "@equinor/fusion-framework-module-app": "^5.2.9",
85
83
  "@equinor/fusion-framework": "^7.0.23",
84
+ "@equinor/fusion-framework-app": "^7.1.10",
86
85
  "@equinor/fusion-framework-module-bookmark": "^1.0.14",
87
- "@equinor/fusion-framework-module-context": "^4.0.17",
88
86
  "@equinor/fusion-framework-module-http": "^5.1.1",
89
- "@equinor/fusion-framework-module-msal": "^3.0.7",
87
+ "@equinor/fusion-framework-module-context": "^4.0.17",
88
+ "@equinor/fusion-framework-module-app": "^5.2.10",
90
89
  "@equinor/fusion-framework-module-navigation": "^3.1.2",
91
- "@equinor/fusion-framework-react-components-bookmark": "^0.2.11",
92
- "@equinor/fusion-framework-react": "^5.3.3",
90
+ "@equinor/fusion-framework-module-msal": "^3.0.7",
93
91
  "@equinor/fusion-framework-module-services": "^3.2.2",
92
+ "@equinor/fusion-framework-react": "^5.3.3",
94
93
  "@equinor/fusion-framework-react-module-bookmark": "^2.0.21",
95
- "@equinor/fusion-query": "^4.0.3"
94
+ "@equinor/fusion-query": "^4.0.3",
95
+ "@equinor/fusion-framework-react-components-bookmark": "^0.2.11"
96
96
  },
97
97
  "scripts": {
98
98
  "prebuild": "pnpm build:source",