@next-bricks/ai-portal 0.46.2 → 0.47.0
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 +27 -23
- package/dist/chunks/114.af61e48a.js +2 -0
- package/dist/chunks/{114.86e10cdd.js.map → 114.af61e48a.js.map} +1 -1
- package/dist/chunks/{161.a114c103.js → 161.6c50f07c.js} +3 -3
- package/dist/chunks/{161.a114c103.js.map → 161.6c50f07c.js.map} +1 -1
- package/dist/chunks/1692.fc5b8118.js +2 -0
- package/dist/chunks/1692.fc5b8118.js.map +1 -0
- package/dist/chunks/1889.b7766f77.js +2 -0
- package/dist/chunks/1889.b7766f77.js.map +1 -0
- package/dist/chunks/3151.d1fdecfb.js +3 -0
- package/dist/chunks/3151.d1fdecfb.js.map +1 -0
- package/dist/chunks/{3171.f486ac82.js → 3171.a4a34e43.js} +2 -2
- package/dist/chunks/{3171.f486ac82.js.map → 3171.a4a34e43.js.map} +1 -1
- package/dist/chunks/{3744.327905d1.js → 3744.8d040aaa.js} +2 -2
- package/dist/chunks/{3744.327905d1.js.map → 3744.8d040aaa.js.map} +1 -1
- package/dist/chunks/{4228.fb9278c3.js → 4228.ea602510.js} +2 -2
- package/dist/chunks/{4228.fb9278c3.js.map → 4228.ea602510.js.map} +1 -1
- package/dist/chunks/4306.9e8251b7.js +2 -0
- package/dist/chunks/4306.9e8251b7.js.map +1 -0
- package/dist/chunks/{7146.c0ae3b12.js → 4765.f5f33140.js} +2 -2
- package/dist/chunks/{7146.c0ae3b12.js.map → 4765.f5f33140.js.map} +1 -1
- package/dist/chunks/{4837.e8c87fc9.js → 4837.d70e4d5f.js} +2 -2
- package/dist/chunks/{9599.ffd509c6.js.map → 4837.d70e4d5f.js.map} +1 -1
- package/dist/chunks/495.8b4a1756.js +2 -0
- package/dist/chunks/495.8b4a1756.js.map +1 -0
- package/dist/chunks/{5552.57a9edba.js → 5552.39ed2457.js} +2 -2
- package/dist/chunks/{5552.57a9edba.js.map → 5552.39ed2457.js.map} +1 -1
- package/dist/chunks/{6530.dd7ab536.js → 6530.3c295a95.js} +2 -2
- package/dist/chunks/6530.3c295a95.js.map +1 -0
- package/dist/chunks/{4765.ae81ae59.js → 7146.6cc7fa79.js} +2 -2
- package/dist/chunks/{4765.ae81ae59.js.map → 7146.6cc7fa79.js.map} +1 -1
- package/dist/chunks/7431.9dd045ca.js +3 -0
- package/dist/chunks/{7431.23127b05.js.map → 7431.9dd045ca.js.map} +1 -1
- package/dist/chunks/7570.62513e32.js +2 -0
- package/dist/chunks/{7570.708bdafd.js.map → 7570.62513e32.js.map} +1 -1
- package/dist/chunks/7733.dbb66cbc.js +2 -0
- package/dist/chunks/{7733.0615ed85.js.map → 7733.dbb66cbc.js.map} +1 -1
- package/dist/chunks/{8882.30a26232.js → 8882.1dd288fd.js} +3 -3
- package/dist/chunks/{8882.30a26232.js.map → 8882.1dd288fd.js.map} +1 -1
- package/dist/chunks/9328.b23938c7.js +2 -0
- package/dist/chunks/9328.b23938c7.js.map +1 -0
- package/dist/chunks/{9474.094511f1.js → 9474.59a27cc1.js} +2 -2
- package/dist/chunks/9474.59a27cc1.js.map +1 -0
- package/dist/chunks/948.85b663ec.js +3 -0
- package/dist/chunks/948.85b663ec.js.map +1 -0
- package/dist/chunks/{9599.ffd509c6.js → 9599.8bf50b3b.js} +2 -2
- package/dist/chunks/{4837.e8c87fc9.js.map → 9599.8bf50b3b.js.map} +1 -1
- package/dist/chunks/action-buttons.52180d20.js +2 -0
- package/dist/chunks/{action-buttons.e4dbe352.js.map → action-buttons.52180d20.js.map} +1 -1
- package/dist/chunks/{activity-timeline.5ea5526f.js → activity-timeline.0c683db9.js} +2 -2
- package/dist/chunks/{activity-timeline.5ea5526f.js.map → activity-timeline.0c683db9.js.map} +1 -1
- package/dist/chunks/{ai-agents.8bc0db39.js → ai-agents.4b5985d1.js} +3 -3
- package/dist/chunks/{ai-agents.8bc0db39.js.map → ai-agents.4b5985d1.js.map} +1 -1
- package/dist/chunks/ai-employees.10893372.js +3 -0
- package/dist/chunks/{ai-employees.b4cfaf9c.js.map → ai-employees.10893372.js.map} +1 -1
- package/dist/chunks/{call-tool.45c76c9a.js → call-tool.1be50464.js} +2 -2
- package/dist/chunks/{call-tool.45c76c9a.js.map → call-tool.1be50464.js.map} +1 -1
- package/dist/chunks/chat-box.57a9d3ec.js +2 -0
- package/dist/chunks/{chat-box.0e8ed3b2.js.map → chat-box.57a9d3ec.js.map} +1 -1
- package/dist/chunks/chat-input.6e8da9e5.js +3 -0
- package/dist/chunks/{chat-input.2bf76ff7.js.map → chat-input.6e8da9e5.js.map} +1 -1
- package/dist/chunks/chat-stream.596a9cf9.js +2 -0
- package/dist/chunks/{chat-stream.40fc8941.js.map → chat-stream.596a9cf9.js.map} +1 -1
- package/dist/chunks/cruise-canvas.5cd0f774.js +2 -0
- package/dist/chunks/{cruise-canvas.f84b9094.js.map → cruise-canvas.5cd0f774.js.map} +1 -1
- package/dist/chunks/{dropdown-select.3c0cd96d.js → dropdown-select.3b1915db.js} +2 -2
- package/dist/chunks/{dropdown-select.3c0cd96d.js.map → dropdown-select.3b1915db.js.map} +1 -1
- package/dist/chunks/{elevo-logo.dc137a3c.js → elevo-logo.93d0f4ab.js} +2 -2
- package/dist/chunks/{elevo-logo.dc137a3c.js.map → elevo-logo.93d0f4ab.js.map} +1 -1
- package/dist/chunks/{elevo-sidebar.6f74b954.js → elevo-sidebar.877ac231.js} +3 -3
- package/dist/chunks/{elevo-sidebar.6f74b954.js.map → elevo-sidebar.877ac231.js.map} +1 -1
- package/dist/chunks/goal-card-list.7b4a6342.js +3 -0
- package/dist/chunks/{goal-card-list.a9057f02.js.map → goal-card-list.7b4a6342.js.map} +1 -1
- package/dist/chunks/{home-container.211ba989.js → home-container.1866b2fa.js} +2 -2
- package/dist/chunks/{home-container.211ba989.js.map → home-container.1866b2fa.js.map} +1 -1
- package/dist/chunks/{icon-button.1f657055.js → icon-button.1ac30b57.js} +2 -2
- package/dist/chunks/{icon-button.1f657055.js.map → icon-button.1ac30b57.js.map} +1 -1
- package/dist/chunks/{load-request-store.eb92f754.js → load-request-store.0229141e.js} +2 -2
- package/dist/chunks/{load-request-store.eb92f754.js.map → load-request-store.0229141e.js.map} +1 -1
- package/dist/chunks/main.83b93022.js +2 -0
- package/dist/chunks/{main.0a194943.js.map → main.83b93022.js.map} +1 -1
- package/dist/chunks/{mcp-tools.457ff64a.js → mcp-tools.028e5150.js} +2 -2
- package/dist/chunks/{mcp-tools.457ff64a.js.map → mcp-tools.028e5150.js.map} +1 -1
- package/dist/chunks/{page-container.099db5b9.js → page-container.5da7bbb4.js} +2 -2
- package/dist/chunks/{page-container.099db5b9.js.map → page-container.5da7bbb4.js.map} +1 -1
- package/dist/chunks/{preview-container.bbde74aa.js → preview-container.6aa7058b.js} +2 -2
- package/dist/chunks/{preview-container.bbde74aa.js.map → preview-container.6aa7058b.js.map} +1 -1
- package/dist/chunks/project-conversations.5326be22.js +3 -0
- package/dist/chunks/{project-conversations.e525349e.js.map → project-conversations.5326be22.js.map} +1 -1
- package/dist/chunks/{project-knowledges.e5845df3.js → project-knowledges.7c8e9b0c.js} +3 -3
- package/dist/chunks/{project-knowledges.e5845df3.js.map → project-knowledges.7c8e9b0c.js.map} +1 -1
- package/dist/chunks/show-case.47b40ba3.js +2 -0
- package/dist/chunks/{show-case.e7d8f1a7.js.map → show-case.47b40ba3.js.map} +1 -1
- package/dist/chunks/show-cases.5dcf60c0.js +2 -0
- package/dist/chunks/{show-cases.b26fafd9.js.map → show-cases.5dcf60c0.js.map} +1 -1
- package/dist/chunks/stat-with-mini-chart.c9fde80c.js +2 -0
- package/dist/chunks/{stat-with-mini-chart.0c308dd8.js.map → stat-with-mini-chart.c9fde80c.js.map} +1 -1
- package/dist/chunks/tab-list.2cbcb36a.js +3 -0
- package/dist/chunks/{tab-list.acfe1ff4.js.map → tab-list.2cbcb36a.js.map} +1 -1
- package/dist/examples.json +6 -6
- package/dist/index.5606be01.js +2 -0
- package/dist/index.5606be01.js.map +1 -0
- package/dist/manifest.json +215 -215
- package/dist/types.json +104 -104
- package/dist-types/shared/MarkdownPre.d.ts +5 -0
- package/dist-types/shared/bricks.d.ts +2 -0
- package/package.json +3 -3
- package/dist/chunks/103.8b767f50.js +0 -3
- package/dist/chunks/103.8b767f50.js.map +0 -1
- package/dist/chunks/114.86e10cdd.js +0 -2
- package/dist/chunks/1889.218ea7ea.js +0 -2
- package/dist/chunks/1889.218ea7ea.js.map +0 -1
- package/dist/chunks/4306.bae21d5d.js +0 -2
- package/dist/chunks/4306.bae21d5d.js.map +0 -1
- package/dist/chunks/495.ab513dc5.js +0 -2
- package/dist/chunks/495.ab513dc5.js.map +0 -1
- package/dist/chunks/6530.dd7ab536.js.map +0 -1
- package/dist/chunks/7431.23127b05.js +0 -3
- package/dist/chunks/7570.708bdafd.js +0 -2
- package/dist/chunks/7733.0615ed85.js +0 -2
- package/dist/chunks/7954.c1753f33.js +0 -2
- package/dist/chunks/7954.c1753f33.js.map +0 -1
- package/dist/chunks/9140.8e69fcb4.js +0 -3
- package/dist/chunks/9140.8e69fcb4.js.map +0 -1
- package/dist/chunks/9328.c93d9ac1.js +0 -2
- package/dist/chunks/9328.c93d9ac1.js.map +0 -1
- package/dist/chunks/9474.094511f1.js.map +0 -1
- package/dist/chunks/action-buttons.e4dbe352.js +0 -2
- package/dist/chunks/ai-employees.b4cfaf9c.js +0 -3
- package/dist/chunks/chat-box.0e8ed3b2.js +0 -2
- package/dist/chunks/chat-input.2bf76ff7.js +0 -3
- package/dist/chunks/chat-stream.40fc8941.js +0 -2
- package/dist/chunks/cruise-canvas.f84b9094.js +0 -2
- package/dist/chunks/goal-card-list.a9057f02.js +0 -3
- package/dist/chunks/main.0a194943.js +0 -2
- package/dist/chunks/project-conversations.e525349e.js +0 -3
- package/dist/chunks/show-case.e7d8f1a7.js +0 -2
- package/dist/chunks/show-cases.b26fafd9.js +0 -2
- package/dist/chunks/stat-with-mini-chart.0c308dd8.js +0 -2
- package/dist/chunks/tab-list.acfe1ff4.js +0 -3
- package/dist/index.0ebd0c2a.js +0 -2
- package/dist/index.0ebd0c2a.js.map +0 -1
- package/dist-types/cruise-canvas/CodeBlock/CodeBlock.d.ts +0 -5
- package/dist-types/shared/CodeDisplay.d.ts +0 -12
- /package/dist/chunks/{161.a114c103.js.LICENSE.txt → 161.6c50f07c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{103.8b767f50.js.LICENSE.txt → 3151.d1fdecfb.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7431.23127b05.js.LICENSE.txt → 7431.9dd045ca.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{8882.30a26232.js.LICENSE.txt → 8882.1dd288fd.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{9140.8e69fcb4.js.LICENSE.txt → 948.85b663ec.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{ai-agents.8bc0db39.js.LICENSE.txt → ai-agents.4b5985d1.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{ai-employees.b4cfaf9c.js.LICENSE.txt → ai-employees.10893372.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-input.2bf76ff7.js.LICENSE.txt → chat-input.6e8da9e5.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{elevo-sidebar.6f74b954.js.LICENSE.txt → elevo-sidebar.877ac231.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{goal-card-list.a9057f02.js.LICENSE.txt → goal-card-list.7b4a6342.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{project-conversations.e525349e.js.LICENSE.txt → project-conversations.5326be22.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{project-knowledges.e5845df3.js.LICENSE.txt → project-knowledges.7c8e9b0c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{tab-list.acfe1ff4.js.LICENSE.txt → tab-list.2cbcb36a.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 9140.8e69fcb4.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[9140],{11369:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(17545);function o(e){var t=function(e){if("object"!=(0,r.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=(0,r.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},12559:(e,t,n)=>{function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},17545:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},19140:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>en,Notification:()=>ln,StoryboardFunctionRegistryFactory:()=>ge,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>Li,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>Ct,checkIfOfComputed:()=>It,createHistory:()=>A,createRuntime:()=>ki,customEditors:()=>ji,customProcessors:()=>M,customTemplates:()=>Be,fetchByProvider:()=>Di,getAuth:()=>$i,getBasePath:()=>p,getCssPropertyValue:()=>ce,getCurrentMode:()=>ae,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>go,getRealValue:()=>Vi,getRuntime:()=>Ii,getThemeVariant:()=>de,getV2RuntimeFromDll:()=>S,handleHttpError:()=>cn,httpErrorToString:()=>nn,instantiateModalStack:()=>zi,isLoggedIn:()=>Ui,isNetworkError:()=>wo,isUnauthenticatedError:()=>rn,logout:()=>Ni,matchPath:()=>jt,registerWidgetFunctions:()=>Fe,registerWidgetI18n:()=>N,resetReloadForError:()=>ko,setUIVersion:()=>bo,shouldReloadForError:()=>Ao,unstable_createRoot:()=>Ki});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Lr,debugDataValue:()=>_r,getAddedContracts:()=>Tr,getAllContextValues:()=>kr,getBrickPackagesById:()=>Ir,getContextValue:()=>Ar,getLegalRuntimeValue:()=>Pr,getRenderId:()=>Or,legacyDoTransform:()=>sr,legacyTransformIntermediateData:()=>lr,legacyTransformProperties:()=>cr,loadBricks:()=>Cr,loadEditors:()=>Rr,mountUseBrick:()=>pr,renderUseBrick:()=>fr,setRealTimeDataInspectRoot:()=>Br,symbolForRootRuntimeContext:()=>dr,unmountUseBrick:()=>hr,updateSnippetPreviewSettings:()=>Er,updateStoryboard:()=>mr,updateStoryboardByRoute:()=>gr,updateStoryboardBySnippet:()=>wr,updateStoryboardByTemplate:()=>vr,updateTemplatePreviewSettings:()=>br});var o=n(24586),i=n(70918),a=n(86121),s=n(70829),c=n(87117),l=n(45599),u=n(94558),d=n(21302),f=(n(26036),n(11732));function p(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(41030);function m(e,t){const n=(0,h.orderBy)(e,(e=>{var t,n;return null!==(t=null===(n=e.app.homepage)||void 0===n?void 0:n.length)&&void 0!==t?t:0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&g(n,t))return e}}function g(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function v(e){var t;return!e||(null===(t=Ii().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let b,y=!1;function w(e,t){y=!confirm(e),t(!y)}function E(e){const{push:t,replace:n}=e;function r(r){return function(o,i,a){let s;const c="string"==typeof o;return s=c?(0,f.parsePath)(o).pathname:o.pathname,"string"==typeof s&&s.startsWith("/")&&v(function(e){var t,n;return m(null!==(t=null===(n=wi)||void 0===n?void 0:n.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===r?"assign":"replace"](c?p()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,i,a)}}return{push:r("push"),replace:r("replace")}}function S(){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 A(){if(!b){const e=(0,f.createBrowserHistory)({basename:p().replace(/\/$/,""),getUserConfirmation:w});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){y=!1,t(e,n),null==r||r(y)}function o(e,t,r){y=!1,n(e,t),null==r||r(y)}function i(t){return function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;const{extraQuery:s,clear:c,keepHash:l,...u}=i,d=new URLSearchParams(c?"":e.location.search),f={};Object.assign(f,n,s);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,a)}}let a;return{pushQuery:i("push"),replaceQuery:i("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){a=e},getBlockMessage:function(){return a},unblock:function(){a=void 0},...E({...e,push:r,replace:o})}}(e)),b=e}return b}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return b};var I=n(74635),C=n(12559),R=n(57372),O=n(71321),T=n(7e4),_=n(29283),P=n(94167),x=new WeakMap;const M=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,i.A)(this,x,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,s.A)(x,this).get(n);if(o||(o=new Map,(0,s.A)(x,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,s.A)(x,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;c.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)c.i18n.removeResourceBundle(t,e)}}}function L(e,t){return`${e}/${t}`}function $(e){return c.i18n.getFixedT(null,L("widget",e))}const N=function(){const e=S();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;c.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 z=()=>{throw new Error("Can't modify read-only proxy object")},H={set:z,defineProperty:z,deleteProperty:z,setPrototypeOf:z};function G(e){return new Proxy(e,H)}function q(e){let{get:t,ownKeys:n}=e;return W()?G(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let X="light";const Y=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);X=e}function Z(){return X}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){Y.setItem(J,{...re(),...e})}function re(){let e;try{e=Y.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!=e?e:{}}let oe="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function ae(){return document.documentElement.dataset.mode}function se(e){e?ie(e):e=oe,e!==ae()&&(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))||""}let le="default";function ue(e){if("default"!==e&&"elevo"!==e)return ue("default");le!==e&&(document.documentElement.dataset.variant=le=e,window.dispatchEvent(new CustomEvent("variant.change",{detail:e})))}function de(){return le}function fe(e,t){const n={};for(const r of e){const e=pe(r,t);void 0!==e&&(n[r]=e)}return n}function pe(e,t){var n,r,o;let{collectCoverage:i,widgetId:a,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:f}=t;switch(e){case"BASE_URL":return i?"/next":p().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>`mock/images/${e}`}:a?null==Ai||null===(n=Ai.images)||void 0===n?void 0:n.widgetImagesFactory(a,s):null==Ai||null===(r=Ai.images)||void 0===r?void 0:r.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return i?h.identity:a?$(a):c.i18n.getFixedT(null,[u,L("app",l.id)].filter(Boolean));case"I18N_TEXT":return i?he:c.i18nText;case"PERMISSIONS":return G({check:i?me:null==Ai||null===(o=Ai.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return G({getTheme:i?()=>"light":Z,getCssPropertyValue:i?()=>"":ce});case"console":return f?G(console):void 0;case"location":return i?{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 he(e){return null==e?void 0:e.en}function me(){return!0}function ge(){let{widgetId:e,widgetVersion:t,collectCoverage:n,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=new Map,i=null==r?void 0:r({precookFunction:O.precookFunction,cook:O.cook,supply:P.supply}),a=new Proxy(Object.freeze({}),{get:(e,t)=>function(e){const t=o.get(e);if(!t)return;if(t.processed)return t.cooked;let a;n&&(a=n.createCollector(e));const s=!i&&!a&&t.transformed;if(s){const e=c(s.globals);t.cooked=new Function(...s.globals,`"use strict";return (${s.source})`)(...s.globals.map((t=>(0,u.hasOwnProperty)(e,t)?e[t]:void 0)))}else{const e=(0,O.precookFunction)(t.source,{typescript:t.typescript,hooks:a&&{beforeVisit:a.beforeVisit},cacheKey:t}),n=c(e.attemptToVisitGlobals);t.cooked=(0,O.cook)(e.function,t.source,{rules:{noVar:!0},globalVariables:i?{...n,...null!=i&&i.LodashWithStaticFields&&e.attemptToVisitGlobals.has("_")?{_:{...n._,...i.LodashWithStaticFields}}:null,...null!=i&&i.ArrayConstructor&&e.attemptToVisitGlobals.has("Array")?{Array:i.ArrayConstructor}:null,...null!=i&&i.ObjectWithStaticFields&&e.attemptToVisitGlobals.has("Object")?{Object:{...n.Object,...i.ObjectWithStaticFields}}:null}:n,ArrayConstructor:null==i?void 0:i.ArrayConstructor,hooks:a&&{beforeEvaluate:a.beforeEvaluate,beforeCall:a.beforeCall,beforeBranch:a.beforeBranch},debug:!!r})}return t.processed=!0,t.cooked}(t)});let s;function c(r){return(0,P.supply)(r,fe(r,{collectCoverage:n,widgetId:e,widgetVersion:t,app:s,storyboardFunctions:a,isStoryboardFunction:!0}),!!n)}return{storyboardFunctions:a,registerStoryboardFunctions:function(e,t){if(t&&(s=t),o.clear(),Array.isArray(e))for(const t of e){var r;let e=t.deps;null==e&&(e=(0,T.collectMemberUsageInFunction)(t,"FN",!!n),e.delete(t.name));const i=null!==(r=t.perm)&&void 0!==r?r:(0,T.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:e,hasPermissionsCheck:i})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,T.collectMemberUsageInFunction)(n,"FN",!0),i=(0,T.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,transformed:t.transformed,deps:r,hasPermissionsCheck:i})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const r=o.get(e);return!!r&&(r.hasPermissionsCheck||[...r.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,O.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,O.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:ve,registerStoryboardFunctions:be,checkPermissionsUsage:ye}=ge();var we={};try{we.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=i.prototype;function i(){t.set(this,n(null))}function a(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function s(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}a(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),i=o[e]||(o[e]=[]),a=0,s=i.length;a<s;a++)if(i[a].listener===n)return;i.push({target:this,listener:n,options:r})})),a(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(a(e,"target",this),a(e,"currentTarget",this),n.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),a(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),i=0,a=o.length;i<a;i++)if(o[i].listener===n)return void o.splice(i,1)})),we.EventTarget=i}(Object,new WeakMap)}const Ee=we.EventTarget;let Se=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const Ae=new Map([[Se.xLarge,"1920px"],[Se.large,"1600px"],[Se.medium,"1280px"],[Se.small,"1024px"],[Se.xSmall,0]]),ke=new Ee,Ie={},Ce={};function Re(e,t){let n=!1;Ie[t]=e.matches;for(const[e]of Ae)if(Ie[e]&&Ce.breakpoint!==e){Ce.breakpoint=e,n=!0;break}n&&ke.dispatchEvent(new CustomEvent("change",{detail:Ce}))}Ae.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);Re(n,t),n.addEventListener?n.addEventListener("change",(e=>{Re(e,t)})):n.addListener((e=>{Re(e,t)}))}));const Oe=()=>Ce;function Te(e){return function(t){var n;const r="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(n=r.getItem(t))&&void 0!==n?n:"null")}}function _e(e){var t,n;return!(null===(t=e?e.flags:null===(n=Ii())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Pe(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 i=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${i}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${i}`,...r)}const xe=new Set(["prefix"]);var Me=new WeakMap;const Be=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,i.A)(this,Me,new Map)}define(e,t){var n,r,o,i;let a=(0,s.A)(Me,this).has(e);a?console.warn(`Custom template of "${e}" already registered.`):(a=!!customElements.get(e),a&&console.warn(`Custom template of "${e}" already defined by customElements.`));const c=_e(),l=null!==(n=null===(r=t.proxy)||void 0===r?void 0:r.properties)&&void 0!==n?n:{},u=[],d=[];for(const[t,n]of Object.entries(l))n.asVariable?(Pe(c,"Template `asVariable`",e,t),c||d.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&u.push([t,n]);const f={...t,proxy:{...t.proxy,properties:Object.fromEntries(u)},state:(t.state?c?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(d.map((e=>({name:e,expose:!0}))))};(0,s.A)(Me,this).set(e,{...f,name:e});const p=(m=f.state,(0,h.uniq)(null!==(g=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[]));var m,g;const v=Object.entries(null!==(o=null===(i=f.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),b=p.concat(u.map((e=>e[0]))),y=v.map((e=>e[0])),w=b.concat(y).filter((e=>e in HTMLElement.prototype&&!xe.has(e)));if(w.length>0&&(Pe(c,"Using native HTMLElement properties as template properties or methods",e,...w),c))throw new Error(`In custom template "${e}", ${w.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!a){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return b}static get _dev_only_definedMethods(){return y}$$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 p)u.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 u)Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refProperty)&&void 0!==t?t:e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);var i;o&&(o[null!==(i=n.refProperty)&&void 0!==i?i:e]=t)},enumerable:!0});for(const[e,n]of v)Object.defineProperty(t.prototype,e,{value(){var t;return this.$$getElementByRef(n.ref)[null!==(t=n.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,s.A)(Me,this).get(e)}};function Le(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${null!=n?n:""}`);const i=o.get(r);if(!i)throw new Error(`Template state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}function $e(e,t,n){const r=Le(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return r}const Ne=new Map,Ue=new Proxy(Object.freeze({}),{get:(e,t)=>Ne.get(t)}),Fe=function(){const e=S();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Ne.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=ge({widgetId:e,widgetVersion:n});Ne.set(e,r),o(t)},je=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,De=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(je);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ke=e=>"*"===e||"x"===e||"X"===e,Ve=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},We=(e,t)=>{if(Ke(e)||Ke(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Ve(e),Ve(t));return n>r?1:n<r?-1:0},ze=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=We(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},He=(e,t,n)=>{Xe(n);const r=((e,t)=>{const n=De(e),r=De(t),o=n.pop(),i=r.pop(),a=ze(n,r);return 0!==a?a:o&&i?ze(o.split("."),i.split(".")):o||i?o?-1:1:0})(e,t);return Ge[n].includes(r)},Ge={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},qe=Object.keys(Ge),Xe=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===qe.indexOf(e))throw new Error(`Invalid operator, expected one of ${qe.join("|")}`)};function Ye(e,t){let n=Bi(e);if(!n&&null!=Ai&&Ai.checkInstalledApps&&(n=Ai.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 He(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function Je(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${null!=n?n:""}`);const i=o.get(r);if(!i)throw new Error(`Form state store is not found when using "${t}"${null!=n?n:""}.\nThis is a bug of Brick Next, please report it.`);return i}const Qe=new Map;async function Ze(e){var t;const n=null==Ai||null===(t=Ai.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=Ai.flowApi.FLOW_API_PROVIDER);let r=Qe.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)Ai.flowApi.registerFlowApiProvider();else if(await(0,l.loadBricksImperatively)([e],Ti()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Qe.set(e,r),r}let et=new WeakSet;function tt(e){if((0,u.isObject)(e)&&!nt(e))if(et.add(e),Array.isArray(e))e.forEach(tt);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(tt)}}function nt(e){return et.has(e)}const rt=new Map;async function ot(e,t,n){var r;const{useProvider:o,method:i="resolve",args:a,params:s,options:c,filename:l,onReject:u}=e,{provider:d,field:f}=e;if(d&&!o)throw new Error(`You're using "provider: ${d}" which is dropped in v3, please use "useProvider" instead`);const p=null!=f;if(p){const e=_e();if(Pe(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const m=!Array.isArray(a)&&s&&null!=Ai&&null!==(r=Ai.flowApi)&&void 0!==r&&r.isFlowApiProvider(o)?{params:s,options:c,filename:l}:null,[g,v,b]=await Promise.all([Ze(o),yt(a,t),yt(m,t)]),y=null==n?void 0:n.renderId,w=!!y&&y!==Pi(),E=it(g,o,i,null!=b&&b.params?b:null!=v?v:[],n,a,w);let S,{transform:A}=e;try{const e=await E;S=p?(0,h.get)(e,f):e,tt(S)}catch(e){if(!function(e){return!(null==e||!e.transform)}(u))throw e;A=u.transform,S=e}return A?"string"==typeof A?{[A]:S}:yt(A,{...t,data:S}):S}async function it(e,t,n,r,o,i,a){let s,c;try{s=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!i)throw e;s=JSON.stringify({useProvider:t,method:n,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(c=rt.get(s)),c||(c=(async o=>{const i=null!=Ai&&null!==(o=Ai.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await Ai.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...i)})(),a||rt.set(s,c)),c}const at=Symbol.for("pre.evaluated.raw"),st=Symbol.for("pre.evaluated.context");function ct(e){return!(null==e||!e[at])}function lt(e){return e[at]}function ut(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[at])}const dt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function ft(e){return dt.has(e.constructor)?e.constructor:TypeError}function pt(e,t,n){const{run:r}=ht(e,t,n,!1);return r()}function ht(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,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[st],...n},e=e[at]}const i={usedArgs:new Set},a={usedArgs:new Set};let s;try{s=(0,O.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(i,e,t),(0,T.collectInstalledAppsHasUsage)(a,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(ft(t))(n)}if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(a.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:d}=s;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[at]:e,[st]:t}:e};let f,p,m,g;const v=_e(t);let b,y;(d.has("STATE")||!v&&d.has("TPL"))&&(g=Le(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(y=Je(t,"FORM_STATE",`: "${e}"`));const w=W();if(r||w){if(d.has("CTX")&&(f=(0,T.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(f))),g){if(m=(0,T.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,T.strictCollectMemberUsage)(e,"TPL");for(const e of t)m.add(e)}r&&o.push(g.waitFor(m))}y&&(b=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(y.waitFor(b))),d.has("PROCESSORS")&&(p=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,l.loadProcessorsImperatively)(p,Ti())))}if(r){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,T.strictCollectMemberUsage)(e,"FN")];n=ye(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=Ai&&Ai.menu){const e=[...i.usedArgs];o.push(Promise.all(e.map((e=>Ai.menu.fetchMenuById(e,t,{getStoryboardByAppId:Mi,resolveData:ot,asyncComputeRealValue:yt})))))}var E;a.usedArgs.size>0&&o.push(null==Ai||null===(E=Ai.checkInstalledApps)||void 0===E?void 0:E.waitForCheckingApps([...a.usedArgs]))}return{blockingList:o,run(){var n,r,o,i;const{ctxStore:a,data:l,event:w,unsafe_penetrate:E}=t,S=E?xi():t,{app:A,location:k,query:I,match:C,flags:R,sys:T}=S,_=null!==(n=S.overrideApp)&&void 0!==n?n:A;for(const n of d)switch(n){case"ANCHOR":c[n]=k.hash?k.hash.substring(1):null;break;case"APP":if(null==_)throw new ReferenceError(`APP is not defined, in "${e}"`);c[n]={...(0,h.cloneDeep)(_),getMenu:null==Ai||null===(r=Ai.menu)||void 0===r?void 0:r.getMenuById};break;case"CTX":c[n]=q({get(e,t){if("DS"===t&&!a.has(t)){var n;const e=null===(n=xi())||void 0===n?void 0:n.ctxStore;if(null!=e&&e.has(t))return e.getValue(t)}return a.getValue(t)},ownKeys:()=>f?Array.from(f):[]});break;case"DATA":c[n]=l;break;case"EVENT":c[n]=w;break;case"FLAGS":c[n]=G(R);break;case"FORM_STATE":c[n]=q({get:(e,t)=>y.getValue(t),ownKeys:()=>Array.from(b)});break;case"HASH":c[n]=k.hash;break;case"INSTALLED_APPS":c[n]=G({has:Ye});break;case"ITEM":case"INDEX":case"SIZE":{const r="ITEM"===n?"forEachItem":"INDEX"===n?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,r)?c[n]=t[r]:console.error(`Using \`${n}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[n]=G({getItem:Te("local")});break;case"MEDIA":c[n]=G(Oe());break;case"MISC":c[n]=Ii().getMiscSettings();break;case"PARAMS":if(null==I)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[n]=new URLSearchParams(I);break;case"PATH":c[n]=G(null!==(o=null==C?void 0:C.params)&&void 0!==o?o:{});break;case"PATH_NAME":c[n]=k.pathname;break;case"PROCESSORS":c[n]=q({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 q({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==I)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(I.keys()).map((e=>[e,I.get(e)])));break;case"QUERY_ARRAY":if(null==I)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[n]=Object.fromEntries(Array.from(I.keys()).map((e=>[e,I.getAll(e)])));break;case"SESSION_STORAGE":c[n]=G({getItem:Te("session")});break;case"TPL":if(Pe(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[n]=q({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(m)});break;case"SYS":c[n]=G(null!=T?T:{});break;case"__WIDGET_FN__":c[n]=Ue;break;case"__WIDGET_IMG__":c[n]=null==Ai||null===(i=Ai.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":c[n]=$}Object.assign(c,fe(s.attemptToVisitGlobals,{storyboardFunctions:ve,app:_,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,O.cook)(s.expression,s.source,{globalVariables:(0,P.supply)(s.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(ft(t))(n)}}}}let mt=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 gt(e){switch(e){case mt.USE_BRICK_PROPERTIES:case mt.USE_BRICK_TRANSFORM:case mt.USE_BRICK_EVENTS:case mt.USE_BRICK_IF:case mt.USE_BRICK_LIFECYCLE:case mt.USE_BRICK_DATA_SOURCE:return!0}return!1}function vt(e,t,n){if(gt(e))return e;if(t)switch(e){case mt.USE_BRICK:return mt.USE_BRICK_ITEM;case mt.USE_BRICK_SLOTS_ITEM_BRICKS:return mt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case mt.INITIAL:if("useBrick"===n)return mt.USE_BRICK;break;case mt.USE_BRICK:case mt.USE_BRICK_ITEM:case mt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return mt.USE_BRICK_PROPERTIES;case"transform":return mt.USE_BRICK_TRANSFORM;case"dataSource":return mt.USE_BRICK_DATA_SOURCE;case"events":return mt.USE_BRICK_EVENTS;case"slots":return mt.USE_BRICK_SLOTS;case"children":return mt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return mt.USE_BRICK_IF;case"lifeCycle":return mt.USE_BRICK_LIFECYCLE}break;case mt.USE_BRICK_SLOTS:return mt.USE_BRICK_SLOTS_ITEM;case mt.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return mt.USE_BRICK_SLOTS_ITEM_BRICKS}return mt.INITIAL}const bt=["app","location","query","match","flags","sys"];async function yt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=ct(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&>(n.$$stateOfUseBrick);let i,a=o;if(r||(0,O.isEvaluable)(e))i=await async function(e,t,n){const{blockingList:r,run:o}=ht(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),a=ut(e);else if(o)i=e;else{const r=t.unsafe_penetrate?{...(0,h.pick)(xi(),bt),...(0,h.omit)(t,bt)}:t;i=((0,u.hasOwnProperty)(r,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?St:_.inject)(e,r)}return a||tt(i),i}if(!(0,u.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=Et(n,!0);return Promise.all(e.map((e=>yt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([yt(r,t),yt(o,t,Et(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function wt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=ct(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&>(n.$$stateOfUseBrick);let i,a=o;if(r||(0,O.isEvaluable)(e))i=pt(e,t),a=ut(e);else if(o)i=e;else{const r=t.unsafe_penetrate?{...(0,h.pick)(xi(),bt),...(0,h.omit)(t,bt)}:t;i=((0,u.hasOwnProperty)(r,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?St:_.inject)(e,r)}return a||tt(i),i}if(!(0,u.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=Et(n,!0);return e.map((e=>wt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[wt(r,t),wt(o,t,Et(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function Et(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:vt(e.$$stateOfUseBrick,t,n)}:e}function St(e){return e}async function At(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ct(e.if)?await yt(e.if,t):e.if)}function kt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ct(e.if)?wt(e.if,t):e.if)}function It(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const Ct=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return kt(e,{data:t})};function Rt(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,O.isEvaluable)(e):ct(e)){const o="string"==typeof e?e:lt(e);if((0,O.isTrackAll)(o)){const e=(0,T.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,T.track)(o,"track context","CTX"),n=(0,T.track)(o,"track state","STATE"),r=(0,T.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function Ot(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 Tt(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function _t(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 Pt(e,t,n){const r=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=wt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?mt.USE_BRICK:mt.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{_t(e,r)}))}function xt(e,t,n){if(n)for(const{contextNames:r,stateNames:o,propValue:i}of t){if(r)for(const t of r)n.disposes.push(e.ctxStore.onChange(t,n.listener));if(o)for(const t of o){const r=Le(e,"STATE",`: "${i}"`);n.disposes.push(r.onChange(t,n.listener))}}}function Mt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Bt(e){return e&&e.sensitive?"":"i"}function Lt(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,i=n.start,a=void 0===i||i,s=n.end,c=void 0===s||s,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(Mt(void 0===p?"":p),"]|$"),m="[".concat(Mt(f),"]"),g=a?"^":"",v=0,b=e;v<b.length;v++){var y=b[v];if("string"==typeof y)g+=Mt(u(y));else{var w=Mt(u(y.prefix)),E=Mt(u(y.suffix));if(y.pattern)if(t&&t.push(y),w||E)if("+"===y.modifier||"*"===y.modifier){var S="*"===y.modifier?"?":"";g+="(?:".concat(w,"((?:").concat(y.pattern,")(?:").concat(E).concat(w,"(?:").concat(y.pattern,"))*)").concat(E,")").concat(S)}else g+="(?:".concat(w,"(").concat(y.pattern,")").concat(E,")").concat(y.modifier);else{if("+"===y.modifier||"*"===y.modifier)throw new TypeError('Can not repeat "'.concat(y.name,'" without a prefix and suffix'));g+="(".concat(y.pattern,")").concat(y.modifier)}else g+="(?:".concat(w).concat(E,")").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,Bt(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,i="";if("?"===e[s=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--o){s++;break}}else if("("===e[s]&&(o++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));i+=e[s++]}else i+=e[s++]+e[s++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=s}else{for(var a="",s=n+1;s<e.length;){var c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=e[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:a}),n=s}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,i=t.delimiter,a=void 0===i?"/#?":i,s=[],c=0,l=0,u="",d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},f=function(e){var t=d(e);if(void 0!==t)return t;var r=n[l],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},p=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},h=function(e){var t=s[s.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=a;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(Mt(a),"]+?"):"(?:(?!".concat(Mt(n),")[^").concat(Mt(a),"])+?")};l<n.length;){var m=d("CHAR"),g=d("NAME"),v=d("PATTERN");if(g||v){var b=m||"";-1===o.indexOf(b)&&(u+=b,b=""),u&&(s.push(u),u=""),s.push({name:g||c++,prefix:b,suffix:"",pattern:v||h(b),modifier:d("MODIFIER")||""})}else{var y=m||d("ESCAPED_CHAR");if(y)u+=y;else if(u&&(s.push(u),u=""),d("OPEN")){b=p();var w=d("NAME")||"",E=d("PATTERN")||"",S=p();f("CLOSE"),s.push({name:w||(E?c++:""),pattern:w&&!E?h(b):E,prefix:b,suffix:S,modifier:d("MODIFIER")||""})}else f("END")}}return s}(e,n),t,n)}function $t(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 $t(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),Bt(n))}(e,t,n):Lt(e,t,n)}const Nt=new Map,Ut=1e4;let Ft=0;function jt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:i=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:a,keys:s}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=Nt.get(n);r||Nt.set(n,r=new Map);const o=r.get(e);if(o)return o;const i=[],a={regexp:$t(e,i,t),keys:i};return Ft<Ut&&(r.set(e,a),Ft++),a}(n,{end:r,strict:o,sensitive:i}),c=a.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:s.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function Dt(e,t,n){return jt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Kt=Symbol.for("tpl.asyncComputedPropsFromHost"),Vt=Symbol.for("tpl.stateStoreId"),Wt=Symbol.for("tpl.externalForEachItem"),zt=Symbol.for("tpl.externalForEachIndex"),Ht=Symbol.for("tpl.externalForEachSize"),Gt=new Set;let qt=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.LICENSE_EXPIRED="LICENSE_EXPIRED",e.LICENSE_BLOCKED="LICENSE_BLOCKED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e.RELOAD="RELOAD",e}({});const Xt={[qt.REQUEST_FAILED]:"Request Failed",[qt.SOMETHING_WENT_WRONG]:"Something went wrong!",[qt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[qt.NETWORK_ERROR]:"Network error, please check your network.",[qt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[qt.LICENSE_BLOCKED]:"The page is not authorized, please contact the platform administrator",[qt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[qt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[qt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[qt.UNKNOWN_ERROR]:"Oops! Something went wrong",[qt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[qt.GO_BACK_HOME]:"Go back to home page",[qt.RELOAD]:"Reload"},Yt={[qt.REQUEST_FAILED]:"请求失败",[qt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[qt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[qt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[qt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[qt.LICENSE_BLOCKED]:"该页面未授权,请联系平台管理员",[qt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[qt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[qt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[qt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[qt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[qt.GO_BACK_HOME]:"回到首页",[qt.RELOAD]:"刷新"},Jt="core/runtime",Qt={en:Xt,zh:Yt};let Zt;const en=Object.freeze({show:function(e){if(Zt)return Zt.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 tn(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 nn(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t(`${Jt}:${qt.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 rn(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let on,an,sn=!1;function cn(e){if(e instanceof R.HttpAbortError)return;if(rn(e)&&!window.NO_AUTH_GUARD){if(sn)return;return sn=!0,void en.show({type:"confirm",content:c.i18n.t(`${Jt}:${qt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=Ii().getFeatureFlags()["sso-enabled"],t=k();tn(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),sn=!1}),(()=>{sn=!1}))}console.error(e);const t=nn(e);t!==on&&(on=t,en.show({type:"error",title:c.i18n.t(`${Jt}:${qt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{on=void 0})))}const ln=Object.freeze({show:function(e){an?an.resolve(e):alert(e.message)}});function un(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const i=mn(o,n,{element:e});e.addEventListener(r,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,i]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function dn(e){return"string"==typeof e.action}function fn(e){return"string"==typeof e.useProvider}function pn(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function hn(e){return!!e.then}function mn(e,t,n){return function(r){var o,i;for(const a of[].concat(e))if(kt(a,{...t,event:r}))if(hn(a))mn(a.then,t,n)(r);else if(dn(a)){const[e,s]=a.action.split(".");switch(a.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":yn(r,s,a.args,a.callback,t);break;case"window.open":wn(r,a.args,t);break;case"window.postMessage":En(r,a.args,t);break;case"parent.postMessage":Sn(r,a.args,t);break;case"location.reload":case"location.assign":Rn(r,s,a.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":On(r,e,s,a.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":Tn(r,s,a.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":_n(r,s,a.args,t);break;case"handleHttpError":cn(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":kn(r,s,a.args,null===(o=a.batch)||void 0===o||o,a.callback,t);break;case"state.update":case"state.refresh":case"state.load":In(r,s,a.args,null===(i=a.batch)||void 0===i||i,a.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Mn(a.args,t,r);$e(t,a.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":Cn(r,a.args,a.callback,t);break;case"message.subscribe":case"message.unsubscribe":Pn(r,s,a.args,t,n,a.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===a.action?"dark":"light");break;case"theme.setTheme":{const[e]=Mn(a.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":se("mode.setDashboardMode"===a.action?"dashboard":"default");break;default:console.error("unknown event listener action:",a.action)}}else fn(a)?gn(r,a,t,n):pn(a)?vn(r,a,t,n):console.error("unknown event handler:",a);else a.else&&mn(a.else,t,n)(r)}}function gn(e,t,n,r){const o="saveAs"!==t.method?"resolve":"saveAs";bn(e,t.useProvider,t,o,n,r)}function vn(e,t,n,r){let o=[];const i=t.target,a=t.targetRef;let s=i;if(("string"==typeof i?(0,O.isEvaluable)(i):ct(i))&&(s=wt(i,{...n,event:e})),"string"==typeof s)if("_self"===s)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(s));else{const e=document.querySelector(s);null!==e&&o.push(e)}else if(s)s instanceof HTMLElement?o.push(s):console.error("unexpected target:",s);else if(a){let t=a;("string"==typeof a?(0,O.isEvaluable)(a):ct(a))&&(t=wt(a,{...n,event:e}));const r=[].concat(t),i=$e(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=i.$$getElementByRef)||void 0===t?void 0:t.call(i,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{bn(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Pt(o,t.properties,{...n,event:e}):console.error("target not found:",i||a)}async function bn(e,t,n,r,o,i,a){const s=fn(n),c=async()=>{var i;const c=s?await Ze(t):t;if("function"!=typeof c[r])throw new Error(`target <${c.tagName.toLowerCase()}> has no method: ${r}`);const l=fn(n);let u,d=l?function(e,t,n){return Array.isArray(e)?wt(e,{...t,event:n}):e}(n.args,o,e):Mn(n.args,o,e,a);var f;return l&&null!=Ai&&null!==(i=Ai.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)?(!Array.isArray(n.args)&&n.params&&(d=wt((0,h.pick)(n,"params","options","filename"),{...o,event:e})),u=await Ai.flowApi.getArgsOfFlowApi(n.useProvider,null!=d?d:[],r,null===(f=n.sse)||void 0===f?void 0:f.stream)):u=d,c[r](...u)};if(!n.callback)return void c();const l=xn(n.callback,o,i),u={progress:l("progress"),success:l("success"),error:l("error"),finally:l("finally")};if(s){var d,f;const t={...o,event:e};if(wt(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:i}=t;const a=Pi();try{const t=await e();for await(const e of t){if(a!==Pi())return;null==n||n(e)}if(a!==Pi())return;null==r||r()}catch(e){if(a!==Pi())return;null==o||o(e)}finally{null==i||i()}}(c,u);if(wt(null===(f=n.poll)||void 0===f?void 0:f.enabled,t))return void function(e,t,n,r){let{progress:o,success:i,error:a,finally:s}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:f,delegateLoadingBar:p}=wt((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),m=Pi();let g;async function v(){let t;Gt.delete(g);try{var n;if(t=null===(n=wt(c,r))||void 0===n?void 0:n(),t)null==s||s();else{var d;const n=await e(),a=null===(d=wt(c,r))||void 0===d?void 0:d();var h;t=a||m!==Pi(),t?a&&(null==s||s()):(null==o||o(n),null!==(h=wt(l,r))&&void 0!==h&&h(n)?(p&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==s||s()):b(null!=u?u:3e3))}}catch(e){var v;const n=null===(v=wt(c,r))||void 0===v?void 0:v();t=n||m!==Pi(),t?n&&(null==s||s()):(null==a||a(e),f?b(null!=u?u:3e3):null==s||s())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}function b(e){g=setTimeout(v,e),Gt.add(g)}b(null!=d?d:0),p&&window.dispatchEvent(new Event("request.start"))}(c,u,n.poll,t)}try{const e=await c();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function yn(e,t,n,r,o){let i=0,a=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,a=!0;break;case"reload":a=!0;break;case"block":i=1,s="setBlockMessage"}let c=[];if(i>0&&(c=Mn(n,o,e,{useEventDetailAsDefault:!0}),c.length=i),a&&r){const e=xn(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[s](...c)}function wn(e,t,n){const[r,o,i]=Mn(t,n,e);window.open(r,o||"_self",i)}function En(e,t,n){const r=Mn(t,n,e);1===r.length&&r.push(location.origin),window.postMessage(...r)}function Sn(e,t,n){if(parent===window)throw new Error("parent is the window itself");const r=Mn(t,n,e);parent.postMessage(...r)}function An(e,t,n,r,o,i){t?r.updateValues(e,n,(e=>Mn(e,o,i)[0])):e.forEach((e=>{const{name:t,value:a}=Mn([e],o,i)[0];r.updateValue(t,a,n)}))}function kn(e,t,n,r,o,i){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[r,a]=Mn(n,i,e);i.ctxStore.updateValue(r,a,t,o,i)}else An(n,r,t,i.ctxStore,i,e)}function In(e,t,n,r,o,i){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)An(n,r,"replace",Le(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[r,a]=Mn(n,i,e);Le(i,`state.${t}`,`: ${r}`).updateValue(r,a,"update"===t?"replace":t,o,i)}}function Cn(e,t,n,r){const[o,i]=Mn(t,r,e);Je(r,"formstate.update",`: ${o}`).updateValue(o,i,"replace",n,r)}function Rn(e,t,n,r){if("assign"===t){const[t]=Mn(n,r,e);location.assign(t)}else location[t]()}function On(e,t,n,r,o){const i="localStorage"===t?localStorage:sessionStorage,[a,s]=Mn(r,o,e);"setItem"===n?void 0!==s&&i.setItem(a,JSON.stringify(s)):i.removeItem(a)}function Tn(e,t,n,r){console[t](...Mn(n,r,e,{useEventAsDefault:!0}))}function _n(e,t,n,r){const o=Mn(n,r,e,{useEventAsDefault:!0});ln.show({type:t,message:o[0]})}async function Pn(e,t,n,r,o,i){const a=()=>{var o;const i=Mn(n,r,e);return null==Ai||null===(o=Ai.messageDispatcher)||void 0===o?void 0:o[t](...i)};if(!i)return void a();const s=xn(i,r,o);try{const e=await a();s("success")(e)}catch(e){s("error")(e)}finally{s("finally")()}}function xn(e,t,n){return function(r){return function(o){const i=null==e?void 0:e[r];if(i)try{const e=new CustomEvent(`callback.${r}`,{detail:o});mn(i,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function Mn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?wt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function Bn(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:i}=Le(r,"bindTemplateProxy"),a=i.tplHostMetadata;a.internalBricksByRef.set(n,e);const s=null===(t=a.proxy)||void 0===t?void 0:t.events;if(s)for(const[e,t]of Object.entries(s))if(t.ref===n){var c,l,u;const n=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=null!==(c=t.refEvent)&&void 0!==c?c:e;o.addEventListener(r,n),null!==(u=(l=o).$$proxyListeners)&&void 0!==u||(l.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function Ln(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=Le(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of null!==(i=r.$$proxyListeners)&&void 0!==i?i:[]){var i;r.removeEventListener(e,t)}delete r.$$proxyListeners}let $n=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.ABSTRACT=3]="ABSTRACT",e}({});function Nn(e){e.replaceChildren()}function Un(e,t){e.mounted=!0,window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.mounted=!0,n.tag===$n.BRICK){var o;const i=n.type;i.includes("-")&&!customElements.get(i)&&console.error(`Undefined custom element: ${i}`),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const a=t&&n===e.child?t:document.createElement(i);if(n.element=a,n.slotId&&a.setAttribute("slot",n.slotId),n.iid&&(a.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(a.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),_t(a,n.properties),un(a,n.events,n.runtimeContext),n.tplHostMetadata&&(a.$$tplStateStore=Le({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),Bn(n),n.portal)r.push(a);else if(n.return){let e=n.return;for(;e;){if(e.tag!==$n.ABSTRACT){e.childElements||(e.childElements=[]),e.childElements.push(a);break}e=e.return}}}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var i;let e=n.return;for(;e;){var a;if(e.tag!==$n.ABSTRACT&&e.childElements)e.tag===$n.ROOT?null===(a=e.container)||void 0===a||a.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===$n.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(i=e)||void 0===i?void 0:i.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const Fn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],jn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Dn=new WeakMap,Kn=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,zn=new WeakMap,Hn=new WeakMap,Gn=new WeakMap,qn=new WeakMap,Xn=new WeakSet;class Yn{constructor(e,t){var n;(0,I.A)(this,Xn),(0,o.A)(this,"scope",void 0),(0,o.A)(this,"unknownBricks",void 0),(0,o.A)(this,"renderId",void 0),(0,i.A)(this,Dn,void 0),(0,i.A)(this,Kn,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,i.A)(this,Vn,new Map),(0,i.A)(this,Wn,void 0),(0,i.A)(this,zn,new Map),(0,i.A)(this,Hn,void 0),(0,i.A)(this,Gn,new WeakMap),(0,i.A)(this,qn,new Map),this.scope=e,this.unknownBricks=null!==(n=null==t?void 0:t.unknownBricks)&&void 0!==n?n:"throw",(0,a.A)(Dn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,a.A)(Hn,this,e)}memoizeMenuRequestNode(e,t){(0,s.A)(Gn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,s.A)(Hn,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,s.A)(Gn,this).get(t);(0,s.A)(Gn,this).set(t,n);let o,i=e.child;for(;i&&i!==r;)o=i,i=i.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,s.A)(Dn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,s.A)(Dn,this).bailout(e)}reCatch(e,t){return(0,s.A)(Dn,this).catch(e,t,!1,!0)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:i}of[...(0,s.A)(qn,this).values()].reverse()){const a=o[o.length-1];if(r.includes(a))continue;const s=await i(e,t);s&&r.push(...o.slice(0,-1)),!1!==s&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,s.A)(qn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...Fn,..."page"===this.scope?jn:[]];for(const r of n){const n=t[r];n&&(0,s.A)(Kn,this)[r].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,s.A)(zn,this).get(e);n?n.add(t):(0,s.A)(zn,this).set(e,new Set([t]))}reRender(e,t,n){var r,o,i,a,s;if(e.tag!==$n.ROOT&&e.disposed)return;const[c,l]=function(e){let t,n,r=e,o=0;for(;r;){if(r.tag===$n.BRICK)r.portal?n=r:t=r;else if(r.child&&r.tag===$n.ABSTRACT){r=r.child,o++;continue}if(o<=0)break;if(r.sibling)r=r.sibling;else{var i;let e=r.return;for(o--;e&&!e.sibling;)e=e.return,o--;if(o<=0)break;r=null===(i=e)||void 0===i?void 0:i.sibling}}return[t,n]}(n),u=null!==(r=c?null===(o=c.element)||void 0===o?void 0:o.nextSibling:null===(i=rr(n,!1))||void 0===i?void 0:i.element)&&void 0!==r?r:null,d=[];let f,p=l?null==l||null===(a=l.element)||void 0===a?void 0:a.nextSibling:null===(s=rr(n,!0))||void 0===s?void 0:s.element;for(;p&&(d.push(p),p instanceof HTMLElement&&"DIV"===p.tagName);)p=p.nextSibling;let h=e.child;for(;h&&h!==n;){if(h.sibling===n){f=h;break}h=h.sibling}const m=document.createDocumentFragment(),g=document.createDocumentFragment(),v={tag:$n.ROOT,container:m,createPortal:g,child:t};for(h=t;h;)h.return=v,h=h.sibling;const[b,y]=or(n);for((0,C.A)(Xn,this,Jn).call(this,b),(0,C.A)(Xn,this,Qn).call(this,y),Un(v),f?f.sibling=t:e.child=t,t.sibling=n.sibling,(0,C.A)(Xn,this,Zn).call(this,y),(0,C.A)(Xn,this,Zn).call(this,b),h=t;h;)h.return=e,h=h.sibling;if(m.hasChildNodes()){const t=function(e){let t=e;for(;t.tag===$n.ABSTRACT;)if(t=t.return,!t)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");return t}(e);var w,E;t.tag===$n.ROOT?null===(w=t.container)||void 0===w||w.insertBefore(m,u):null===(E=t.element)||void 0===E||E.insertBefore(m,u)}if(g.hasChildNodes()){var S;let e=t;for(;e&&e.return;)e=e.return;if((null===(S=e)||void 0===S?void 0:S.tag)!==$n.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const n="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of d)if(n.contains(e)){r=e;break}n.insertBefore(g,r)}const[A]=or(t);(0,C.A)(Xn,this,er).call(this,A)}dispose(){for(const e of Object.values((0,s.A)(Kn,this)))e.length=0;for(const e of(0,s.A)(Vn,this).values()){for(const t of e)t.disconnect();e.length=0}(0,s.A)(Vn,this).clear(),(0,s.A)(Wn,this)&&(ke.removeEventListener("change",(0,s.A)(Wn,this)),(0,a.A)(Wn,this,void 0)),(0,s.A)(zn,this).clear(),(0,s.A)(qn,this).clear(),(0,a.A)(Gn,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(Xn,this,tr).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(Xn,this,tr).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(Xn,this,tr).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(Xn,this,tr).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(Xn,this,tr).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(Xn,this,tr).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,s.A)(Kn,this).onScrollIntoView)(0,C.A)(Xn,this,nr).call(this,e,t)}initializeMediaChange(){(0,a.A)(Wn,this,(e=>{(0,C.A)(Xn,this,tr).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),ke.addEventListener("change",(0,s.A)(Wn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,s.A)(Kn,this).onMessage)for(const r of[].concat(n)){var t;null==Ai||null===(t=Ai.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{mn(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==Ai||null===(e=Ai.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(Xn,this,tr).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(Xn,this,tr).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(Xn,this,tr).call(this,"onUnmount",new CustomEvent("unmount"))}}function Jn(e){const t=[...Fn,..."page"===this.scope?jn:[]],n=[];for(const r of t){const t=(0,h.remove)((0,s.A)(Kn,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o,i;const e=(0,s.A)(Vn,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,s.A)(Vn,this).delete(t)}Ln(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove(),null===(i=t.disposes)||void 0===i||i.forEach((e=>e())),delete t.disposes}const a=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)mn(t,e.runtimeContext,e)(a)}function Qn(e){for(const n of e){var t;null===(t=n.disposes)||void 0===t||t.forEach((e=>e())),delete n.disposes}}function Zn(e){for(const t of e)delete t.child,delete t.sibling,delete t.return,t.disposed=!0,t.tag===$n.BRICK&&(delete t.element,delete t.runtimeContext),Object.freeze(t)}function er(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,s.A)(Kn,this).onMount)e.has(n)&&mn(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,s.A)(Kn,this).onScrollIntoView)e.has(t)&&(0,C.A)(Xn,this,nr).call(this,t,n)}function tr(e,t){for(const{brick:n,handlers:r}of(0,s.A)(Kn,this)[e])mn(r,n.runtimeContext,n)(t);const n=(0,s.A)(zn,this).get(e);if(n)for(const e of n)e()}function nr(e,t){var n;const r=null!==(n=t.threshold)&&void 0!==n?n:.1,o=new IntersectionObserver(((n,o)=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=r&&(mn(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:r});o.observe(e.element);let i=(0,s.A)(Vn,this).get(e);i||(i=[],(0,s.A)(Vn,this).set(e,i)),i.push(o)}function rr(e,t){let n=e;for(;n;){if(n!==e&&n.tag===$n.BRICK&&(t?n.portal:!n.portal))return n;if(n!==e&&n.child&&n.tag===$n.ABSTRACT)n=n.child;else if(n.sibling)n=n.sibling;else{var r;let e=n.return;for(;e;){if(e.tag!==$n.ABSTRACT)return;if(e.sibling)break;e=e.return}n=null===(r=e)||void 0===r?void 0:r.sibling}}}function or(e){const t=new Set,n=new Set;let r=e;for(;r;)if(r.tag===$n.BRICK?t.add(r):r.tag===$n.ABSTRACT&&n.add(r),r.child)r=r.child;else{if(r===e)break;if(r.sibling)r=r.sibling;else{var o;let i=r.return;for(;i;){if(i===e)return[t,n];if(i.sibling)break;i=i.return}r=null===(o=i)||void 0===o?void 0:o.sibling}}return[t,n]}const ir=new Map;function ar(e){return ir.get(e)}function sr(e,t,n){const r=S();if(r)return r.doTransform(e,t,n);if(n)throw new Error("Legacy doTransform does not support options in v3");return wt(t,{...xi(),data:e},{noInject:!0})}function cr(e,t,n,r,o,i){const a=S();if(a)return a.transformProperties(e,t,n,r,o,i);if(i)throw new Error("Legacy transformProperties does not support options in v3");const s=function(e,t,n,r){const o={},i=n?(0,h.get)(e,n):e;if(Array.isArray(t))for(const e of t)ur(o,i,e.to,e.from,e.mapArray);else ur(o,i,t,void 0,r);return o}(t,n,r,o);for(const[t,n]of Object.entries(s))(0,h.set)(e,t,n);return e}function lr(e,t,n,r){const o=n?(0,h.get)(e,n):e;return t?cr({},o,t,void 0,r):o}function ur(e,t,n,r,o){if(!n)return;let i=r?(0,h.get)(t,r):t,a=Array.isArray(i);if(a||!0!==o?a&&!1===o&&(a=!1):(a=!0,i=[i]),"string"!=typeof n)for(const[t,r]of Object.entries(n))e[t]=a?i.map((e=>sr(e,r))):sr(i,r);else e[n]=i}const dr=Symbol.for("root.runtimeContext");async function fr(e,t,n){var r,o,i,a;const[s,c,l]=so({...null!==(r=e[dr])&&void 0!==r?r:xi(),data:t,pendingPermissionsPreCheck:[]});s.inUseBrick=!0,null!==(o=s.tplStateStoreMap)&&void 0!==o||(s.tplStateStoreMap=new Map),null!==(i=s.formStateStoreMap)&&void 0!==i||(s.formStateStoreMap=new Map);const u=new Yn("fragment"),d={tag:$n.ROOT,createPortal:null},f=_e(),p=await oo(d,f&&!n?e:{errorBoundary:n,...e},s,u,[],{}),h=[...c,...l];let m;await ao(p,s,h);let g=p.node;for(;g;){if(g.tag===$n.BRICK){m=g;break}g=g.child}if(null!==(a=m)&&void 0!==a&&a.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return d.child=p.node,{tagName:m?m.type:null,renderRoot:d,rendererContext:u,scopedStores:h}}function pr(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:i}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Un(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function hr(e,t){let{rendererContext:n}=e;t.portal&&(Nn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function mr(e,t){const n=Mi(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),B(n)}function gr(e,t){const n=Mi(e);let r=!1;function o(e){e.forEach(((n,a)=>{"routes"===n.type?o(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(r=!0,e[a]=t):Array.isArray(n.bricks)&&i(n.bricks)}))}function i(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?o(t.routes):i(t.bricks)}))}o(n.routes),r||n.routes.unshift(t)}function vr(e,t,n){const r=`${e}.${t.name}`;Be.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),br(e,t.name,n)}function br(e,t,n){Sr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function yr(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function wr(e,t){var n;Sr(e,yr(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const Er=wr;function Sr(e,t,n,r){const{routes:o}=Mi(e),i=o.findIndex((e=>e.path===t)),a={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===i?o.unshift(a):o.splice(i,1,a)}function Ar(e,t){let{tplStateStoreId:n}=t;const r=xi();return n?Le({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function kr(e){let{tplStateStoreId:t}=e;const n=xi();return t?Le({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function Ir(e){return Ti().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function Cr(e){return(0,l.loadBricksImperatively)(e,Ti())}function Rr(e,t){return(0,l.loadEditorsImperatively)(e,null!=t?t:Ti())}function Or(){return Pi()}async function Tr(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const i=Mi(n);let a;if("route"===r)a={routes:[e]};else if("template"===r)a={meta:{customTemplates:[e]}};else if("snippet"===r){var s;const t=yr(e.snippetId);a={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===t))]}}const c=[];return a&&o&&(await o(a)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.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 _r(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...xi(),tplStateStoreId:n,match:ar(r)};return e.resolve?ot(e.resolve,o,{cache:"reload"}):yt(e.value,o)}function Pr(e){var t;const n=xi();return{app:null!==(t=null==n?void 0:n.overrideApp)&&void 0!==t?t:null==n?void 0:n.app,location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(n,["query","sys"]),match:ar(null==e?void 0:e.routeId)}}let xr;const Mr=[];function Br(e){xr=e;const t=kr({tplStateStoreId:e.tplStateStoreId});$r({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Lr(e){Mr.push(e)}function $r(e){setTimeout((()=>{for(const t of Mr)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const Nr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Ur{constructor(e,t,n,r){(0,o.A)(this,"type",void 0),(0,o.A)(this,"data",new Map),(0,o.A)(this,"changeEventType",void 0),(0,o.A)(this,"pendingStack",[]),(0,o.A)(this,"hostBrick",void 0),(0,o.A)(this,"stateStoreId",void 0),(0,o.A)(this,"batchUpdate",!1),(0,o.A)(this,"batchUpdateContextsNames",[]),(0,o.A)(this,"rendererContext",void 0),(0,o.A)(this,"routeMap",new WeakMap),(0,o.A)(this,"routeStackMap",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}has(e){return this.data.has(e)}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(xr){const{tplStateStoreId:n}=xr;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&$r({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={},i=[];e.forEach((e=>{const{name:o,value:a}=n([e]),s=this.data.get(o);i.push(...this.getAffectListByContext(o)),s&&(r[o]=s),this.updateValue(o,a,t)})),i.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const a=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}))}};a(r),a(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const i=this.data.get(e);if(!i)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?i.value=t:(0,u.isObject)(i.value)?Object.assign(i.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let a;"load"===n&&(i.loaded?a=Promise.resolve(i.value):i.loading&&(a=i.loading));const s=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!==Pi()};if(a||(a=i.loading=i.load({cache:"load"===n?"default":"reload",...t}),a.then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||s(e)||null!=r&&r.error||cn(e)}))),r){const e=xn(r,o);a.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!s(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],i=(0,T.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,T.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)i.usedProperties.add(e);t.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}r.set(o,i)}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))){var i;o.set(e,(null!==(i=o.get(e))&&void 0!==i?i:0)+1)}const a=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,c=new Map,l=new Map([...new Set(e.map((e=>e.name)))].map((e=>{const t=new Promise(((t,n)=>{c.set(e,{resolve:t,reject:n})}));return t.catch((()=>{})),[e,t]}))),u=async e=>{var n;s.add(e);const i=await t(e);r.delete(e);const a=null!==(n=o.get(e.name))&&void 0!==n?n:0;if(i){if(c.get(e.name).resolve(),o.delete(e.name),0===a)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===a?(c.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,a-1);await f()};let d=a;async function f(){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,d)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(u))}const p=f().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),d=!0,await f());for(const e of c.values())e.resolve()})).catch((e=>{for(const t of c.values())t.reject(e);throw e}));return p.catch((()=>{})),{pendingResult:p,pendingContexts:l}}(e,(e=>this.resolve(e,t,n,r)),this.type,_e(t));if(Array.isArray(r))for(const e of r){const t=this.routeStackMap.get(e);t?t.add(o):this.routeStackMap.set(e,new Set([o]))}this.pendingStack.push(o)}}onChange(e,t){var n;const r=null===(n=this.data.get(e))||void 0===n?void 0:n.eventTarget;return null==r||r.addEventListener(this.changeEventType,t),()=>{null==r||r.removeEventListener(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{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 At(e,t))return!1;let o,i,a,s,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await Ot(n,e.name)),void 0===o){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");c=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,T.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(s=await At(e.resolve,t),(s||c)&&(i=async e=>{var n;return(await ot(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),s)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await i():"async"===l&&(a=i());else if(!n)return!1}s&&"eager"===l||void 0===e.value||(o=await yt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:o,eventTarget:new Ee,useResolve:s,load:i,loaded:"eager"===l,loading:a,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var f;t&&Nr.includes(t)&&(null===(f=this.rendererContext)||void 0===f||f.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,mn(e.onChange,t)),e.track){const n=(0,T.strictCollectMemberUsage)(c?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(d.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{d.useResolve=c?kt(e.resolve,t):!!i,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,wt(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),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);this.routeMap.delete(t)}const n=this.routeStackMap.get(t);void 0!==n&&((0,h.pull)(this.pendingStack,...n),this.routeStackMap.delete(t))}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function Fr(e,t,n,r){const{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:a,tplStateStoreId:s,hostBrick:c}=e;let l;if(t&&o){const e=o.properties.get(t);e&&(g=i,l=e.map((e=>{let{from:t,to:n}=e;const r=g.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,Ot(r,t),!0]})).filter(Boolean));const s=o.slots.get(t);if(s&&r)throw new Error(`Can not have proxied slot ref when the ref target has a slot element child, check your template "${c.type}" and ref "${t}"`);if(s&&a){const e=new Map;for(const{from:t,to:r}of s){var d,f,p,m;const o=null!==(d=null===(f=a[t])||void 0===f?void 0:f.bricks)&&void 0!==d?d:[];if(!o.length)continue;const i=null!==(p=r.refSlot)&&void 0!==p?p:t;let s=e.get(i);if(!s){s=[];const t=(0,u.hasOwnProperty)(n,i)?n[i].bricks.length+1:1;for(let e=0;e<t;e+=1)s.push([]);e.set(i,s)}const l=null!==(m=r.refPosition)&&void 0!==m?m:-1,g=(0,u.hasOwnProperty)(c.runtimeContext,"forEachItem");s[(0,h.clamp)(l<0?s.length+l:l,0,s.length-1)].push(...g?jr(o,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex,c.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=r.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var g;return{[Kt]:l,[Vt]:s}}function jr(e,t,n,r){return e.map((e=>{var o;let{children:i,slots:a,...s}=e;return{...s,[Wt]:t,[zt]:n,[Ht]:r,slots:":forEach"===s.brick?uo(i,a):Object.fromEntries(Object.entries(null!==(o=uo(i,a))&&void 0!==o?o:{}).map((e=>{let[o,i]=e;return[o,"routes"===i.type?{type:"routes",routes:Dr(i.routes,t,n,r)}:{type:"bricks",bricks:jr(i.bricks,t,n,r)}]})))}}))}function Dr(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:Dr(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:jr(e.bricks,t,n,r)}))}function Kr(e,t,n){var r,o,i,a;if(null!=e.if&&!e.if||"string"==typeof e.if)throw new Error(`Can not use "if" in a slot currently, check your template "${t.hostBrick.type}"`);const s=String(null!==(r=null===(o=e.properties)||void 0===o?void 0:o.name)&&void 0!==r?r:"");if((0,O.isEvaluable)(s))throw new Error(`Can not use an expression as slot name "${s}" currently, check your template "${t.hostBrick.type}"`);if(t.usedSlots.has(s))throw new Error(`Can not have multiple slots with the same name "${s}", check your template "${t.hostBrick.type}"`);if(t.usedSlots.add(s),t.externalSlots&&(0,u.hasOwnProperty)(t.externalSlots,s)){var c;const e=null!==(c=t.externalSlots[s].bricks)&&void 0!==c?c:[];if(e.length>0){const n=t.hostBrick.runtimeContext;return(0,u.hasOwnProperty)(n,"forEachItem")?jr(e,n.forEachItem,n.forEachIndex,n.forEachSize):e}}const l=uo(e.children,e.slots);return(null!==(i=null==l||null===(a=l[""])||void 0===a?void 0:a.bricks)&&void 0!==i?i:[]).flatMap((e=>n(e,t)))}function Vr(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.flatMap((e=>r(e)))]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e,o){if("slot"===e.brick)return null==o||o(),Kr(e,t,(e=>r(e)));const{properties:i,slots:a,children:s,...c}=e,l=uo(s,a);let u=!1;const d=()=>{u=!0},f=Object.fromEntries(Object.entries(null!=l?l:{}).map((e=>{var t;let[n,o]=e;return[n,{type:"bricks",bricks:(null!==(t=o.bricks)&&void 0!==t?t:[]).flatMap((e=>r(e,d)))}]})));return{...c,properties:n(i),slots:f,...Fr(t,c.ref,f,u)}}return n(e)}function Wr(e,t,n){if(null===e.if&&delete e.if,"slot"===e.brick)return null==n||n(),Kr(e,t,Wr);const{properties:r,slots:o,children:i,...a}=e,s=uo(i,o);let c=!1;const l=()=>{c=!0},u=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var n;let[r,o]=e;return[r,{type:"bricks",bricks:(null!==(n=o.bricks)&&void 0!==n?n:[]).flatMap((e=>Wr(e,t,l)))}]})));return{...a,properties:Vr(r,t),slots:u,...Fr(t,a.ref,u,c)}}const zr="form-renderer.form-renderer",Hr=Symbol.for("form.stateStoreId"),Gr=["forms.general-form","form.general-form","eo-form"];function qr(e,t,n){const{id:r,bricks:o,events:i,context:a,mountPoint:s,instanceId:c}=e;let{brick:l,properties:d}=e;const f=t.find((e=>e.fieldId===r));if(f){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}(f);l||(l=e.brick),d={...e.properties,...d}}const p={brick:l,properties:d,iid:c,slot:s,events:i,context:a,children:Xr(o,t,n),[Hr]:n};return(0,u.hasOwnProperty)(e,"if")&&(p.if=e.if),p}function Xr(e,t,n){if(Array.isArray(e))return e.map((e=>qr(e,t,n)))}var Yr=new WeakSet;class Jr extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,Yr),(0,o.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(Yr,this,Qr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Yr,this,Qr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Yr,this,Qr).call(this,"resetFields",t)}getFieldsValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,C.A)(Yr,this,Qr).call(this,"getFieldsValue",t)}}function Qr(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,i=null==o||null===(n=o.tagName)||void 0===n?void 0:n.toLowerCase();if(Gr.includes(i))return o[e](...r);console.error(`no ${e} method in the container element`,{container:i})}class Zr extends Error{constructor(e){super(e),this.name="PageError",Error.captureStackTrace&&Error.captureStackTrace(this,l.BrickLoadError)}}async function eo(e,t,n){const{title:r,variant:o,showLink:i,showDescription:a}=function(e){var t,n;return e instanceof Zr?"page blocked"===e.message?{showLink:"home",title:c.i18n.t(`${Jt}:${qt.LICENSE_BLOCKED}`),variant:"no-permission"}:"app not found"===e.message?{showLink:"home",title:c.i18n.t(`${Jt}:${qt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:c.i18n.t(`${Jt}:${qt.PAGE_NOT_FOUND}`)}:e instanceof l.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement?{showDescription:!0,title:c.i18n.t(`${Jt}:${qt.NETWORK_ERROR}`),variant:"internet-disconnected",showLink:"reload"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Jt}:${qt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:c.i18n.t(`${Jt}:${qt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Jt}:${qt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){var s;const n=null!==(s=_i().error)&&void 0!==s?s:"illustrations.error-message";if(!1!==n){const s="eo-link",c=(i?[n,s]:[n]).filter((e=>!customElements.get(e)));try{await Promise.race([(0,l.loadBricksImperatively)(c,Ti()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const u={tag:$n.BRICK,type:n,properties:{errorTitle:r,description:a?nn(e):void 0,variant:o,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return i&&(u.child=to(i,s,u,"")),u}catch(e){console.error("Failed to load brick:",c.join(", "),e)}}}const u=n&&!!customElements.get("easyops-default-error"),d={tag:$n.BRICK,type:u?"easyops-default-error":"div",properties:{errorTitle:r,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t},f={tag:$n.BRICK,type:"div",properties:{textContent:u?a?nn(e):"":a?`${r}: ${nn(e)}`:r},runtimeContext:null,return:d};return d.child=f,n&&i&&(f.sibling=to(i,"a",d,u?"link":"")),d}function to(e,t,n,r){return{tag:$n.BRICK,type:t,slotId:r,properties:{textContent:"home"===e?c.i18n.t(`${Jt}:${qt.GO_BACK_HOME}`):"reload"===e?c.i18n.t(`${Jt}:${qt.RELOAD}`):c.i18n.t(`${Jt}:${qt.GO_BACK_TO_PREVIOUS_PAGE}`),href:"home"===e?p():"reload"===e?location.href:void 0},events:"previous"===e?{click:{action:"history.goBack"}}:void 0,runtimeContext:null,return:n}}async function no(e,t,n,r,o,i,a,s,c){const u=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=Dt(n,t.app.homepage,t.location.pathname);if(e&&await At(n,t))return t.app.noAuthGuard||n.public||null==Ai||!Ai.auth||Ai.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),d={blockingList:[]},f=d.menuRequestNode={return:i};switch(u){case"missed":break;case"unauthenticated":d.unauthenticated=!0;break;default:{var p;const i=d.route=u.route;d.path=u.match.path;const g={...n,match:u.match};i.iid&&(h=i.iid,m=u.match,ir.set(h,m)),s&&g.ctxStore.disposeDataInRoutes(t);const v=o.concat(i);g.ctxStore.define(i.context,g,void 0,v),g.pendingPermissionsPreCheck.push(null==Ai||null===(p=Ai.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(i,(e=>yt(e,g))));const{preLoadBricks:b}=i;if(Array.isArray(b)&&d.blockingList.push((0,l.loadBricksImperatively)(b,Ti())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await yt(i.redirect,g):(await ot({transform:"redirect",...i.redirect},g)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);d.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 yt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,g);n&&(f.request=n),s||r.memoizeMenuRequestNode(t,f);const o=(0,T.strictCollectMemberUsage)(i.context,"PROCESSORS",2);let u;o.size>0&&d.blockingList.push(fo((0,l.loadProcessorsImperatively)(o,Ti()),"processors",[...o].join(", "),r.unknownBricks)),u="routes"===i.type?await no(e,i.routes,g,r,v,f,a,void 0,c):await ro(e,i.bricks,g,r,v,f,a,void 0,c),co(d,u),lo(f,u.menuRequestNode)}}}var h,m;return d}async function ro(e,t,n,r,o,i,a,s,c){!function(e,t){function n(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(n);else for(const[t,o]of Object.entries(e))(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?o.forEach((e=>r(e,!0))):r(o,!0,!0):n(o)}function r(e,o,i){if(o&&(e[dr]=t),n(e.properties),!i)return;const a=uo(e.children,e.slots);for(const e of Object.values(null!=a?a:{}))for(const t of null!==(s=e.bricks)&&void 0!==s?s:[]){var s;r(t,o)}}for(const t of e)r(t)}(t,n);const l={blockingList:[]};return(await Promise.all(t.map((t=>oo(e,t,n,r,o,i,a,s&&new Map(s),c))))).forEach((e=>{co(l,e)})),l}async function oo(e,t,n,r,o,i,a){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,c=arguments.length>8?arguments[8]:void 0;try{return await async function(e,t,n,r,o,i,a,s,c){var d,f;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:m,permissionsPreCheck:v,...b}=t;if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):ct(e)&&(0,O.isTrackAll)(lt(e))}(m))return oo(e,{brick:":if",iid:t.iid,dataSource:m,permissionsPreCheck:v,slots:{"":{type:"bricks",bricks:[b]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,i,a,s,c);const y=t[Vt],w=t[Hr],E={...n,tplStateStoreId:y,formStateStoreId:w};(0,u.hasOwnProperty)(t,Wt)&&(E.forEachItem=t[Wt],E.forEachIndex=t[zt],E.forEachSize=t[Ht]);const S=_e(E),{context:A}=t;if(Array.isArray(A)&&A.length>0&&(Pe(S,"Defining context on bricks","check your brick:",t),S||E.ctxStore.define(A,E)),E.pendingPermissionsPreCheck.push(null==Ai||null===(d=Ai.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(t,(e=>yt(e,E)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!ct(e.if)?It(await ot(e.if,t)):At(e,t)}(t,E))return p;const k=t.brick;if(k.startsWith(":")){var I;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(k);const{dataSource:n}=t,{contextNames:c,stateNames:l}=Rt(n),d=!(!c&&!l),f=async(d,f,p)=>{var h;const m=await yt(n,d);p&&xt(d,[{contextNames:c,stateNames:l,propValue:n}],f);const g=":forEach"===k?"":":switch"===k?String(m):m?"":"else",v=uo(t.children,t.slots),b=v&&(0,u.hasOwnProperty)(v,g)&&(null===(h=v[g])||void 0===h?void 0:h.bricks),y={blockingList:[]},w={tag:$n.ABSTRACT,return:e,iid:t.iid};if(y.node=w,!Array.isArray(b))return y;let E;switch(k){case":forEach":if(!Array.isArray(m))break;E=await async function(e,t,n,r,o,i,a,s,c,l){const u={blockingList:[]},d=t.length,f=await Promise.all(t.map(((t,u)=>Promise.all(n.map((n=>oo(e,n,{...r,forEachItem:t,forEachIndex:u,forEachSize:d},o,i,a,s,c&&new Map(c),l)))))));return f.flat().forEach((e=>{co(u,e)})),u}(w,m,b,d,r,o,i,a,s,f);break;case":if":case":switch":E=await ro(w,b,d,r,o,i,a,s,f)}return E&&(w.child=E.node,co(y,{...E,node:void 0})),y},p=async e=>{let{type:n,runtimeContext:r,tplStateStoreScope:o,formStateStoreScope:i}=e,a=!1;const s={disposes:[],listener:()=>{a=!0}};let c,l=0,u=!0;for(;u||a;){if(a=!1,c=await f(r,s,u&&"initial"===n),!a&&"rerender"===n){const e=[...o,...i];await ao(c,r,[r.ctxStore,...e])}if(s.disposes.forEach((e=>e())),s.disposes.length=0,u=!1,++l>10)throw new Error(`Maximum rerender stack overflowed (iid: ${t.iid})`)}return c};let m=await p({type:"initial",runtimeContext:E});const{onMount:g,onUnmount:v}=null!==(I=t.lifeCycle)&&void 0!==I?I:{};if(d){var C;let t=0;const o=async()=>{if(!e.mounted||e.disposed)return;const n=++t,[o,i,a]=so(E),s=await p({type:"rerender",runtimeContext:o,tplStateStoreScope:i,formStateStoreScope:a});if(t===n&&e.mounted&&!e.disposed){v&&mn(v,E)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(e,s.node,m.node),m=s,g&&mn(g,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of[...i,...a])e.mountAsyncData()}},i=(0,h.debounce)(o,0,{leading:!0,trailing:!0}),a=e.tag===$n.ROOT?null:e,s=a?null!==(C=a.disposes)&&void 0!==C?C:a.disposes=[]:[];if(c)for(const e of c)s.push(E.ctxStore.onChange(e,i));if(l)for(const e of l){const t=Le(E,"STATE",`: "${n}"`);s.push(t.onChange(e,i))}}return g&&r.registerArbitraryLifeCycle("onMount",(()=>{mn(g,E)(new CustomEvent("mount",{detail:{rerender:!1}}))})),v&&r.registerArbitraryLifeCycle("onUnmount",(()=>{mn(v,E)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),m}/\.tpl-/.test(k)&&!Be.get(k)&&await fo((0,l.loadBricksImperatively)([k],Ti()),"brick",k,r.unknownBricks);const R=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Be.get(n))return n}return!!Be.get(e)&&e}(k,null===(f=E.app)||void 0===f?void 0:f.id);if(R){var _;const e=null!==(_=s.get(R))&&void 0!==_?_:0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${R}"`);s.set(R,e+1)}else k.includes("-")&&!customElements.get(k)&&(k===zr?customElements.get(zr)||customElements.define(zr,Jr):p.blockingList.push(fo((0,l.enqueueStableLoadBricks)([k],Ti()),"brick",k,r.unknownBricks)));let P,x;if(k===zr){var M,B;({formData:P,...x}=null!==(M=t.properties)&&void 0!==M?M:{}),null!==(B=t.properties)&&void 0!==B&&B.compute&&(P=await yt(P,E))}else{if(E.inUseBrick){const e=t.transform;e&&(Pe(S,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',t),S||(x={...t.properties,...e}))}null!=x||(x=t.properties)}const L=[],$=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:i,stateNames:a,formStateNames:s}=Rt(o);return(i||a||s)&&n.push({contextNames:i,stateNames:a,formStateNames:s,propName:r,propValue:o}),[r,yt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?mt.USE_BRICK:mt.INITIAL})]})):[]}(x,E,L),N=t[Kt];N&&$.push(...N);const U="script"===k;if(U||"link"===k){const e=await Tt($);if(U?e.src:"stylesheet"===e.rel&&e.href){var F;const t=null!==(F=window.PUBLIC_ROOT)&&void 0!==F?F:"";if(U){const{src:n,...r}=e;await fo((0,l.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await fo((0,l.loadStyle)(n,t,r),"stylesheet",n,"silent")}return p}}const j={tag:$n.BRICK,type:R||k,return:e,slotId:a,events:t.events,runtimeContext:E,portal:t.portal,iid:t.iid,ref:t.ref};p.node=j;const D=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);D.size>0&&p.blockingList.push(fo((0,l.loadProcessorsImperatively)(D,Ti()),"processors",[...D].join(", "),r.unknownBricks));const K=[];xt(E,L,c);K.push((async()=>{j.properties=await Tt($),function(e,t){for(const r of t){var n;const t=()=>{e.element&&Pt(e.element,{[r.propName]:r.propValue},e.runtimeContext)};if(null!==(n=e.disposes)&&void 0!==n||(e.disposes=[]),r.contextNames)for(const n of r.contextNames)e.disposes.push(e.runtimeContext.ctxStore.onChange(n,t));if(r.stateNames){const n=Le(e.runtimeContext,"STATE",`: "${r.propValue}"`);for(const o of r.stateNames)e.disposes.push(n.onChange(o,t))}if(r.formStateNames){const n=Je(e.runtimeContext,"FORM_STATE",`: "${r.propValue}"`);for(const o of r.formStateNames)e.disposes.push(n.onChange(o,t))}}}(j,L)})()),r.registerBrickLifeCycle(j,t.lifeCycle);let V,W=t;R?W=function(e,t,n,r,o){var i;const a=(0,h.uniqueId)("tpl-state-"),s={...n.runtimeContext,tplStateStoreId:a};delete s.forEachItem,delete s.forEachIndex,delete s.forEachSize,delete s.formStateStoreId;const c=new Ur("STATE",n,o,a);s.tplStateStoreMap.set(a,c),s.tplStateStoreScope&&s.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:f}=Be.get(e);null==Ai||null===(i=Ai.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(d,s,r);const{slots:p,children:m,...g}=t,v={...g,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:a,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:uo(m,p),tplStateStoreId:a,hostBrick:n,usedSlots:new Set};return v.slots={"":{type:"bricks",bricks:l.flatMap((e=>Wr(e,y)))}},v}(R,t,j,$,r):k===zr&&(W=function(e,t,n,r,o){var i,a;const s="string"==typeof e?JSON.parse(e):e,c=(0,h.uniqueId)("form-state-"),l={...n.runtimeContext,formStateStoreId:c};delete l.forEachItem,delete l.forEachIndex,delete l.forEachSize,delete l.tplStateStoreId;const d=new Ur("FORM_STATE",void 0,o,c);l.formStateStoreMap.set(c,d),l.formStateStoreScope&&l.formStateStoreScope.push(d);const f=null!==(i=s.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,l,r);const p=qr(s.formSchema,s.fields,c);return Gr.includes(p.brick)&&t.events&&(p.events=function(e,t){const n=null!=e?e:{};for(const[e,r]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(p.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:[p]}]}:{...t,slots:void 0,children:[p]}}(P,t,j,$,r)),W.portal&&(j.slotId=void 0),R?(V={...E},delete V.forEachItem,delete V.forEachIndex,delete V.forEachSize):V=E;return K.push((async()=>{const e=uo(W.children,W.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map((async(e,n)=>{let[a,l]=e;if("routes"!==l.type)return ro(j,l.bricks,V,r,o,i,a,s,c);let u={blockingList:[]};const d={tag:$n.ABSTRACT,return:j};u.node=d;const f=o[o.length-1];null!=f&&f.incrementalSubRoutes&&(t.set(n,a),r.performIncrementalRender(l,o,(async(e,t)=>{const{homepage:n}=V.app,{pathname:s}=e;if(!g(n,s)||!o.every((e=>{let r,o;return(r=Dt(e,n,t.pathname))&&(o=Dt(e,n,s))&&(e!==f||function(e,t){if((0,h.isEqual)(e,t))return!0;const n=(e,t)=>String(Number(t))===t,r=(0,h.omitBy)(e,n),o=(0,h.omitBy)(t,n);return(0,h.isEqual)(r,o)}(r.params,o.params))})))return!1;const[c,d,p]=so({...V,location:e,query:new URLSearchParams(e.search)});let m,v=!1,b=[];const y={blockingList:[]},w={tag:$n.ABSTRACT,return:j};y.node=w;try{if(m=await no(w,l.routes,c,r,o,i,a,!0),m.route){if(r.reBailout(m))return!0;b=[...d,...p],await ao(m,c,[c.ctxStore,...b])}}catch(e){console.error("Incremental sub-router failed:",e);const t=await r.reCatch(e,w);if(!t)return!0;({failed:v,output:m}=t)}if(j.disposed)return!0;if(w.child=m.node,co(y,{...m,node:void 0}),await r.reMergeMenuRequestNodes(i,l.routes,m.menuRequestNode),r.reRender(j,w,u.node),u=y,!v){c.ctxStore.mountAsyncData(m.route);for(const e of b)e.mountAsyncData()}return!0})));const m=await no(d,l.routes,V,r,o,i,a,void 0,c);return d.child=m.node,co(p,{...m,node:void 0}),lo(i,p.menuRequestNode=m.menuRequestNode),u}))),a={...p,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach((e=>{co(a,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}(a,e)})),a.node&&(j.child=a.node),co(p,{...a,node:void 0}),lo(i,p.menuRequestNode=a.menuRequestNode)})()),await Promise.all(K),p}(e,t,n,r,o,i,a,s,c)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await eo(n,e),blockingList:[]};throw n}}function io(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function ao(e,t,n){return(0,l.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function so(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function co(e,t){const{blockingList:n,node:r,menuRequestNode:o,...i}=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,i)}function lo(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 uo(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...r}of e){const e=null!=t?t:"";(0,u.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(r)}}return n}function fo(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let po,ho,mo;function go(){if(!po){if(po={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){po.isInIframe=!0;try{if(window.origin===window.parent.origin){po.isInIframeOfSameSite=!0;const e="/next/"===p(),t=window.parent.location.pathname,n=t.startsWith("/next/");po.isInIframeOfNext=!(Number(e)^Number(n));const r=n?"/next":"";po.isInIframeOfVisualBuilder=t.startsWith(`${r}/visual-builder/`)||t.startsWith(`${r}/visual-builder-`),po.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(po)}return po}function vo(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}`;Be.define(n,t)}}function bo(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const yo="basic.show-watermark";function wo(e){return!!e&&(e instanceof l.BrickLoadError||e instanceof R.HttpFetchError||e instanceof Error&&"ChunkLoadError"===e.name||e instanceof Event&&"error"===e.type&&e.target instanceof HTMLScriptElement)}const Eo="reload-for-error-count",So=2;function Ao(e){if(/upchat/i.test(navigator.userAgent)&&wo(e)){var t;const e=+(null!==(t=sessionStorage.getItem(Eo))&&void 0!==t?t:0);if(e<So)return sessionStorage.setItem(Eo,String(e+1)),!0;ko()}return!1}function ko(){sessionStorage.removeItem(Eo)}var Io=new WeakMap,Co=new WeakMap,Ro=new WeakMap,Oo=new WeakMap,To=new WeakMap,_o=new WeakMap,Po=new WeakMap,xo=new WeakMap,Mo=new WeakMap,Bo=new WeakMap,Lo=new WeakMap,$o=new WeakMap,No=new WeakSet;class Uo{constructor(e){(0,I.A)(this,No),(0,i.A)(this,Io,void 0),(0,i.A)(this,Co,!1),(0,i.A)(this,Ro,void 0),(0,i.A)(this,Oo,void 0),(0,i.A)(this,To,void 0),(0,i.A)(this,_o,new Set),(0,i.A)(this,Po,0),(0,i.A)(this,xo,void 0),(0,i.A)(this,Mo,void 0),(0,i.A)(this,Bo,void 0),(0,i.A)(this,Lo,void 0),(0,i.A)(this,$o,!1),(0,a.A)(Io,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(No,this,Fo).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(No,this,Fo).call(this,{location:e,action:t})))}getRenderId(){return(0,s.A)(xo,this)}getRuntimeContext(){return(0,s.A)(Oo,this)}getRecentApps(){return{currentApp:(0,s.A)(Mo,this),previousApp:(0,s.A)(Bo,this)}}getNavConfig(){return(0,s.A)(Lo,this)}bootstrap(){window.AbortController&&(ho=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:ho.signal,...e.options}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const r=t;t=e,(0,s.A)(Co,this)?(0,a.A)(Ro,this,{location:e,prevLocation:r,action:n}):(0,C.A)(No,this,Do).call(this,{location:e,prevLocation:r,action:n}).catch(cn)})),(0,C.A)(No,this,Do).call(this,{location:e.location})}}function Fo(e){var t;const n=k(),r=n.getBlockMessage();null===(t=(0,s.A)(To,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function jo(e,t,n){var r,o;if((0,a.A)(Po,this,(r=(0,s.A)(Po,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function Do(e){(0,a.A)(Co,this,!0);try{await(0,C.A)(No,this,Ko).call(this,e)}finally{if((0,a.A)(Co,this,!1),(0,s.A)(Ro,this)){const e=(0,s.A)(Ro,this);(0,a.A)(Ro,this,void 0),await(0,C.A)(No,this,Do).call(this,e)}}}async function Ko(e){let{location:t,prevLocation:n,action:r}=e;if(n){var o,i,a,c;let e;const u={hash:void 0,state:void 0};var l;if(void 0!==t.key&&("POP"!==r||void 0!==n.key&&!1!==(null===(o=n.state)||void 0===o?void 0:o.notify))||(u.key=void 0),((0,f.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==r&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(e=!0),e||null!==(a=t.state)&&void 0!==a&&a.noIncremental||(0,s.A)($o,this)||(e=await(null===(l=(0,s.A)(To,this))||void 0===l?void 0:l.didPerformIncrementalRender(t,n))),e)return;if(ho&&(ho.abort(),ho=new AbortController),null===(c=(0,s.A)(To,this))||void 0===c||c.dispatchPageLeave(),"POP"===r&&v(m((0,s.A)(Io,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(No,this,Vo).call(this,t,!n)}async function Vo(e,t){var n,r,o,i,c,u;const d=(0,a.A)(xo,this,(0,h.uniqueId)("render-id-"));let f=null==Ai||null===(n=Ai.auth)||void 0===n||null===(r=n.isBlockedPath)||void 0===r?void 0:r.call(n,e.pathname);et=new WeakSet,rt.clear(),null==Ai||null===(o=Ai.flowApi)||void 0===o||o.clearCollectWidgetContract(),k().unblock();const p=null==Ai||null===(i=Ai.pageView)||void 0===i?void 0:i.create(),g=f?void 0:m((0,s.A)(Io,this),e.pathname),v=null===(c=(0,s.A)(Oo,this))||void 0===c?void 0:c.app,b=null==g||null===(u=g.app)||void 0===u?void 0:u.id;window.BOOTSTRAP_UNION_FILE&&b&&b!==(null==v?void 0:v.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:b,version:g.app.currentVersion}),null!=g&&g.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==Ai||null===(t=Ai.fulfilStoryboard)||void 0===t?void 0:t.call(Ai,e)),B(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(g);const y=(0,a.A)(Mo,this,null==g?void 0:g.app);var w,E,S,A;y&&(null==g||null===(w=g.meta)||void 0===w||null===(w=w.blackList)||void 0===w||null===(E=w.forEach)||void 0===E||E.call(w,(e=>{var t,n;let r=e&&(e.to||e.url);if(r&&"string"==typeof r){if(r=r.split("?")[0].replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g,":$1"),e.to)try{r=wt(r,{app:y})}catch(e){console.error(e)}else r=r.replace(/^\/next\//,"/");r&&(null==Ai||null===(t=Ai.auth)||void 0===t||null===(n=t.addPathToBlackList)||void 0===n||n.call(t,r))}})),f=null==Ai||null===(S=Ai.auth)||void 0===S||null===(A=S.isBlockedPath)||void 0===A?void 0:A.call(S,e.pathname)),function(){var e,t,n,r,o,i,a,s;const c=Ii().getFeatureFlags(),u=Ii().getMiscSettings();if(!c["show-watermark"])return;const d="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]),f=null!==(n=null==Ai||null===(r=Ai.auth)||void 0===r||null===(r=r.getAuth())||void 0===r?void 0:r.username)&&void 0!==n?n:"",p=null!==(o=u.watermarkConfig)&&void 0!==o?o:{flags:{}},m=[..."string"==typeof p.content?[p.content]:null!==(i=p.content)&&void 0!==i?i:[],null!==(a=p.flags)&&void 0!==a&&a["show-development"]&&d?"Development":"",null!==(s=p.flags)&&void 0!==s&&s["show-user"]?f:""].filter(Boolean);if(0===m.length)return;const g={content:m,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(p,["content","flags"])};mo?mo.resolve(g):(0,l.loadBricksImperatively)([yo],Ti()).then((()=>{mo=document.createElement(yo),mo.resolve(g)}),(e=>{console.error("Load watermark service failed:",e)}))}();const I=v&&y?v.id!==y.id:v!==y;(0,O.clearExpressionASTCache)(),I&&(0,O.clearFunctionASTCache)();const T=Ii().getFeatureFlags(),_=(0,s.A)(To,this),P=(t,n)=>{null==p||p({status:"redirected"}),(0,s.A)(_o,this).add(_),(0,C.A)(No,this,jo).call(this,t,n,e)},x=()=>{const t=T["sso-enabled"]?"/sso-auth/login":"/auth/login";tn(e),P(t,{from:e})},M=document.querySelector("#main-mount-point"),L=document.querySelector("#portal-mount-point"),$={tag:$n.ROOT,container:M,createPortal:L},N=()=>{var e;Nn(M),Nn(L),(0,s.A)(_o,this).add(_);for(const e of(0,s.A)(_o,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,s.A)(_o,this).clear(),null==Ai||null===(e=Ai.messageDispatcher)||void 0===e||e.reset(),I&&((0,a.A)(Bo,this,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:y}})))};if(Q(y&&(re()[y.id]||y.theme)||"light"),ie("default"),ue(Ii().getMiscSettings().globalThemeVariant),y&&!f){var U,F,j,D,K,W;null==Ai||null===(U=Ai.checkInstalledApps)||void 0===U||U.preCheckInstalledApps(g,(e=>!!Bi(e)));const n={bailout:e=>e.unauthenticated?(x(),!0):e.redirect?(P(e.redirect.path,e.redirect.state),!0):void(0,a.A)(Po,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,a.A)(Lo,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,s.A)(Lo,this)}))},catch:async(t,n,r,o)=>{if(!rn(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const i=Ii().getMiscSettings().noAuthGuardLoginPath;if(rn(t)&&i)return void P(i,{from:e});if(r)throw t;return!o&&Ao(t)?void window.location.reload():{failed:!0,output:{node:await eo(t,n,!o),blockingList:[]}}}(0,s.A)(_o,this).add(_)}else x()}},r=(0,a.A)(To,this,new Yn("page",{routeHelper:n,renderId:d})),o=(0,a.A)(Oo,this,{app:y,location:e,query:new URLSearchParams(e.search),flags:T,sys:{...null==Ai||null===(F=Ai.auth)||void 0===F?void 0:F.getAuth(),...go(),settings:{brand:Ii().getBrandSettings()}},ctxStore:new Ur("CTX",void 0,r),pendingPermissionsPreCheck:[null==Ai||null===(j=Ai.checkPermissions)||void 0===j?void 0:j.preCheckPermissions(g)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,a.A)(Lo,this,void 0),vo(g),be(null===(D=g.meta)||void 0===D?void 0:D.functions,y),null==Ai||null===(K=Ai.flowApi)||void 0===K||K.collectContract(null===(W=g.meta)||void 0===W?void 0:W.contracts);let i,c=!1,l=[];try{ir.clear();const e={};if(i=await no($,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.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,h.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}(g.routes),o,r,[],e),n.bailout(i))return;l=io(o),await ao(i,o,l),e.child=i.menuRequestNode,r.setInitialMenuRequestNode(e),await n.mergeMenus(r.getMenuRequests())}catch(e){console.error("Router failed:",e),t&&(0,a.A)($o,this,!0);const r=await n.catch(e,$,t);if(!r)return;({failed:c,output:i}=r)}if(ko(),$.child=i.node,(0,a.A)($o,this,!1),N(),i.route&&"routes"!==i.route.type||c){if(c||r.dispatchBeforePageLoad(),te(),se(),bo(null==y?void 0:y.uiVersion),Un($),window.scrollTo(0,0),c)null==p||p({status:"failed"});else{r.dispatchPageLoad(),r.dispatchAnchorLoad(),r.dispatchOnMount(),r.initializeScrollIntoView(),r.initializeMediaChange(),r.initializeMessageDispatcher();for(const e of l)e.mountAsyncData();null==p||p({status:"ok",path:i.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Ai&&Ai.auth&&!Ai.auth.isLoggedIn())return void x();N()}te(),se();const z=await eo(new Zr(f?"page blocked":y?"page not found":"app not found"),$,!0);$.child=z,Un($),window.scrollTo(0,0),null==p||p({status:f?"blocked":"not-found"}),V("rendered")}const Wo="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function zo(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 Ho(e){return e<=1?"".concat(100*Number(e),"%"):e}function Go(e){return 1===e.length?"0"+e:String(e)}function qo(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 Xo(e){return Yo(e)/255}function Yo(e){return parseInt(e,16)}var Jo={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 Qo(e){var t,n,r,o={r:0,g:0,b:0},i=1,a=null,s=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(Jo[e])e=Jo[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=ni.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=ni.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ni.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=ni.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ni.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=ni.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ni.hex8.exec(e))?{r:Yo(n[1]),g:Yo(n[2]),b:Yo(n[3]),a:Xo(n[4]),format:t?"name":"hex8"}:(n=ni.hex6.exec(e))?{r:Yo(n[1]),g:Yo(n[2]),b:Yo(n[3]),format:t?"name":"hex"}:(n=ni.hex4.exec(e))?{r:Yo(n[1]+n[1]),g:Yo(n[2]+n[2]),b:Yo(n[3]+n[3]),a:Xo(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=ni.hex3.exec(e))&&{r:Yo(n[1]+n[1]),g:Yo(n[2]+n[2]),b:Yo(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(ri(e.r)&&ri(e.g)&&ri(e.b)?(t=e.r,n=e.g,r=e.b,o={r:255*zo(t,255),g:255*zo(n,255),b:255*zo(r,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):ri(e.h)&&ri(e.s)&&ri(e.v)?(a=Ho(e.s),s=Ho(e.v),o=function(e,t,n){e=6*zo(e,360),t=zo(t,100),n=zo(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),s=n*(1-(1-o)*t),c=r%6;return{r:255*[n,a,i,i,s,n][c],g:255*[s,n,n,a,i,i][c],b:255*[i,i,s,n,n,a][c]}}(e.h,a,s),l=!0,u="hsv"):ri(e.h)&&ri(e.s)&&ri(e.l)&&(a=Ho(e.s),c=Ho(e.l),o=function(e,t,n){var r,o,i;if(e=zo(e,360),t=zo(t,100),n=zo(n,100),0===t)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=qo(s,a,e+1/3),o=qo(s,a,e),i=qo(s,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,a,c),l=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(i=e.a)),i=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(i),{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:i}}var Zo="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),ei="[\\s|\\(]+(".concat(Zo,")[,|\\s]+(").concat(Zo,")[,|\\s]+(").concat(Zo,")\\s*\\)?"),ti="[\\s|\\(]+(".concat(Zo,")[,|\\s]+(").concat(Zo,")[,|\\s]+(").concat(Zo,")[,|\\s]+(").concat(Zo,")\\s*\\)?"),ni={CSS_UNIT:new RegExp(Zo),rgb:new RegExp("rgb"+ei),rgba:new RegExp("rgba"+ti),hsl:new RegExp("hsl"+ei),hsla:new RegExp("hsla"+ti),hsv:new RegExp("hsv"+ei),hsva:new RegExp("hsva"+ti),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 ri(e){return Boolean(ni.CSS_UNIT.exec(String(e)))}var oi=[{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 ii(e){var t=function(e,t,n){e=zo(e,255),t=zo(t,255),n=zo(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,s=r-o,c=0===r?0:s/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/s+(t<n?6:0);break;case t:i=(n-e)/s+2;break;case n:i=(e-t)/s+4}i/=6}return{h:i,s:c,v:a}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function ai(e){var t=e.r,n=e.g,r=e.b;return"#".concat(function(e,t,n){var r=[Go(Math.round(e).toString(16)),Go(Math.round(t).toString(16)),Go(Math.round(n).toString(16))];return r.join("")}(t,n,r))}function si(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function ci(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function li(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function ui(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Qo(e),o=5;o>0;o-=1){var i=ii(r),a=ai(Qo({h:si(i,o,!0),s:ci(i,o,!0),v:li(i,o,!0)}));n.push(a)}n.push(ai(r));for(var s=1;s<=4;s+=1){var c=ii(r),l=ai(Qo({h:si(c,s),s:ci(c,s),v:li(c,s)}));n.push(l)}return"dark"===t.theme?oi.map((function(e){var r,o,i,a=e.index,s=e.opacity;return ai((r=Qo(t.backgroundColor||"#141414"),i=100*s/100,{r:((o=Qo(n[a])).r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b}))})):n}var di={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"},fi={},pi={};function hi(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function mi(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function gi(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function vi(e,t,n){return"dark"===t?ui(e,{theme:t,backgroundColor:n})[5]:e}function bi(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?mi:hi)("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?mi:hi)("".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(gi(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,ui(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,i]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(gi(vi(t[i],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(i,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(i,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(i,"-").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?mi:hi)(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 yi,wi,Ei,Si,Ai;function ki(e){if(yi)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}})),Ai=null==e?void 0:e.hooks,(0,c.initializeI18n)(Jt,Qt),d.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{d.locale(c.i18n.language)})),A(),yi=new Oi,yi}Object.keys(di).forEach((function(e){fi[e]=ui(di[e]),fi[e].primary=fi[e][5],pi[e]=ui(di[e],{theme:"dark",backgroundColor:"#141414"}),pi[e].primary=pi[e][5]})),fi.red,fi.volcano,fi.gold,fi.orange,fi.yellow,fi.lime,fi.green,fi.cyan,fi.blue,fi.geekblue,fi.purple,fi.magenta,fi.grey;const Ii=function(){const e=S();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 yi};var Ci=new WeakMap,Ri=new WeakMap;class Oi{constructor(){(0,i.A)(this,Ci,!1),(0,i.A)(this,Ri,!1),(0,o.A)(this,"version",3)}initialize(e){var t;if((0,s.A)(Ci,this))throw new Error("The runtime cannot be initialized more than once");(0,a.A)(Ci,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),wi=e;const{notification:n,dialog:r}=_i();var o;!1!==n&&(o=null!=n?n:"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{an=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{Zt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=r?r:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?bi({type:"brandColor",...e.brandColor}):e.baseColors?bi({type:"baseColors",...e.baseColors}):e.variables&&bi({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,s.A)(Ri,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,a.A)(Ri,this,!0),Ei=new Uo(wi.storyboards),await Ei.bootstrap()}getRecentApps(){var e,t;return null!==(e=null===(t=Ei)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Ei)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Ye(e,t)}getFeatureFlags(){var e,t;return{...null===(e=wi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=Ei)||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=wi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=Ei)||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=wi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=wi)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e,t;return null!==(e=null===(t=wi)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=wi)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=Ei)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=Ei)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,l.loadBricksImperatively)(e,Ti())}}function Ti(){var e,t,n,r;return null!=Si?Si:Si=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}(null!==(e=null!==(t=null!==(n=null===(r=wi)||void 0===r?void 0:r.brickPackages)&&void 0!==n?n:Wo)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[],window.PUBLIC_DEPS)}function _i(){var e,t;return null!==(e=null===(t=wi)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function Pi(){var e;return null===(e=Ei)||void 0===e?void 0:e.getRenderId()}function xi(){var e;return null===(e=Ei)||void 0===e?void 0:e.getRuntimeContext()}function Mi(e){var t;return null===(t=wi)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Bi(e){var t;return null===(t=Mi(e))||void 0===t?void 0:t.app}function Li(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==Ai||null===(e=Ai.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function $i(){var e;return null==Ai||null===(e=Ai.auth)||void 0===e?void 0:e.getAuth()}function Ni(){var e,t;return null==Ai||null===(e=Ai.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Ui(){var e;return null==Ai||null===(e=Ai.auth)||void 0===e?void 0:e.isLoggedIn()}var Fi=new WeakMap;const ji=new class{constructor(){(0,i.A)(this,Fi,new Map)}define(e,t){(0,s.A)(Fi,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,s.A)(Fi,this).set(e,t)}get(e){return(0,s.A)(Fi,this).get(e)}};async function Di(e,t,n){return it(await Ze(e),e,"resolve",t,n)}function Ki(e){let t,{portal:n,scope:r="fragment",unknownBricks:o,supportsUseChildren:i,unsafe_penetrate:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=n;t=n||(()=>(s=document.createElement("div"),s.style.position="absolute",s.style.width=s.style.height="0",document.body.append(s),s));let l,u,d=!1;return{async render(n){let{theme:f,uiVersion:p,language:m,context:g,functions:v,templates:b,i18n:y,url:w,app:E}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(d)throw new Error("The root is unmounted and cannot be rendered any more");const S=[].concat(n);if(i){(0,T.replaceUseChildren)(S);for(const e of null!=b?b:[])Array.isArray(e.bricks)&&(0,T.replaceUseChildren)(e.bricks)}const A=l,k=(0,h.uniqueId)("render-id-");l=new Yn(r,{unknownBricks:o,renderId:k});const I={ctxStore:new Ur("CTX",void 0,l),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map,unsafe_penetrate:a};if(w){const e=new URL(w);I.query=e.searchParams,I.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const C={tag:$n.ROOT,container:e,createPortal:t};if("page"===r){var R;Q(null!=f?f:"light"),ie("default"),bo(p),m&&await c.i18n.changeLanguage(m),null!=E||(E={id:"demo",homepage:"/demo"}),I.app=E;const e={app:E,meta:{i18n:y,customTemplates:b}};null===(R=u)||void 0===R||R(),u=B(e),vo(e),be(v,E)}I.ctxStore.define(g,I);let O,_=!1,P=[];try{O=await ro(C,S,I,l,[],{}),P=io(I),await ao(O,I,P)}catch(e){_=!0,O={node:await eo(e,C,"page"===r),blockingList:[]}}if(C.child=O.node,null==A||A.dispatchOnUnmount(),null==A||A.dispose(),Nn(e),s&&Nn(s),"page"===r&&(_||l.dispatchBeforePageLoad(),te(),se()),Un(C),"page"===r&&window.scrollTo(0,0),!_){for(const e of P)e.mountAsyncData();"page"===r&&l.dispatchPageLoad(),l.dispatchOnMount(),l.initializeScrollIntoView(),l.initializeMediaChange(),l.initializeMessageDispatcher()}},unmount(){d||(d=!0,Nn(e),s&&(Nn(s),n||s.remove()))}}}function Vi(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...xi()};t&&(n.query=new URLSearchParams(k().location.search));const r=t=>{if("string"==typeof t){if((0,O.isEvaluable)(t)){const e=pt(t,n);return tt(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||nt(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)}const Wi=[];function zi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=-1;const n=()=>{if(t>-1){const e=Wi.indexOf(t);e>-1&&Wi.splice(e,1)}};return{push:()=>{var r;return n(),t=(null!==(r=Wi[Wi.length-1])&&void 0!==r?r:-1)+1,Wi.push(t),t+e},pull:n}}},24586:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(11369);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},70829:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(12559);function o(e,t){return e.get((0,r.A)(e,t))}},70918:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(72016);function o(e,t,n){(0,r.A)(e,t),t.set(e,n)}},72016:(e,t,n)=>{function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},74635:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(72016);function o(e,t){(0,r.A)(e,t),t.add(e)}},86121:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(12559);function o(e,t,n){return e.set((0,r.A)(e,t),n),n}}}]);
|
|
3
|
-
//# sourceMappingURL=9140.8e69fcb4.js.map
|