@next-bricks/form-platform 0.4.0 → 0.4.1
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/dist/bricks.json +1 -1
- package/dist/chunks/1045.4edb55a1.js +2 -0
- package/dist/chunks/1045.4edb55a1.js.map +1 -0
- package/dist/chunks/1122.fa9a5c27.js +2 -0
- package/dist/chunks/1122.fa9a5c27.js.map +1 -0
- package/dist/chunks/114.47cdbefe.js +2 -0
- package/dist/chunks/114.47cdbefe.js.map +1 -0
- package/dist/chunks/1370.237efa45.js +2 -0
- package/dist/chunks/1370.237efa45.js.map +1 -0
- package/dist/chunks/1889.a2a83a9a.js +2 -0
- package/dist/chunks/{1889.2fbcb228.js.map → 1889.a2a83a9a.js.map} +1 -1
- package/dist/chunks/1940.9f0372a4.js +2 -0
- package/dist/chunks/1940.9f0372a4.js.map +1 -0
- package/dist/chunks/2052.22b87711.js +2 -0
- package/dist/chunks/{2052.e16f99fc.js.map → 2052.22b87711.js.map} +1 -1
- package/dist/chunks/2277.15e597c9.js +2 -0
- package/dist/chunks/2277.15e597c9.js.map +1 -0
- package/dist/chunks/2512.816c82eb.js +3 -0
- package/dist/chunks/2512.816c82eb.js.map +1 -0
- package/dist/chunks/3144.bf8c8136.js +3 -0
- package/dist/chunks/{3144.f2df7ec8.js.map → 3144.bf8c8136.js.map} +1 -1
- package/dist/chunks/3171.fee0d854.js +2 -0
- package/dist/chunks/3171.fee0d854.js.map +1 -0
- package/dist/chunks/3214.e9940a98.js +3 -0
- package/dist/chunks/3214.e9940a98.js.map +1 -0
- package/dist/chunks/3426.21c50f9e.js +2 -0
- package/dist/chunks/3426.21c50f9e.js.map +1 -0
- package/dist/chunks/3933.92e3dfd1.js +2 -0
- package/dist/chunks/3933.92e3dfd1.js.map +1 -0
- package/dist/chunks/4041.0a734a15.js +3 -0
- package/dist/chunks/{4041.fa6f3b31.js.map → 4041.0a734a15.js.map} +1 -1
- package/dist/chunks/4310.620e241f.js +3 -0
- package/dist/chunks/{4310.4736ad91.js.map → 4310.620e241f.js.map} +1 -1
- package/dist/chunks/4658.1be7814a.js +2 -0
- package/dist/chunks/4658.1be7814a.js.map +1 -0
- package/dist/chunks/4741.f8813a01.js +2 -0
- package/dist/chunks/{4741.458ddf99.js.map → 4741.f8813a01.js.map} +1 -1
- package/dist/chunks/5250.b18e2eb5.js +3 -0
- package/dist/chunks/{5250.5dff32d0.js.map → 5250.b18e2eb5.js.map} +1 -1
- package/dist/chunks/5384.9178beda.js +2 -0
- package/dist/chunks/{5384.2a1e79e1.js.map → 5384.9178beda.js.map} +1 -1
- package/dist/chunks/5399.4b060ed6.js +2 -0
- package/dist/chunks/5399.4b060ed6.js.map +1 -0
- package/dist/chunks/5552.6128fa5a.js +2 -0
- package/dist/chunks/5552.6128fa5a.js.map +1 -0
- package/dist/chunks/6314.b5b44211.js +2 -0
- package/dist/chunks/6314.b5b44211.js.map +1 -0
- package/dist/chunks/6519.d4fab4fd.js +2 -0
- package/dist/chunks/6519.d4fab4fd.js.map +1 -0
- package/dist/chunks/6773.ddb8f6f4.js +2 -0
- package/dist/chunks/{6773.f97328dd.js.map → 6773.ddb8f6f4.js.map} +1 -1
- package/dist/chunks/7041.3cd44633.js +3 -0
- package/dist/chunks/7041.3cd44633.js.LICENSE.txt +1 -0
- package/dist/chunks/7041.3cd44633.js.map +1 -0
- package/dist/chunks/7087.b07038c7.js +2 -0
- package/dist/chunks/7087.b07038c7.js.map +1 -0
- package/dist/chunks/726.66d9e157.js +2 -0
- package/dist/chunks/{726.e07694dc.js.map → 726.66d9e157.js.map} +1 -1
- package/dist/chunks/7721.ff633403.js +3 -0
- package/dist/chunks/{7721.5fec8155.js.map → 7721.ff633403.js.map} +1 -1
- package/dist/chunks/7733.0244a393.js +2 -0
- package/dist/chunks/7733.0244a393.js.map +1 -0
- package/dist/chunks/843.194a6c9c.js +2 -0
- package/dist/chunks/{843.eb424dd9.js.map → 843.194a6c9c.js.map} +1 -1
- package/dist/chunks/871.3ffcf34b.js +2 -0
- package/dist/chunks/871.3ffcf34b.js.map +1 -0
- package/dist/chunks/8989.e1f256ba.js +2 -0
- package/dist/chunks/8989.e1f256ba.js.map +1 -0
- package/dist/chunks/9515.4fbf1755.js +2 -0
- package/dist/chunks/{9515.e79131dc.js.map → 9515.4fbf1755.js.map} +1 -1
- package/dist/chunks/9559.173de377.js +2 -0
- package/dist/chunks/9559.173de377.js.map +1 -0
- package/dist/chunks/9844.72d6bae1.js +2 -0
- package/dist/chunks/{9844.8f6ee168.js.map → 9844.72d6bae1.js.map} +1 -1
- package/dist/chunks/eo-user-or-user-group-select.b4422dab.js +3 -0
- package/dist/chunks/eo-user-or-user-group-select.b4422dab.js.map +1 -0
- package/dist/chunks/main.118b1696.js +2 -0
- package/dist/chunks/main.118b1696.js.map +1 -0
- package/dist/index.750c107c.js +2 -0
- package/dist/index.750c107c.js.map +1 -0
- package/package.json +4 -4
- package/dist/chunks/1045.67fee621.js +0 -2
- package/dist/chunks/1045.67fee621.js.map +0 -1
- package/dist/chunks/1122.f0d01b4d.js +0 -2
- package/dist/chunks/1122.f0d01b4d.js.map +0 -1
- package/dist/chunks/114.a871a720.js +0 -2
- package/dist/chunks/114.a871a720.js.map +0 -1
- package/dist/chunks/1370.0f757c98.js +0 -2
- package/dist/chunks/1370.0f757c98.js.map +0 -1
- package/dist/chunks/1889.2fbcb228.js +0 -2
- package/dist/chunks/1940.e08c6a3a.js +0 -2
- package/dist/chunks/1940.e08c6a3a.js.map +0 -1
- package/dist/chunks/2052.e16f99fc.js +0 -2
- package/dist/chunks/2277.c6d595bb.js +0 -2
- package/dist/chunks/2277.c6d595bb.js.map +0 -1
- package/dist/chunks/2512.69bf5508.js +0 -3
- package/dist/chunks/2512.69bf5508.js.map +0 -1
- package/dist/chunks/2652.7965cfa8.js +0 -2
- package/dist/chunks/2652.7965cfa8.js.map +0 -1
- package/dist/chunks/3144.f2df7ec8.js +0 -3
- package/dist/chunks/3171.57b9140a.js +0 -2
- package/dist/chunks/3171.57b9140a.js.map +0 -1
- package/dist/chunks/3214.a900282b.js +0 -3
- package/dist/chunks/3214.a900282b.js.map +0 -1
- package/dist/chunks/3426.0dbb3278.js +0 -2
- package/dist/chunks/3426.0dbb3278.js.map +0 -1
- package/dist/chunks/3751.b2617e40.js +0 -2
- package/dist/chunks/3751.b2617e40.js.map +0 -1
- package/dist/chunks/3933.0aa4aefd.js +0 -2
- package/dist/chunks/3933.0aa4aefd.js.map +0 -1
- package/dist/chunks/4041.fa6f3b31.js +0 -3
- package/dist/chunks/4223.54dd11a6.js +0 -2
- package/dist/chunks/4223.54dd11a6.js.map +0 -1
- package/dist/chunks/4310.4736ad91.js +0 -3
- package/dist/chunks/4658.55cfb45c.js +0 -2
- package/dist/chunks/4658.55cfb45c.js.map +0 -1
- package/dist/chunks/4741.458ddf99.js +0 -2
- package/dist/chunks/5250.5dff32d0.js +0 -3
- package/dist/chunks/5384.2a1e79e1.js +0 -2
- package/dist/chunks/5399.ca624c52.js +0 -2
- package/dist/chunks/5399.ca624c52.js.map +0 -1
- package/dist/chunks/5552.4f3485eb.js +0 -2
- package/dist/chunks/5552.4f3485eb.js.map +0 -1
- package/dist/chunks/6166.ae5b71a0.js +0 -2
- package/dist/chunks/6166.ae5b71a0.js.map +0 -1
- package/dist/chunks/6314.2c685042.js +0 -2
- package/dist/chunks/6314.2c685042.js.map +0 -1
- package/dist/chunks/6519.4d90b3ba.js +0 -2
- package/dist/chunks/6519.4d90b3ba.js.map +0 -1
- package/dist/chunks/6773.f97328dd.js +0 -2
- package/dist/chunks/726.e07694dc.js +0 -2
- package/dist/chunks/7721.5fec8155.js +0 -3
- package/dist/chunks/7733.9478f9d8.js +0 -2
- package/dist/chunks/7733.9478f9d8.js.map +0 -1
- package/dist/chunks/7780.3f03983c.js +0 -2
- package/dist/chunks/7780.3f03983c.js.map +0 -1
- package/dist/chunks/843.eb424dd9.js +0 -2
- package/dist/chunks/871.d2107039.js +0 -2
- package/dist/chunks/871.d2107039.js.map +0 -1
- package/dist/chunks/8989.184a6095.js +0 -2
- package/dist/chunks/8989.184a6095.js.map +0 -1
- package/dist/chunks/9515.e79131dc.js +0 -2
- package/dist/chunks/9559.1f8f1468.js +0 -2
- package/dist/chunks/9559.1f8f1468.js.map +0 -1
- package/dist/chunks/9844.8f6ee168.js +0 -2
- package/dist/chunks/eo-user-or-user-group-select.ffbb2e3a.js +0 -3
- package/dist/chunks/eo-user-or-user-group-select.ffbb2e3a.js.map +0 -1
- package/dist/chunks/main.0846b089.js +0 -2
- package/dist/chunks/main.0846b089.js.map +0 -1
- package/dist/index.04083e69.js +0 -2
- package/dist/index.04083e69.js.map +0 -1
- /package/dist/chunks/{2512.69bf5508.js.LICENSE.txt → 2512.816c82eb.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{3144.f2df7ec8.js.LICENSE.txt → 3144.bf8c8136.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{3214.a900282b.js.LICENSE.txt → 3214.e9940a98.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{4041.fa6f3b31.js.LICENSE.txt → 4041.0a734a15.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{4310.4736ad91.js.LICENSE.txt → 4310.620e241f.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5250.5dff32d0.js.LICENSE.txt → 5250.b18e2eb5.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7721.5fec8155.js.LICENSE.txt → 7721.ff633403.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-user-or-user-group-select.ffbb2e3a.js.LICENSE.txt → eo-user-or-user-group-select.b4422dab.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 7041.3cd44633.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_next_bricks_form_platform=globalThis.webpackChunk_next_bricks_form_platform||[]).push([[7041],{7041:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Yt,Notification:()=>rn,StoryboardFunctionRegistryFactory:()=>pe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>ya,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Et,checkIfOfComputed:()=>St,createHistory:()=>I,createRuntime:()=>ia,customProcessors:()=>M,customTemplates:()=>Pe,fetchByProvider:()=>Aa,getAuth:()=>wa,getBasePath:()=>m,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>C,getPageInfo:()=>Xr,getRealValue:()=>Ia,getRuntime:()=>ca,getV2RuntimeFromDll:()=>k,handleHttpError:()=>nn,httpErrorToString:()=>Jt,isLoggedIn:()=>Ea,isUnauthenticatedError:()=>Xt,logout:()=>Sa,matchPath:()=>Lt,registerWidgetFunctions:()=>$e,registerWidgetI18n:()=>N,setUIVersion:()=>eo,unstable_createRoot:()=>ka});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>kr,debugDataValue:()=>wr,getAddedContracts:()=>yr,getAllContextValues:()=>mr,getBrickPackagesById:()=>gr,getContextValue:()=>hr,getRenderId:()=>br,legacyDoTransform:()=>ar,loadBricks:()=>vr,mountUseBrick:()=>rr,renderUseBrick:()=>nr,setRealTimeDataInspectRoot:()=>Ar,symbolForRootRuntimeContext:()=>tr,unmountUseBrick:()=>or,updateSnippetPreviewSettings:()=>fr,updateStoryboard:()=>sr,updateStoryboardByRoute:()=>ir,updateStoryboardBySnippet:()=>dr,updateStoryboardByTemplate:()=>cr,updateTemplatePreviewSettings:()=>lr});var o=n(4635),a=n(4586),s=n(918),i=n(2559),c=n(6121),l=n(829),u=n(1586),d=n(8958),f=n(729),p=n(1302),h=(n(6036),n(2890));function m(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var g=n(1030);function v(e,t){const n=(0,g.orderBy)(e,(e=>{var t;return(null===(t=e.app.homepage)||void 0===t?void 0:t.length)??0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&b(n,t))return e}}function b(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function y(e){var t;return!e||(null===(t=ca().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let w,S=!1;function E(e,t){S=!confirm(e),t(!S)}function A(e){const{push:t,replace:n}=e;function r(r){return function(o,a,s){let i;const c="string"==typeof o;return i=c?(0,h.parsePath)(o).pathname:o.pathname,"string"==typeof i&&i.startsWith("/")&&y(function(e){var t;return v((null===(t=oa)||void 0===t?void 0:t.storyboards)??[],e)}(i))?location["push"===r?"assign":"replace"](c?m()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,a,s)}}return{push:r("push"),replace:r("replace")}}function k(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function I(){if(!w){const e=(0,h.createBrowserHistory)({basename:m().replace(/\/$/,""),getUserConfirmation:E});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){S=!1,t(e,n),null==r||r(S)}function o(e,t,r){S=!1,n(e,t),null==r||r(S)}function a(t){return function(n){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;const{extraQuery:i,clear:c,keepHash:l,...u}=a,d=new URLSearchParams(c?"":e.location.search),f={};Object.assign(f,n,i);for(const[e,t]of Object.entries(f))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?r:o)(`?${d.toString()}${l?e.location.hash:""}`,u,s)}}let s;return{pushQuery:a("push"),replaceQuery:a("replace"),pushAnchor:function(t,n,o){r({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,o)},reload:function(t){o({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){s=e},getBlockMessage:function(){return s},unblock:function(){s=void 0},...A({...e,push:r,replace:o})}}(e)),w=e}return w}const C=function(){const e=k();if(e)return e.getHistory}()||function(){return w};var R=n(7067),T=n(7389),O=n(8701),x=n(4871),P=n(6639),_=new WeakMap;const M=function(){const e=k();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,s.A)(this,_,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,l.A)(_,this).get(n);if(o||(o=new Map,(0,l.A)(_,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,l.A)(_,this).get(e)}};function B(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=L("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;u.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)u.i18n.removeResourceBundle(t,e)}}}function L(e,t){return`${e}/${t}`}function $(e){return u.i18n.getFixedT(null,L("widget",e))}const N=function(){const e=k();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=L("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;u.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",j="devtools-panel-change";let D,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||D&&"Evaluations"!==D))return;const r=()=>{var r;null===(r=n.emit)||void 0===r||r.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):setTimeout(r,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const H=()=>{throw new Error("Can't modify read-only proxy object")},q={set:H,defineProperty:H,deleteProperty:H,setPrototypeOf:H};function z(e){return new Proxy(e,q)}function G(e){let{get:t,ownKeys:n}=e;return W()?z(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const Q=new f.JsonStorage(localStorage),J="apps-theme";function X(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);Y=e}function Z(){return Y}function ee(){return document.documentElement.dataset.theme}function te(e){e?X(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){Q.setItem(J,{...re(),...e})}function re(){let e;try{e=Q.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return e??{}}let oe="default";function ae(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function se(){return document.documentElement.dataset.mode}function ie(e){e?ae(e):e=oe,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){const n={};for(const r of e){const e=ue(r,t);void 0!==e&&(n[r]=e)}return n}function ue(e,t){var n,r,o;let{collectCoverage:a,widgetId:s,widgetVersion:i,app:c,appendI18nNamespace:l,storyboardFunctions:d,isStoryboardFunction:f}=t;switch(e){case"BASE_URL":return a?"/next":m().replace(/\/$/,"");case"FN":return d;case"IMG":return a?{get:e=>`mock/images/${e}`}:s?null==sa||null===(n=sa.images)||void 0===n?void 0:n.widgetImagesFactory(s,i):null==sa||null===(r=sa.images)||void 0===r?void 0:r.imagesFactory(c.id,c.isBuildPush,c.currentVersion);case"I18N":return a?g.identity:s?$(s):u.i18n.getFixedT(null,[l,L("app",c.id)].filter(Boolean));case"I18N_TEXT":return a?de:u.i18nText;case"PERMISSIONS":return z({check:a?fe:null==sa||null===(o=sa.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return z({getTheme:a?()=>"light":Z});case"console":return f?z(console):void 0;case"location":return a?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function fe(){return!0}function pe(){let{widgetId:e,widgetVersion:t,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=new Map,o=new Proxy(Object.freeze({}),{get:(s,i)=>function(s){const i=r.get(s);if(!i)return;if(i.processed)return i.cooked;let c;n&&(c=n.createCollector(s));const l=(0,T.precookFunction)(i.source,{typescript:i.typescript,hooks:c&&{beforeVisit:c.beforeVisit}});return i.cooked=(0,T.cook)(l.function,i.source,{rules:{noVar:!0},globalVariables:(0,P.supply)(l.attemptToVisitGlobals,le(l.attemptToVisitGlobals,{collectCoverage:n,widgetId:e,widgetVersion:t,app:a,storyboardFunctions:o,isStoryboardFunction:!0}),!!n),hooks:c&&{beforeEvaluate:c.beforeEvaluate,beforeCall:c.beforeCall,beforeBranch:c.beforeBranch}}),i.processed=!0,i.cooked}(i)});let a;return{storyboardFunctions:o,registerStoryboardFunctions:function(e,t){if(t&&(a=t),r.clear(),Array.isArray(e))for(const t of e){const e=(0,O.collectMemberUsageInFunction)(t,"FN",!!n),o=(0,O.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");r.set(t.name,{source:t.source,typescript:t.typescript,deps:e,hasPermissionsCheck:o})}},updateStoryboardFunction(e,t){const n={...t,name:e},o=(0,O.collectMemberUsageInFunction)(n,"FN",!0),a=(0,O.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");r.set(e,{source:t.source,typescript:t.typescript,deps:o,hasPermissionsCheck:a})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const o=r.get(e);return!!o&&(o.hasPermissionsCheck||[...o.deps].some(n))}return!1};return e.some(n)}}}const{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=pe();var ve={};try{ve.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=a.prototype;function a(){t.set(this,n(null))}function s(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function i(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}s(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),a=o[e]||(o[e]=[]),s=0,i=a.length;s<i;s++)if(a[s].listener===n)return;a.push({target:this,listener:n,options:r})})),s(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(s(e,"target",this),s(e,"currentTarget",this),n.slice(0).some(i,e),delete e.currentTarget,delete e.target),!0})),s(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),a=0,s=o.length;a<s;a++)if(o[a].listener===n)return void o.splice(a,1)})),ve.EventTarget=a}(Object,new WeakMap)}const be=ve.EventTarget;let ye=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const we=new Map([[ye.xLarge,"1920px"],[ye.large,"1600px"],[ye.medium,"1280px"],[ye.small,"1024px"],[ye.xSmall,0]]),Se=new be,Ee={},Ae={};function ke(e,t){let n=!1;Ee[t]=e.matches;for(const[e]of we)if(Ee[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&Se.dispatchEvent(new CustomEvent("change",{detail:Ae}))}we.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);ke(n,t),n.addEventListener?n.addEventListener("change",(e=>{ke(e,t)})):n.addListener((e=>{ke(e,t)}))}));const Ie=()=>Ae;function Ce(e){return function(t){const n="local"===e?localStorage:sessionStorage;return JSON.parse(n.getItem(t)??"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=ca())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Te(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];const a=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${a}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${a}`,...r)}const Oe=new Set(["prefix"]);var xe=new WeakMap;const Pe=function(){const e=k();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,s.A)(this,xe,new Map)}define(e,t){var n,r;let o=(0,l.A)(xe,this).has(e);o?console.warn(`Custom template of "${e}" already registered.`):(o=!!customElements.get(e),o&&console.warn(`Custom template of "${e}" already defined by customElements.`));const a=Re(),s=(null===(n=t.proxy)||void 0===n?void 0:n.properties)??{},i=[],c=[];for(const[t,n]of Object.entries(s))n.asVariable?(Te(a,"Template `asVariable`",e,t),a||c.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&i.push([t,n]);const u={...t,proxy:{...t.proxy,properties:Object.fromEntries(i)},state:(t.state?a?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(c.map((e=>({name:e,expose:!0}))))};(0,l.A)(xe,this).set(e,{...u,name:e});const d=(f=u.state,(0,g.uniq)((null==f?void 0:f.filter((e=>e.expose)).map((e=>e.name)))??[]));var f;const p=Object.entries((null===(r=u.proxy)||void 0===r?void 0:r.methods)??{}),h=d.concat(i.map((e=>e[0]))),m=p.map((e=>e[0])),v=h.concat(m).filter((e=>e in HTMLElement.prototype&&!Oe.has(e)));if(v.length>0&&(Te(a,"Using native HTMLElement properties as template properties or methods",e,...v),a))throw new Error(`In custom template "${e}", ${v.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!o){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return h}static get _dev_only_definedMethods(){return m}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const r=document.createElement("slot");t.appendChild(n),t.appendChild(r),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of d)i.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of i)Object.defineProperty(t.prototype,e,{get(){return this.$$getElementByRef(n.ref)[n.refProperty??e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);o&&(o[n.refProperty??e]=t)},enumerable:!0});for(const[e,n]of p)Object.defineProperty(t.prototype,e,{value(){this.$$getElementByRef(n.ref)[n.refMethod??e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,l.A)(xe,this).get(e)}};function _e(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${n??""}`);const a=o.get(r);if(!a)throw new Error(`Template state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return a}function Me(e,t,n){const r=_e(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return r}const Be=new Map,Le=new Proxy(Object.freeze({}),{get:(e,t)=>Be.get(t)}),$e=function(){const e=k();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Be.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=pe({widgetId:e,widgetVersion:n});Be.set(e,r),o(t)},Ne=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ue=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Ne);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Fe=e=>"*"===e||"x"===e||"X"===e,je=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},De=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(je(e),je(t));return n>r?1:n<r?-1:0},Ke=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=De(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{qe(n);const r=((e,t)=>{const n=Ue(e),r=Ue(t),o=n.pop(),a=r.pop(),s=Ke(n,r);return 0!==s?s:o&&a?Ke(o.split("."),a.split(".")):o||a?o?-1:1:0})(e,t);return We[n].includes(r)},We={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},He=Object.keys(We),qe=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===He.indexOf(e))throw new Error(`Invalid operator, expected one of ${He.join("|")}`)};function ze(e,t){let n=ba(e);if(!n&&null!=sa&&sa.checkInstalledApps&&(n=sa.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const r=t.match(/^([><]=?|=)(.*)$/);try{if(!r)throw new TypeError(`Invalid match version: ${t}`);return Ve(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function Ge(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${n??""}`);const a=o.get(r);if(!a)throw new Error(`Form state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return a}const Ye=new Map;async function Qe(e){var t;const n=null==sa||null===(t=sa.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=sa.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)sa.flowApi.registerFlowApiProvider();else if(await(0,d.loadBricksImperatively)([e],ha()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Ye.set(e,r),r}let Je=new WeakSet;function Xe(e){if((0,f.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Xe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Xe)}}function Ze(e){return Je.has(e)}const et=new Map;async function tt(e,t,n){const{useProvider:r,method:o="resolve",args:a=[],onReject:s}=e,{provider:i,field:c}=e;if(i&&!r)throw new Error(`You're using "provider: ${i}" which is dropped in v3, please use "useProvider" instead`);const l=null!=c;if(l){const e=Re();if(Te(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Qe(r),mt(a,t)]),f=null==n?void 0:n.renderId,p=nt(u,r,o,d,n,a,!!f&&f!==ma());let h,{transform:m}=e;try{const e=await p;h=l?(0,g.get)(e,c):e,Xe(h)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;m=s.transform,h=e}return m?"string"==typeof m?{[m]:h}:mt(m,{...t,data:h}):h}async function nt(e,t,n,r,o,a,s){let i,c;try{i=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!a)throw e;i=JSON.stringify({useProvider:t,method:n,originalArgs:a})}return"reload"!==(null==o?void 0:o.cache)&&(c=et.get(i)),c||(c=(async o=>{const a=null!=sa&&null!==(o=sa.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await sa.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...a)})(),s||et.set(i,c)),c}const rt=Symbol.for("pre.evaluated.raw"),ot=Symbol.for("pre.evaluated.context");function at(e){return!(null==e||!e[rt])}function st(e){return e[rt]}function it(e){return"string"==typeof e?(0,T.shouldAllowRecursiveEvaluations)(e):(0,T.shouldAllowRecursiveEvaluations)(e[rt])}const ct=new WeakSet([SyntaxError,TypeError,ReferenceError]);function lt(e){return ct.has(e.constructor)?e.constructor:TypeError}function ut(e,t,n){const{run:r}=dt(e,t,n,!1);return r()}function dt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const o=[];if("string"!=typeof e){const n=(0,g.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ot],...n},e=e[rt]}const a={usedArgs:new Set},s={usedArgs:new Set};let i;try{i=(0,T.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,O.collectAppGetMenuUsage)(a,e,t),(0,O.collectInstalledAppsHasUsage)(s,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}if(a.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(s.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:l}=i;if(n.lazy||l.has("EVENT")&&!(0,f.hasOwnProperty)(t,"event")||l.has("DATA")&&!(0,f.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let u,p,h,m;const v=Re(t);let b,y;(l.has("STATE")||!v&&l.has("TPL"))&&(m=_e(t,"STATE",`: "${e}"`)),l.has("FORM_STATE")&&(y=Ge(t,"FORM_STATE",`: "${e}"`));const w=W();if(r||w){if(l.has("CTX")&&(u=(0,O.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(u))),m){if(h=(0,O.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,O.strictCollectMemberUsage)(e,"TPL");for(const e of t)h.add(e)}r&&o.push(m.waitFor(h))}y&&(b=(0,O.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(y.waitFor(b))),l.has("PROCESSORS")&&(p=(0,O.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,d.loadProcessorsImperatively)(p,ha())))}if(r){let n=l.has("PERMISSIONS");if(!n&&l.has("FN")){const t=[...(0,O.strictCollectMemberUsage)(e,"FN")];n=ge(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),a.usedArgs.size>0&&null!=sa&&sa.menu){const e=[...a.usedArgs];o.push(Promise.all(e.map((e=>sa.menu.fetchMenuById(e,t,{getStoryboardByAppId:va,resolveData:tt,asyncComputeRealValue:mt})))))}var S;s.usedArgs.size>0&&o.push(null==sa||null===(S=sa.checkInstalledApps)||void 0===S?void 0:S.waitForCheckingApps([...s.usedArgs]))}return{blockingList:o,run(){var n,r;const{app:o,location:a,query:s,match:d,flags:w,sys:S,ctxStore:E,data:A,event:k}=t,I=t.overrideApp??o;for(const o of l)switch(o){case"ANCHOR":c[o]=a.hash?a.hash.substring(1):null;break;case"APP":if(null==I)throw new ReferenceError(`APP is not defined, in "${e}"`);c[o]={...(0,g.cloneDeep)(I),getMenu:null==sa||null===(n=sa.menu)||void 0===n?void 0:n.getMenuById};break;case"CTX":c[o]=G({get:(e,t)=>E.getValue(t),ownKeys:()=>Array.from(u)});break;case"DATA":c[o]=A;break;case"EVENT":c[o]=k;break;case"FLAGS":c[o]=z(w);break;case"FORM_STATE":c[o]=G({get:(e,t)=>y.getValue(t),ownKeys:()=>Array.from(b)});break;case"HASH":c[o]=a.hash;break;case"INSTALLED_APPS":c[o]=z({has:ze});break;case"ITEM":case"INDEX":{const n="ITEM"===o?"forEachItem":"forEachIndex";(0,f.hasOwnProperty)(t,n)?c[o]=t[n]:console.error(`Using \`${o}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[o]=z({getItem:Ce("local")});break;case"MEDIA":c[o]=z(Ie());break;case"MISC":c[o]=ca().getMiscSettings();break;case"PARAMS":if(null==s)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[o]=new URLSearchParams(s);break;case"PATH":c[o]=z((null==d?void 0:d.params)??{});break;case"PATH_NAME":c[o]=a.pathname;break;case"PROCESSORS":c[o]=G({get(e,t){const n=M.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return G({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of p){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==s)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.get(e)])));break;case"QUERY_ARRAY":if(null==s)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.getAll(e)])));break;case"SESSION_STORAGE":c[o]=z({getItem:Ce("session")});break;case"TPL":if(Te(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[o]=G({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":c[o]=z(S??{});break;case"__WIDGET_FN__":c[o]=Le;break;case"__WIDGET_IMG__":c[o]=null==sa||null===(r=sa.images)||void 0===r?void 0:r.widgetImagesFactory;break;case"__WIDGET_I18N__":c[o]=$}Object.assign(c,le(i.attemptToVisitGlobals,{storyboardFunctions:he,app:I,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,T.cook)(i.expression,i.source,{globalVariables:(0,P.supply)(i.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}}}}let ft=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function pt(e){switch(e){case ft.USE_BRICK_PROPERTIES:case ft.USE_BRICK_TRANSFORM:case ft.USE_BRICK_EVENTS:case ft.USE_BRICK_IF:case ft.USE_BRICK_LIFECYCLE:case ft.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(pt(e))return e;if(t)switch(e){case ft.USE_BRICK:return ft.USE_BRICK_ITEM;case ft.USE_BRICK_SLOTS_ITEM_BRICKS:return ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case ft.INITIAL:if("useBrick"===n)return ft.USE_BRICK;break;case ft.USE_BRICK:case ft.USE_BRICK_ITEM:case ft.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return ft.USE_BRICK_PROPERTIES;case"transform":return ft.USE_BRICK_TRANSFORM;case"dataSource":return ft.USE_BRICK_DATA_SOURCE;case"events":return ft.USE_BRICK_EVENTS;case"slots":return ft.USE_BRICK_SLOTS;case"children":return ft.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return ft.USE_BRICK_IF;case"lifeCycle":return ft.USE_BRICK_LIFECYCLE}break;case ft.USE_BRICK_SLOTS:return ft.USE_BRICK_SLOTS_ITEM;case ft.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return ft.USE_BRICK_SLOTS_ITEM_BRICKS}return ft.INITIAL}async function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=at(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&pt(n.$$stateOfUseBrick);let a,s=o;return r||(0,T.isEvaluable)(e)?(a=await async function(e,t,n){const{blockingList:r,run:o}=dt(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),s=it(e)):a=o?e:((0,f.hasOwnProperty)(t,"data")?n.noInject?x.transform:x.transformAndInject:n.noInject?bt:x.inject)(e,t),s||Xe(a),a}if(!(0,f.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return Promise.all(e.map((e=>mt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([mt(r,t),mt(o,t,vt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=at(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&pt(n.$$stateOfUseBrick);let a,s=o;return r||(0,T.isEvaluable)(e)?(a=ut(e,t),s=it(e)):a=o?e:((0,f.hasOwnProperty)(t,"data")?n.noInject?x.transform:x.transformAndInject:n.noInject?bt:x.inject)(e,t),s||Xe(a),a}if(!(0,f.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return e.map((e=>gt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[gt(r,t),gt(o,t,vt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function vt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function bt(e){return e}async function yt(e,t){return!(0,f.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||at(e.if)?await mt(e.if,t):e.if)}function wt(e,t){return!(0,f.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||at(e.if)?gt(e.if,t):e.if)}function St(e){return!(0,f.hasOwnProperty)(e,"if")||!!e.if}const Et=function(){const e=k();if(e)return e.looseCheckIfByTransform}()||function(e,t){return wt(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,T.isEvaluable)(e):at(e)){const o="string"==typeof e?e:st(e);if((0,T.isTrackAll)(o)){const e=(0,O.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,O.track)(o,"track context","CTX"),n=(0,O.track)(o,"track state","STATE"),r=(0,O.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function kt(e,t){for(const[n,r,o]of e)if(n===t){const e=await r;if(void 0!==e||!o)return e}}async function It(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,f.isObject)(e))||(t[n]=e)}return t}function Ct(e,t){if(t)for(const[n,r]of Object.entries(t))switch(n){case"style":case"dataset":for(const[t,o]of Object.entries(r))e[n][t]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${n}\` is prohibited`);default:e[n]=r}}function Rt(e,t,n){const r=function(e,t){return(0,f.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=gt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?ft.USE_BRICK:ft.INITIAL});if("style"!==n&&"dataset"!==n||(0,f.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}function Tt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ot(e){return e&&e.sensitive?"":"i"}function xt(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,a=n.start,s=void 0===a||a,i=n.end,c=void 0===i||i,l=n.encode,u=void 0===l?function(e){return e}:l,d=n.delimiter,f=void 0===d?"/#?":d,p=n.endsWith,h="[".concat(Tt(void 0===p?"":p),"]|$"),m="[".concat(Tt(f),"]"),g=s?"^":"",v=0,b=e;v<b.length;v++){var y=b[v];if("string"==typeof y)g+=Tt(u(y));else{var w=Tt(u(y.prefix)),S=Tt(u(y.suffix));if(y.pattern)if(t&&t.push(y),w||S)if("+"===y.modifier||"*"===y.modifier){var E="*"===y.modifier?"?":"";g+="(?:".concat(w,"((?:").concat(y.pattern,")(?:").concat(S).concat(w,"(?:").concat(y.pattern,"))*)").concat(S,")").concat(E)}else g+="(?:".concat(w,"(").concat(y.pattern,")").concat(S,")").concat(y.modifier);else"+"===y.modifier||"*"===y.modifier?g+="((?:".concat(y.pattern,")").concat(y.modifier,")"):g+="(".concat(y.pattern,")").concat(y.modifier);else g+="(?:".concat(w).concat(S,")").concat(y.modifier)}}if(c)o||(g+="".concat(m,"?")),g+=n.endsWith?"(?=".concat(h,")"):"$";else{var A=e[e.length-1],k="string"==typeof A?m.indexOf(A[A.length-1])>-1:void 0===A;o||(g+="(?:".concat(m,"(?=").concat(h,"))?")),k||(g+="(?=".concat(m,"|").concat(h,")"))}return new RegExp(g,Ot(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,a="";if("?"===e[i=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<e.length;)if("\\"!==e[i]){if(")"===e[i]){if(0==--o){i++;break}}else if("("===e[i]&&(o++,"?"!==e[i+1]))throw new TypeError("Capturing groups are not allowed at ".concat(i));a+=e[i++]}else a+=e[i++]+e[i++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!a)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:a}),n=i}else{for(var s="",i=n+1;i<e.length;){var c=e.charCodeAt(i);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[i++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=i}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,a="[^".concat(Tt(t.delimiter||"/#?"),"]+?"),s=[],i=0,c=0,l="",u=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var r=n[c],o=r.type,a=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(a,", expected ").concat(e))},f=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};c<n.length;){var p=u("CHAR"),h=u("NAME"),m=u("PATTERN");if(h||m){var g=p||"";-1===o.indexOf(g)&&(l+=g,g=""),l&&(s.push(l),l=""),s.push({name:h||i++,prefix:g,suffix:"",pattern:m||a,modifier:u("MODIFIER")||""})}else{var v=p||u("ESCAPED_CHAR");if(v)l+=v;else if(l&&(s.push(l),l=""),u("OPEN")){g=f();var b=u("NAME")||"",y=u("PATTERN")||"",w=f();d("CLOSE"),s.push({name:b||(y?i++:""),pattern:b&&!y?a:y,prefix:g,suffix:w,modifier:u("MODIFIER")||""})}else d("END")}}return s}(e,n),t,n)}function Pt(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return Pt(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),Ot(n))}(e,t,n):xt(e,t,n)}const _t=new Map,Mt=1e4;let Bt=0;function Lt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:a=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:s,keys:i}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=_t.get(n);r||_t.set(n,r=new Map);const o=r.get(e);if(o)return o;const a=[],s={regexp:Pt(e,a,t),keys:a};return Bt<Mt&&(r.set(e,s),Bt++),s}(n,{end:r,strict:o,sensitive:a}),c=s.exec(e);if(!c)return null;const[l,...u]=c,d=e===l;return r&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:i.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function $t(e,t,n){return Lt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Nt=Symbol.for("tpl.asyncComputedPropsFromHost"),Ut=Symbol.for("tpl.stateStoreId"),Ft=Symbol.for("tpl.externalForEachItem"),jt=Symbol.for("tpl.externalForEachIndex"),Dt=Symbol.for("tpl.externalNoForEach"),Kt=new Set;let Vt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e}({});const Wt={[Vt.REQUEST_FAILED]:"Request Failed",[Vt.SOMETHING_WENT_WRONG]:"Something went wrong!",[Vt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Vt.NETWORK_ERROR]:"Network error, please check your network."},Ht={[Vt.REQUEST_FAILED]:"请求失败",[Vt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Vt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Vt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},qt="core/runtime",zt={en:Wt,zh:Ht};let Gt;const Yt=Object.freeze({show:function(e){if(Gt)return Gt.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function Qt(e){const{search:t,pathname:n}=e,r=n?window.btoa(encodeURIComponent(n)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${r}; path=/`,document.cookie=`SALOGINQUERY=${o}; path=/`}function Jt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return u.i18n.t(`${qt}:${Vt.NETWORK_ERROR}`);if(e instanceof R.HttpResponseError&&e.responseJson){if("string"==typeof e.responseJson.error)return e.responseJson.error;if("string"==typeof e.responseJson.msg)return e.responseJson.msg}return null==e?"Unknown error":e.toString()}function Xt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let Zt,en,tn=!1;function nn(e){if(e instanceof R.HttpAbortError)return;if(Xt(e)&&!window.NO_AUTH_GUARD){if(tn)return;return tn=!0,void Yt.show({type:"confirm",content:u.i18n.t(`${qt}:${Vt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=ca().getFeatureFlags()["sso-enabled"],t=C();Qt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),tn=!1}),(()=>{tn=!1}))}console.error(e);const t=Jt(e);t!==Zt&&(Zt=t,Yt.show({type:"error",title:u.i18n.t(`${qt}:${Vt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Zt=void 0})))}const rn=Object.freeze({show:function(e){en?en.resolve(e):alert(e.message)}});function on(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const a=un(o,n,{element:e});e.addEventListener(r,a),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,a]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function an(e){return"string"==typeof e.action}function sn(e){return"string"==typeof e.useProvider}function cn(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function ln(e){return!!e.then}function un(e,t,n){return function(r){for(const o of[].concat(e))if(wt(o,{...t,event:r}))if(ln(o))un(o.then,t,n)(r);else if(an(o)){const[e,a]=o.action.split(".");switch(o.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":hn(r,a,o.args,o.callback,t);break;case"window.open":mn(r,o.args,t);break;case"location.reload":case"location.assign":wn(r,a,o.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Sn(r,e,a,o.args,t);break;case"event.preventDefault":r.preventDefault();break;case"event.stopPropagation":r.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":En(r,a,o.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":An(r,a,o.args,t);break;case"handleHttpError":nn(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":vn(r,a,o.args,o.batch??!0,o.callback,t);break;case"state.update":case"state.refresh":case"state.load":bn(r,a,o.args,o.batch??!0,o.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Cn(o.args,t,r);Me(t,o.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":yn(r,o.args,o.callback,t);break;case"message.subscribe":case"message.unsubscribe":kn(r,a,o.args,t,n,o.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===o.action?"dark":"light");break;case"theme.setTheme":{const[e]=Cn(o.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ie("mode.setDashboardMode"===o.action?"dashboard":"default");break;default:console.error("unknown event listener action:",o.action)}}else sn(o)?dn(r,o,t,n):cn(o)?fn(r,o,t,n):console.error("unknown event handler:",o);else o.else&&un(o.else,t,n)(r)}}async function dn(e,t,n,r){try{pn(e,await Qe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",n,r)}catch(e){console.error(Jt(e))}}function fn(e,t,n,r){let o=[];const a=t.target,s=t.targetRef;let i=a;if(("string"==typeof a?(0,T.isEvaluable)(a):at(a))&&(i=gt(a,{...n,event:e})),"string"==typeof i)if("_self"===i)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(i));else{const e=document.querySelector(i);null!==e&&o.push(e)}else if(i)i instanceof HTMLElement?o.push(i):console.error("unexpected target:",i);else if(s){let t=s;("string"==typeof s?(0,T.isEvaluable)(s):at(s))&&(t=gt(s,{...n,event:e}));const r=[].concat(t),a=Me(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=a.$$getElementByRef)||void 0===t?void 0:t.call(a,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{pn(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(o,t.properties,{...n,event:e}):console.error("target not found:",a||s)}async function pn(e,t,n,r,o,a,s){if("function"!=typeof t[r])return void console.error("target has no method:",{target:t,method:r});const i=async()=>{var a;let i=Cn(n.args,o,e,s);var c;return sn(n)&&null!=sa&&null!==(a=sa.flowApi)&&void 0!==a&&a.isFlowApiProvider(n.useProvider)&&(i=await sa.flowApi.getArgsOfFlowApi(n.useProvider,i,r,null===(c=n.sse)||void 0===c?void 0:c.stream)),t[r](...i)};if(!n.callback)return void i();const c=In(n.callback,o,a),l={progress:c("progress"),success:c("success"),error:c("error"),finally:c("finally")};if(sn(n)){var u,d;const t={...o,event:e};if(gt(null===(u=n.sse)||void 0===u?void 0:u.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:a}=t;const s=ma();try{const t=await e();for await(const e of t){if(s!==ma())return;null==n||n(e)}if(s!==ma())return;null==r||r()}catch(e){if(s!==ma())return;null==o||o(e)}finally{null==a||a()}}(i,l);if(gt(null===(d=n.poll)||void 0===d?void 0:d.enabled,t))return void function(e,t,n,r){let{progress:o,success:a,error:s,finally:i}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:f,delegateLoadingBar:p}=gt((0,g.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),h=ma();let m;async function v(){let t;Kt.delete(m);try{var n;if(t=null===(n=gt(c,r))||void 0===n?void 0:n(),t)null==i||i();else{var d;const n=await e(),s=null===(d=gt(c,r))||void 0===d?void 0:d();var g;t=s||h!==ma(),t?s&&(null==i||i()):(null==o||o(n),null!==(g=gt(l,r))&&void 0!==g&&g(n)?(p&&window.dispatchEvent(new Event("request.end")),null==a||a(n),null==i||i()):b(u??3e3))}}catch(e){var v;const n=null===(v=gt(c,r))||void 0===v?void 0:v();t=n||h!==ma(),t?n&&(null==i||i()):(null==s||s(e),f?b(u??3e3):null==i||i())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}function b(e){m=setTimeout(v,e),Kt.add(m)}b(d??0),p&&window.dispatchEvent(new Event("request.start"))}(i,l,n.poll,t)}try{const e=await i();l.success(e)}catch(e){l.error(e)}finally{l.finally()}}function hn(e,t,n,r,o){let a=0,s=!1,i=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":a=2,s=!0;break;case"reload":s=!0;break;case"block":a=1,i="setBlockMessage"}let c=[];if(a>0&&(c=Cn(n,o,e,{useEventDetailAsDefault:!0}),c.length=a),s&&r){const e=In(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}C()[i](...c)}function mn(e,t,n){const[r,o,a]=Cn(t,n,e);window.open(r,o||"_self",a)}function gn(e,t,n,r,o,a){t?r.updateValues(e,n,(e=>Cn(e,o,a)[0])):e.forEach((e=>{const{name:t,value:s}=Cn([e],o,a)[0];r.updateValue(t,s,n)}))}function vn(e,t,n,r,o,a){if(!Array.isArray(n)||!n.every(f.isObject)||"assign"!==t&&"replace"!==t){const[r,s]=Cn(n,a,e);a.ctxStore.updateValue(r,s,t,o,a)}else gn(n,r,t,a.ctxStore,a,e)}function bn(e,t,n,r,o,a){if(Array.isArray(n)&&n.every(f.isObject)&&"update"===t)gn(n,r,"replace",_e(a,`state.${t}`,`: ${JSON.stringify(n)}`),a,e);else{const[r,s]=Cn(n,a,e);_e(a,`state.${t}`,`: ${r}`).updateValue(r,s,"update"===t?"replace":t,o,a)}}function yn(e,t,n,r){const[o,a]=Cn(t,r,e);Ge(r,"formstate.update",`: ${o}`).updateValue(o,a,"replace",n,r)}function wn(e,t,n,r){if("assign"===t){const[t]=Cn(n,r,e);location.assign(t)}else location[t]()}function Sn(e,t,n,r,o){const a="localStorage"===t?localStorage:sessionStorage,[s,i]=Cn(r,o,e);"setItem"===n?void 0!==i&&a.setItem(s,JSON.stringify(i)):a.removeItem(s)}function En(e,t,n,r){console[t](...Cn(n,r,e,{useEventAsDefault:!0}))}function An(e,t,n,r){const o=Cn(n,r,e,{useEventAsDefault:!0});rn.show({type:t,message:o[0]})}async function kn(e,t,n,r,o,a){const s=()=>{var o;const a=Cn(n,r,e);return null==sa||null===(o=sa.messageDispatcher)||void 0===o?void 0:o[t](...a)};if(!a)return void s();const i=In(a,r,o);try{const e=await s();i("success")(e)}catch(e){i("error")(e)}finally{i("finally")()}}function In(e,t,n){return function(r){return function(o){const a=null==e?void 0:e[r];if(a)try{const e=new CustomEvent(`callback.${r}`,{detail:o});un(a,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function Cn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?gt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function Rn(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:a}=_e(r,"bindTemplateProxy"),s=a.tplHostMetadata;s.internalBricksByRef.set(n,e);const i=null===(t=s.proxy)||void 0===t?void 0:t.events;if(i)for(const[e,t]of Object.entries(i))if(t.ref===n){var c;const n=t=>{t.bubbles&&t.stopPropagation(),a.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=t.refEvent??e;o.addEventListener(r,n),(c=o).$$proxyListeners??(c.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function Tn(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=_e(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of r.$$proxyListeners??[])r.removeEventListener(e,t);delete r.$$proxyListeners}let On=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function xn(e){e.replaceChildren()}function Pn(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===On.BRICK){var o;const a=n.type;a.includes("-")&&!customElements.get(a)&&console.error(`Undefined custom element: ${a}`),"basic-bricks.script-brick"===a&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const s=t&&n===e.child?t:document.createElement(a);n.element=s,n.slotId&&s.setAttribute("slot",n.slotId),n.iid&&(s.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(s.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Ct(s,n.properties),on(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=_e({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),Rn(n),n.portal?r.push(s):n.return&&(n.return.childElements||(n.return.childElements=[]),n.return.childElements.push(s))}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var a;let e=n.return;for(;e;){var s;if(e.childElements)e.tag===On.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===On.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(a=e)||void 0===a?void 0:a.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const _n=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Mn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Bn=new WeakMap,Ln=new WeakMap,$n=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,jn=new WeakMap,Dn=new WeakMap,Kn=new WeakMap,Vn=new WeakSet;class Wn{constructor(e,t){(0,o.A)(this,Vn),(0,a.A)(this,"scope",void 0),(0,a.A)(this,"unknownBricks",void 0),(0,a.A)(this,"renderId",void 0),(0,s.A)(this,Bn,void 0),(0,s.A)(this,Ln,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,s.A)(this,$n,new Map),(0,s.A)(this,Nn,void 0),(0,s.A)(this,Un,new Map),(0,s.A)(this,Fn,void 0),(0,s.A)(this,jn,void 0),(0,s.A)(this,Dn,new WeakMap),(0,s.A)(this,Kn,new Map),this.scope=e,this.unknownBricks=(null==t?void 0:t.unknownBricks)??"throw",(0,c.A)(Bn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,c.A)(jn,this,e)}memoizeMenuRequestNode(e,t){(0,l.A)(Dn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,l.A)(jn,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(0,l.A)(Dn,this).get(t);(0,l.A)(Dn,this).set(t,n);let o,a=e.child;for(;a&&a!==r;)o=a,a=a.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,l.A)(Bn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,l.A)(Bn,this).bailout(e)}reCatch(e,t){return(0,l.A)(Bn,this).catch(e,t)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:a}of[...(0,l.A)(Kn,this).values()].reverse()){const s=o[o.length-1];if(r.includes(s))continue;const i=await a(e,t);i&&r.push(...o.slice(0,-1)),!1!==i&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,l.A)(Kn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[..._n,..."page"===this.scope?Mn:[]];for(const r of n){const n=t[r];n&&(0,l.A)(Ln,this)[r].push({brick:e,handlers:n})}(0,g.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,l.A)(Un,this).get(e);n?n.add(t):(0,l.A)(Un,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,l.A)(Fn,this)||(0,c.A)(Fn,this,new WeakMap);const o=[e??"",...t].join(".");let a=(0,l.A)(Fn,this).get(r);a||(a=new Map,(0,l.A)(Fn,this).set(r,a)),a.set(o,{node:n,last:Yn(n),lastNormal:Qn(n),lastPortal:Xn(n)})}reRender(e,t,n,r){const o=[e??"",...t].join("."),a=(0,l.A)(Fn,this).get(r).get(o),{node:s,last:c,lastNormal:u,lastPortal:d}=a;let f;const p=[];if((null==s?void 0:s.tag)===On.PLACEHOLDER){var h,m;f=(null===(h=function(e){return Jn(e,!0)}(s))||void 0===h?void 0:h.element)??null;const e=null===(m=function(e){return Zn(e,!0)}(s))||void 0===m?void 0:m.element;e&&p.push(e)}else{var g,v;f=(null==u||null===(g=u.element)||void 0===g?void 0:g.nextSibling)??null;let e=null==d||null===(v=d.element)||void 0===v?void 0:v.nextSibling;for(;e&&(p.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const b=Yn(n);let y;a.node=n,a.last=b,a.lastNormal=Qn(n),a.lastPortal=Xn(n);let w=r.child;for(;w&&w!==c;){if(w.sibling===s){y=w;break}w=w.sibling}const S=document.createDocumentFragment(),E=document.createDocumentFragment(),A={tag:On.ROOT,container:S,createPortal:E,child:n};for(w=n;w;)w.return=A,w=w.sibling;const k=er(s,c);for((0,i.A)(Vn,this,Hn).call(this,k),Pn(A),y?y.sibling=n:r.child=n,b&&(b.sibling=null==c?void 0:c.sibling),w=n;w;)w.return=r,w=w.sibling;var I,C;if(r.tag===On.ROOT?null===(I=r.container)||void 0===I||I.insertBefore(S,f):null===(C=r.element)||void 0===C||C.insertBefore(S,f),E.childNodes.length>0){var R;let e=n;for(;e&&e.return;)e=e.return;if((null===(R=e)||void 0===R?void 0:R.tag)!==On.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const t="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of p)if(t.contains(e)){r=e;break}t.insertBefore(E,r)}const T=er(n,b);(0,i.A)(Vn,this,qn).call(this,T)}dispose(){for(const e of Object.values((0,l.A)(Ln,this)))e.length=0;for(const e of(0,l.A)($n,this).values()){for(const t of e)t.disconnect();e.length=0}(0,l.A)($n,this).clear(),(0,l.A)(Nn,this)&&(Se.removeEventListener("change",(0,l.A)(Nn,this)),(0,c.A)(Nn,this,void 0)),(0,c.A)(Fn,this,void 0),(0,l.A)(Un,this).clear(),(0,l.A)(Kn,this).clear(),(0,c.A)(Dn,this,void 0)}dispatchBeforePageLoad(){(0,i.A)(Vn,this,zn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,i.A)(Vn,this,zn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,i.A)(Vn,this,zn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,i.A)(Vn,this,zn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=C().location;e&&"#"!==e?(0,i.A)(Vn,this,zn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,i.A)(Vn,this,zn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,l.A)(Ln,this).onScrollIntoView)(0,i.A)(Vn,this,Gn).call(this,e,t)}initializeMediaChange(){(0,c.A)(Nn,this,(e=>{(0,i.A)(Vn,this,zn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:z(e.detail)}))})),Se.addEventListener("change",(0,l.A)(Nn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,l.A)(Ln,this).onMessage)for(const r of[].concat(n)){var t;null==sa||null===(t=sa.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{un(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==sa||null===(e=sa.messageDispatcher)||void 0===e||e.onClose((()=>{(0,i.A)(Vn,this,zn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,i.A)(Vn,this,zn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,i.A)(Vn,this,zn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Hn(e){const t=[..._n,..."page"===this.scope?Mn:[]],n=[];for(const r of t){const t=(0,g.remove)((0,l.A)(Ln,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o;const e=(0,l.A)($n,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,l.A)($n,this).delete(t)}Tn(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove()}const a=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)un(t,e.runtimeContext,e)(a)}function qn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,l.A)(Ln,this).onMount)e.has(n)&&un(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,l.A)(Ln,this).onScrollIntoView)e.has(t)&&(0,i.A)(Vn,this,Gn).call(this,t,n)}function zn(e,t){for(const{brick:n,handlers:r}of(0,l.A)(Ln,this)[e])un(r,n.runtimeContext,n)(t);const n=(0,l.A)(Un,this).get(e);if(n)for(const e of n)e()}function Gn(e,t){const n=t.threshold??.1,r=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(un(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});r.observe(e.element);let o=(0,l.A)($n,this).get(e);o||(o=[],(0,l.A)($n,this).set(e,o)),o.push(r)}function Yn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function Qn(e){return Jn(e,!1)}function Jn(e,t){let n,r=e;for(;r;){if(r.tag===On.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function Xn(e){return Zn(e,!1)}function Zn(e,t){let n,r=e;for(;r;){if(r.tag===On.BRICK&&r.portal){if(t)return r;n=r}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&!e.sibling;)e=e.return;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}function er(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===On.BRICK&&n.add(r),r.child)r=r.child;else{if(r===t)break;if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&e!==t&&!e.sibling;)e=e.return;if(e===t)break;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}const tr=Symbol.for("root.runtimeContext");async function nr(e,t,n){var r,o;const[a,s,i]=Wr({...e[tr]??ga(),data:t,pendingPermissionsPreCheck:[]});a.tplStateStoreMap??(a.tplStateStoreMap=new Map),a.formStateStoreMap??(a.formStateStoreMap=new Map);const c=new Wn("fragment"),l={tag:On.ROOT,createPortal:null},u=e.transform,d=Re();u&&Te(d,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);const f=await Dr(l,d&&!n?e:{errorBoundary:n,...e,properties:{...e.properties,...u}},a,c,[],{}),p=[...s,...i];if(await Vr(f,a,p),(null===(r=f.node)||void 0===r?void 0:r.tag)===On.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(o=f.node)&&void 0!==o&&o.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return l.child=f.node,{tagName:f.node?f.node.type:null,renderRoot:l,rendererContext:c,scopedStores:p}}function rr(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:a}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Pn(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of a)e.mountAsyncData();return{portal:n}}function or(e,t){let{rendererContext:n}=e;t.portal&&(xn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function ar(e,t,n){if(n)throw new Error("Legacy doTransform does not support options in v3");return gt(t,{...ga(),data:e},{noInject:!0})}function sr(e,t){const n=va(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),B(n)}function ir(e,t){const n=va(e);let r=!1;const o=e=>`${e.path}.${e.exact}`,a=(e,n)=>e.map((e=>{const s=o(e);return"routes"===e.type?(e.routes=a(e.routes,n),e):s===n?(r=!0,t):e}));n.routes=a(n.routes,o(t)),r||n.routes.unshift(t)}function cr(e,t,n){const r=`${e}.${t.name}`;Pe.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),lr(e,t.name,n)}function lr(e,t,n){pr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,g.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function ur(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function dr(e,t){var n;pr(e,ur(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const fr=dr;function pr(e,t,n,r){const{routes:o}=va(e),a=o.findIndex((e=>e.path===t)),s={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===a?o.unshift(s):o.splice(a,1,s)}function hr(e,t){let{tplStateStoreId:n}=t;const r=ga();return n?_e({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function mr(e){let{tplStateStoreId:t}=e;const n=ga();return t?_e({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function gr(e){return ha().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function vr(e){return(0,d.loadBricksImperatively)(e,ha())}function br(){return ma()}async function yr(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const a=va(n);let s;if("route"===r)s={routes:[e]};else if("template"===r)s={meta:{customTemplates:[e]}};else if("snippet"===r){var i;const t=ur(e.snippetId);s={routes:[null==a||null===(i=a.routes)||void 0===i?void 0:i.find((e=>e.path===t))]}}const c=[];return s&&o&&(await o(s)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=a&&null!==(t=a.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===r&&e.name===o))||c.push(e)})),c}async function wr(e,t){let{tplStateStoreId:n}=t;const r={...ga(),tplStateStoreId:n};return e.resolve?tt(e.resolve,r,{cache:"reload"}):mt(e.value,r)}let Sr;const Er=[];function Ar(e){Sr=e;const t=mr({tplStateStoreId:e.tplStateStoreId});Ir({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function kr(e){Er.push(e)}function Ir(e){setTimeout((()=>{for(const t of Er)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const Cr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Rr{constructor(e,t,n,r){(0,a.A)(this,"type",void 0),(0,a.A)(this,"data",new Map),(0,a.A)(this,"changeEventType",void 0),(0,a.A)(this,"pendingStack",[]),(0,a.A)(this,"hostBrick",void 0),(0,a.A)(this,"stateStoreId",void 0),(0,a.A)(this,"batchUpdate",!1),(0,a.A)(this,"batchUpdateContextsNames",[]),(0,a.A)(this,"rendererContext",void 0),(0,a.A)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Sr){const{tplStateStoreId:n}=Sr;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Ir({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const r={},o={},a=[];e.forEach((e=>{const{name:o,value:s}=n([e]),i=this.data.get(o);a.push(...this.getAffectListByContext(o)),i&&(r[o]=i),this.updateValue(o,s,t)})),a.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const s=e=>{for(const n in e){var t;const r=e[n];null===(t=r.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:r.value}))}};s(r),s(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const a=this.data.get(e);if(!a)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?a.value=t:(0,f.isObject)(a.value)?Object.assign(a.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),a.value=t),this.batchUpdate||a.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:a.value}));else{if(!a.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let s;"load"===n&&(a.loaded?s=Promise.resolve(a.value):a.loading&&(s=a.loading));const i=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==ma()};if(s||(s=a.loading=a.load({cache:"load"===n?"default":"reload",...t}),s.then((e=>{this.finishLoad(a,e)}),(e=>{!a.useResolve||i(e)||null!=r&&r.error||nn(e)}))),r){const e=In(r,o);s.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!i(t)&&r.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,r){if(Array.isArray(e)&&e.length>0){const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const r=new Map;for(const o of e){const e=[o.if,o.value,o.resolve],a=(0,O.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,O.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)a.usedProperties.add(e);t.hasNonStaticUsage&&(a.hasNonStaticUsage=!0)}r.set(o,a)}return r}(e,n,arguments.length>3?arguments[3]:void 0),o=new Map;for(const e of Array.from(r.keys()).map((e=>e.name)))o.set(e,(o.get(e)??0)+1);const a=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,i=new Map,c=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,n)=>{i.set(e,{resolve:t,reject:n})}))]))),l=async e=>{s.add(e);const n=await t(e);r.delete(e);const a=o.get(e.name)??0;if(n){if(i.get(e.name).resolve(),o.delete(e.name),0===a)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===a?(i.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,a-1);await d()};let u=a;async function d(){const e=Array.from(r.entries()).filter(function(e,t){return(n,r)=>t?0===r:![...n[1].usedProperties].some((t=>e.has(t)))}(o,u)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(l))}return{pendingResult:d().then((async()=>{r.size>0&&(function(e,t){const n=new Map(e),r=new Set(Array.from(n.keys()).map((e=>e.name))),o=()=>{let e=!1;for(const[t,o]of n.entries())[...o.usedProperties].some((e=>r.has(e)))||(n.delete(t),r.delete(t.name),e=!0);e&&o()};if(o(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(r,n),u=!0,await d());for(const e of i.values())e.resolve()})).catch((e=>{for(const t of i.values())t.reject(e);throw e})),pendingContexts:c}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));this.pendingStack.push(o)}}onChange(e,t){var n;null===(n=this.data.get(e))||void 0===n||n.eventTarget.addEventListener(this.changeEventType,t)}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingContexts:e}of this.pendingStack)for(const t of e.values())t.catch((()=>{}));for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,r){if(!await yt(e,t))return!1;let o,a,s,i,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await kt(n,e.name)),void 0===o){if(e.resolve){const n=(0,f.hasOwnProperty)(e,"value");c=e.track&&n&&(0,f.hasOwnProperty)(e.resolve,"if")&&(0,O.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(i=await yt(e.resolve,t),(i||c)&&(a=async e=>{var n;return(await tt(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),i)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await a():"async"===l&&(s=a());else if(!n)return!1}i&&"eager"===l||void 0===e.value||(o=await mt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const u={name:e.name,value:o,eventTarget:new be,useResolve:i,load:a,loaded:"eager"===l,loading:s,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var d;t&&Cr.includes(t)&&(null===(d=this.rendererContext)||void 0===d||d.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&u.eventTarget.addEventListener(this.changeEventType,un(e.onChange,t)),e.track){const n=(0,O.strictCollectMemberUsage)(c?[e.resolve,e.value]:a?e.resolve:e.value,this.type);!a&&(u.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{u.useResolve=c?wt(e.resolve,t):!!a,u.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,gt(e.value,t),"replace")}),e))}if(u.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,u),Array.isArray(r))for(const t of r){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e)for(const t of e)this.data.delete(t)}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function Tr(e,t,n){const{reversedProxies:r,asyncHostPropertyEntries:o,externalSlots:a,tplStateStoreId:s,hostBrick:i}=e;let c;if(t&&r){const s=r.properties.get(t);s&&(u=o,c=s.map((e=>{let{from:t,to:n}=e;const r=u.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const d=r.slots.get(t);if(d&&a){const t=new Map;for(const{from:r,to:o}of d){var l;const s=(null===(l=a[r])||void 0===l?void 0:l.bricks)??[];if(!s.length)continue;const c=o.refSlot??r;let u=t.get(c);if(!u){u=[];const e=(0,f.hasOwnProperty)(n,c)?n[c].bricks.length+1:1;for(let t=0;t<e;t+=1)u.push([]);t.set(c,u)}const d=o.refPosition??-1,p=(0,f.hasOwnProperty)(i.runtimeContext,"forEachItem");u[(0,g.clamp)(d<0?u.length+d:d,0,u.length-1)].push(..."base-layout-v3.tpl-scroll-load-list"!==e.__temporary_tpl_tag_name&&"shrcb-homepage.tpl-custom-scroll-load-list"!==e.__temporary_tpl_tag_name||p?Or(s,p,i.runtimeContext.forEachItem,i.runtimeContext.forEachIndex):s)}for(const[e,r]of t.entries()){(0,f.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]});const t=n[e];t.bricks=r.flatMap(((e,n)=>n<t.bricks.length?e.concat(t.bricks[n]):e)),0===t.bricks.length&&delete n[e]}}}var u;return{[Nt]:c,[Ut]:s}}function Or(e,t,n,r){return e.map((e=>{let{children:o,slots:a,[Ft]:s,[jt]:i,[Dt]:c,...l}=e;return{...l,...t?{[Ft]:n,[jt]:r}:{[Dt]:!0},slots:":forEach"===l.brick?zr(o,a):Object.fromEntries(Object.entries(zr(o,a)??{}).map((e=>{let[o,a]=e;return[o,"routes"===a.type?{type:"routes",routes:xr(a.routes,t,n,r)}:{type:"bricks",bricks:Or(a.bricks,t,n,r)}]})))}}))}function xr(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:xr(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Or(e.bricks,t,n,r)}))}function Pr(e,t){function n(e){return(0,f.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,f.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(r)]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e){const{properties:o,slots:a,children:s,...i}=e,c=zr(s,a),l=Object.fromEntries(Object.entries(c??{}).map((e=>{let[t,n]=e;return[t,{type:"bricks",bricks:(n.bricks??[]).map(r)}]})));return{...i,properties:n(o),slots:l,...Tr(t,i.ref,l)}}return n(e)}function _r(e,t,n,r,o){var a;const s=(0,g.uniqueId)("tpl-state-"),i={...n.runtimeContext,tplStateStoreId:s};delete i.forEachItem,delete i.forEachIndex,delete i.formStateStoreId;const c=new Rr("STATE",n,o,s);i.tplStateStoreMap.set(s,c),i.tplStateStoreScope&&i.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:f}=Pe.get(e);null==sa||null===(a=sa.flowApi)||void 0===a||a.collectWidgetContract(f),c.define(d,i,r);const{slots:p,children:h,...m}=t,v={...m,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const b={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=b.properties.get(t.ref);n||(n=[],b.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=b.slots.get(t.ref);n||(n=[],b.slots.set(t.ref,n)),n.push({from:e,to:t})}const y={reversedProxies:b,asyncHostPropertyEntries:r,externalSlots:zr(h,p),tplStateStoreId:s,hostBrick:n,__temporary_tpl_tag_name:e};return v.slots={"":{type:"bricks",bricks:l.map((e=>Mr(e,y)))}},v}function Mr(e,t){null===e.if&&delete e.if;const{properties:n,slots:r,children:o,...a}=e,s=zr(o,r),i=Object.fromEntries(Object.entries(s??{}).map((e=>{let[n,r]=e;return[n,{type:"bricks",bricks:(r.bricks??[]).map((e=>Mr(e,t)))}]})));return{...a,properties:Pr(n,t),slots:i,...Tr(t,a.ref,i)}}const Br="form-renderer.form-renderer",Lr=Symbol.for("form.stateStoreId"),$r=["forms.general-form","form.general-form","eo-form"];function Nr(e,t,n){const{id:r,bricks:o,events:a,context:s,mountPoint:i,instanceId:c}=e;let{brick:l,properties:u}=e;const d=t.find((e=>e.fieldId===r));if(d){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},r=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...r()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...r(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...r(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...r(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...r()}};break;default:t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description}}}return t}(d);l||(l=e.brick),u={...e.properties,...u}}const p={brick:l,properties:u,iid:c,slot:i,events:a,context:s,children:Ur(o,t,n),[Lr]:n};return(0,f.hasOwnProperty)(e,"if")&&(p.if=e.if),p}function Ur(e,t,n){if(Array.isArray(e))return e.map((e=>Nr(e,t,n)))}async function Fr(e,t,n,r,o,a,s,i){const c=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=$t(n,t.app.homepage,t.location.pathname);if(e&&await yt(n,t))return t.app.noAuthGuard||n.public||null==sa||!sa.auth||sa.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),l={blockingList:[]},u=l.menuRequestNode={return:a};switch(c){case"missed":break;case"unauthenticated":l.unauthenticated=!0;break;default:{var f;const a=l.route=c.route;l.path=c.match.path;const p={...n,match:c.match};i&&p.ctxStore.disposeDataInRoutes(t);const h=o.concat(a);p.ctxStore.define(a.context,p,void 0,h),p.pendingPermissionsPreCheck.push(null==sa||null===(f=sa.checkPermissions)||void 0===f?void 0:f.preCheckPermissionsForBrickOrRoute(a,(e=>mt(e,p))));const{preLoadBricks:m}=a;if(Array.isArray(m)&&l.blockingList.push((0,d.loadBricksImperatively)(m,ha())),"redirect"===a.type){let e;if(e="string"==typeof a.redirect?await mt(a.redirect,p):(await tt({transform:"redirect",...a.redirect},p)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);l.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return mt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(a.menu,p);let o;n&&(u.request=n),i||r.memoizeMenuRequestNode(t,u),o="routes"===a.type?await Fr(e,a.routes,p,r,h,u,s):await jr(e,a.bricks,p,r,h,u,s),Hr(l,o),qr(u,o.menuRequestNode)}}}return l}async function jr(e,t,n,r,o,a,s,i,c){!function(e,t,n){function r(e){if((0,f.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(const[t,n]of Object.entries(e))(0,f.isObject)(n)&&"useBrick"===t?Array.isArray(n)?n.forEach((e=>o(e,!0))):o(n,!0,!0):r(n)}function o(e,a,s){if(a&&(e[tr]=t),r(e.properties),n&&!s)return;const i=zr(e.children,e.slots);for(const e of Object.values(i??{}))for(const t of e.bricks??[])o(t,a)}for(const t of e)o(t)}(t,n,!0);const l={blockingList:[]},u=c??[];return(await Promise.all(t.map(((t,c)=>Dr(e,t,n,r,o,a,s,u.concat(c),i&&new Map(i)))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(s,u.concat(n),t.node,e),Hr(l,t)})),l}async function Dr(e,t,n,r,o,a,s){let i=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new Map;try{return await async function(e,t,n,r,o,a,s,i,c){var l,u;const p={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),p;const{if:h,permissionsPreCheck:m,...v}=t;if(function(e){return"string"==typeof e?(0,T.isTrackAll)(e):at(e)&&(0,T.isTrackAll)(st(e))}(h))return Dr(e,{brick:":if",dataSource:h,permissionsPreCheck:m,slots:{"":{type:"bricks",bricks:[v]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,a,s,i,c);const y=t[Ut],w=t[Lr],S={...n,tplStateStoreId:y,formStateStoreId:w};(0,f.hasOwnProperty)(t,Ft)?(S.forEachItem=t[Ft],S.forEachIndex=t[jt]):t[Dt]&&(delete S.forEachItem,delete S.forEachIndex);const{context:E}=t;if(Array.isArray(E)&&E.length>0){const e=Re(S);Te(e,"Defining context on bricks","check your brick:",t),e||S.ctxStore.define(E,S)}if(S.pendingPermissionsPreCheck.push(null==sa||null===(l=sa.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>mt(e,S)))),!await async function(e,t){return(0,f.isObject)(e.if)&&!at(e.if)?St(await tt(e.if,t)):yt(e,t)}(t,S))return p;const A=t.brick;if(A.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(A);const{dataSource:n}=t,l=async l=>{var u;const d=await mt(n,l),p=":forEach"===A?"":":switch"===A?String(d):d?"":"else",h=zr(t.children,t.slots),m=h&&(0,f.hasOwnProperty)(h,p)&&(null===(u=h[p])||void 0===u?void 0:u.bricks);if(!Array.isArray(m))return{blockingList:[]};switch(A){case":forEach":return Array.isArray(d)?async function(e,t,n,r,o,a,s,i,c,l){const u={blockingList:[]},d=t.length,f=await Promise.all(t.map(((t,u)=>Promise.all(n.map(((n,f)=>Dr(e,n,{...r,forEachItem:t,forEachIndex:u},o,a,s,i,l.concat(u*d+f),c&&new Map(c))))))));return f.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(i,l.concat(n),t.node,e),Hr(u,t)})),u}(e,d,m,l,r,o,a,s,c,i):{blockingList:[]};case":if":case":switch":return jr(e,m,l,r,o,a,s,c,i)}},u=async t=>{const n=await l(t);return n.node??(n.node={tag:On.PLACEHOLDER,return:e}),n},d=await u(S),{onMount:p,onUnmount:h}=t.lifeCycle??{},{contextNames:m,stateNames:v}=At(n);if(m||v){d.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,a,c]=Wr(S),l=await u(o),d=[...a,...c];if(await Vr(l,o,d),t===n){h&&un(h,S)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(s,i,l.node,e),p&&un(p,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of d)e.mountAsyncData()}},a=(0,g.debounce)(o);if(m)for(const e of m)S.ctxStore.onChange(e,a);if(v)for(const e of v)_e(S,"STATE",`: "${n}"`).onChange(e,a)}return p&&r.registerArbitraryLifeCycle("onMount",(()=>{un(p,S)(new CustomEvent("mount",{detail:{rerender:!1}}))})),h&&r.registerArbitraryLifeCycle("onUnmount",(()=>{un(h,S)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),d}/\.tpl-/.test(A)&&!Pe.get(A)&&await Gr((0,d.loadBricksImperatively)([A],ha()),"brick",A,r.unknownBricks);const k=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Pe.get(n))return n}return!!Pe.get(e)&&e}(A,null===(u=S.app)||void 0===u?void 0:u.id);if(k){const e=c.get(k)??0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${k}"`);c.set(k,e+1)}else A.includes("-")&&!customElements.get(A)&&(A===Br?customElements.define(Br,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):p.blockingList.push(Gr((0,d.enqueueStableLoadBricks)([A],ha()),"brick",A,r.unknownBricks)));let I,C;A===Br?({formData:I,...C}=t.properties??{}):C=t.properties;const R=[],x=function(e,t,n){return(0,f.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:a,stateNames:s,formStateNames:i}=At(o);return(a||s||i)&&n.push({contextNames:a,stateNames:s,formStateNames:i,propName:r,propValue:o}),[r,mt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?ft.USE_BRICK:ft.INITIAL})]})):[]}(C,S,R),P=t[Nt];P&&x.push(...P);const _="script"===A;if(_||"link"===A){const e=await It(x);if(_?e.src:"stylesheet"===e.rel&&e.href){const t=window.PUBLIC_ROOT??"";if(_){const{src:n,...r}=e;await Gr((0,d.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await Gr((0,d.loadStyle)(n,t,r),"stylesheet",n,"silent")}return p}}const M={tag:On.BRICK,type:k||A,return:e,slotId:s,events:t.events,runtimeContext:S,portal:t.portal,iid:t.iid,ref:t.ref};p.node=M;const B=(0,O.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);B.size>0&&p.blockingList.push(Gr((0,d.loadProcessorsImperatively)(B,ha()),"processors",[...B].join(", "),r.unknownBricks));const L=[];L.push((async()=>{M.properties=await It(x),function(e,t){for(const n of t){const t=()=>{e.element&&Rt(e.element,{[n.propName]:n.propValue},e.runtimeContext)};if(n.contextNames)for(const r of n.contextNames)e.runtimeContext.ctxStore.onChange(r,t);if(n.stateNames){const r=_e(e.runtimeContext,"STATE",`: "${n.propValue}"`);for(const e of n.stateNames)r.onChange(e,t)}if(n.formStateNames){const r=Ge(e.runtimeContext,"FORM_STATE",`: "${n.propValue}"`);for(const e of n.formStateNames)r.onChange(e,t)}}}(M,R)})()),r.registerBrickLifeCycle(M,t.lifeCycle);let $,N=t;k?N=_r(k,t,M,x,r):A===Br&&(N=function(e,t,n,r,o){var a;const s="string"==typeof e?JSON.parse(e):e,i=(0,g.uniqueId)("form-state-"),c={...n.runtimeContext,formStateStoreId:i};delete c.forEachItem,delete c.forEachIndex,delete c.tplStateStoreId;const l=new Rr("FORM_STATE",void 0,o,i);c.formStateStoreMap.set(i,l),c.formStateStoreScope&&c.formStateStoreScope.push(l);const u=s.context??[];u.some((e=>"params"===e.name))||u.push({name:"params"}),l.define(u,c,r);const d=Nr(s.formSchema,s.fields,i);return $r.includes(d.brick)&&t.events&&(d.events=function(e,t){const n=e??{};for(const[e,r]of Object.entries(t))n[e]=(0,f.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(d.events,t.events)),"boolean"!=typeof(null===(a=t.properties)||void 0===a?void 0:a.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[d]}]}:{...t,slots:void 0,children:[d]}}(I,t,M,x,r)),N.portal&&(M.slotId=void 0),k?($={...S},delete $.forEachItem,delete $.forEachIndex):$=S;return L.push((async()=>{const e=zr(N.children,N.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map(((e,n)=>{let[s,i]=e;if("routes"!==i.type)return jr(M,i.bricks,$,r,o,a,s,c);const l=o[o.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(n,s),r.performIncrementalRender(i,o,(async(e,t)=>{const{homepage:n}=$.app,{pathname:c}=e;if(!b(n,c)||!o.every((e=>{let r,o;return(r=$t(e,n,t.pathname))&&(o=$t(e,n,c))&&(e!==l||(0,g.isEqual)(r.params,o.params))})))return!1;const[u,d,f]=Wr({...$,location:e,query:new URLSearchParams(e.search)});let p,h=!1,m=[];try{if(p=await Fr(M,i.routes,u,r,o,a,s,!0),p.route){if(r.reBailout(p))return!0;m=[...d,...f],await Vr(p,u,[u.ctxStore,...m])}await r.reMergeMenuRequestNodes(a,i.routes,p.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=r.reCatch(e,M);if(!t)return!0;({failed:h,output:p}=t),await r.reMergeMenuRequestNodes(a,i.routes,p.menuRequestNode)}if(r.reRender(s,[],p.node,M),!h){u.ctxStore.mountAsyncData(p.route);for(const e of m)e.mountAsyncData()}return!!p.route||null}))),Fr(M,i.routes,$,r,o,a,s)}))),s={...p,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,M),Hr(s,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(s,e)})),s.node&&(M.child=s.node),Hr(p,{...s,node:void 0}),qr(a,p.menuRequestNode=s.menuRequestNode)})()),await Promise.all(L),p}(e,t,n,r,o,a,s,i,c)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:{tag:On.BRICK,type:"div",properties:{textContent:Jt(n),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:e},blockingList:[]};throw n}}function Kr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function Vr(e,t,n){return(0,d.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Wr(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function Hr(e,t){const{blockingList:n,node:r,menuRequestNode:o,hasTrackingControls:a,...s}=t;if(e.blockingList.push(...n),r)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=r}else e.node=r;Object.assign(e,s)}function qr(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function zr(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const t of e){const e=t.slot??"";(0,f.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(t)}}return n}function Gr(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let Yr,Qr,Jr;function Xr(){if(!Yr){if(Yr={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){Yr.isInIframe=!0;try{if(window.origin===window.parent.origin){Yr.isInIframeOfSameSite=!0;const e="/next/"===m(),t=window.parent.location.pathname,n=t.startsWith("/next/");Yr.isInIframeOfNext=0==(Number(e)^Number(n)),Yr.isInIframeOfVisualBuilder=t.startsWith((n?"/next":"")+"/visual-builder/"),Yr.isInIframeOfLegacyConsole=e&&!n}}catch(e){}}Object.freeze(Yr)}return Yr}function Zr(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Pe.define(n,t)}}function eo(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const to="basic.show-watermark";var no=new WeakMap,ro=new WeakMap,oo=new WeakMap,ao=new WeakMap,so=new WeakMap,io=new WeakMap,co=new WeakMap,lo=new WeakMap,uo=new WeakMap,fo=new WeakMap,po=new WeakMap,ho=new WeakMap,mo=new WeakSet;class go{constructor(e){(0,o.A)(this,mo),(0,s.A)(this,no,void 0),(0,s.A)(this,ro,!1),(0,s.A)(this,oo,void 0),(0,s.A)(this,ao,void 0),(0,s.A)(this,so,void 0),(0,s.A)(this,io,void 0),(0,s.A)(this,co,new Set),(0,s.A)(this,lo,0),(0,s.A)(this,uo,void 0),(0,s.A)(this,fo,void 0),(0,s.A)(this,po,void 0),(0,s.A)(this,ho,void 0),(0,c.A)(no,this,e);const t=C();window.addEventListener("beforeunload",(e=>{(0,i.A)(mo,this,vo).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,i.A)(mo,this,vo).call(this,{location:e,action:t})))}getRenderId(){return(0,l.A)(uo,this)}getRuntimeContext(){return(0,l.A)(so,this)}getRecentApps(){return{currentApp:(0,l.A)(fo,this),previousApp:(0,l.A)(po,this)}}getNavConfig(){return(0,l.A)(ho,this)}bootstrap(){window.AbortController&&(Qr=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{...e.options,signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:Qr.signal}}})));const e=C();(0,c.A)(oo,this,e.location);let t=0;return e.listen((async(e,n)=>{var r,o,a,s;const u=++t;let d;const f={hash:void 0,state:void 0};var p;if(void 0!==e.key&&("POP"!==n||void 0!==(0,l.A)(oo,this).key&&!1!==(null===(r=(0,l.A)(oo,this).state)||void 0===r?void 0:r.notify))||(f.key=void 0),((0,h.locationsAreEqual)({...(0,l.A)(oo,this),...f},{...e,...f})||"POP"!==n&&!1===(null===(o=e.state)||void 0===o?void 0:o.notify))&&(d=!0),d||null!==(a=e.state)&&void 0!==a&&a.noIncremental||(d=await(null===(p=(0,l.A)(io,this))||void 0===p?void 0:p.didPerformIncrementalRender(e,(0,l.A)(oo,this)))),t===u)if(d)(0,c.A)(oo,this,e);else{if(Qr&&(Qr.abort(),Qr=new AbortController),(0,c.A)(oo,this,e),null===(s=(0,l.A)(io,this))||void 0===s||s.dispatchPageLeave(),"POP"===n&&y(v((0,l.A)(no,this),e.pathname)))return void window.location.reload();(0,l.A)(ro,this)?(0,c.A)(ao,this,e):(V("locationChange"),(0,i.A)(mo,this,yo).call(this,e).catch(nn))}})),(0,i.A)(mo,this,yo).call(this,e.location)}}function vo(e){var t;const n=C(),r=n.getBlockMessage();null===(t=(0,l.A)(io,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function bo(e,t,n){var r,o;if((0,c.A)(lo,this,(r=(0,l.A)(lo,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}C().replace(e,t)}async function yo(e){(0,c.A)(ro,this,!0);try{await(0,i.A)(mo,this,wo).call(this,e)}finally{if((0,c.A)(ro,this,!1),(0,l.A)(ao,this)){const e=(0,l.A)(ao,this);(0,c.A)(ao,this,void 0),await(0,i.A)(mo,this,yo).call(this,e)}}}async function wo(e){var t,n,r,o;const a=(0,c.A)(uo,this,(0,g.uniqueId)("render-id-"));Je=new WeakSet,et.clear(),null==sa||null===(t=sa.flowApi)||void 0===t||t.clearCollectWidgetContract(),C().unblock();const s=null==sa||null===(n=sa.pageView)||void 0===n?void 0:n.create(),u=v((0,l.A)(no,this),e.pathname),f=null===(r=(0,l.A)(so,this))||void 0===r?void 0:r.app,p=null==u||null===(o=u.app)||void 0===o?void 0:o.id;window.BOOTSTRAP_UNION_FILE&&p&&p!==(null==f?void 0:f.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:p,version:u.app.currentVersion}),null!=u&&u.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==sa||null===(t=sa.fulfilStoryboard)||void 0===t?void 0:t.call(sa,e)),B(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(u);const h=(0,c.A)(fo,this,null==u?void 0:u.app);!function(){var e,t,n,r,o;const a=ca().getFeatureFlags(),s=ca().getMiscSettings();if(!a["show-watermark"])return;const i="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),c=(null==sa||null===(n=sa.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)??"",l=s.watermarkConfig??{flags:{}},u={content:[..."string"==typeof l.content?[l.content]:l.content??[],null!==(r=l.flags)&&void 0!==r&&r["show-development"]&&i?"Development":"",null!==(o=l.flags)&&void 0!==o&&o["show-user"]?c:""].filter(Boolean),zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,g.omit)(l,["content","flags"])};Jr?Jr.resolve(u):(0,d.loadBricksImperatively)([to],ha()).then((()=>{Jr=document.createElement(to),Jr.resolve(u)}),(e=>{console.error("Load watermark service failed:",e)}))}();const m=f&&h?f.id!==h.id:f!==h,b=ca().getFeatureFlags(),y=(0,l.A)(io,this),w=(t,n)=>{null==s||s({status:"redirected"}),(0,l.A)(co,this).add(y),(0,i.A)(mo,this,bo).call(this,t,n,e)},S=()=>{const t=b["sso-enabled"]?"/sso-auth/login":"/auth/login";Qt(e),w(t,{from:e})},E=document.querySelector("#main-mount-point"),A=document.querySelector("#portal-mount-point"),k={tag:On.ROOT,container:E,createPortal:A},I=()=>{var e;xn(E),xn(A),(0,l.A)(co,this).add(y);for(const e of(0,l.A)(co,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,l.A)(co,this).clear(),null==sa||null===(e=sa.messageDispatcher)||void 0===e||e.reset(),m&&((0,c.A)(po,this,f),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:f,currentApp:h}})))};if(X(h&&(re()[h.id]||h.theme)||"light"),ae("default"),h){var T,O,x,P,_,M;null==sa||null===(T=sa.checkInstalledApps)||void 0===T||T.preCheckInstalledApps(u,(e=>!!ba(e)));const t={bailout:e=>e.unauthenticated?(S(),!0):e.redirect?(w(e.redirect.path,e.redirect.state),!0):void(0,c.A)(lo,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,c.A)(ho,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,l.A)(ho,this)}))},catch:(t,n)=>{if(!Xt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const r=ca().getMiscSettings().noAuthGuardLoginPath;return Xt(t)&&r?void w(r,{from:e}):{failed:!0,output:{node:{tag:On.BRICK,type:"div",properties:{textContent:Jt(t),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:n},blockingList:[]}}}(0,l.A)(co,this).add(y)}else S()}},n=(0,c.A)(io,this,new Wn("page",{routeHelper:t,renderId:a})),r=(0,c.A)(so,this,{app:h,location:e,query:new URLSearchParams(e.search),flags:b,sys:{...null==sa||null===(O=sa.auth)||void 0===O?void 0:O.getAuth(),...Xr(),settings:{brand:ca().getBrandSettings()}},ctxStore:new Rr("CTX",void 0,n),pendingPermissionsPreCheck:[null==sa||null===(x=sa.checkPermissions)||void 0===x?void 0:x.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,c.A)(ho,this,void 0),Zr(u),me(null===(P=u.meta)||void 0===P?void 0:P.functions,h),null==sa||null===(_=sa.flowApi)||void 0===_||_.collectContract(null===(M=u.meta)||void 0===M?void 0:M.contracts);let o,i=!1,d=[];try{const e={};if(o=await Fr(k,function(e){if(window.parent===window)return e;let t=e;const n=(0,g.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const r=(0,g.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)],t}(u.routes),r,n,[],e),t.bailout(o))return;d=Kr(r),await Vr(o,r,d),e.child=o.menuRequestNode,n.setInitialMenuRequestNode(e),await t.mergeMenus(n.getMenuRequests())}catch(e){console.error("Router failed:",e);const n=t.catch(e,k);if(!n)return;({failed:i,output:o}=n)}if(k.child=o.node,I(),o.route&&"routes"!==o.route.type||i){if(i||n.dispatchBeforePageLoad(),te(),ie(),eo(null==h?void 0:h.uiVersion),Pn(k),window.scrollTo(0,0),i)null==s||s({status:"failed"});else{n.dispatchPageLoad(),n.dispatchAnchorLoad(),n.dispatchOnMount(),n.initializeScrollIntoView(),n.initializeMediaChange(),n.initializeMessageDispatcher();for(const e of d)e.mountAsyncData();null==s||s({status:"ok",path:o.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=sa&&sa.auth&&!sa.auth.isLoggedIn())return void S();I()}te(),ie();const L={tag:On.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:k};k.child=L,Pn(k),window.scrollTo(0,0),null==s||s({status:"not-found"}),V("rendered")}const So="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function Eo(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function Ao(e){return e<=1?"".concat(100*Number(e),"%"):e}function ko(e){return 1===e.length?"0"+e:String(e)}function Io(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Co(e){return Ro(e)/255}function Ro(e){return parseInt(e,16)}var To={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Oo(e){var t,n,r,o={r:0,g:0,b:0},a=1,s=null,i=null,c=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(To[e])e=To[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=Mo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Mo.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Mo.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Mo.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Mo.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Mo.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Mo.hex8.exec(e))?{r:Ro(n[1]),g:Ro(n[2]),b:Ro(n[3]),a:Co(n[4]),format:t?"name":"hex8"}:(n=Mo.hex6.exec(e))?{r:Ro(n[1]),g:Ro(n[2]),b:Ro(n[3]),format:t?"name":"hex"}:(n=Mo.hex4.exec(e))?{r:Ro(n[1]+n[1]),g:Ro(n[2]+n[2]),b:Ro(n[3]+n[3]),a:Co(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=Mo.hex3.exec(e))&&{r:Ro(n[1]+n[1]),g:Ro(n[2]+n[2]),b:Ro(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(Bo(e.r)&&Bo(e.g)&&Bo(e.b)?(t=e.r,n=e.g,r=e.b,o={r:255*Eo(t,255),g:255*Eo(n,255),b:255*Eo(r,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):Bo(e.h)&&Bo(e.s)&&Bo(e.v)?(s=Ao(e.s),i=Ao(e.v),o=function(e,t,n){e=6*Eo(e,360),t=Eo(t,100),n=Eo(n,100);var r=Math.floor(e),o=e-r,a=n*(1-t),s=n*(1-o*t),i=n*(1-(1-o)*t),c=r%6;return{r:255*[n,s,a,a,i,n][c],g:255*[i,n,n,s,a,a][c],b:255*[a,a,i,n,n,s][c]}}(e.h,s,i),l=!0,u="hsv"):Bo(e.h)&&Bo(e.s)&&Bo(e.l)&&(s=Ao(e.s),c=Ao(e.l),o=function(e,t,n){var r,o,a;if(e=Eo(e,360),t=Eo(t,100),n=Eo(n,100),0===t)o=n,a=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,i=2*n-s;r=Io(i,s,e+1/3),o=Io(i,s,e),a=Io(i,s,e-1/3)}return{r:255*r,g:255*o,b:255*a}}(e.h,s,c),l=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(a=e.a)),a=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(a),{ok:l,format:e.format||u,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a}}var xo="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),Po="[\\s|\\(]+(".concat(xo,")[,|\\s]+(").concat(xo,")[,|\\s]+(").concat(xo,")\\s*\\)?"),_o="[\\s|\\(]+(".concat(xo,")[,|\\s]+(").concat(xo,")[,|\\s]+(").concat(xo,")[,|\\s]+(").concat(xo,")\\s*\\)?"),Mo={CSS_UNIT:new RegExp(xo),rgb:new RegExp("rgb"+Po),rgba:new RegExp("rgba"+_o),hsl:new RegExp("hsl"+Po),hsla:new RegExp("hsla"+_o),hsv:new RegExp("hsv"+Po),hsva:new RegExp("hsva"+_o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Bo(e){return Boolean(Mo.CSS_UNIT.exec(String(e)))}var Lo=2,$o=.16,No=.05,Uo=.05,Fo=.15,jo=5,Do=4,Ko=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Vo(e){var t=function(e,t,n){e=Eo(e,255),t=Eo(t,255),n=Eo(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),a=0,s=r,i=r-o,c=0===r?0:i/r;if(r===o)a=0;else{switch(r){case e:a=(t-n)/i+(t<n?6:0);break;case t:a=(n-e)/i+2;break;case n:a=(e-t)/i+4}a/=6}return{h:a,s:c,v:s}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function Wo(e){var t=e.r,n=e.g,r=e.b;return"#".concat(function(e,t,n,r){var o=[ko(Math.round(e).toString(16)),ko(Math.round(t).toString(16)),ko(Math.round(n).toString(16))];return o.join("")}(t,n,r))}function Ho(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Lo*t:Math.round(e.h)+Lo*t:n?Math.round(e.h)+Lo*t:Math.round(e.h)-Lo*t)<0?r+=360:r>=360&&(r-=360),r}function qo(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-$o*t:t===Do?e.s+$o:e.s+No*t)>1&&(r=1),n&&t===jo&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function zo(e,t,n){var r;return(r=n?e.v+Uo*t:e.v-Fo*t)>1&&(r=1),Number(r.toFixed(2))}function Go(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Oo(e),o=jo;o>0;o-=1){var a=Vo(r),s=Wo(Oo({h:Ho(a,o,!0),s:qo(a,o,!0),v:zo(a,o,!0)}));n.push(s)}n.push(Wo(r));for(var i=1;i<=Do;i+=1){var c=Vo(r),l=Wo(Oo({h:Ho(c,i),s:qo(c,i),v:zo(c,i)}));n.push(l)}return"dark"===t.theme?Ko.map((function(e){var r,o,a,s=e.index,i=e.opacity;return Wo((r=Oo(t.backgroundColor||"#141414"),a=100*i/100,{r:((o=Oo(n[s])).r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b}))})):n}var Yo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Qo={},Jo={};function Xo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Zo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function ea(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function ta(e,t,n){return"dark"===t?Go(e,{theme:t,backgroundColor:n})[5]:e}function na(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Zo:Xo)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?Zo:Xo)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,r]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),r.map(((e,r)=>[" --palette-".concat(n,"-").concat(r+1,"-channel: ").concat(ea(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(r+1,": rgb(var(--palette-").concat(n,"-").concat(r+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[r,o]=e;return[r,Go(o,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((r=>{var[o,a]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(ea(ta(t[a],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(a,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(a,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(a,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Zo:Xo)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let ra,oa,aa,sa;function ia(e){if(ra)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case j:D=n.panel}})),sa=null==e?void 0:e.hooks,(0,u.initializeI18n)(qt,zt),p.locale(u.i18n.language),u.i18n.on("languageChanged",(()=>{p.locale(u.i18n.language)})),I(),ra=new fa,ra}Object.keys(Yo).forEach((function(e){Qo[e]=Go(Yo[e]),Qo[e].primary=Qo[e][5],Jo[e]=Go(Yo[e],{theme:"dark",backgroundColor:"#141414"}),Jo[e].primary=Jo[e][5]})),Qo.red,Qo.volcano,Qo.gold,Qo.orange,Qo.yellow,Qo.lime,Qo.green,Qo.cyan,Qo.blue,Qo.geekblue,Qo.purple,Qo.magenta,Qo.grey;const ca=function(){const e=k();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return ra};var la=new WeakMap,ua=new WeakMap,da=new WeakSet;class fa{constructor(){(0,o.A)(this,da),(0,s.A)(this,la,!1),(0,s.A)(this,ua,!1),(0,a.A)(this,"version",3)}initialize(e){var t;if((0,l.A)(la,this))throw new Error("The runtime cannot be initialized more than once");(0,c.A)(la,this,!0),function(e){(0,f.isObject)(e.settings)&&(0,f.deepFreeze)(e.settings),e.brickPackages&&(0,f.deepFreeze)(e.brickPackages)}(e),oa=e;const{notification:n,dialog:r}=(0,i.A)(da,this,pa).call(this);var o;!1!==n&&(o=n??"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{en=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{Gt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(r??"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?na({type:"brandColor",...e.brandColor}):e.baseColors?na({type:"baseColors",...e.baseColors}):e.variables&&na({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,l.A)(ua,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,c.A)(ua,this,!0),aa=new go(oa.storyboards),await aa.bootstrap()}getRecentApps(){var e;return(null===(e=aa)||void 0===e?void 0:e.getRecentApps())??{}}getCurrentApp(){var e;return null===(e=aa)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return ze(e,t)}getFeatureFlags(){var e,t;return{...null===(e=oa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=aa)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=oa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=aa)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=oa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=oa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e;return(null===(e=oa)||void 0===e?void 0:e.desktops)??[]}getLaunchpadSiteMap(){var e;return(null===(e=oa)||void 0===e?void 0:e.siteSort)??[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){const t=this.getBrandSettings().base_title;document.title=e?`${e} - ${t}`:t}getNavConfig(){var e;return null===(e=aa)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,d.loadBricksImperatively)(e,ha())}}function pa(){var e;return(null===(e=oa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.presetBricks)??{}}function ha(){var e;return function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...e,...t].forEach((e=>{const t=e.filePath.split("/")[1];n.set(t,e)})),Array.from(n.values())}(null===(e=oa)||void 0===e?void 0:e.brickPackages,window.PUBLIC_DEPS)??So??window.STANDALONE_BRICK_PACKAGES??[]}function ma(){var e;return null===(e=aa)||void 0===e?void 0:e.getRenderId()}function ga(){var e;return null===(e=aa)||void 0===e?void 0:e.getRuntimeContext()}function va(e){var t;return null===(t=oa)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function ba(e){var t;return null===(t=va(e))||void 0===t?void 0:t.app}function ya(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==sa||null===(e=sa.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function wa(){var e;return null==sa||null===(e=sa.auth)||void 0===e?void 0:e.getAuth()}function Sa(){var e,t;return null==sa||null===(e=sa.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Ea(){var e;return null==sa||null===(e=sa.auth)||void 0===e?void 0:e.isLoggedIn()}async function Aa(e,t,n){return nt(await Qe(e),e,"resolve",t,n)}function ka(e){let t,{portal:n,scope:r="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n;t=n||(()=>(a=document.createElement("div"),a.style.position="absolute",a.style.width=a.style.height="0",document.body.append(a),a));let s,i,c=!1;return{async render(n){let{theme:l,uiVersion:u,context:d,functions:f,templates:p,i18n:h,url:m,app:v}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");const b=[].concat(n),y=s,w=(0,g.uniqueId)("render-id-");s=new Wn(r,{unknownBricks:o,renderId:w});const S={ctxStore:new Rr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(m){const e=new URL(m);S.query=e.searchParams,S.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const E={tag:On.ROOT,container:e,createPortal:t};if("page"===r){var A;X(l??"light"),ae("default"),eo(u),v??(v={id:"demo",homepage:"/demo"}),S.app=v;const e={app:v,meta:{i18n:h,customTemplates:p}};null===(A=i)||void 0===A||A(),i=B(e),Zr(e),me(f,v)}S.ctxStore.define(d,S);let k,I=!1,C=[];try{k=await jr(E,b,S,s,[],{}),C=Kr(S),await Vr(k,S,C)}catch(e){I=!0,k={node:{tag:On.BRICK,type:"div",properties:{textContent:Jt(e),dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},return:E,runtimeContext:null},blockingList:[]}}if(E.child=k.node,null==y||y.dispatchOnUnmount(),null==y||y.dispose(),xn(e),a&&xn(a),"page"===r&&(I||s.dispatchBeforePageLoad(),te(),ie()),Pn(E),"page"===r&&window.scrollTo(0,0),!I){for(const e of C)e.mountAsyncData();"page"===r&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}},unmount(){c||(c=!0,xn(e),a&&(xn(a),n||a.remove()))}}}function Ia(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...ga()};t&&(n.query=new URLSearchParams(C().location.search));const r=t=>{if("string"==typeof t){if((0,T.isEvaluable)(t)){const e=ut(t,n);return Xe(e),e}return(0,x.inject)(t,n)}return!(0,f.isObject)(t)||Ze(e)?t:Array.isArray(t)?t.map((e=>r(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[r(t),r(n)]})))};return r(e)}}}]);
|
|
3
|
+
//# sourceMappingURL=7041.3cd44633.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! (c) Andrea Giammarchi - ISC */
|