@abtnode/webapp 1.16.20-beta-e363262e → 1.16.20-beta-bb1cd034

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/blocklet.yml CHANGED
@@ -31,4 +31,4 @@ environments: []
31
31
  capabilities: {}
32
32
  screenshots: []
33
33
  components: []
34
- gitHash: 479cea04dd620d8194d6221b2594b6a0f390ba76
34
+ gitHash: b000d880478911fbad7f5b197daf8a9065463ca8
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.c9e90622.css",
4
- "main.js": "./static/js/main.30420eb5.js",
4
+ "main.js": "./static/js/main.d254ff10.js",
5
5
  "static/js/9041.77cacdd7.chunk.js": "./static/js/9041.77cacdd7.chunk.js",
6
6
  "static/js/2960.6a54b27f.chunk.js": "./static/js/2960.6a54b27f.chunk.js",
7
7
  "static/js/3389.72b7e591.chunk.js": "./static/js/3389.72b7e591.chunk.js",
@@ -24,7 +24,7 @@
24
24
  "static/js/2365.a3571172.chunk.js": "./static/js/2365.a3571172.chunk.js",
25
25
  "static/js/9277.b9c7a9e7.chunk.js": "./static/js/9277.b9c7a9e7.chunk.js",
26
26
  "static/css/8973.9cab926a.chunk.css": "./static/css/8973.9cab926a.chunk.css",
27
- "static/js/8973.12ec2ee1.chunk.js": "./static/js/8973.12ec2ee1.chunk.js",
27
+ "static/js/8973.639c0cf3.chunk.js": "./static/js/8973.639c0cf3.chunk.js",
28
28
  "static/js/4775.c9c59b2e.chunk.js": "./static/js/4775.c9c59b2e.chunk.js",
29
29
  "static/js/8986.0c6ecc50.chunk.js": "./static/js/8986.0c6ecc50.chunk.js",
30
30
  "static/js/2537.a919ce43.chunk.js": "./static/js/2537.a919ce43.chunk.js",
@@ -111,7 +111,7 @@
111
111
  "static/js/5979.bd3d3c0f.chunk.js": "./static/js/5979.bd3d3c0f.chunk.js",
112
112
  "static/js/6931.e9297d29.chunk.js": "./static/js/6931.e9297d29.chunk.js",
113
113
  "static/js/5396.56766685.chunk.js": "./static/js/5396.56766685.chunk.js",
114
- "static/js/7022.3ab32ae3.chunk.js": "./static/js/7022.3ab32ae3.chunk.js",
114
+ "static/js/7022.02d74e90.chunk.js": "./static/js/7022.02d74e90.chunk.js",
115
115
  "static/media/ubuntu-mono-all-400-normal.woff": "./static/media/ubuntu-mono-all-400-normal.c879328bc62e9c68268f.woff",
116
116
  "static/media/lato-all-400-normal.woff": "./static/media/lato-all-400-normal.3dc1eff492ab1f598560.woff",
117
117
  "static/media/lato-all-700-normal.woff": "./static/media/lato-all-700-normal.1e7707c9ec98d9b97e7f.woff",
@@ -131,6 +131,6 @@
131
131
  },
132
132
  "entrypoints": [
133
133
  "static/css/main.c9e90622.css",
134
- "static/js/main.30420eb5.js"
134
+ "static/js/main.d254ff10.js"
135
135
  ]
136
136
  }
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/><meta name="theme-color" content="#000000"/><script>"https:"===window.location.protocol&&document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />')</script><link rel="manifest" href="manifest.json"/><link rel="stylesheet" href="icons/css/all.css"/><title>Blocklet Server</title><script src="api/env"></script><script defer="defer" src="./static/js/main.30420eb5.js"></script><link href="./static/css/main.c9e90622.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/><meta name="theme-color" content="#000000"/><script>"https:"===window.location.protocol&&document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />')</script><link rel="manifest" href="manifest.json"/><link rel="stylesheet" href="icons/css/all.css"/><title>Blocklet Server</title><script src="api/env"></script><script defer="defer" src="./static/js/main.d254ff10.js"></script><link href="./static/css/main.c9e90622.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -1 +1 @@
1
- (()=>{"use strict";var e={522:()=>{try{self["workbox:core:6.5.3"]&&_()}catch(e){}},434:()=>{try{self["workbox:expiration:6.5.3"]&&_()}catch(e){}},290:()=>{try{self["workbox:precaching:6.5.3"]&&_()}catch(e){}},92:()=>{try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},559:()=>{try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,s),r.exports}(()=>{s(522);const e=function(e){let t=e;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return n.length>0&&(t+=" :: ".concat(JSON.stringify(n))),t};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const n=new Set;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},r=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||r(a.precache),c=e=>e||r(a.runtime);function o(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let h;function l(e){e.then((()=>{}))}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=e=>new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"");function f(e,t){const s=t();return e.waitUntil(s),s}async function p(e,s){let n=null;if(e.url){n=new URL(e.url).origin}if(n!==self.location.origin)throw new t("cross-origin-copy-response",{origin:n});const a=e.clone(),r={headers:new Headers(a.headers),status:a.status,statusText:a.statusText},i=s?s(r):r,c=function(){if(void 0===h){const t=new Response("");if("body"in t)try{new Response(t.body),h=!0}catch(e){h=!1}h=!1}return h}()?a.body:await a.blob();return new Response(c,i)}s(290);function g(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:n}=e;if(!n)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(n,location.href);return{cacheKey:e.href,url:e.href}}const a=new URL(n,location.href),r=new URL(n,location.href);return a.searchParams.set("__WB_REVISION__",s),{cacheKey:a.href,url:r.href}}class w{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async e=>{let{request:t,state:s}=e;s&&(s.originalRequest=t)},this.cachedResponseWillBeUsed=async e=>{let{event:t,state:s,cachedResponse:n}=e;if("install"===t.type&&s&&s.originalRequest&&s.originalRequest instanceof Request){const e=s.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}}class y{constructor(e){let{precacheController:t}=e;this.cacheKeyWillBeUsed=async e=>{let{request:t,params:s}=e;const n=(null===s||void 0===s?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=t}}s(559);function m(e){return"string"===typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let n=m(e);if("navigate"===n.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))n=await e({request:n.clone(),event:s})}catch(i){if(i instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let e;e=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(c){throw a&&await this.runCallbacks("fetchDidFail",{error:c,event:s,originalRequest:a.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:n,matchOptions:a}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},a),{cacheName:n});s=await caches.match(r,i);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await c({cacheName:n,matchOptions:a,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=m(e);var r;await(r=0,new Promise((e=>setTimeout(e,r))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:d(i.url)});const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:h,matchOptions:l}=this._strategy,u=await self.caches.open(h),f=this.hasCallback("cacheDidUpdate"),p=f?await async function(e,t,s,n){const a=o(t.url,s);if(t.url===a)return e.match(t,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await e.keys(t,r);for(const c of i)if(a===o(c.url,s))return e.match(c,n)}(u,i.clone(),["__WB_REVISION__"],l):null;try{await u.put(i,f?c.clone():c)}catch(g){if(g instanceof Error)throw"QuotaExceededError"===g.name&&await async function(){for(const e of n)await e()}(),g}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:h,oldResponse:p,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s="".concat(e.url," | ").concat(t);if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"===typeof t[e]){const s=this._pluginStateMap.get(t),n=n=>{const a=Object.assign(Object.assign({},n),{state:s});return t[e](a)};yield n}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cacheName=c(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"===typeof e.request?new Request(e.request):e.request,n="params"in e?e.params:void 0,a=new _(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,s,n){let a;await e.runCallbacks("handlerWillStart",{event:n,request:s});try{if(a=await this._handle(s,e),!a||"error"===a.type)throw new t("no-response",{url:s.url})}catch(r){if(r instanceof Error)for(const t of e.iterateCallbacks("handlerDidError"))if(a=await t({error:r,event:n,request:s}),a)break;if(!a)throw r}for(const t of e.iterateCallbacks("handlerWillRespond"))a=await t({event:n,request:s,response:a});return a}async _awaitComplete(e,t,s,n){let a,r;try{a=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:a}),await t.doneWaiting()}catch(i){i instanceof Error&&(r=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:a,error:r}),t.destroy(),r)throw r}}class b extends v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(b.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let n;const a=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=a.integrity,r=e.integrity,i=!r||r===t;if(n=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||t:void 0})),t&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,n.clone());0}}return n}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const n=await s.fetch(e);if(!await s.cachePut(e,n.clone()))throw new t("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==b.copyRedirectedCacheableResponsesPlugin&&(n===b.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push(b.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}b.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate(e){let{response:t}=e;return!t||t.status>=400?null:t}},b.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate(e){let{response:t}=e;return t.redirected?await p(t):t}};class R{constructor(){let{cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new b({cacheName:i(e),plugins:[...t,new y({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const n of e){"string"===typeof n?s.push(n):n&&void 0===n.revision&&s.push(n.url);const{cacheKey:e,url:a}=g(n),r="string"!==typeof n&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:e});if("string"!==typeof n&&n.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==n.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(e,n.integrity)}if(this._urlsToCacheKeys.set(a,e),this._urlsToCacheModes.set(a,r),s.length>0){const e="Workbox is precaching URLs without revision "+"info: ".concat(s.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(e)}}}install(e){return f(e,(async()=>{const t=new w;this.strategy.plugins.push(t);for(const[a,r]of this._urlsToCacheKeys){const t=this._cacheKeysToIntegrities.get(r),s=this._urlsToCacheModes.get(a),n=new Request(a,{integrity:t,cache:s,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:r},request:n,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(e){return f(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const a of t)s.has(a.url)||(await e.delete(a),n.push(a.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let x;const C=()=>(x||(x=new R),x);s(92);const E=e=>e&&"object"===typeof e?e:{handle:e};class L{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";this.handler=E(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=E(e)}}class q extends L{constructor(e,t,s){super((t=>{let{url:s}=t;const n=e.exec(s.href);if(n&&(s.origin===location.origin||0===n.index))return n.slice(1)}),t,s)}}class D{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"===typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest(e){let{request:t,event:s}=e;const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:s,request:t,sameOrigin:a,url:n});let c=i&&i.handler;const o=t.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return void 0;let h;try{h=c.handle({url:n,request:t,event:s,params:r})}catch(u){h=Promise.reject(u)}const l=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||l)&&(h=h.catch((async e=>{if(l){0;try{return await l.handle({url:n,request:t,event:s,params:r})}catch(a){a instanceof Error&&(e=a)}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:s});throw e}))),h}findMatchingRoute(e){let{url:t,sameOrigin:s,request:n,event:a}=e;const r=this._routes.get(n.method)||[];for(const i of r){let e;const r=i.match({url:t,sameOrigin:s,request:n,event:a});if(r)return e=r,(Array.isArray(e)&&0===e.length||r.constructor===Object&&0===Object.keys(r).length||"boolean"===typeof r)&&(e=void 0),{route:i,params:e}}return{}}setDefaultHandler(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";this._defaultHandlerMap.set(t,E(e))}setCatchHandler(e){this._catchHandler=E(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let U;const k=()=>(U||(U=new D,U.addFetchListener(),U.addCacheListener()),U);function T(e,s,n){let a;if("string"===typeof e){const t=new URL(e,location.href);0;a=new L((e=>{let{url:s}=e;return s.href===t.href}),s,n)}else if(e instanceof RegExp)a=new q(e,s,n);else if("function"===typeof e)a=new L(e,s,n);else{if(!(e instanceof L))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=e}return k().registerRoute(a),a}class N extends L{constructor(e,t){super((s=>{let{request:n}=s;const a=e.getURLsToCacheKeys();for(const r of function(e){let{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(n){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(a){const e=a({url:r});for(const t of e)yield t.href}}()}(n.url,t)){const t=a.get(r);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const I=(e,t)=>t.some((t=>e instanceof t));let K,M;const A=new WeakMap,P=new WeakMap,S=new WeakMap,O=new WeakMap,W=new WeakMap;let B={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return H(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(M||(M=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return e.apply(V(this),s),H(A.get(this))}:function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return H(e.apply(V(this),s))}:function(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];const r=e.call(V(this),t,...n);return S.set(r,t.sort?t.sort():[t]),H(r)}}function F(e){return"function"===typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",r),e.removeEventListener("abort",r)},a=()=>{t(),n()},r=()=>{s(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",r),e.addEventListener("abort",r)}));P.set(e,t)}(e),I(e,K||(K=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e)}function H(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",r)},a=()=>{t(H(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&A.set(t,e)})).catch((()=>{})),W.set(t,e),t}(e);if(O.has(e))return O.get(e);const t=F(e);return t!==e&&(O.set(e,t),W.set(t,e)),t}const V=e=>W.get(e);const G=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],$=new Map;function J(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if($.get(t))return $.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=Q.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!G.includes(s))return;const r=async function(e){const t=this.transaction(e,a?"readwrite":"readonly");let r=t.store;for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return n&&(r=r.index(c.shift())),(await Promise.all([r[s](...c),a&&t.done]))[0]};return $.set(t,r),r}B=(e=>({...e,get:(t,s,n)=>J(t,s)||e.get(t,s,n),has:(t,s)=>!!J(t,s)||e.has(t,s)}))(B);s(434);const z="cache-entries",X=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class Y{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e){let{blocked:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),H(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=X(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(z,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(z,this._getId(e));return null===s||void 0===s?void 0:s.timestamp}async expireEntries(e,t){const s=await this.getDb();let n=await s.transaction(z).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp<e||t&&r>=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(z,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+X(e)}async getDb(){return this._db||(this._db=await function(e,t){let{blocked:s,upgrade:n,blocking:a,terminated:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),c=H(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(H(i.result),e.oldVersion,e.newVersion,H(i.transaction),e)})),s&&i.addEventListener("blocked",(e=>s(e.oldVersion,e.newVersion,e))),c.then((e=>{r&&e.addEventListener("close",(()=>r())),a&&e.addEventListener("versionchange",(e=>a(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),c}("workbox-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Y(e)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),s=await self.caches.open(this._cacheName);for(const n of t)await s.delete(n,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,l(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),s=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<s}return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const ee={cacheWillUpdate:async e=>{let{response:t}=e;return 200===t.status||0===t.status?t:null}};var te;(function(e){C().precache(e)})(([{'revision':'91c68daa8b0b1c6d1bf476e4df0ab972','url':'./index.html'},{'revision':null,'url':'./static/css/1371.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/3826.a5e3e6d6.chunk.css'},{'revision':null,'url':'./static/css/4665.5d6e9197.chunk.css'},{'revision':null,'url':'./static/css/7657.cc1ab277.chunk.css'},{'revision':null,'url':'./static/css/7676.7f909312.chunk.css'},{'revision':null,'url':'./static/css/8219.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/8973.9cab926a.chunk.css'},{'revision':null,'url':'./static/css/main.c9e90622.css'},{'revision':null,'url':'./static/js/1185.4672e754.chunk.js'},{'revision':null,'url':'./static/js/1294.8ccea539.chunk.js'},{'revision':null,'url':'./static/js/1361.c522d24a.chunk.js'},{'revision':null,'url':'./static/js/1366.da3d7a8e.chunk.js'},{'revision':null,'url':'./static/js/1371.08ecc84e.chunk.js'},{'revision':null,'url':'./static/js/1494.35b60e8f.chunk.js'},{'revision':null,'url':'./static/js/1524.dd0af8c0.chunk.js'},{'revision':null,'url':'./static/js/1633.5c43bf43.chunk.js'},{'revision':null,'url':'./static/js/1667.3001639f.chunk.js'},{'revision':null,'url':'./static/js/1685.00ac41cb.chunk.js'},{'revision':null,'url':'./static/js/1826.2ee3d019.chunk.js'},{'revision':null,'url':'./static/js/2129.fd2cfa2b.chunk.js'},{'revision':null,'url':'./static/js/2168.0e7f9ae7.chunk.js'},{'revision':null,'url':'./static/js/2294.6d1e1f1d.chunk.js'},{'revision':null,'url':'./static/js/2334.311ae46d.chunk.js'},{'revision':null,'url':'./static/js/2365.a3571172.chunk.js'},{'revision':null,'url':'./static/js/2529.061c5064.chunk.js'},{'revision':null,'url':'./static/js/253.e339f2b0.chunk.js'},{'revision':null,'url':'./static/js/2537.a919ce43.chunk.js'},{'revision':null,'url':'./static/js/2564.777b4d9f.chunk.js'},{'revision':null,'url':'./static/js/2611.3b62474f.chunk.js'},{'revision':null,'url':'./static/js/271.f7901bf2.chunk.js'},{'revision':null,'url':'./static/js/2720.147ae463.chunk.js'},{'revision':null,'url':'./static/js/2828.89d42424.chunk.js'},{'revision':null,'url':'./static/js/2911.92a82b04.chunk.js'},{'revision':null,'url':'./static/js/2960.6a54b27f.chunk.js'},{'revision':null,'url':'./static/js/3111.f44a8d78.chunk.js'},{'revision':null,'url':'./static/js/3135.f99a1aa8.chunk.js'},{'revision':null,'url':'./static/js/3137.93dab4d8.chunk.js'},{'revision':null,'url':'./static/js/3216.4aabeb78.chunk.js'},{'revision':null,'url':'./static/js/3389.72b7e591.chunk.js'},{'revision':null,'url':'./static/js/3476.47d6170f.chunk.js'},{'revision':null,'url':'./static/js/3633.02809898.chunk.js'},{'revision':null,'url':'./static/js/3732.d5b401f7.chunk.js'},{'revision':null,'url':'./static/js/3826.d40f6fa7.chunk.js'},{'revision':null,'url':'./static/js/3829.2ca489ad.chunk.js'},{'revision':null,'url':'./static/js/3883.61409707.chunk.js'},{'revision':null,'url':'./static/js/3896.de9209b2.chunk.js'},{'revision':null,'url':'./static/js/4074.e94a9635.chunk.js'},{'revision':null,'url':'./static/js/4104.d4d484aa.chunk.js'},{'revision':null,'url':'./static/js/4240.ecc8270b.chunk.js'},{'revision':null,'url':'./static/js/4241.fe0e853e.chunk.js'},{'revision':null,'url':'./static/js/4274.75f87895.chunk.js'},{'revision':null,'url':'./static/js/4349.b225724a.chunk.js'},{'revision':null,'url':'./static/js/442.d95b0c5a.chunk.js'},{'revision':null,'url':'./static/js/4435.5212440d.chunk.js'},{'revision':null,'url':'./static/js/4448.d67840f3.chunk.js'},{'revision':null,'url':'./static/js/4471.c2380391.chunk.js'},{'revision':null,'url':'./static/js/4590.39f2b68f.chunk.js'},{'revision':null,'url':'./static/js/4631.f627efb4.chunk.js'},{'revision':null,'url':'./static/js/4775.c9c59b2e.chunk.js'},{'revision':null,'url':'./static/js/4901.7dab9c36.chunk.js'},{'revision':null,'url':'./static/js/4906.b8af826c.chunk.js'},{'revision':null,'url':'./static/js/506.e1874511.chunk.js'},{'revision':null,'url':'./static/js/5074.5643e827.chunk.js'},{'revision':null,'url':'./static/js/5396.56766685.chunk.js'},{'revision':null,'url':'./static/js/5509.2e6eb7fd.chunk.js'},{'revision':null,'url':'./static/js/5526.1c49cfe0.chunk.js'},{'revision':null,'url':'./static/js/5555.3e38d927.chunk.js'},{'revision':null,'url':'./static/js/556.cfa178eb.chunk.js'},{'revision':null,'url':'./static/js/5672.b32c024f.chunk.js'},{'revision':null,'url':'./static/js/5760.82f7dc8f.chunk.js'},{'revision':null,'url':'./static/js/5804.996e83bb.chunk.js'},{'revision':null,'url':'./static/js/5979.bd3d3c0f.chunk.js'},{'revision':null,'url':'./static/js/6490.8f3553c2.chunk.js'},{'revision':null,'url':'./static/js/6511.978080d1.chunk.js'},{'revision':null,'url':'./static/js/6547.01abc819.chunk.js'},{'revision':null,'url':'./static/js/6580.8cdb4aa4.chunk.js'},{'revision':null,'url':'./static/js/6602.34495e3d.chunk.js'},{'revision':null,'url':'./static/js/6780.0338caf8.chunk.js'},{'revision':null,'url':'./static/js/6830.1a23c027.chunk.js'},{'revision':null,'url':'./static/js/6931.e9297d29.chunk.js'},{'revision':null,'url':'./static/js/6950.9b84af05.chunk.js'},{'revision':null,'url':'./static/js/7020.2fd6f467.chunk.js'},{'revision':null,'url':'./static/js/7022.3ab32ae3.chunk.js'},{'revision':null,'url':'./static/js/7150.9849325f.chunk.js'},{'revision':null,'url':'./static/js/744.74c12fbb.chunk.js'},{'revision':null,'url':'./static/js/7534.c27466a0.chunk.js'},{'revision':null,'url':'./static/js/7638.98fe2185.chunk.js'},{'revision':null,'url':'./static/js/7657.380e09e9.chunk.js'},{'revision':null,'url':'./static/js/7676.1bd862b3.chunk.js'},{'revision':null,'url':'./static/js/7687.1a079d52.chunk.js'},{'revision':null,'url':'./static/js/7718.49194e44.chunk.js'},{'revision':null,'url':'./static/js/7913.2359b90e.chunk.js'},{'revision':null,'url':'./static/js/8219.33f29652.chunk.js'},{'revision':null,'url':'./static/js/8249.b3efc43c.chunk.js'},{'revision':null,'url':'./static/js/8262.39716df6.chunk.js'},{'revision':null,'url':'./static/js/8382.e1c429ed.chunk.js'},{'revision':null,'url':'./static/js/8537.d5e4e119.chunk.js'},{'revision':null,'url':'./static/js/8585.b9c88d3c.chunk.js'},{'revision':null,'url':'./static/js/8606.a872b105.chunk.js'},{'revision':null,'url':'./static/js/8973.12ec2ee1.chunk.js'},{'revision':null,'url':'./static/js/8986.0c6ecc50.chunk.js'},{'revision':null,'url':'./static/js/9038.aa97e3e5.chunk.js'},{'revision':null,'url':'./static/js/9041.77cacdd7.chunk.js'},{'revision':null,'url':'./static/js/9249.c5031d0b.chunk.js'},{'revision':null,'url':'./static/js/9277.b9c7a9e7.chunk.js'},{'revision':null,'url':'./static/js/9327.4b32dd25.chunk.js'},{'revision':null,'url':'./static/js/95.f2b78229.chunk.js'},{'revision':null,'url':'./static/js/9517.ac659c32.chunk.js'},{'revision':null,'url':'./static/js/9552.82c09530.chunk.js'},{'revision':null,'url':'./static/js/9580.5599a514.chunk.js'},{'revision':null,'url':'./static/js/9662.df51b9e7.chunk.js'},{'revision':null,'url':'./static/js/main.30420eb5.js'},{'revision':null,'url':'./static/media/lato-all-400-normal.3dc1eff492ab1f598560.woff'},{'revision':null,'url':'./static/media/lato-all-700-normal.1e7707c9ec98d9b97e7f.woff'},{'revision':null,'url':'./static/media/lato-latin-400-normal.be36596da218e1eec01c.woff2'},{'revision':null,'url':'./static/media/lato-latin-700-normal.8f28e0e1fdb195149f1c.woff2'},{'revision':null,'url':'./static/media/lato-latin-ext-400-normal.361f3dbb9db6a5980326.woff2'},{'revision':null,'url':'./static/media/lato-latin-ext-700-normal.9c8812eaec45956201e1.woff2'},{'revision':'3f75f5574309bf1ab1a642cae6cec338','url':'./static/media/logo.60f66bbe1ce9674a4df4e374c9d97fc4.svg'},{'revision':null,'url':'./static/media/ubuntu-mono-all-400-normal.c879328bc62e9c68268f.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.c367f416832eb8f1b846.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.eda1c4946b1f7bf58386.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.22f3bfc91f79c342bdf4.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.b3459900ea8a25d1f7c2.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.18e32d9d743af28f913e.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.b56e2315611d10838ad5.woff2'}]||[]).filter((e=>"/"!==e.url&&!e.url.includes("index.html")))),function(e){const t=C();T(new N(t,e))}(te),self.addEventListener("activate",(()=>self.clients.claim())),self.addEventListener("activate",(()=>{console.log("Service Worker activated")})),self.addEventListener("install",(e=>{console.log("Service Worker installed"),e.waitUntil(self.skipWaiting())}));const se=e=>"GET"!==e.method||(!!e.url.includes("/api")||(!!e.url.includes("__meta__.js")||!!e.url.includes("__blocklet__.js")));T((e=>{const{request:t}=e;return!se(t)&&t.url.includes("/static/")}),new class extends v{async _handle(e,s){let n,a=await s.cacheMatch(e);if(a)0;else{0;try{a=await s.fetchAndCachePut(e)}catch(r){r instanceof Error&&(n=r)}0}if(!a)throw new t("no-response",{url:e.url,error:n});return a}}({cacheName:"static",plugins:[new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cachedResponseWillBeUsed=async e=>{let{event:t,request:s,cacheName:n,cachedResponse:a}=e;if(!a)return null;const r=this._isResponseDateFresh(a),i=this._getCacheExpiration(n);l(i.expireEntries());const c=i.updateTimestamp(s.url);if(t)try{t.waitUntil(c)}catch(o){0}return r?a:null},this.cacheDidUpdate=async e=>{let{cacheName:t,request:s}=e;const n=this._getCacheExpiration(t);await n.updateTimestamp(s.url),await n.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){n.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===c())throw new t("expire-custom-caches-only");let s=this._cacheExpirations.get(e);return s||(s=new Z(e,this._config),this._cacheExpirations.set(e,s)),s}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(null===t)return!0;return t>=Date.now()-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),s=new Date(t).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}({maxEntries:200})]})),T((e=>{const{request:t}=e;return!se(t)&&(t.url.includes("/images/")||t.url.includes("/icons/"))}),new class extends v{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ee)}async _handle(e,s){const n=s.fetchAndCachePut(e).catch((()=>{}));s.waitUntil(n);let a,r=await s.cacheMatch(e);if(r)0;else{0;try{r=await n}catch(i){i instanceof Error&&(a=i)}}if(!r)throw new t("no-response",{url:e.url,error:a});return r}})})()})();
1
+ (()=>{"use strict";var e={522:()=>{try{self["workbox:core:6.5.3"]&&_()}catch(e){}},434:()=>{try{self["workbox:expiration:6.5.3"]&&_()}catch(e){}},290:()=>{try{self["workbox:precaching:6.5.3"]&&_()}catch(e){}},92:()=>{try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},559:()=>{try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,s),r.exports}(()=>{s(522);const e=function(e){let t=e;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return n.length>0&&(t+=" :: ".concat(JSON.stringify(n))),t};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const n=new Set;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},r=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||r(a.precache),c=e=>e||r(a.runtime);function o(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let h;function l(e){e.then((()=>{}))}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=e=>new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"");function f(e,t){const s=t();return e.waitUntil(s),s}async function p(e,s){let n=null;if(e.url){n=new URL(e.url).origin}if(n!==self.location.origin)throw new t("cross-origin-copy-response",{origin:n});const a=e.clone(),r={headers:new Headers(a.headers),status:a.status,statusText:a.statusText},i=s?s(r):r,c=function(){if(void 0===h){const t=new Response("");if("body"in t)try{new Response(t.body),h=!0}catch(e){h=!1}h=!1}return h}()?a.body:await a.blob();return new Response(c,i)}s(290);function g(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:n}=e;if(!n)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(n,location.href);return{cacheKey:e.href,url:e.href}}const a=new URL(n,location.href),r=new URL(n,location.href);return a.searchParams.set("__WB_REVISION__",s),{cacheKey:a.href,url:r.href}}class w{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async e=>{let{request:t,state:s}=e;s&&(s.originalRequest=t)},this.cachedResponseWillBeUsed=async e=>{let{event:t,state:s,cachedResponse:n}=e;if("install"===t.type&&s&&s.originalRequest&&s.originalRequest instanceof Request){const e=s.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}}class y{constructor(e){let{precacheController:t}=e;this.cacheKeyWillBeUsed=async e=>{let{request:t,params:s}=e;const n=(null===s||void 0===s?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=t}}s(559);function m(e){return"string"===typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let n=m(e);if("navigate"===n.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))n=await e({request:n.clone(),event:s})}catch(i){if(i instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let e;e=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(c){throw a&&await this.runCallbacks("fetchDidFail",{error:c,event:s,originalRequest:a.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:n,matchOptions:a}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},a),{cacheName:n});s=await caches.match(r,i);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await c({cacheName:n,matchOptions:a,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=m(e);var r;await(r=0,new Promise((e=>setTimeout(e,r))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:d(i.url)});const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:h,matchOptions:l}=this._strategy,u=await self.caches.open(h),f=this.hasCallback("cacheDidUpdate"),p=f?await async function(e,t,s,n){const a=o(t.url,s);if(t.url===a)return e.match(t,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await e.keys(t,r);for(const c of i)if(a===o(c.url,s))return e.match(c,n)}(u,i.clone(),["__WB_REVISION__"],l):null;try{await u.put(i,f?c.clone():c)}catch(g){if(g instanceof Error)throw"QuotaExceededError"===g.name&&await async function(){for(const e of n)await e()}(),g}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:h,oldResponse:p,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s="".concat(e.url," | ").concat(t);if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"===typeof t[e]){const s=this._pluginStateMap.get(t),n=n=>{const a=Object.assign(Object.assign({},n),{state:s});return t[e](a)};yield n}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cacheName=c(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"===typeof e.request?new Request(e.request):e.request,n="params"in e?e.params:void 0,a=new _(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,s,n){let a;await e.runCallbacks("handlerWillStart",{event:n,request:s});try{if(a=await this._handle(s,e),!a||"error"===a.type)throw new t("no-response",{url:s.url})}catch(r){if(r instanceof Error)for(const t of e.iterateCallbacks("handlerDidError"))if(a=await t({error:r,event:n,request:s}),a)break;if(!a)throw r}for(const t of e.iterateCallbacks("handlerWillRespond"))a=await t({event:n,request:s,response:a});return a}async _awaitComplete(e,t,s,n){let a,r;try{a=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:a}),await t.doneWaiting()}catch(i){i instanceof Error&&(r=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:a,error:r}),t.destroy(),r)throw r}}class b extends v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(b.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let n;const a=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=a.integrity,r=e.integrity,i=!r||r===t;if(n=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||t:void 0})),t&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,n.clone());0}}return n}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const n=await s.fetch(e);if(!await s.cachePut(e,n.clone()))throw new t("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==b.copyRedirectedCacheableResponsesPlugin&&(n===b.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push(b.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}b.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate(e){let{response:t}=e;return!t||t.status>=400?null:t}},b.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate(e){let{response:t}=e;return t.redirected?await p(t):t}};class R{constructor(){let{cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new b({cacheName:i(e),plugins:[...t,new y({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const n of e){"string"===typeof n?s.push(n):n&&void 0===n.revision&&s.push(n.url);const{cacheKey:e,url:a}=g(n),r="string"!==typeof n&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:e});if("string"!==typeof n&&n.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==n.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(e,n.integrity)}if(this._urlsToCacheKeys.set(a,e),this._urlsToCacheModes.set(a,r),s.length>0){const e="Workbox is precaching URLs without revision "+"info: ".concat(s.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(e)}}}install(e){return f(e,(async()=>{const t=new w;this.strategy.plugins.push(t);for(const[a,r]of this._urlsToCacheKeys){const t=this._cacheKeysToIntegrities.get(r),s=this._urlsToCacheModes.get(a),n=new Request(a,{integrity:t,cache:s,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:r},request:n,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(e){return f(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const a of t)s.has(a.url)||(await e.delete(a),n.push(a.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let x;const C=()=>(x||(x=new R),x);s(92);const E=e=>e&&"object"===typeof e?e:{handle:e};class L{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";this.handler=E(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=E(e)}}class q extends L{constructor(e,t,s){super((t=>{let{url:s}=t;const n=e.exec(s.href);if(n&&(s.origin===location.origin||0===n.index))return n.slice(1)}),t,s)}}class D{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"===typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest(e){let{request:t,event:s}=e;const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:s,request:t,sameOrigin:a,url:n});let c=i&&i.handler;const o=t.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return void 0;let h;try{h=c.handle({url:n,request:t,event:s,params:r})}catch(u){h=Promise.reject(u)}const l=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||l)&&(h=h.catch((async e=>{if(l){0;try{return await l.handle({url:n,request:t,event:s,params:r})}catch(a){a instanceof Error&&(e=a)}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:s});throw e}))),h}findMatchingRoute(e){let{url:t,sameOrigin:s,request:n,event:a}=e;const r=this._routes.get(n.method)||[];for(const i of r){let e;const r=i.match({url:t,sameOrigin:s,request:n,event:a});if(r)return e=r,(Array.isArray(e)&&0===e.length||r.constructor===Object&&0===Object.keys(r).length||"boolean"===typeof r)&&(e=void 0),{route:i,params:e}}return{}}setDefaultHandler(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";this._defaultHandlerMap.set(t,E(e))}setCatchHandler(e){this._catchHandler=E(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let U;const k=()=>(U||(U=new D,U.addFetchListener(),U.addCacheListener()),U);function T(e,s,n){let a;if("string"===typeof e){const t=new URL(e,location.href);0;a=new L((e=>{let{url:s}=e;return s.href===t.href}),s,n)}else if(e instanceof RegExp)a=new q(e,s,n);else if("function"===typeof e)a=new L(e,s,n);else{if(!(e instanceof L))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=e}return k().registerRoute(a),a}class N extends L{constructor(e,t){super((s=>{let{request:n}=s;const a=e.getURLsToCacheKeys();for(const r of function(e){let{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(n){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(a){const e=a({url:r});for(const t of e)yield t.href}}()}(n.url,t)){const t=a.get(r);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const I=(e,t)=>t.some((t=>e instanceof t));let K,M;const A=new WeakMap,P=new WeakMap,S=new WeakMap,O=new WeakMap,W=new WeakMap;let B={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return H(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(M||(M=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return e.apply(V(this),s),H(A.get(this))}:function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return H(e.apply(V(this),s))}:function(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];const r=e.call(V(this),t,...n);return S.set(r,t.sort?t.sort():[t]),H(r)}}function F(e){return"function"===typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",r),e.removeEventListener("abort",r)},a=()=>{t(),n()},r=()=>{s(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",r),e.addEventListener("abort",r)}));P.set(e,t)}(e),I(e,K||(K=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e)}function H(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",r)},a=()=>{t(H(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&A.set(t,e)})).catch((()=>{})),W.set(t,e),t}(e);if(O.has(e))return O.get(e);const t=F(e);return t!==e&&(O.set(e,t),W.set(t,e)),t}const V=e=>W.get(e);const G=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],$=new Map;function J(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if($.get(t))return $.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=Q.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!G.includes(s))return;const r=async function(e){const t=this.transaction(e,a?"readwrite":"readonly");let r=t.store;for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return n&&(r=r.index(c.shift())),(await Promise.all([r[s](...c),a&&t.done]))[0]};return $.set(t,r),r}B=(e=>({...e,get:(t,s,n)=>J(t,s)||e.get(t,s,n),has:(t,s)=>!!J(t,s)||e.has(t,s)}))(B);s(434);const z="cache-entries",X=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class Y{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e){let{blocked:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),H(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=X(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(z,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(z,this._getId(e));return null===s||void 0===s?void 0:s.timestamp}async expireEntries(e,t){const s=await this.getDb();let n=await s.transaction(z).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp<e||t&&r>=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(z,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+X(e)}async getDb(){return this._db||(this._db=await function(e,t){let{blocked:s,upgrade:n,blocking:a,terminated:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),c=H(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(H(i.result),e.oldVersion,e.newVersion,H(i.transaction),e)})),s&&i.addEventListener("blocked",(e=>s(e.oldVersion,e.newVersion,e))),c.then((e=>{r&&e.addEventListener("close",(()=>r())),a&&e.addEventListener("versionchange",(e=>a(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),c}("workbox-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Y(e)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),s=await self.caches.open(this._cacheName);for(const n of t)await s.delete(n,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,l(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),s=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<s}return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const ee={cacheWillUpdate:async e=>{let{response:t}=e;return 200===t.status||0===t.status?t:null}};var te;(function(e){C().precache(e)})(([{'revision':'124a7f53715bb64180b0afdbd9248292','url':'./index.html'},{'revision':null,'url':'./static/css/1371.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/3826.a5e3e6d6.chunk.css'},{'revision':null,'url':'./static/css/4665.5d6e9197.chunk.css'},{'revision':null,'url':'./static/css/7657.cc1ab277.chunk.css'},{'revision':null,'url':'./static/css/7676.7f909312.chunk.css'},{'revision':null,'url':'./static/css/8219.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/8973.9cab926a.chunk.css'},{'revision':null,'url':'./static/css/main.c9e90622.css'},{'revision':null,'url':'./static/js/1185.4672e754.chunk.js'},{'revision':null,'url':'./static/js/1294.8ccea539.chunk.js'},{'revision':null,'url':'./static/js/1361.c522d24a.chunk.js'},{'revision':null,'url':'./static/js/1366.da3d7a8e.chunk.js'},{'revision':null,'url':'./static/js/1371.08ecc84e.chunk.js'},{'revision':null,'url':'./static/js/1494.35b60e8f.chunk.js'},{'revision':null,'url':'./static/js/1524.dd0af8c0.chunk.js'},{'revision':null,'url':'./static/js/1633.5c43bf43.chunk.js'},{'revision':null,'url':'./static/js/1667.3001639f.chunk.js'},{'revision':null,'url':'./static/js/1685.00ac41cb.chunk.js'},{'revision':null,'url':'./static/js/1826.2ee3d019.chunk.js'},{'revision':null,'url':'./static/js/2129.fd2cfa2b.chunk.js'},{'revision':null,'url':'./static/js/2168.0e7f9ae7.chunk.js'},{'revision':null,'url':'./static/js/2294.6d1e1f1d.chunk.js'},{'revision':null,'url':'./static/js/2334.311ae46d.chunk.js'},{'revision':null,'url':'./static/js/2365.a3571172.chunk.js'},{'revision':null,'url':'./static/js/2529.061c5064.chunk.js'},{'revision':null,'url':'./static/js/253.e339f2b0.chunk.js'},{'revision':null,'url':'./static/js/2537.a919ce43.chunk.js'},{'revision':null,'url':'./static/js/2564.777b4d9f.chunk.js'},{'revision':null,'url':'./static/js/2611.3b62474f.chunk.js'},{'revision':null,'url':'./static/js/271.f7901bf2.chunk.js'},{'revision':null,'url':'./static/js/2720.147ae463.chunk.js'},{'revision':null,'url':'./static/js/2828.89d42424.chunk.js'},{'revision':null,'url':'./static/js/2911.92a82b04.chunk.js'},{'revision':null,'url':'./static/js/2960.6a54b27f.chunk.js'},{'revision':null,'url':'./static/js/3111.f44a8d78.chunk.js'},{'revision':null,'url':'./static/js/3135.f99a1aa8.chunk.js'},{'revision':null,'url':'./static/js/3137.93dab4d8.chunk.js'},{'revision':null,'url':'./static/js/3216.4aabeb78.chunk.js'},{'revision':null,'url':'./static/js/3389.72b7e591.chunk.js'},{'revision':null,'url':'./static/js/3476.47d6170f.chunk.js'},{'revision':null,'url':'./static/js/3633.02809898.chunk.js'},{'revision':null,'url':'./static/js/3732.d5b401f7.chunk.js'},{'revision':null,'url':'./static/js/3826.d40f6fa7.chunk.js'},{'revision':null,'url':'./static/js/3829.2ca489ad.chunk.js'},{'revision':null,'url':'./static/js/3883.61409707.chunk.js'},{'revision':null,'url':'./static/js/3896.de9209b2.chunk.js'},{'revision':null,'url':'./static/js/4074.e94a9635.chunk.js'},{'revision':null,'url':'./static/js/4104.d4d484aa.chunk.js'},{'revision':null,'url':'./static/js/4240.ecc8270b.chunk.js'},{'revision':null,'url':'./static/js/4241.fe0e853e.chunk.js'},{'revision':null,'url':'./static/js/4274.75f87895.chunk.js'},{'revision':null,'url':'./static/js/4349.b225724a.chunk.js'},{'revision':null,'url':'./static/js/442.d95b0c5a.chunk.js'},{'revision':null,'url':'./static/js/4435.5212440d.chunk.js'},{'revision':null,'url':'./static/js/4448.d67840f3.chunk.js'},{'revision':null,'url':'./static/js/4471.c2380391.chunk.js'},{'revision':null,'url':'./static/js/4590.39f2b68f.chunk.js'},{'revision':null,'url':'./static/js/4631.f627efb4.chunk.js'},{'revision':null,'url':'./static/js/4775.c9c59b2e.chunk.js'},{'revision':null,'url':'./static/js/4901.7dab9c36.chunk.js'},{'revision':null,'url':'./static/js/4906.b8af826c.chunk.js'},{'revision':null,'url':'./static/js/506.e1874511.chunk.js'},{'revision':null,'url':'./static/js/5074.5643e827.chunk.js'},{'revision':null,'url':'./static/js/5396.56766685.chunk.js'},{'revision':null,'url':'./static/js/5509.2e6eb7fd.chunk.js'},{'revision':null,'url':'./static/js/5526.1c49cfe0.chunk.js'},{'revision':null,'url':'./static/js/5555.3e38d927.chunk.js'},{'revision':null,'url':'./static/js/556.cfa178eb.chunk.js'},{'revision':null,'url':'./static/js/5672.b32c024f.chunk.js'},{'revision':null,'url':'./static/js/5760.82f7dc8f.chunk.js'},{'revision':null,'url':'./static/js/5804.996e83bb.chunk.js'},{'revision':null,'url':'./static/js/5979.bd3d3c0f.chunk.js'},{'revision':null,'url':'./static/js/6490.8f3553c2.chunk.js'},{'revision':null,'url':'./static/js/6511.978080d1.chunk.js'},{'revision':null,'url':'./static/js/6547.01abc819.chunk.js'},{'revision':null,'url':'./static/js/6580.8cdb4aa4.chunk.js'},{'revision':null,'url':'./static/js/6602.34495e3d.chunk.js'},{'revision':null,'url':'./static/js/6780.0338caf8.chunk.js'},{'revision':null,'url':'./static/js/6830.1a23c027.chunk.js'},{'revision':null,'url':'./static/js/6931.e9297d29.chunk.js'},{'revision':null,'url':'./static/js/6950.9b84af05.chunk.js'},{'revision':null,'url':'./static/js/7020.2fd6f467.chunk.js'},{'revision':null,'url':'./static/js/7022.02d74e90.chunk.js'},{'revision':null,'url':'./static/js/7150.9849325f.chunk.js'},{'revision':null,'url':'./static/js/744.74c12fbb.chunk.js'},{'revision':null,'url':'./static/js/7534.c27466a0.chunk.js'},{'revision':null,'url':'./static/js/7638.98fe2185.chunk.js'},{'revision':null,'url':'./static/js/7657.380e09e9.chunk.js'},{'revision':null,'url':'./static/js/7676.1bd862b3.chunk.js'},{'revision':null,'url':'./static/js/7687.1a079d52.chunk.js'},{'revision':null,'url':'./static/js/7718.49194e44.chunk.js'},{'revision':null,'url':'./static/js/7913.2359b90e.chunk.js'},{'revision':null,'url':'./static/js/8219.33f29652.chunk.js'},{'revision':null,'url':'./static/js/8249.b3efc43c.chunk.js'},{'revision':null,'url':'./static/js/8262.39716df6.chunk.js'},{'revision':null,'url':'./static/js/8382.e1c429ed.chunk.js'},{'revision':null,'url':'./static/js/8537.d5e4e119.chunk.js'},{'revision':null,'url':'./static/js/8585.b9c88d3c.chunk.js'},{'revision':null,'url':'./static/js/8606.a872b105.chunk.js'},{'revision':null,'url':'./static/js/8973.639c0cf3.chunk.js'},{'revision':null,'url':'./static/js/8986.0c6ecc50.chunk.js'},{'revision':null,'url':'./static/js/9038.aa97e3e5.chunk.js'},{'revision':null,'url':'./static/js/9041.77cacdd7.chunk.js'},{'revision':null,'url':'./static/js/9249.c5031d0b.chunk.js'},{'revision':null,'url':'./static/js/9277.b9c7a9e7.chunk.js'},{'revision':null,'url':'./static/js/9327.4b32dd25.chunk.js'},{'revision':null,'url':'./static/js/95.f2b78229.chunk.js'},{'revision':null,'url':'./static/js/9517.ac659c32.chunk.js'},{'revision':null,'url':'./static/js/9552.82c09530.chunk.js'},{'revision':null,'url':'./static/js/9580.5599a514.chunk.js'},{'revision':null,'url':'./static/js/9662.df51b9e7.chunk.js'},{'revision':null,'url':'./static/js/main.d254ff10.js'},{'revision':null,'url':'./static/media/lato-all-400-normal.3dc1eff492ab1f598560.woff'},{'revision':null,'url':'./static/media/lato-all-700-normal.1e7707c9ec98d9b97e7f.woff'},{'revision':null,'url':'./static/media/lato-latin-400-normal.be36596da218e1eec01c.woff2'},{'revision':null,'url':'./static/media/lato-latin-700-normal.8f28e0e1fdb195149f1c.woff2'},{'revision':null,'url':'./static/media/lato-latin-ext-400-normal.361f3dbb9db6a5980326.woff2'},{'revision':null,'url':'./static/media/lato-latin-ext-700-normal.9c8812eaec45956201e1.woff2'},{'revision':'3f75f5574309bf1ab1a642cae6cec338','url':'./static/media/logo.60f66bbe1ce9674a4df4e374c9d97fc4.svg'},{'revision':null,'url':'./static/media/ubuntu-mono-all-400-normal.c879328bc62e9c68268f.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.c367f416832eb8f1b846.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.eda1c4946b1f7bf58386.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.22f3bfc91f79c342bdf4.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.b3459900ea8a25d1f7c2.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.18e32d9d743af28f913e.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.b56e2315611d10838ad5.woff2'}]||[]).filter((e=>"/"!==e.url&&!e.url.includes("index.html")))),function(e){const t=C();T(new N(t,e))}(te),self.addEventListener("activate",(()=>self.clients.claim())),self.addEventListener("activate",(()=>{console.log("Service Worker activated")})),self.addEventListener("install",(e=>{console.log("Service Worker installed"),e.waitUntil(self.skipWaiting())}));const se=e=>"GET"!==e.method||(!!e.url.includes("/api")||(!!e.url.includes("__meta__.js")||!!e.url.includes("__blocklet__.js")));T((e=>{const{request:t}=e;return!se(t)&&t.url.includes("/static/")}),new class extends v{async _handle(e,s){let n,a=await s.cacheMatch(e);if(a)0;else{0;try{a=await s.fetchAndCachePut(e)}catch(r){r instanceof Error&&(n=r)}0}if(!a)throw new t("no-response",{url:e.url,error:n});return a}}({cacheName:"static",plugins:[new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cachedResponseWillBeUsed=async e=>{let{event:t,request:s,cacheName:n,cachedResponse:a}=e;if(!a)return null;const r=this._isResponseDateFresh(a),i=this._getCacheExpiration(n);l(i.expireEntries());const c=i.updateTimestamp(s.url);if(t)try{t.waitUntil(c)}catch(o){0}return r?a:null},this.cacheDidUpdate=async e=>{let{cacheName:t,request:s}=e;const n=this._getCacheExpiration(t);await n.updateTimestamp(s.url),await n.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){n.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===c())throw new t("expire-custom-caches-only");let s=this._cacheExpirations.get(e);return s||(s=new Z(e,this._config),this._cacheExpirations.set(e,s)),s}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(null===t)return!0;return t>=Date.now()-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),s=new Date(t).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}({maxEntries:200})]})),T((e=>{const{request:t}=e;return!se(t)&&(t.url.includes("/images/")||t.url.includes("/icons/"))}),new class extends v{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ee)}async _handle(e,s){const n=s.fetchAndCachePut(e).catch((()=>{}));s.waitUntil(n);let a,r=await s.cacheMatch(e);if(r)0;else{0;try{r=await n}catch(i){i instanceof Error&&(a=i)}}if(!r)throw new t("no-response",{url:e.url,error:a});return r}})})()})();
@@ -0,0 +1 @@
1
+ (self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[7022],{13671:(e,t,i)=>{"use strict";i.d(t,{$8:()=>A,y0:()=>L});var n=i(5057),o=i(68420),s=i(36991),a=i(14491),r=i(29054),l=i(40807),d=i.n(l),c=i(24914),u=i.n(c),m=i(76811),v=i(86229),p=i(4651),f=i(6352),h=i.n(f),g=i(32243),E=i.n(g),k=i(35432),D=i(49714),S=i(41365),b=i.n(S);const y=E()((e=>{const{origin:t,hostname:i}=new URL(e);return i===window.location.hostname||b()(h()(t,k.WELLKNOWN_PING_PREFIX))})),C={};function R(e){let{urls:t,checkAccessible:i=b(),disableCache:o=!1}=e;const s=(0,n.useRef)(t.filter((e=>C[e])).map((e=>C[e]))),a=s.current.length===t.length,[r,l]=(0,n.useState)(a?s.current:[]),[d,c]=(0,n.useState)(!a),u=(0,n.useMemo)((()=>!d&&r.length?r[0]:null),[r,d]);return(0,n.useEffect)((()=>{if((null===t||void 0===t?void 0:t.length)>0&&!a){(async()=>{let e;if(c(!0),o)e=await(0,D.evaluateURLs)(t,{checkAccessible:i}),e.forEach((e=>{C[e.url]=e}));else{(await(0,D.evaluateURLs)(t.filter((e=>!C[e])),{checkAccessible:i})).forEach((e=>{C[e.url]=e})),e=t.map((e=>C[e])).sort(((e,t)=>t.score-e.score))}l(e),c(!1)})()}}),[t,o,a]),{urlsState:r,loading:d,recommendedUrlState:u,recommendedUrl:null===u||void 0===u?void 0:u.url}}function B(e){var t,i,o,s,r,l,c,f;let{did:h,client:g,useSubscription:E,getIP:k,useLocaleContext:D,disableSubscription:S}=e;const{t:b,locale:C}=D(),[B,P]=(0,n.useState)(null),[w,N]=(0,n.useState)(!1),[I,U]=(0,n.useState)(!1),[x,A]=(0,n.useState)(),[L,T]=(0,n.useState)({cpu:[],memory:[]}),[_,O]=(0,n.useState)({}),F=null!==x&&void 0!==x&&null!==(t=x.site)&&void 0!==t&&null!==(i=t.domainAliases)&&void 0!==i&&i.length?JSON.stringify(x.site.domainAliases.map((e=>e.value))):"",H=(0,n.useMemo)((()=>{var e;return((null===x||void 0===x||null===(e=x.site)||void 0===e?void 0:e.domainAliases)||[]).map((e=>e.value))}),[F]),{domainsAccessibility:G,recommendedDomain:K}=function(e){const t=(0,n.useMemo)((()=>e.map((e=>(0,a.Sk)(e)))),[e]),{urlsState:i,loading:o,recommendedUrl:s}=R({urls:t,checkAccessible:y});let r;if(o)r={domainsAccessibility:e.reduce(((e,t)=>({...e,[t]:{loading:!0}})),{}),recommendedDomain:null};else{var l;const e=i.reduce(((e,t)=>{const i=new URL(t.url).hostname;return e[i]={...t,domain:i},e}),{}),t=(null===(l=i.find((e=>e.accessible)))||void 0===l?void 0:l.url)||s;r={domainsAccessibility:e,recommendedDomain:t?new URL(t).hostname:null}}return r}(H),Z=async function(){let{showError:e=!0,attachRuntimeInfo:t=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!w)try{N(!0),P(null);const{blocklet:e}=await g.getBlocklet({input:{did:h}});if(!e)throw new Error(b("blocklet.notFound"));A((t=>((0,p.Gv)(e,{fixRuntime:"merge-old",oldBlocklet:t}),e))),N(!1),t&&((async()=>{U(!0);try{const{blocklet:e}=await g.getBlocklet({input:{did:h,attachRuntimeInfo:!0}});await(0,p.Gv)(e,{getIP:k}),A(e)}catch(e){v.Z.error(e.message)}finally{U(!1)}})(),(async()=>{try{const e=await g.getBlockletRuntimeHistory({input:{did:h,hours:6}});e&&T({cpu:e.history.map((e=>({date:e.date,value:e.cpu}))),memory:e.history.map((e=>({date:e.date,value:e.mem})))})}catch(e){v.Z.error(e.message)}})())}catch(i){N(!1),P(i),e&&v.Z.error(i.message)}},M=e=>{var t;(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.did)===x.meta.did&&Z({showError:!1})},V=e=>{var t;(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.did)===x.meta.did&&Z({attachRuntimeInfo:!1,showError:!1})},j=()=>{h&&F&&g.checkDomains({input:{did:h}}).catch((e=>{console.error(e)}))};(0,n.useEffect)((()=>{F&&!S&&j()}),[F,S]),E(m.BlockletEvents.domainStatus,(e=>{O((t=>({...t,[e.domain]:{...t[e.domain],...e}})))}),[null===x||void 0===x||null===(o=x.meta)||void 0===o?void 0:o.did,!S]),E(m.BlockletEvents.statusChange,(e=>{var t;(null===e||void 0===e||null===(t=e.meta)||void 0===t?void 0:t.did)===x.meta.did&&(A((t=>{const i={...t};return i.status=(0,m.fromBlockletStatus)(e.status),(i.children||[]).forEach((t=>{const i=e.children.find((e=>{var i,n;return(null===(i=e.meta)||void 0===i?void 0:i.did)===(null===(n=t.meta)||void 0===n?void 0:n.did)}));i&&(t.status=(0,m.fromBlockletStatus)(i.status))})),i})),V(e))}),[null===x||void 0===x||null===(s=x.meta)||void 0===s?void 0:s.did,!S]),E(m.BlockletEvents.storeChange,V,[null===x||void 0===x||null===(r=x.meta)||void 0===r?void 0:r.did,!S]),E(m.BlockletEvents.installed,M,[null===x||void 0===x||null===(l=x.meta)||void 0===l?void 0:l.did,!S]),E(m.BlockletEvents.upgraded,M,[null===x||void 0===x||null===(c=x.meta)||void 0===c?void 0:c.did,!S]),E(m.BlockletEvents.updated,M,[null===x||void 0===x||null===(f=x.meta)||void 0===f?void 0:f.did,!S]);const q=x?d()(x,{site:{domainAliases:x.site.domainAliases.map((e=>{const t=e.value,i=(0,a.H$)(t);return e.domainStatus=u()(_[i],["domain","meta"]),e.accessibility=u()(G[t],["domain"]),e.href=(0,a.vH)({blocklet:x,domain:e,params:(0,a.f0)(x,C)}),e}))}}):null;return{loading:w,loadingRuntimeInfo:I,error:B,blocklet:q,runtimeHistory:L,recommendedDomain:K||"",actions:{refreshBlocklet:Z,refreshDomainStatus:j,setBlocklet:A,configNavigations:async e=>{const{blocklet:t}=await g.configNavigations({input:{did:h,navigations:e}});A(t)}}}}var P=i(38242),w=i(75793),N=i(33234),I=i(96266);const{Provider:U,Consumer:x}=r.BlockletContext;function A(e){let{did:t,children:i}=e;const{api:r,ws:{useSubscription:l}}=(0,w.h6)(),[d,c]=(0,n.useState)(),{loading:u,loadingRuntimeInfo:m,error:v,blocklet:p,recommendedDomain:f,runtimeHistory:h,actions:{refreshBlocklet:g,refreshDomainStatus:E,setBlocklet:k,configNavigations:D}}=B({did:t,client:r,useSubscription:l,getIP:N.Z,useLocaleContext:o.PE});(0,n.useEffect)((()=>{g()}),[t]),(0,n.useEffect)((()=>{if(!p||null===p||void 0===p||!p.controller)return;const{controller:e}=p;(0,a.Nh)(e.chainHost,e.nftId).then((e=>{e.expirationDate=(0,s.getNftExpirationDate)(e),e.expired=(0,s.isNFTExpired)(e),c(e)})).catch((e=>console.error(e)))}),[null===p||void 0===p?void 0:p.appPid]);const S={did:t,client:r,loading:u,loadingRuntimeInfo:m,error:v,blocklet:p,recommendedDomain:f,runtimeHistory:h,nftState:d,appIdList:p?(0,P.getBlockletAppIdList)(p):[],actions:{refreshBlocklet:g,refreshDomainStatus:E,setBlocklet:k,configNavigations:D}};return(0,I.jsx)(U,{value:S,children:i})}function L(){return(0,n.useContext)(r.BlockletContext)}},17022:(e,t,i)=>{"use strict";i.d(t,{G6:()=>C});var n=i(5057),o=i(35432),s=i(76811),a=i(38242),r=i(86229),l=i(14491),d=i(17425),c=i(4651),u=i(68420),m=i(75793),v=i(13671),p=i(34937),f=i(96266);const{Provider:h,Consumer:g}=d.TeamContext,E=(e,t,i)=>e===t.did?t.name:i?(0,a.getDisplayName)(i):"",k=(e,t,i)=>{if(i){const e=i.environments.find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR));return e?e.value:"auto"}return"default"},D=(e,t,i)=>e===t.did?t.trustedPassports||[]:i&&i.trustedPassports||[],S=(e,t,i)=>e===t.did?t.trustedFactories||[]:i&&i.trustedFactories||[],b=(e,t,i)=>{if(e===t.did)return e;if(i){return((i.environments||[]).find((e=>"BLOCKLET_APP_ID"===e.key))||{}).value||""}return""},y=(e,t,i)=>e===t.did?!1!==t.enablePassportIssuance:!i||!1!==i.enablePassportIssuance;function C(e){let{teamDid:t,children:i}=e;const{t:s,locale:a}=(0,u.PE)(),{api:d,info:g}=(0,m.h6)(),{recommendedDomain:C,blocklet:R}=(0,v.y0)()||{},[B,P]=(0,n.useState)([]),[w,N]=(0,n.useState)([]),[I,U]=(0,n.useState)([]),x=E(t,g,R),A=k(t,g,R),L=D(t,g,R),T=S(t,g,R),_=b(t,g,R),O=y(t,g,R),F=async e=>{try{const t=await d.doBatchQuery({getRoles:{input:{teamDid:e}},getPermissions:{input:{teamDid:e}},getInvitations:{input:{teamDid:e}}});N((t.getRoles.roles||[]).filter((e=>!o.RBAC_CONFIG.roles.some((t=>t.name===e.name&&(!t.passport||t.noHuman))))).map((e=>(e.hasDescription=!!e.description,e.hasDescription||(e.description=s("team.passport.description",{teamName:x,title:e.title})),e)))),U(t.getPermissions.permissions||[]),P(t.getInvitations.invitations||[])}catch(t){r.Z.error(t.message)}};(0,n.useEffect)((()=>{F(t)}),[t]),(0,n.useEffect)((()=>{N((e=>e.map((e=>(e.hasDescription||(e.description=s("team.passport.description",{teamName:x,title:e.title})),{...e})))))}),[s,a]);const H=e=>{e.teamDid===t&&F(t)};(0,p.mU)(o.EVENTS.USER_ADDED,H,[t]),(0,p.mU)(o.EVENTS.USER_REMOVED,H,[t]),(0,p.mU)(o.EVENTS.USER_UPDATED,H,[t]);const G={teamDid:t,teamIssuerDid:_,teamName:x,invitations:B,roles:w,permissions:I,trustedPassports:L,trustedFactories:T,isNodeTeam:t===g.did,enablePassportIssuance:O,refresh:()=>F(t),passportColor:A,endpoint:t===g.did?(0,c.RU)(g):(0,l.Sk)(C),blocklet:R,api:{getUser:function(){let{did:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={teamDid:t,user:{did:e}};return d.getUser({input:i})},getUsers:function(){let{query:e,paging:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n={teamDid:t};return i&&(n.paging=i),e&&(n.query=e),n.sort={lastLoginAt:-1},d.getUsers({input:n})},getUsersCountPerRole:()=>d.getUsersCountPerRole({input:{teamDid:t}})}};return(0,f.jsx)(h,{value:G,children:i})}C.defaultProps={}},36991:(e,t,i)=>{const n=i(59408),o=i(43681),s=e=>n(o(e,"data.value.expirationDate",[]));e.exports={isNFTExpired:e=>(e=>!!e&&new Date(e).getTime()<=Date.now())(s(e)),getNftExpirationDate:s,isNFTConsumed:e=>!!e.data.value.consumedTime}},17425:(e,t,i)=>{"use strict";i.d(t,{DJ:()=>r,TeamContext:()=>o});var n=i(5057);const o=(0,n.createContext)({}),{Provider:s,Consumer:a}=o;function r(){return(0,n.useContext)(o)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[8973],{80378:(e,n,t)=>{t.d(n,{Z:()=>p});var i=t(55898),o=t.n(i),a=t(62681),l=t(72333),r=t(6352),s=t.n(r),c=t(35432),d=t(58238),m=t(14491);var u=t(96266);function p(e){let{blocklet:n,style:t,size:i,ancestors:o,...r}=e;const p=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var n;let{blocklet:t,ancestors:i=[]}=e;const o=(0,d.h6)(),{inService:a}=o,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let r=a?s()(m.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):s()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)r=s()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),l);else{const e=window.env.apiPrefix||"/",n=i.concat(t),o=a?n.slice(1):n;r=s()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),l)}return{logoUrl:r,inService:a}}({blocklet:n,ancestors:o}),{variant:g}=r,x=f?()=>{}:e=>{e.target.src="".concat(p.imgPrefix,"/blocklet.png")};let b=(0,u.jsx)("img",{src:h,onError:x,alt:n.meta.name,style:{width:i}});return n.meta.logo||(b=(0,u.jsx)(l.Z,{did:n.meta.did||"",responsive:!0})),(0,u.jsx)(a.Z,{variant:g||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t),...r,children:b})}p.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},p.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{t.d(n,{Z:()=>r});var i=t(55898),o=t.n(i),a=t(39948),l=t(96266);function r(e){let{depth:n}=e;return(0,l.jsx)(a.Z,{ml:Math.max(2*(n-1),0),sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}r.propTypes={depth:o().number},r.defaultProps={depth:1}},44784:(e,n,t)=>{t.d(n,{Z:()=>d});var i,o=t(71171),a=t(33518),l=t(82790),r=t(96266);function s(e){let{labelProps:n,className:t,style:i,...o}=e;const a={...n,labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"};return(0,r.jsx)(c,{className:t,style:i,children:(0,r.jsx)(l.Z,{labelProps:a,...o})})}s.propTypes=l.Z.propTypes,s.defaultProps=l.Z.defaultProps;const c=a.Z.div(i||(i=(0,o.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(e=>{let{theme:n}=e;return n.breakpoints.down("sm")})),d=s},59375:(e,n,t)=>{t.d(n,{Z:()=>Z});var i,o=t(71171),a=t(5057),l=t(55898),r=t.n(l),s=t(6352),c=t.n(s),d=t(33518),m=t(92706),u=t.n(m),p=t(39948),h=t(52277),f=t.n(h),g=t(68420),x=t(96266);const b=(0,a.lazy)((()=>Promise.all([t.e(1294),t.e(3826)]).then(t.bind(t,23826)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function Z(e){let{url:n,height:t,width:i,enabled:o,type:l,did:r,prefix:s,headers:d,onUploaded:m}=e;const{t:u}=(0,g.PE)(),h=(0,a.useRef)(null),Z={cursor:o?"pointer":"default","&::after":{content:'"'.concat(u("common.switch"),'"')}};return(0,x.jsxs)(j,{id:"uploader-".concat(r,"-").concat(l),children:[(0,x.jsx)(b,{ref:h,popup:!0,onUploadFinish:()=>{var e;m(),null===(e=h.current)||void 0===e||e.close()},plugins:["ImageEditor"],apiPathProps:{uploader:c()(s,v,l,r),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,x.jsx)(p.Z,{className:f()("uploader-wrapper",o&&"enabled"),sx:Z,onClick:()=>{var e;null===(e=h.current)||void 0===e||e.open()},children:(0,x.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:i}})})]},"uploader-".concat(r,"-").concat(l))}Z.propTypes={url:r().string.isRequired,type:r().oneOf(["square","rect","favicon"]).isRequired,did:r().string.isRequired,prefix:r().string.isRequired,headers:r().func,onUploaded:r().func,height:r().number,width:r().any,enabled:r().bool},Z.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:u()};const j=d.Z.div(i||(i=(0,o.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},5119:(e,n,t)=>{t.r(n),t.d(n,{default:()=>rt});var i=t(71171),o=t(5057),a=t(33518),l=t(55898),r=t.n(l),s=t(96181),c=t(6352),d=t.n(c),m=t(35432),u=t(39948),p=t(55402),h=t(82275),f=t(96399),g=t(65688),x=t(37633),b=t(48037),v=t(92273),Z=t(76720),j=t(15849),y=t(68420),C=t(94464),k=t(38242),w=t(80378),S=t(1722),E=t(43681),L=t.n(E),P=t(50482),R=t.n(P),T=t(16147),_=t(29034),A=t(28726),N=t(80578),O=t(76811),I=t(86229),F=t(28641),B=t(44846),z=t(13727),D=t(56184),U=t(67680),K=t(74490),W=t(51177),q=t(19654),G=t(96366),V=t(90067),H=t(35406),M=t(11875),Y=t(95890),J=t(96266);const Q={PaperProps:{style:{maxHeight:224,width:250}}},X=(e,n,t)=>({fontWeight:-1===n.indexOf(e)?t.typography.fontWeightRegular:t.typography.fontWeightMedium});function $(e){let{label:n,disabled:t,required:i,initialValue:a,onChange:l,style:r,onSubmit:s,triggers:c,options:d,formatterBeforeSubmit:m,helperText:p,...h}=e;const f=(0,G.Z)(),[g,x]=(0,o.useState)(!1),[b,v]=(0,o.useState)(!1),[Z,j]=(0,o.useState)(a),[y,C]=(0,o.useState)(Z),k=g?(0,J.jsx)(W.Z,{value:y,onChange:e=>{let{value:n}=e.target;n="string"===typeof n?n.split(","):n,C(n),l(n)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",renderValue:e=>(0,J.jsx)(u.Z,{sx:{display:"flex",flexWrap:"wrap"},children:e.filter((e=>d.some((n=>n.code===e)))).map((e=>(0,J.jsx)(q.Z,{label:d.find((n=>n.code===e)).name,style:{marginRight:8},size:"small"},e)))}),MenuProps:Q,...h,children:d.map((e=>(0,J.jsx)(K.Z,{value:e.code,style:X(e.code,y,f),children:e.name},e.code)))}):(0,J.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:y.filter((e=>d.some((n=>n.code===e)))).map((e=>(0,J.jsx)(q.Z,{label:d.find((n=>n.code===e)).name,style:{marginRight:8},size:"small"},e)))});return(0,J.jsx)(M.Z,{className:"form",style:r,children:(0,J.jsxs)(u.Z,{className:"form-item",children:[(0,J.jsxs)(u.Z,{className:"form-item-label",children:[n,i&&(0,J.jsx)(H.Z,{})]}),(0,J.jsxs)(u.Z,{className:"form-item-body",children:[(0,J.jsx)(u.Z,{className:"form-item-input",children:k}),(0,J.jsx)(u.Z,{className:"form-item-action",children:g?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U.Z,{"data-cy":"schema-form-item-confirm",onClick:async()=>{v(!0);try{!1===await s("function"===typeof m?m(y):y)?C(Z):(C(y),j(y))}catch(e){C(Z)}finally{v(!1),x(!1)}},disabled:t||b,size:"large",children:b?(0,J.jsx)(B.Z,{size:24}):(0,J.jsx)(D.Z,{})}),(0,J.jsx)(U.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{C(Z),x(!1)},disabled:t||b,size:"large",children:(0,J.jsx)(z.default,{})})]}):(0,J.jsx)(Y.Z,{triggers:c,onEnterEdit:()=>x(!0),disabled:t})})]}),g&&p&&(0,J.jsx)(V.Z,{children:p})]})})}$.propTypes={style:r().object,onSubmit:r().func,onChange:r().func,label:r().string,initialValue:r().string,required:r().bool,disabled:r().bool,triggers:r().array,options:r().array,helperText:r().string,formatterBeforeSubmit:r().func},$.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(",")};var ee,ne=t(58238),te=t(14491),ie=t(54063),oe=t(63406),ae=t(78410),le=t(31853),re=t(49983),se=t(70461),ce=t(73545),de=t(29054);function me(e){let{initialValue:n,onChange:t,disabled:i,loading:o}=e;const{t:a}=(0,y.PE)(),{api:l}=(0,ce.T)(),{blocklet:r}=(0,de.y0)(),[s,c]=(0,le.Z)({newAppSk:"",isConnectOpen:!1}),d=()=>c({isConnectOpen:!1}),p=r.structVersion===m.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:()=>{(0,te.An)(r.status)?I.Z.error(a("blocklet.error.isRunning")):(0,k.isInProgress)(r.status)?I.Z.error(a("blocklet.error.isInProgress")):c({isConnectOpen:!0})}}]:[];return[(0,J.jsx)(F.Z,{disabled:i,loading:o,initialValue:n,onSubmit:e=>(c({newAppSk:e}),!1),triggers:p,secure:!0}),s.newAppSk&&(0,J.jsx)(se.Z,{title:a("blocklet.config.appSkTitle"),description:(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(u.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,J.jsx)(u.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,J.jsxs)(ue,{children:[(0,J.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,J.jsx)("li",{children:a("blocklet.config.appDidChangeTipL2")})]})]}),confirm:a("confirm"),cancel:a("cancel"),onConfirm:()=>(async e=>{try{await t(e)}finally{c({newAppSk:""})}})(s.newAppSk),onCancel:()=>c({newAppSk:""})}),(0,J.jsx)(re.Z,{popup:!0,open:s.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:l.get,checkTimeout:3e5,onSuccess:d,extraParams:{appDid:r.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:d})]}me.propTypes={initialValue:r().string,onChange:r().func,disabled:r().bool,loading:r().bool},me.defaultProps={initialValue:"default",onChange:()=>{},disabled:!1,loading:!1};const ue=(0,a.Z)("ul")(ee||(ee=(0,i.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"])));var pe,he=t(13128),fe=t(55372),ge=t(11750),xe=t(88574),be=t(26174),ve=t(88092),Ze=t(50185),je=t(17425);function ye(e){let{onCancel:n,onSuccess:t,onError:i}=e;const{api:a}=(0,o.useContext)(ce.B),[l,r]=(0,o.useState)(!1),{t:s,locale:c}=(0,y.PE)(),[d,m]=(0,o.useState)(""),[p,h]=(0,o.useState)(!1),[f,g]=(0,o.useState)(0),[x,b]=(0,o.useState)(""),{endpoint:v}=(0,je.DJ)(),[Z,j]=(0,o.useState)(!1),C=e=>{m(null),r(!0);try{b(e.result),g(w.length-1)}catch(n){const e=(0,te.Z)(n);m(e),i(n)}finally{r(!1)}},k=()=>{h(!1),g(0)},w=[{body:(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(ge.Z,{children:s("team.transferApp.transferDialog.tips.progress")}),(0,J.jsx)(ge.Z,{mt:3,mb:2,children:s("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:()=>{h(!0),g(1)}},{body:()=>(0,J.jsx)(re.Z,{action:"transfer-app-owner",open:p,locale:c,checkFn:a.get,onClose:k,onSuccess:C,checkTimeout:3e5,extraParams:{},messages:{title:s("team.transferApp.connectDialog.title"),scan:s("team.transferApp.connectDialog.scan"),confirm:s("team.transferApp.connectDialog.confirm"),success:s("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const e=(0,te.VP)({transferId:x.transferId,endpoint:v});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u.Z,{component:Ce,dangerouslySetInnerHTML:{__html:s("team.transferApp.transferDialog.createSuccessTip1")}}),(0,J.jsx)(u.Z,{component:Ce,mt:2,children:(0,J.jsx)(Ce,{children:s("team.transferApp.transferDialog.createSuccessTip3")})}),(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(u.Z,{component:Ce,mt:2,children:(0,J.jsx)(Ce,{children:s("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,te.B2)(x.expireDate,c)})})}),(0,J.jsx)(u.Z,{my:1,children:(0,J.jsx)(Ze.Z,{children:e})})]}),(0,J.jsx)("div",{children:(0,J.jsx)(be.Z,{value:"end",control:(0,J.jsx)(ve.Z,{checked:Z,onChange:e=>j(e.target.checked)}),label:s("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:s("common.confirm"),onConfirm:t}],S=w[f];return(0,J.jsxs)(he.ZP,{title:(0,J.jsx)(Ce,{className:"title",children:s("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,J.jsxs)(J.Fragment,{children:[S.cancel&&(0,J.jsx)(A.Z,{onClick:S.onCancel,color:"inherit",children:S.cancel}),(0,J.jsxs)(A.Z,{onClick:S.onConfirm,color:"error",disabled:l||f===w.length-1&&!Z,variant:"contained",autoFocus:!0,children:[l&&(0,J.jsx)(B.Z,{size:16}),S.confirm]})]}),children:[(0,J.jsx)(fe.Z,{component:"div",children:"function"===typeof S.body?S.body():S.body}),!!d&&(0,J.jsx)(xe.Z,{type:"error",variant:"icon",children:d})]})}ye.propTypes={onCancel:r().func.isRequired,onSuccess:r().func.isRequired,onError:r().func},ye.defaultProps={onError:()=>{}};const Ce=a.Z.div(pe||(pe=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"])));var ke,we=t(49522),Se=t(59375);const Ee=Object.keys(O.SUPPORTED_LANGUAGES).map((e=>({code:e,name:O.SUPPORTED_LANGUAGES[e].nativeName})));function Le(e){var n;let{blocklet:t,onUpdate:i,hasPermission:a,...l}=e;const{api:r,inService:s,prefix:c,getSessionInHeader:d,ws:{useSubscription:p}}=(0,ne.h6)(),{t:h}=(0,o.useContext)(y.RD),[f,g]=(0,o.useState)(""),[x,b]=(0,o.useState)(""),[v,Z]=(0,o.useState)(!1),j=(0,k.getWhoCanAccess)(t),C=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,w=x||!a,{logoUrl:S,rectLogoUrl:E,faviconUrl:P}=(0,we.Z)({blocklet:t}),{did:B}=t.meta,{site:z}=t,D=L()(t.meta,"capabilities.clusterMode",!1);if(p(m.EVENTS.NODE_RUNTIME_INFO,(e=>{D&&g(L()(e,"cpu.physicalCores",""))})),(0,te.wS)(t.status))return null;const U=t.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE)),K=!U||"yes"===U.value,W=t.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES)),q=t.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL)),G=t.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)),V=t.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)),H=[{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:h("blocklet.config.name"),value:t.environments.find((e=>"BLOCKLET_APP_NAME"===e.key)).value},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:h("blocklet.config.description"),value:t.environments.find((e=>"BLOCKLET_APP_DESCRIPTION"===e.key)).value},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:h("blocklet.config.appUrl"),value:q?q.value:""},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:h("blocklet.config.copyrightOwner"),value:G?G.value:""},{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:h("blocklet.config.copyrightYear"),value:V?V.value:""}];if(D){const e=t.configs.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE)),n=e?e.value:f;H.push({key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:h("blocklet.config.clusterSize"),value:n,cpuCores:f})}const M=async(e,n)=>{if(e===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const e=(0,te.I)({value:n,cpuCores:f});if(e)return void I.Z.error(e)}const o=[{key:e,value:n}];try{b(!0);const{blocklet:e}=await r.configBlocklet({input:{did:t.meta.did,configs:o}});i(e)}catch(a){I.Z.error(a.message)}finally{b(!1)}};return(0,J.jsxs)(_e,{...l,children:[H.map((e=>(0,J.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,J.jsx)(F.Z,{style:{marginTop:0},disabled:x||w,loading:x,initialValue:e.value,onSubmit:n=>M(e.key,n)})]}))),(0,J.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:h("blocklet.config.logoSquare")}),(0,J.jsx)(Se.Z,{did:t.meta.did,height:80,width:80,type:"square",prefix:c,url:S,enabled:a,headers:d}),(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoRect")}),(0,J.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoRectDesc")}),(0,J.jsx)(Se.Z,{did:t.meta.did,height:80,type:"rect",prefix:c,url:E,enabled:a,headers:d}),(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:h("blocklet.config.logoFavicon")}),(0,J.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("blocklet.config.logoFaviconDesc")}),(0,J.jsx)(Se.Z,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:c,url:P,enabled:a,headers:d}),(0,J.jsx)(u.Z,{className:"config-form",children:"all"===j&&"registry"===t.source&&(0,J.jsxs)(u.Z,{className:"config-item",children:[(0,J.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.access.publicToStore"),(0,J.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.access.publicInstanceTip")})]}),(0,J.jsx)(T.Z,{disabled:w,checked:C,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configPublicToStore({input:{did:t.meta.did,publicToStore:n}});i(o)}catch(n){I.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,J.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,J.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.languages")}),(0,J.jsx)($,{style:{marginTop:0},disabled:x||w,loading:x,options:Ee,initialValue:W?W.value.split(","):["en","zh"],onSubmit:e=>M("BLOCKLET_APP_LANGUAGES",e),helperText:h("blocklet.config.selectLanguagesTip")})]}),(0,J.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,J.jsx)(u.Z,{className:"config-form",mt:2,children:(0,J.jsx)(u.Z,{className:"config-label",mb:0,children:h("common.security")})}),(0,J.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("router.domainSecurity.cors.title")}),(0,J.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,J.jsx)(F.Z,{style:{marginTop:0},disabled:x||w,loading:x,initialValue:(z.corsAllowedOrigins||[]).join(", "),onSubmit:async e=>{const n=z.corsAllowedOrigins||[],i=e.split(",").map((e=>e.trim())).filter(Boolean);if(R()(n,i))return!1;try{b(!0);const e=i.length?i:["__none__"];await r.updateRoutingSite({input:{id:z.id,corsAllowedOrigins:e,teamDid:t.meta.did}}),b(!1)}catch(o){return I.Z.error(o.message),b(!1),!1}return!0}})]}),(0,J.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,J.jsx)(u.Z,{mb:2,className:"config-label",fontSize:20,children:h("blocklet.config.dangerZone")}),(0,J.jsxs)(u.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,J.jsx)(u.Z,{className:"config-form",mt:2,children:!s&&(0,J.jsxs)(u.Z,{className:"config-item",children:[(0,J.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.deletable.name"),(0,J.jsx)(u.Z,{className:"config-desc",children:h(K?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,J.jsx)(T.Z,{disabled:w,checked:!K,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE,value:n?"no":"yes"}]}});i(o)}catch(n){I.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,J.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,J.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:h("blocklet.config.sk")}),(0,J.jsx)(me,{disabled:x||w,loading:x,initialValue:t.environments.find((e=>"BLOCKLET_APP_SK"===e.key)).value,onChange:async e=>{if(!x){b(!0);try{const{blocklet:n}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:e}]}});i(n)}catch(n){I.Z.error(n.message)}finally{b(!1)}}}})]}),s&&(0,J.jsx)(oe.Z,{role:"owner",children:e=>(e||ie.C)&&(0,J.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,J.jsxs)(u.Z,{className:"config-item",children:[(0,J.jsx)(u.Z,{className:"config-label",mb:0,children:h("team.transferApp.name")}),(0,J.jsxs)(A.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:()=>Z(!0),children:[(0,J.jsx)(N.Z,{style:{fontSize:"1.3em",marginRight:4}}),h("team.transferApp.name")]})]}),v&&(0,J.jsx)(ye,{onCancel:()=>Z(!1),onSuccess:()=>Z(!1)})]})}),(0,J.jsx)(u.Z,{className:"config-form",mt:2,children:(0,J.jsxs)(u.Z,{className:"config-item",children:[(0,J.jsxs)(u.Z,{className:"config-label",children:[h("blocklet.config.clearCache.name"),(0,J.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.clearCache.purpose")})]}),(0,J.jsx)(ae.Z,{teamDid:B})]})})]})]})}const Pe=(0,oe.V)(Le,"mutate_blocklets"),Re=(0,oe.V)(Le,"",te.Wf);function Te(e){const{inService:n}=(0,ne.h6)();return n?(0,J.jsx)(Re,{...e}):(0,J.jsx)(Pe,{...e})}Le.propTypes={blocklet:r().object.isRequired,onUpdate:r().func,hasPermission:r().bool},Le.defaultProps={onUpdate:()=>{},hasPermission:!1};const _e=a.Z.div(ke||(ke=(0,i.Z)(["\n padding-top: 24px;\n .config-form {\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n }\n }\n\n .config-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 16px 0;\n }\n\n .config-label {\n font-weight: bold;\n }\n\n .config-desc {\n font-weight: normal;\n font-size: 12px;\n color: #666;\n }\n\n .form-item {\n margin-top: 0;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var Ae=t(25710),Ne=t(93066),Oe=t(47020),Ie=t(80576),Fe=t(8708),Be=t.n(Fe),ze=t(12673),De=t(99360),Ue=t(80506),Ke=t(766),We=t.n(Ke),qe=t(24529),Ge=t.n(qe),Ve=t(16727),He=t.n(Ve),Me=t(92706),Ye=t.n(Me);const Je=(0,o.forwardRef)(((e,n)=>{const{t:t}=(0,o.useContext)(y.RD),i=(0,ze.Z)({show:!1,title:"",content:"",onConfirm:Ye(),onCancel:Ye(),loading:!1}),a=(0,De.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.show=!0,i.title=e.title,i.content=e.content,i.onConfirm=e.onConfirm||Ye(),i.onCancel=e.onCancel||Ye(),i.loading=!1})),l=(0,De.Z)((()=>{i.title="",i.content="",i.onConfirm=Ye(),i.onCancel=Ye()})),r=(0,De.Z)((()=>{i.show=!1,setTimeout((()=>{l()}),300)})),s=(0,De.Z)((()=>{r(),null===i||void 0===i||i.onCancel()}),[]),c=(0,De.Z)((async()=>{i.loading=!0;try{await(null===i||void 0===i?void 0:i.onConfirm(r))}finally{i.loading=!1}}),[]);return(0,o.useImperativeHandle)(n,(()=>({open:a,close:r})),[a,r]),(0,J.jsx)(he.I4,{open:i.show,title:i.title,onConfirm:c,onCancel:s,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:i.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:i.content instanceof Function?i.content():i.content})}));function Qe(){const e=(0,o.useRef)(null),n=(0,De.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.open(...i)})),t=(0,De.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.close(...i)})),i={open:n,close:t};return{confirmHolder:(0,J.jsx)(Je,{ref:e}),confirmApi:i}}const Xe={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};const $e=function(){var e,n,t;const{api:i}=(0,ne.h6)(),{blocklet:o}=(0,de.y0)(),{t:a}=(0,y.PE)(),{confirmApi:l,confirmHolder:r}=Qe(),s=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,c=Object.assign({...Xe},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),{handleSubmit:d,control:m,formState:p,watch:h,reset:f}=(0,Ue.cI)({defaultValues:Be()(c,Object.keys(Xe))}),g=(0,ze.Z)({testReceiver:"",testReceiverError:""}),x=h("enabled"),b=(0,De.Z)((async function(e,n){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];try{var o,l;const{blocklet:n}=await i.configNotification({input:{did:s,notification:JSON.stringify({email:e})}}),r=Object.assign({...Xe},(null===n||void 0===n||null===(o=n.settings)||void 0===o||null===(l=o.notification)||void 0===l?void 0:l.email)||{});f(r),t&&I.Z.success(a("oauth.saveSuccess"))}catch(r){if(!t)throw r;I.Z.error(r.message||a("oauth.saveFailed"))}})),v=(0,De.Z)((async(e,n,t)=>{try{p.isDirty&&await b(e,n,!1),await i.sendEmail({input:{did:s,receiver:t,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),I.Z.success(a("notification.email.testSuccess"))}catch(o){I.Z.error(o.message||a("notification.email.testfailed"))}})),Z=(0,De.Z)(((e,n)=>{g.testReceiver="",g.testReceiverError="",l.open({title:a("notification.email.testSendEmail"),content:()=>(0,J.jsx)(u.Z,{sx:{width:"300px"},children:(0,J.jsx)(Oe.Z,{fullWidth:!0,name:"testReceiver",label:a("notification.email.inputTestReceiver"),value:g.testReceiver,onChange:e=>{g.testReceiver=e.target.value},error:!!g.testReceiverError,helperText:g.testReceiverError||"\u3000"})}),async onConfirm(t){var i;const o=null===(i=g.testReceiver)||void 0===i?void 0:i.trim();o?We()(o)?(g.testReceiverError="",await v(e,n,o),t()):g.testReceiverError=a("notification.email.receiverInvalid"):g.testReceiverError=a("notification.email.receiverRequired")}})})),j=(0,De.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!We()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),C=(0,De.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Ge()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),k=(0,De.Z)((e=>e?!!He()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired"))),w=(0,De.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired"))),S=(0,De.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired"))),E=(0,De.Z)((()=>!0));return(0,J.jsxs)(u.Z,{children:[(0,J.jsxs)("form",{onSubmit:d(b),disabled:!0,children:[(0,J.jsx)(Ue.Qr,{name:"enabled",control:m,render:e=>{let{field:n}=e;return(0,J.jsx)(be.Z,{control:(0,J.jsx)(T.Z,{checked:n.value,...n}),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,J.jsx)(Ue.Qr,{name:"from",control:m,rules:{validate:x?j:E},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,label:a("notification.email.from"),error:!!p.errors[t.name],helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,J.jsx)(Ue.Qr,{name:"host",control:m,rules:{validate:x?C:E},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.host"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,J.jsx)(Ue.Qr,{name:"port",control:m,rules:{validate:x?k:E},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,type:"number",error:!!p.errors[t.name],label:a("notification.email.port"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,J.jsx)(Ue.Qr,{name:"user",control:m,rules:{validate:x?w:E},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.user"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,J.jsx)(Ue.Qr,{name:"password",control:m,rules:{validate:x?S:E},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,type:"password",error:!!p.errors[t.name],label:a("notification.email.password"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,J.jsx)(Ue.Qr,{name:"secure",control:m,rules:{validate:E},render:e=>{let{field:n}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(be.Z,{control:(0,J.jsx)(T.Z,{checked:n.value,...n,disabled:!x}),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,J.jsx)(A.Z,{variant:"outlined",color:"warning",onClick:d(Z),sx:{mr:2},disabled:!x,children:a("oauth.runTest")}),(0,J.jsx)(A.Z,{type:"submit",variant:"contained",disabled:!p.isDirty,children:a("oauth.save")})]}),r]})},en=[{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];const nn=function(){const[e,n]=(0,o.useState)(en[0].value),{t:t}=(0,o.useContext)(y.RD),i=(0,Ne.Z)((()=>({email:(0,J.jsx)($e,{}),more:(0,J.jsx)(u.Z,{children:(0,J.jsx)(Ae.Z,{children:t("notification.comingSoon")})})})),[t]);return(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(C.Z,{tabs:en,current:e,onChange:n}),(0,J.jsx)(u.Z,{marginTop:"10px",children:i[e]})]})};var tn=t(75239),on=t(48342),an=t(94552),ln=t(24558),rn=t(74286),sn=t(76667),cn=t(70648),dn=t(44067),mn=t(7664),un=t(44123),pn=t(53906);const hn=[{value:m.WHO_CAN_ACCESS.ALL,icon:pn.Z,title:{zh:"\u6240\u6709\u4eba\u53ef\u8bbf\u95ee",en:"Accessible to all"},description:{zh:"\u5411\u6240\u6709\u4eba\u5f00\u653e\uff0c\u65e0\u9700\u901a\u884c\u8bc1\u5373\u53ef\u8bbf\u95ee\u5e94\u7528",en:"Open to the world anyone can access without passport"}},{value:m.WHO_CAN_ACCESS.INVITED,icon:un.Z,title:{zh:"\u53ea\u6709\u88ab\u9080\u8bf7\u7684\u4eba\u53ef\u4ee5\u8bbf\u95ee",en:"Only invited people can access"},description:{zh:"\u7a0d\u540e\u60a8\u53ef\u4ee5\u5728\u7ba1\u7406\u9875\u9762\u4e2d\u9080\u8bf7\u6210\u5458",en:"You can invite members later in the admin page"}},{value:m.WHO_CAN_ACCESS.OWNER,icon:mn.Z,title:{zh:"\u53ea\u6709\u5e94\u7528\u6240\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee",en:"Only Owner of the blocklet can access"},description:{zh:"\u5fc5\u987b\u63d0\u4f9b\u6240\u6709\u8005\u901a\u884c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5e94\u7528",en:"You must provide owner passport to access this application"}}];var fn,gn;const xn="roles",bn=[...hn,{value:xn,icon:cn.Z,title:{zh:"\u6307\u5b9a\u901a\u884c\u8bc1\u53ef\u8bbf\u95ee",en:"Accessible to selected passports"},description:{zh:"\u53ea\u6709\u6307\u5b9a\u7684\u901a\u884c\u8bc1\u53ef\u4ee5\u8bbf\u95ee",en:"Only specified passports can access"}}],vn=(e,n)=>{if(e&&e.startsWith(m.WHO_CAN_ACCESS_PREFIX_ROLES)){const t=(0,k.getRolesFromAuthConfig)({whoCanAccess:e}),i=n.filter((e=>t.includes(e.name)));return{access:xn,roles:i}}return{access:e,roles:[]}},Zn=function(e,n){let{roles:t=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(e.configs||[]).find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO));if(i)return vn(i.value,t);if(n&&L()(n,"settings.whoCanAccess")&&L()(n,"settings.whoCanAccess")!==m.WHO_CAN_ACCESS.ALL)return vn(L()(n,"settings.whoCanAccess"),t);const o=(0,k.findServiceFromMeta)(e.meta,m.NODE_SERVICES.AUTH);return L()(o,"config.whoCanAccess")?vn(o.config.whoCanAccess,t):{access:m.WHO_CAN_ACCESS.ALL,roles:[]}};function jn(e){let{blocklet:n,ancestors:t,children:i}=e;const a=(0,G.Z)(),[l,r]=(0,o.useState)(""),{t:s,locale:c}=(0,y.PE)(),{api:d}=(0,ne.h6)(),{roles:p}=(0,je.DJ)(),[h,f]=(0,o.useState)(""),g=t[0]||n,{access:x,roles:b}=Zn(n,g,{roles:p}),[v,Z]=(0,o.useState)(x),[j,C]=(0,o.useState)(b),w=[...t.map((e=>e.meta.did)),n.meta.did],S={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:a.palette.text.secondary},E=t.concat(n).map((e=>(0,k.getDisplayName)(e,!0))).join(" / ");if((0,te.wS)(n.status))return null;if("unknown"===n.status&&(0,te.wS)(n.status))return null;const L=()=>{r(!1)},P=e=>{e.stopPropagation(),r(!0)},R=h||v===xn&&!j.length;return["function"===typeof i?i({open:P}):(0,J.jsx)(U.Z,{onClick:P,"data-cy":"action-config-component",children:(0,J.jsx)(sn.default,{})}),l&&(0,J.jsxs)(yn,{open:!0,fullWidth:!0,title:E,onClose:L,PaperProps:{style:{minHeight:"auto"}},actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(A.Z,{onClick:L,color:"inherit","data-cy":"config-access-cancel",children:s("common.cancel")}),(0,J.jsxs)(A.Z,{onClick:async()=>{if(!h){f(!0);try{let e=v;e===xn&&(e="".concat(m.WHO_CAN_ACCESS_PREFIX_ROLES).concat(j.map((e=>e.name)).join(","))),await d.updateWhoCanAccess({input:{did:w,whoCanAccess:e}}),I.Z.success(s("blocklet.config.access.updatedTip")),L(),f(!1)}catch(e){f(!1),I.Z.error((0,te.Z)(e))}}},color:"primary",disabled:R,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[h&&(0,J.jsx)(B.Z,{size:16}),s("common.confirm")]})]}),children:[(0,J.jsx)(u.Z,{mt:4,mb:3,children:(0,J.jsx)(Oe.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:v,onChange:e=>{const{value:n}=e.target;Z(n)},"data-cy":"config-access-select",SelectProps:{renderValue:e=>{const n=bn.find((n=>n.value===e));return n?(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(n.icon,{style:S}),n.title[c]]}):null}},children:bn.map((e=>(0,J.jsxs)(Cn,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center",children:[(0,J.jsx)(e.icon,{style:S}),(0,J.jsx)(u.Z,{children:e.title[c]})]}),(0,J.jsx)(u.Z,{children:(0,J.jsx)(u.Z,{className:"tip",children:e.description[c]})})]})))})}),v===xn&&(0,J.jsx)(u.Z,{mt:4,mb:3,children:(0,J.jsx)(Oe.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:j.map((e=>e.name)),onChange:e=>{C(p.filter((n=>(e.target.value||[]).includes(n.name))))},SelectProps:{multiple:!0,renderValue:e=>(0,J.jsx)(u.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((e=>{const n=p.find((n=>n.name===e));return(0,J.jsx)(q.Z,{label:n.title},n.text)}))})},children:p.map((e=>{let{name:n,title:t}=e;return(0,J.jsxs)(K.Z,{value:n,children:[(0,J.jsx)(ve.Z,{checked:j.some((e=>e.name===n))}),(0,J.jsx)(dn.Z,{primary:t})]},n)}))})})]})]}jn.propTypes={blocklet:r().object.isRequired,ancestors:r().array,children:r().any},jn.defaultProps={ancestors:[],children:null};const yn=(0,a.Z)(he.ZP)(fn||(fn=(0,i.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"]))),Cn=(0,a.Z)(K.Z)(gn||(gn=(0,i.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(e=>e.theme.palette.text.secondary));var kn;function wn(e){var n;let{blocklet:t,ancestors:i,depth:a}=e;const l=(0,G.Z)(),{t:r,locale:s}=(0,y.PE)(),{roles:c}=(0,je.DJ)(),[d,m]=(0,o.useState)(!0),{recommendedDomain:p}=(0,de.y0)(),h=i[0]||t,f="/".concat(i.map((e=>e.mountPoint||"/")).join("/"),"/").concat(t.mountPoint||"/").replace(/\/+/g,"/"),g=(0,te.vH)({blocklet:h,domain:{value:p},mountPoint:f,params:(0,te.f0)(h,s)}),x={fill:l.palette.text.secondary},b=a>0&&t.children.length>0,j=(0,J.jsx)(U.Z,{size:"small",children:d?(0,J.jsx)(Z.Z,{fontSize:"inherit"}):(0,J.jsx)(v.default,{fontSize:"inherit"})}),{access:C,roles:S}=Zn(t,h,{roles:c});let E;if("roles"!==C)E=hn.find((e=>e.value===C))||hn[2];else{const e=S.map((e=>e.title)).join("/");E={title:{zh:"\u53ea\u6709 ".concat(e," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(e," can access")}}}return[(a>0||"gateway"!==t.meta.group)&&(0,J.jsxs)(u.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,J.jsxs)(u.Z,{pl:Math.max(2*(a-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:b?"pointer":"cursor"},onClick:()=>b&&m(!d),children:[b?j:(0,J.jsx)(u.Z,{width:28}),(0,J.jsx)(w.Z,{blocklet:t,ancestors:i}),(0,J.jsxs)(u.Z,{ml:"16px",children:[(0,J.jsx)(u.Z,{style:{color:"#222",fontSize:18},children:(0,k.getDisplayName)(t,!0)}),(0,J.jsx)(u.Z,{display:"flex",alignItems:"center",children:(0,J.jsx)(u.Z,{color:"text.secondary",children:E.title[s]})})]})]},t),(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(tn.Z,{title:r("common.visit"),children:(0,J.jsx)("a",{target:"_blank",href:g,rel:"noopener noreferrer",title:g,children:(0,J.jsx)(U.Z,{children:(0,J.jsx)(an.Z,{})})})}),(0,J.jsx)(jn,{blocklet:t,ancestors:i,children:e=>{let{open:n}=e;return(0,J.jsx)(tn.Z,{title:r("common.edit"),children:(0,J.jsx)(U.Z,{onClick:n,"data-cy":"btn-edit-".concat(t.meta.did),children:(0,J.jsx)(ln.Z,{style:x})})})}})]},"actions")]},"group-not-gateway-box"),(0,J.jsx)(rn.Z,{depth:a},"line"),null!==(n=t.children)&&void 0!==n&&n.length?(0,J.jsx)(on.Z,{in:d,children:t.children.map((e=>(0,J.jsx)(wn,{blocklet:e,ancestors:[...i,t],depth:a+1},"".concat(a+1,"-").concat(e.meta.did))))},"blocklet-collapse"):null]}function Sn(){const{t:e}=(0,y.PE)(),{blocklet:n}=(0,de.y0)(),t=[...n.children]||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,J.jsx)(En,{component:"div",children:t&&t.length?[(0,J.jsx)(u.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,J.jsx)(wn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,J.jsx)(u.Z,{mt:8,children:(0,J.jsx)(Ae.Z,{children:e("blocklet.component.noComponent")})})})}wn.propTypes={blocklet:r().object.isRequired,ancestors:r().array,depth:r().number},wn.defaultProps={ancestors:[],depth:0},Sn.propTypes={};const En=(0,a.Z)(u.Z)(kn||(kn=(0,i.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n &.first {\n margin-top: 0;\n }\n }\n"])),(e=>e.theme.spacing(5)),(e=>e.theme.spacing(3)));var Ln=t(56556),Pn=t(44784);const Rn=function(){var e,n,t;const{api:i}=(0,ne.h6)(),{blocklet:o}=(0,de.y0)(),{t:a}=(0,y.PE)(),l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),{handleSubmit:s,control:c,formState:d,watch:m,reset:p}=(0,Ue.cI)({defaultValues:Be()(r,["domain","clientId","enabled"])}),h=m("enabled"),f=(0,De.Z)((async e=>{try{var n,t;const{blocklet:o}=await i.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:e})}}),r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{});p(r),I.Z.success(a("oauth.saveSuccess"))}catch(o){I.Z.error(o.message||a("oauth.saveFailed"))}})),g=(0,De.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe"))),x=(0,De.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe"))),b=(0,De.Z)((()=>!0));return(0,J.jsx)(u.Z,{children:(0,J.jsxs)("form",{onSubmit:s(f),disabled:!0,children:[(0,J.jsx)(Ue.Qr,{name:"enabled",control:c,render:e=>{let{field:n}=e;return(0,J.jsx)(be.Z,{control:(0,J.jsx)(Pn.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,J.jsx)(Ue.Qr,{name:"domain",control:c,rules:{validate:h?g:b},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,label:a("oauth.auth0.domain"),error:!!d.errors[t.name],helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,J.jsx)(Ue.Qr,{name:"clientId",control:c,rules:{validate:h?x:b},render:e=>{var n;let{field:t}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,children:(0,J.jsx)(Oe.Z,{...t,error:!!d.errors[t.name],label:a("oauth.auth0.clientId"),helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,J.jsx)(Ln.Z,{type:"submit",variant:"contained",onSubmit:s(f),disabled:!d.isDirty,children:a("oauth.save")})]})})};var Tn=t(77150),_n=t(24103);const An={ttl:604800};function Nn(e){const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return{...e,ttl:n}}function On(){var e,n;const{api:t}=(0,ne.h6)(),{blocklet:i}=(0,de.y0)(),o=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({},An,(null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{}),{handleSubmit:l,control:r,formState:s,reset:c}=(0,Ue.cI)({defaultValues:Be()(Nn(a),["ttl"])}),{t:d}=(0,y.PE)(),m=(0,De.Z)((async e=>{try{var n;const{blocklet:i}=await t.updateAppSessionConfig({input:{did:o,config:Nn(e,!0)}}),a=Object.assign({},An,Be()((null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{},["ttl"]));c(Nn(a)),I.Z.success(d("common.configSuccess"))}catch(i){I.Z.error(i.message)}}));return(0,J.jsx)(u.Z,{children:(0,J.jsxs)("form",{onSubmit:l(m),disabled:!0,children:[(0,J.jsx)(Ue.Qr,{name:"ttl",control:r,render:e=>{let{field:n}=e;return(0,J.jsx)(Ie.Z,{fullWidth:!0,sx:{mb:2},children:(0,J.jsxs)(_n.Z,{px:3,children:[(0,J.jsx)(u.Z,{mx:-3,my:.5,children:d("blocklet.config.session.ttl",{day:n.value})}),(0,J.jsx)(Tn.ZP,{...n,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}})]})})}}),(0,J.jsx)(Ln.Z,{type:"submit",variant:"contained",onSubmit:l(m),disabled:!s.isDirty,children:d("oauth.save")})]})})}var In=t(82555),Fn=t(30333),Bn=t(75760),zn=t(97038),Dn=t(64886),Un=t(42080),Kn=t.n(Un),Wn=t(75506),qn=t.n(Wn),Gn=t(47685),Vn=t(13260),Hn=t(82434),Mn=t.n(Hn);const Yn=(0,o.forwardRef)(((e,n)=>{var t,i;const{t:a}=(0,o.useContext)(y.RD),{blocklet:l}=(0,de.y0)(),{api:r}=(0,ne.h6)(),s=(0,ze.Z)({mode:"view",show:!1,data:{},callback:Ye()}),c=(0,Gn.Fg)(),m=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,p=(0,De.Z)((()=>{s.mode="view",s.data={},s.callback=Ye()}),[]),h=(0,De.Z)((()=>{s.show=!1,setTimeout((()=>{p()}),m)}),[]),f=(0,De.Z)((e=>{s.mode="view",s.show=!0,s.data=e}),[]),g=(0,De.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ye();s.mode="approve",s.show=!0,s.data=e,s.callback=n}),[]);(0,o.useImperativeHandle)(n,(()=>({open:f,close:h,approve:g})),[f,h,g]);const x=(0,Ne.Z)((()=>{if(!s.show)return[];s.data.migratedFrom=[s.data.appId,s.data.appPid];const e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==s.data.isMaster&&Kn()(e,"appliedAt","status"),e.map((e=>{const n=a("federated.info.".concat(e));let t=s.data[e];if("appName"===e&&s.data.isMaster&&(t=(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(In.Z,{component:Fn.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,J.jsx)(Vn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,J.jsx)(u.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){const e=Mn()(t)?t:d()(s.data.appUrl||"",t||"");try{const n=new URL(e);n.searchParams.set("imageFilter","resize"),n.searchParams.set("w","80"),n.searchParams.set("h","80"),t=(0,J.jsx)("img",{src:n.href,width:"60",height:"60",alt:s.data.appName})}catch{t=(0,J.jsx)("img",{src:e,width:"60",height:"60",alt:s.data.appName})}}if("status"===e&&(t=t&&a("federated.status.".concat(t))),"migratedFrom"===e){t=(s.data.migratedFrom||[]).filter((e=>![s.data.appId,s.data.appPid].includes(e))).map((e=>(0,J.jsx)(Vn.kL,{children:e})))}return qn()(t)&&(t="-"),{name:n,value:t}}))}),[s.data]),b="approve"===s.mode,v=(0,De.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"rejected"}}),h(),null===s||void 0===s||s.callback(!1)})),Z=(0,De.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"approved"}}),h(),null===s||void 0===s||s.callback(!0)}));return(0,J.jsx)(he.ZP,{open:s.show,title:a(b?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:h,actions:b?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ln.Z,{color:"error",variant:"contained",onClick:v,children:a("common.reject")}),(0,J.jsx)(Ln.Z,{variant:"contained",onClick:Z,children:a("common.approve")})]}):(0,J.jsx)(Ln.Z,{variant:"outlined",onClick:h,children:a("common.close")}),children:x.map((e=>(0,J.jsx)(Dn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)))})}));var Jn=t(79842),Qn=t(85408),Xn=t.n(Qn);const $n=(0,o.forwardRef)(((e,n)=>{var t,i;const a=(0,Gn.Fg)(),l=(null===a||void 0===a||null===(t=a.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,{t:r}=(0,o.useContext)(y.RD),s=(0,ze.Z)({show:!1,data:{link:""}}),c=(0,De.Z)((()=>{s.data.link=""}),[]),d=(0,De.Z)((()=>{s.show=!1,setTimeout((()=>{c()}),l)}),[]),m=(0,De.Z)((e=>{let{link:n}=e;s.show=!0,s.data.link=n}),[]);(0,o.useImperativeHandle)(n,(()=>({open:m,close:d})),[m,d]);const p=(0,De.Z)((()=>{Xn()(s.data.link),d()}),[d]);return(0,J.jsxs)(he.ZP,{open:s.show,title:r("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,J.jsx)(A.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:p,children:r("common.copyAndClose")}),children:[(0,J.jsx)(u.Z,{mb:1,children:r("federated.inviteJoinFederatedLoginDescription")}),(0,J.jsx)(u.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,J.jsx)(Jn.Z,{language:"shell",style:{marginBottom:0},children:s.data.link})})]})}));function et(e){var n,t,i,a,l;let{mode:r}=e;const s=(0,o.useRef)(null),c=(0,o.useRef)(null),{t:d,locale:m}=(0,o.useContext)(y.RD),{blocklet:p,actions:{refreshBlocklet:h}}=(0,de.y0)(),{confirmApi:f,confirmHolder:g}=Qe(),{api:x}=(0,ne.h6)(),b=(null===(n=p.settings.federated)||void 0===n?void 0:n.sites)||[],v=(null===(t=p.settings.federated)||void 0===t?void 0:t.config)||{},Z=!1!==v.isMaster,j=(0,De.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.open(e)})),C=(0,De.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.approve(e,h)})),k=(0,De.Z)((e=>{f.open({title:d("federated.disableFederatedLogin"),content:d("federated.disableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"revoked"}}),n()}})})),w=(0,De.Z)((e=>{f.open({title:d("federated.enableFederatedLogin"),content:d("federated.enableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"approved"}}),n()}})})),S=(0,Ne.Z)((()=>{const e=[{label:d("common.name"),name:"appName",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,J.jsx)(u.Z,{display:"inline-block",children:(0,J.jsxs)(u.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:e=>{e.stopPropagation()},children:[t&&(0,J.jsx)(In.Z,{component:Fn.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:d("common.did"),name:"appId",options:{customBodyRenderLite:e=>{const n=b[e];return(0,J.jsx)(zn.Z,{children:n.appId})}}},{label:d("common.status"),name:"status",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,J.jsx)(u.Z,{children:t?"-":d("federated.status.".concat(n.status))})}}}];return Z&&e.push({label:d("common.actions"),name:"actions",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,J.jsx)(u.Z,{display:"flex",gap:1,children:t?(0,J.jsxs)(J.Fragment,{children:["rejected"===n.status&&(0,J.jsx)(A.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation()},children:d("federated.status.rejected")}),"revoked"===n.status&&(0,J.jsx)(A.Z,{variant:"contained",color:"secondary",size:"small",onClick:e=>{e.stopPropagation()},children:d("federated.status.revoked")})]}):(0,J.jsxs)(J.Fragment,{children:["pending"===n.status&&(0,J.jsx)(A.Z,{variant:"contained",color:"primary",size:"small",onClick:e=>{e.stopPropagation(),C(n)},children:d("federated.status.pending")}),"approved"===n.status&&(0,J.jsx)(A.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation(),k(n)},style:{whiteSpace:"nowrap"},children:d("federated.revoke")}),"revoked"===n.status&&(0,J.jsx)(A.Z,{variant:"contained",color:"warning",size:"small",onClick:e=>{e.stopPropagation(),w(n)},style:{whiteSpace:"nowrap"},children:d("federated.approve")})]})})}}}),e}),[v.appId,b,Z,d]),E=(0,Ne.Z)((()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n){let{dataIndex:t}=n;const i=b[t];j(i)}})),[]),L=(0,De.Z)((()=>{const e=p.environments.find((e=>e.key===O.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL));var n;null!==e&&void 0!==e&&e.value?null===(n=s.current)||void 0===n||n.open({link:e.value}):I.Z.error(d("federated.failedToGetFederatedLoginLink"))}),[null===(i=p.site)||void 0===i||null===(a=i.domainAliases)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.href]),P=(0,De.Z)((()=>{f.open({title:d("federated.quitFederatedLogin"),content:d("federated.quitFederatedLoginDescription"),async onConfirm(e){await x.quitFederatedLogin({input:{did:p.appPid}}),e()}})})),R=(0,De.Z)((()=>{f.open({title:d("federated.disbandFederatedLogin"),content:d("federated.disbandFederatedLoginDescription"),async onConfirm(e){await x.disbandFederatedLogin({input:{did:p.appPid}}),e()}})})),T=[];return"master"!==r?T.push((0,J.jsx)(A.Z,{size:"small",variant:"contained",color:"error",onClick:P,sx:{ml:1},children:d("federated.quitFederatedLogin")},"quitFederatedLogin")):(T.push((0,J.jsx)(A.Z,{size:"small",variant:"contained",onClick:L,sx:{ml:1},children:d("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),T.push((0,J.jsx)(A.Z,{color:"error",size:"small",variant:"contained",onClick:R,sx:{ml:1},children:d("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Bn.Z,{className:"main-table",locale:m,data:b,columns:S,customButtons:T,title:(0,J.jsx)(u.Z,{className:"table-toolbar-left",children:d("oauth.federated")}),options:E}),g,(0,J.jsx)($n,{ref:s}),(0,J.jsx)(Yn,{ref:c})]})}et.propTypes={mode:r().oneOf(["member","master"])},et.defaultProps={mode:"member"};const nt=et,tt=(0,o.forwardRef)(((e,n)=>{var t,i;const{t:a}=(0,o.useContext)(y.RD),{api:l}=(0,ne.h6)(),{blocklet:r}=(0,de.y0)(),s=null===r||void 0===r?void 0:r.appPid,c=(0,Gn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,m=(0,ze.Z)({show:!1,appUrl:"",appUrlError:"",callback:Ye()}),p=(0,De.Z)((()=>{m.appUrl="",m.appUrlError="",m.callback=Ye()}),[]),h=(0,De.Z)((()=>{m.show=!1,setTimeout((()=>{p()}),d)}),[]),f=(0,De.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ye();m.show=!0,m.callback=e}),[]);(0,o.useImperativeHandle)(n,(()=>({open:f,close:h})),[f,h]);const g=(0,De.Z)((e=>{if(!e)throw new Error(a("federated.federatedJoinAppUrlRequired"));if(!Mn()(e))throw new Error(a("federated.federatedJoinAppUrlInvalid"))})),x=(0,De.Z)((async()=>{try{g(m.appUrl);const e=await l.joinFederatedLogin({input:{did:s,appUrl:m.appUrl}});m.show=!1,h(),null===m||void 0===m||m.callback(e)}catch(e){m.appUrlError=e.message}}),[h,s]);return(0,J.jsxs)(he.ZP,{open:m.show,title:a("federated.joinFederatedLogin"),onClose:h,PaperProps:{style:{minHeight:"unset"}},actions:(0,J.jsx)(A.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,children:a("common.confirm")}),children:[(0,J.jsx)(u.Z,{mb:1,children:a("federated.joinFederatedLoginDescription")}),(0,J.jsx)(Oe.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:a("federated.federatedJoinAppUrl"),label:a("federated.federatedJoinAppUrl"),value:m.appUrl,error:!!m.appUrlError,helperText:m.appUrlError||"eg: https://www.arcblock.io",onChange:e=>{m.appUrl=e.target.value}})]})}));function it(){var e,n,t,i;const a=(0,o.useRef)(null),l=(0,o.useRef)(null),{t:r}=(0,o.useContext)(y.RD),{blocklet:s,actions:{refreshBlocklet:c}}=(0,de.y0)(),d=(0,De.Z)((()=>{var e,n,t;const i=null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href;if(i)try{var o;const e=new URL(i);null===(o=a.current)||void 0===o||o.open({link:e.origin})}catch{I.Z.error(r("federated.failedToGetFederatedLoginLink"))}}),[null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href]),m=(0,De.Z)((()=>{var e;null===(e=l.current)||void 0===e||e.open((()=>{c()}))}),[c]);if((null===(i=s.settings.federated)||void 0===i?void 0:i.sites.length)>0){var p;const e=!1!==(null===(p=s.settings.federated)||void 0===p?void 0:p.config.isMaster);return(0,J.jsx)(nt,{mode:e?"master":"member"})}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(u.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,J.jsx)(A.Z,{variant:"contained",onClick:d,children:r("federated.inviteJoinFederatedLogin")}),(0,J.jsx)(_.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,J.jsx)(A.Z,{variant:"outlined",onClick:m,children:r("federated.joinFederatedLogin")})]}),(0,J.jsx)($n,{ref:a}),(0,J.jsx)(tt,{ref:l})]})}const ot=function(){const{t:e}=(0,o.useContext)(y.RD),n=[{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,J.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],[t,i]=(0,o.useState)(n[0].value),a=(0,Ne.Z)((()=>({auth0:(0,J.jsx)(Rn,{}),federated:(0,J.jsx)(it,{}),more:(0,J.jsx)(u.Z,{children:(0,J.jsx)(Ae.Z,{children:e("oauth.comingSoon")})}),settings:(0,J.jsx)(u.Z,{children:(0,J.jsx)(On,{})})})),[e]);return(0,J.jsxs)(u.Z,{children:[(0,J.jsx)(C.Z,{tabs:n,current:t,onChange:i}),(0,J.jsx)(u.Z,{marginTop:"10px",children:a[t]})]})};var at;const lt=e=>{let{tabs:n,blocklet:t,ancestors:i=[],depth:o=1,t:a}=e;const l=[...i.map((e=>e.meta.did)),t.meta.did].join("/"),r=!(null!==i&&void 0!==i&&i.length);n.push({label:(0,J.jsxs)(u.Z,{pl:2*Math.max(1,o-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[r?(0,J.jsx)(S.Z,{size:24,blocklet:t}):(0,J.jsx)(w.Z,{size:24,blocklet:t,ancestors:i}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:r?a("blocklet.component.container"):(0,k.getDisplayName)(t,!0)})})]},l),value:l}),t.children.length>0&&t.children.forEach((e=>{lt({tabs:n,blocklet:e,ancestors:[...i,t],depth:o+1,t:a})}))};function rt(e){let{blocklet:n,onUpdate:t,...i}=e;const{t:a}=(0,o.useContext)(y.RD),{info:l,inService:r}=(0,ne.h6)(),[c,k]=(0,o.useState)(!0),[w,S]=(0,j.useSearchParams)(),E=w.get("tab")||"general",L=[{label:(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,J.jsx)(h.Z,{sx:{fontSize:24}}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:a("common.general")})})]},"general"),value:"general"},{label:(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,J.jsx)(f.Z,{sx:{fontSize:24}}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:a("common.access")})})]},"access"),value:"access"},{label:(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,J.jsx)(g.Z,{sx:{fontSize:24}}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:a("common.login")})})]},"oauth"),value:"oauth"},{label:(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,J.jsx)(x.Z,{sx:{fontSize:24}}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:a("common.notification")})})]},"notification"),value:"notification"},{label:(0,J.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,J.jsx)(u.Z,{ml:-2,style:{transform:"translateY(2px)"},children:c?(0,J.jsx)(Z.Z,{fontSize:"inherit"}):(0,J.jsx)(v.default,{fontSize:"inherit"})}),(0,J.jsx)(b.Z,{sx:{fontSize:24}}),(0,J.jsx)(u.Z,{ml:"16px",children:(0,J.jsx)(u.Z,{style:{color:"#222"},children:a("common.preferences")})})]},"preference"),value:"preference"}];c&&lt({tabs:L,blocklet:n,t:a});let P=null;if("general"===E)P=(0,J.jsx)(Te,{blocklet:n,onUpdate:t});else if("access"===E)P=(0,J.jsx)(Sn,{});else if("oauth"===E)P=(0,J.jsx)(ot,{});else if("notification"===E)P=(0,J.jsx)(nn,{});else{const e=r?m.WELLKNOWN_SERVICE_PATH_PREFIX:l.routing.adminPath,n=new URLSearchParams;r||n.set("authKey","__sst"),n.set("schemaKey",d()(window.location.origin,e,"/api/preferences?id=".concat(encodeURIComponent(E)))),P=(0,J.jsx)(s.Z,{url:"".concat(d()(window.location.origin,e,"/hosted/form-collector/"),"?").concat(n.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,J.jsx)(st,{...i,children:(0,J.jsxs)(p.ZP,{container:!0,spacing:4,columns:24,children:[(0,J.jsx)(p.ZP,{item:!0,sm:7,md:5,children:(0,J.jsx)(C.Z,{tabs:L,current:E,orientation:"vertical",onChange:e=>{"preference"===e?k(!c):S((n=>("general"===e?n.delete("tab"):n.set("tab",e),n)))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,J.jsx)(p.ZP,{item:!0,sm:17,md:19,children:(0,J.jsx)(u.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:P})})]})})}rt.propTypes={blocklet:r().object.isRequired,onUpdate:r().func},rt.defaultProps={onUpdate:()=>{}};const st=a.Z.div(at||(at=(0,i.Z)(["\n .MuiTab-root {\n text-align: left;\n align-items: flex-start;\n font-weight: normal;\n }\n .Mui-selected {\n font-weight: bold;\n }\n"])))},78410:(e,n,t)=>{t.d(n,{Z:()=>u});var i=t(5057),o=t(86229),a=t(28726),l=t(44846),r=t(68420),s=t(14491),c=t(58238),d=t(70461),m=t(96266);function u(e){let{teamDid:n,size:t="small",...u}=e;const{t:p}=(0,r.PE)(),{api:h}=(0,c.h6)(),[f,g]=(0,i.useState)(!1),[x,b]=(0,i.useState)(null),v={title:p("blocklet.config.clearCache.title"),description:p("blocklet.config.clearCache.description"),confirm:p("common.confirm"),cancel:p("common.cancel"),onConfirm:async()=>{try{var e;g(!0);const t=await h.clearCache({input:{teamDid:n}});o.Z.success(p("blocklet.config.clearCache.success",{count:(null===(e=t.removed)||void 0===e?void 0:e.length)||0}))}catch(t){o.Z.error((0,s.Z)(t))}finally{g(!1),b(null)}},onCancel:()=>{g(!1),b(null)}};return(0,m.jsxs)("div",{...u,children:[(0,m.jsxs)(a.Z,{onClick:()=>b(v),color:"error",variant:"outlined",size:t,children:[f?(0,m.jsx)(l.Z,{size:16,style:{marginRight:5}}):null,p("blocklet.config.clearCache.action")]}),x&&(0,m.jsx)(d.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}},50185:(e,n,t)=>{t.d(n,{Z:()=>c});var i=t(5057),o=t(55898),a=t.n(o),l=t(12937),r=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:o}=(0,i.useContext)(r.RD);return(0,s.jsx)(l.Z,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...t,children:n})}c.propTypes={children:a().any.isRequired}},28641:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(39948),r=t(47020),s=t(44846),c=t(13727),d=t(56184),m=t(67680),u=t(35406),p=t(11875),h=t(95890),f=t(96266);const g=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function x(e){let{label:n,disabled:t,required:o,initialValue:a,onChange:x,placeholder:b,style:v,onSubmit:Z,secure:j,triggers:y,formatterBeforeSubmit:C,...k}=e;const[w,S]=(0,i.useState)(!1),[E,L]=(0,i.useState)(!1),[P,R]=(0,i.useState)(j&&"__encrypted__"===a?null:a),[T,_]=(0,i.useState)(P),A=async()=>{L(!0);try{if(!1===await Z(T))_(P);else{let e=T;"function"===typeof C&&(e=C(T)),_(e),R(e)}}catch(e){_(P)}finally{L(!1),S(!1)}},N=w?(0,f.jsx)(r.Z,{style:{flex:1},fullWidth:!0,value:T,onChange:e=>{var n;n=e.target.value,_(n),x(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:b,onKeyDown:e=>{"Enter"===e.key&&A()},disabled:t,type:j?"password":"text",...k}):(0,f.jsx)(l.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:g(T,j,a)});return(0,f.jsx)(p.Z,{className:"form",style:v,children:(0,f.jsxs)(l.Z,{className:"form-item",children:[(0,f.jsxs)(l.Z,{className:"form-item-label",children:[n,o&&(0,f.jsx)(u.Z,{})]}),(0,f.jsxs)(l.Z,{className:"form-item-body",children:[(0,f.jsx)(l.Z,{className:"form-item-input",children:N}),(0,f.jsx)(l.Z,{className:"form-item-action",children:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-confirm",onClick:A,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(P),S(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.default,{})})]}):(0,f.jsx)(h.Z,{triggers:y,onEnterEdit:()=>S(!0),disabled:t})})]})]})})}x.propTypes={style:a().object,onSubmit:a().func,onChange:a().func,label:a().string,initialValue:a().string,placeholder:a().string,required:a().bool,disabled:a().bool,secure:a().bool,triggers:a().array,formatterBeforeSubmit:a().func},x.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{t.d(n,{Z:()=>r});var i,o=t(71171),a=t(33518),l=t(39948);const r=(0,a.Z)(l.Z)(i||(i=(0,o.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},95890:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(24558),r=t(67680),s=t(56556),c=t(49127),d=t(49390),m=t(37200),u=t(25228),p=t(24202),h=t(74490),f=t(1733),g=t(96266);function x(e){let{triggers:n,onEnterEdit:t,disabled:o}=e;const a=i.useRef(null),[x,b]=i.useState(!1);return 0===n.length?(0,g.jsx)(r.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(c.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}),(0,g.jsx)(s.Z,{size:"small","aria-controls":x?"split-button-menu":void 0,"aria-expanded":x?"true":void 0,onClick:()=>{b((e=>!e))},children:(0,g.jsx)(d.Z,{})})]}),(0,g.jsx)(p.Z,{sx:{zIndex:9999},open:x,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(u.Z,{children:(0,g.jsx)(m.d,{onClickAway:e=>{a.current&&a.current.contains(e.target)||b(!1)},children:(0,g.jsx)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,g.jsx)(h.Z,{onClick:()=>{return n=e.handler,b(!1),void n();var n},children:e.title},e.key)))})})})})]})}x.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},x.defaultProps={triggers:[]}},35406:(e,n,t)=>{t.d(n,{Z:()=>a});var i,o=t(71171);const a=t(33518).Z.span(i||(i=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},54063:(e,n,t)=>{t.d(n,{C:()=>i});const i="true"===localStorage.getItem("enableDebug")}}]);