@next-bricks/form-platform 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +1 -1
- package/dist/chunks/{1419.bc8e6a7b.js → 1419.50c90c7a.js} +3 -3
- package/dist/chunks/{1419.bc8e6a7b.js.map → 1419.50c90c7a.js.map} +1 -1
- package/dist/chunks/{1646.d7004420.js → 1646.fabd3780.js} +2 -2
- package/dist/chunks/1646.fabd3780.js.map +1 -0
- package/dist/chunks/5491.ac01ea3b.js +2 -0
- package/dist/chunks/5491.ac01ea3b.js.map +1 -0
- package/dist/chunks/7746.54706f82.js +2 -0
- package/dist/chunks/7746.54706f82.js.map +1 -0
- package/dist/chunks/{9213.6352406b.js → 9213.22edbbcf.js} +3 -3
- package/dist/chunks/{9213.6352406b.js.map → 9213.22edbbcf.js.map} +1 -1
- package/dist/chunks/{eo-user-or-user-group-select.48fdf8cf.js → eo-user-or-user-group-select.2a14a9ba.js} +3 -3
- package/dist/chunks/{eo-user-or-user-group-select.48fdf8cf.js.map → eo-user-or-user-group-select.2a14a9ba.js.map} +1 -1
- package/dist/chunks/main.80954f25.js +2 -0
- package/dist/chunks/{main.a959c430.js.map → main.80954f25.js.map} +1 -1
- package/dist/index.efe03feb.js +2 -0
- package/dist/{index.9558b6ef.js.map → index.efe03feb.js.map} +1 -1
- package/package.json +2 -2
- package/dist/chunks/1646.d7004420.js.map +0 -1
- package/dist/chunks/5491.2a6ab1c7.js +0 -2
- package/dist/chunks/5491.2a6ab1c7.js.map +0 -1
- package/dist/chunks/7746.95a17e2b.js +0 -2
- package/dist/chunks/7746.95a17e2b.js.map +0 -1
- package/dist/chunks/main.a959c430.js +0 -2
- package/dist/index.9558b6ef.js +0 -2
- /package/dist/chunks/{1419.bc8e6a7b.js.LICENSE.txt → 1419.50c90c7a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{9213.6352406b.js.LICENSE.txt → 9213.22edbbcf.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-user-or-user-group-select.48fdf8cf.js.LICENSE.txt → eo-user-or-user-group-select.2a14a9ba.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_form_platform=self.webpackChunk_next_bricks_form_platform||[]).push([[5491],{5491:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>ir,Notification:()=>fr,StoryboardFunctionRegistryFactory:()=>he,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ne,authenticate:()=>ja,batchSetAppsLocalTheme:()=>ae,checkIfByTransform:()=>Ot,checkIfOfComputed:()=>Rt,createHistory:()=>Z,createRuntime:()=>Pa,customProcessors:()=>B,customTemplates:()=>Me,fetchByProvider:()=>Va,getAuth:()=>Da,getBasePath:()=>v,getCssPropertyValue:()=>ue,getCurrentMode:()=>le,getCurrentTheme:()=>re,getHistory:()=>A,getPageInfo:()=>Xn,getRuntime:()=>_a,getV2RuntimeFromDll:()=>I,handleHttpError:()=>pr,httpErrorToString:()=>sr,isLoggedIn:()=>Wa,isUnauthenticatedError:()=>lr,logout:()=>Ka,matchPath:()=>Vt,registerWidgetFunctions:()=>Ne,registerWidgetI18n:()=>$,unstable_createRoot:()=>za});var n={};r.r(n),r.d(n,{getAddedContracts:()=>po,getAllContextValues:()=>lo,getBrickPackagesById:()=>co,getContextValue:()=>so,getRenderId:()=>uo,legacyDoTransform:()=>Qa,mountUseBrick:()=>Ya,renderUseBrick:()=>qa,unmountUseBrick:()=>Ja,updateSnippetPreviewSettings:()=>oo,updateStoryboard:()=>Xa,updateStoryboardByRoute:()=>eo,updateStoryboardBySnippet:()=>ao,updateStoryboardByTemplate:()=>to,updateTemplatePreviewSettings:()=>ro});var a=r(3028),o=r(4795),i=r(3395),s=r(381),l=r(687),c=r(420),u=r(5300),d=r(2307),p=r(8874),f=(r(8525),r(7857));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(2159),m=r(5178);function g(e,t){var r=(0,m.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&y(a,t))return n}}function y(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function b(e){var t;return!e||(null===(t=_a().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var w,E=["extraQuery","clear","keepHash"],S=!1;function k(e,t){t(!(S=!confirm(e)))}function I(){var e,{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 Z(){if(!w){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:k});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){S=!1,r(e,t),null==n||n(S)}function i(e,t,r){S=!1,n(e,t),null==r||r(S)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:l,keepHash:c}=n,u=(0,h.Z)(n,E),d=new URLSearchParams(l?"":e.location.search),p={};for(var[f,v]of(Object.assign(p,r,s),Object.entries(p)))if(Array.isArray(v))for(var m of(d.delete(f),v))d.append(f,m);else null==v||""===v?d.delete(f):d.set(f,v);("push"===t?o:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,a)}}return(0,a.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.Z)((0,a.Z)({},e.location),{},{key:void 0,hash:t,state:(0,a.Z)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.Z)((0,a.Z)({},e.location),{},{state:(0,a.Z)((0,a.Z)({},e.location.state),{},{notify:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(a,o,i){var s,l="string"==typeof a;return"string"==typeof(s=l?(0,f.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&b(function(e){var t,r;return g(null!==(t=null===(r=Ca)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?v()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:o,replace:i})))}(e)),w=e}return w}var A=function(){var e=I();if(e)return e.getHistory}()||function(){return w},C=r(5866),R=r(6171),T=r(6777),O=r(5506),P=r(6750),_=r(7127),M=r(2388),x=new WeakMap,B=function(){var e=I();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,i.Z)(this,x,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,l.Z)(this,x).get(r);if(a||(a=new Map,(0,l.Z)(this,x).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,l.Z)(this,x).get(e)}};function L(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=U("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;c.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)c.i18n.removeResourceBundle(e,n)}}}function U(e,t){return"".concat(e,"/").concat(t)}function N(e){return c.i18n.getFixedT(null,U("widget",e))}var F,$=function(){var e=I();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=U("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;c.i18n.addResourceBundle(t,r,n)}))},j="brick-next-devtools-panel",D="devtools-frame-active-change",K="devtools-panel-change",W=!0;function V(e,t){var r=H();if(r&&("evaluation"!==e||W&&(!F||"Evaluations"===F))){var n=()=>{var n;null===(n=r.emit)||void 0===n||n.call(r,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(n):setTimeout(n,0)}}function H(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var z=()=>{throw new Error("Can't modify read-only proxy object")},q={set:z,defineProperty:z,deleteProperty:z,setPrototypeOf:z};function G(e){return new Proxy(e,q)}function Y(e){var{get:t,ownKeys:r}=e;return H()?G(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var J="light",Q=new d.JsonStorage(localStorage),X="apps-theme";function ee(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));J=e}function te(){return J}function re(){return document.documentElement.dataset.theme}function ne(e){e?ee(e):e=te(),e!==re()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ae(e){Q.setItem(X,(0,a.Z)((0,a.Z)({},oe()),e))}function oe(){var e,t;try{t=Q.getItem(X)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var ie="default";function se(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));ie=e}function le(){return document.documentElement.dataset.mode}function ce(e){e?se(e):e=ie,e!==le()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ue(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return r&&(null===(t=window.getComputedStyle(r))||void 0===t?void 0:t.getPropertyValue(e))||""}function de(e,t){var r={};for(var n of e){var a=pe(n,t);void 0!==a&&(r[n]=a)}return r}function pe(e,t){var r,n,a,{collectCoverage:o,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return o?"/next":v().replace(/\/$/,"");case"FN":return d;case"IMG":return o?{get:e=>"mock/images/".concat(e)}:i?null==Ta||null===(r=Ta.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==Ta||null===(n=Ta.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return o?m.identity:i?N(i):c.i18n.getFixedT(null,[u,U("app",l.id)].filter(Boolean));case"I18N_TEXT":return o?fe:c.i18nText;case"PERMISSIONS":return G({check:o?ve:null==Ta||null===(a=Ta.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return G({getTheme:o?()=>"light":te});case"console":return p?G(console):void 0;case"location":return o?{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 fe(e){return null==e?void 0:e.en}function ve(){return!0}function he(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new Map,i=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,l=o.get(a);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(a));var c=(0,O.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,O.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,M.supply)(c.attemptToVisitGlobals,de(c.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:i,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),l.processed=!0,l.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),o.clear(),Array.isArray(t))for(var a of t){var i=(0,P.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,P.collectMemberUsageInFunction)(a,"PERMISSIONS",!!n).has("check");o.set(a.name,{source:a.source,typescript:a.typescript,deps:i,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,P.collectMemberUsageInFunction)(r,"FN",!0),i=(0,P.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:i})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=o.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:me,registerStoryboardFunctions:ge,checkPermissionsUsage:ye}=he(),be={};try{be.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,a=o.prototype;function o(){t.set(this,r(null))}function i(e,t,r){n(e,t,{configurable:!0,writable:!0,value:r})}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}i(a,"addEventListener",(function(e,r,n){for(var a=t.get(this),o=a[e]||(a[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===r)return;o.push({target:this,listener:r,options:n})})),i(a,"dispatchEvent",(function(e){var r=t.get(this)[e.type];return r&&(i(e,"target",this),i(e,"currentTarget",this),r.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(a,"removeEventListener",(function(e,r){for(var n=t.get(this),a=n[e]||(n[e]=[]),o=0,i=a.length;o<i;o++)if(a[o].listener===r)return void a.splice(o,1)})),be.EventTarget=o}(Object,new WeakMap)}const we=be.EventTarget;var Ee=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),Se=new Map([[Ee.xLarge,"1920px"],[Ee.large,"1600px"],[Ee.medium,"1280px"],[Ee.small,"1024px"],[Ee.xSmall,0]]),ke=new we,Ie={},Ze={};function Ae(e,t){var r=!1;for(var[n]of(Ie[t]=e.matches,Se))if(Ie[n]&&Ze.breakpoint!==n){Ze.breakpoint=n,r=!0;break}r&&ke.dispatchEvent(new CustomEvent("change",{detail:Ze}))}Se.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Ae(r,t),r.addEventListener?r.addEventListener("change",(e=>{Ae(e,t)})):r.addListener((e=>{Ae(e,t)}))}));var Ce=()=>Ze;function Re(e){return function(t){var r,n="local"===e?localStorage:sessionStorage;return JSON.parse(null!==(r=n.getItem(t))&&void 0!==r?r:"null")}}function Te(e){var t,r;return!(null===(t=e?e.flags:null===(r=_a())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var o=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(o),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(o),...n)}var Pe=new Set(["prefix"]),_e=new WeakMap,Me=function(){var e=I();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,i.Z)(this,_e,{writable:!0,value:new Map})}define(e,t){var r,n,o,i,s=(0,l.Z)(this,_e).has(e);s?console.warn('Custom template of "'.concat(e,'" already registered.')):(s=!!customElements.get(e))&&console.warn('Custom template of "'.concat(e,'" already defined by customElements.'));var c=Te(),u=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},d=[],p=[];for(var[f,v]of Object.entries(u))v.asVariable?(Oe(c,"Template `asVariable`",e,f),c||p.push(f)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,f):v.ref&&d.push([f,v]);var h=(0,a.Z)((0,a.Z)({},t),{},{proxy:(0,a.Z)((0,a.Z)({},t.proxy),{},{properties:Object.fromEntries(d)}),state:(t.state?c?t.state:t.state.map((e=>(0,a.Z)({expose:!0},e))):[]).concat(p.map((e=>({name:e,expose:!0}))))});(0,l.Z)(this,_e).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var g,y,b=(g=h.state,(0,m.uniq)(null!==(y=null==g?void 0:g.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==y?y:[])),w=Object.entries(null!==(o=null===(i=h.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),E=b.concat(d.map((e=>e[0]))),S=w.map((e=>e[0])),k=E.concat(S).filter((e=>e in HTMLElement.prototype&&!Pe.has(e)));if(k.length>0&&(Oe(c,"Using native HTMLElement properties as template properties or methods",e,...k),c))throw new Error('In custom template "'.concat(e,'", ').concat(k.map((e=>'"'.concat(e,'"'))).join(", ")," are native HTMLElement properties, and should be avoid to be used as brick properties or methods."));if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return E}static get _dev_only_definedMethods(){return S}$$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(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var I=function(r){if(d.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),1;Object.defineProperty(t.prototype,r,{get(){return this.$$tplStateStore.getValue(r)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(r,e,"replace")},enumerable:!0})};for(var Z of b)I(Z);var A=function(e,r){Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(r.ref)[null!==(t=r.refProperty)&&void 0!==t?t:e]},set(t){var n,a,o=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);o&&(o[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[C,R]of d)A(C,R);var T=function(e,r){Object.defineProperty(t.prototype,e,{value(){var t;this.$$getElementByRef(r.ref)[null!==(t=r.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0})};for(var[O,P]of w)T(O,P);customElements.define(e,t)}}get(e){return(0,l.Z)(this,_e).get(e)}};function xe(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var o=a.get(n);if(!o)throw new Error('Template state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return o}function Be(e,t,r){var n=xe(e,t,r).hostBrick.element;if(!n)throw new Error('Template host element is gone when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return n}var Le=new Map,Ue=new Proxy(Object.freeze({}),{get:(e,t)=>Le.get(t)}),Ne=function(){var e=I();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Le.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=he({widgetId:e,widgetVersion:r});Le.set(e,n),a(t)};const Fe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$e=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Fe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},je=e=>"*"===e||"x"===e||"X"===e,De=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Ke=(e,t)=>{if(je(e)||je(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(De(e),De(t));return r>n?1:r<n?-1:0},We=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ke(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},Ve=(e,t,r)=>{qe(r);const n=((e,t)=>{const r=$e(e),n=$e(t),a=r.pop(),o=n.pop(),i=We(r,n);return 0!==i?i:a&&o?We(a.split("."),o.split(".")):a||o?a?-1:1:0})(e,t);return He[r].includes(n)},He={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ze=Object.keys(He),qe=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===ze.indexOf(e))throw new Error(`Invalid operator, expected one of ${ze.join("|")}`)};function Ge(e,t){var r=$a(e);if(!r&&null!=Ta&&Ta.checkInstalledApps&&(r=Ta.checkInstalledApps.getCheckedApp(e)),!r||"running"===r.installStatus)return!1;if(!t||!r.currentVersion)return!0;var n=t.match(/^([><]=?|=)(.*)$/);try{if(!n)throw new TypeError("Invalid match version: ".concat(t));return Ve(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ye(e,t,r){var{formStateStoreId:n,formStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var o=a.get(n);if(!o)throw new Error('Form state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return o}var Je=new Map;function Qe(e){return Xe.apply(this,arguments)}function Xe(){return Xe=(0,o.Z)((function*(e){var t,r=null==Ta||null===(t=Ta.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=Ta.flowApi.FLOW_API_PROVIDER);var n=Je.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)Ta.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],La()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Je.set(e,n),n})),Xe.apply(this,arguments)}var et=new WeakSet;function tt(e){if((0,d.isObject)(e)&&!rt(e))if(et.add(e),Array.isArray(e))e.forEach(tt);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(tt)}}function rt(e){return et.has(e)}var nt=new Map;function at(e,t,r){return ot.apply(this,arguments)}function ot(){return(ot=(0,o.Z)((function*(e,t,r){var{useProvider:n,method:o="resolve",args:i=[],onReject:s}=e,{provider:l,field:c}=e;if(l&&!n)throw new Error("You're using \"provider: ".concat(l,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=c;if(u){var d=Te();if(Oe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([Qe(n),wt(i,t)]),h=it(f,n,o,v,r,i),{transform:g}=e;try{var y=yield h;tt(p=u?(0,m.get)(y,c):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,p=e}return g?"string"==typeof g?{[g]:p}:wt(g,(0,a.Z)((0,a.Z)({},t),{},{data:p})):p}))).apply(this,arguments)}function it(e,t,r,n,a,o){return st.apply(this,arguments)}function st(){return st=(0,o.Z)((function*(e,t,r,n,a,i){var s,l;try{s=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;s=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==a?void 0:a.cache)&&(l=nt.get(s)),l||(l=(0,o.Z)((function*(){var a,o=null!=Ta&&null!==(a=Ta.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield Ta.flowApi.getArgsOfFlowApi(t,n,r):n;return e.resolve(...o)}))(),nt.set(s,l)),l})),st.apply(this,arguments)}var lt=Symbol.for("pre.evaluated.raw"),ct=Symbol.for("pre.evaluated.context");function ut(e){return!(null==e||!e[lt])}function dt(e){return e[lt]}function pt(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[lt])}var ft=new WeakSet([SyntaxError,TypeError,ReferenceError]);function vt(e){return ft.has(e.constructor)?e.constructor:TypeError}function ht(){return(ht=(0,o.Z)((function*(e,t,r){var{blockingList:n,run:a}=mt(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function mt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=[];if("string"!=typeof e){var i=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.Z)((0,a.Z)({},e[ct]),i),e=e[lt]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,O.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,P.collectAppGetMenuUsage)(l,e,t),(0,P.collectInstalledAppsHasUsage)(c,e,t)}}})}catch(t){var p="".concat(t.message,', in "').concat(e,'"');throw new(vt(t))(p)}if(l.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(c.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var f,v,h,g,y={},{attemptToVisitGlobals:b}=s;if(r.lazy||b.has("EVENT")&&!(0,d.hasOwnProperty)(t,"event")||b.has("DATA")&&!(0,d.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[lt]:e,[ct]:t}:e};var w,E,S=Te(t);(b.has("STATE")||!S&&b.has("TPL"))&&(g=xe(t,"STATE",': "'.concat(e,'"'))),b.has("FORM_STATE")&&(E=Ye(t,"FORM_STATE",': "'.concat(e,'"')));var k=H();if(n||k){if(b.has("CTX")&&(f=(0,P.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(f))),g){if(h=(0,P.strictCollectMemberUsage)(e,"STATE"),!S){var I=(0,P.strictCollectMemberUsage)(e,"TPL");for(var Z of I)h.add(Z)}n&&o.push(g.waitFor(h))}E&&(w=(0,P.strictCollectMemberUsage)(e,"FORM_STATE"),n&&o.push(E.waitFor(w))),b.has("PROCESSORS")&&(v=(0,P.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,u.loadProcessorsImperatively)(v,La())))}if(n){var A,C=b.has("PERMISSIONS");if(!C&&b.has("FN")){var R=[...(0,P.strictCollectMemberUsage)(e,"FN")];C=ye(R)}if(C&&o.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=Ta&&Ta.menu){var T=[...l.usedArgs];o.push(Promise.all(T.map((e=>Ta.menu.fetchMenuById(e,t,{getStoryboardByAppId:Fa,resolveData:at,asyncComputeRealValue:wt})))))}c.usedArgs.size>0&&o.push(null==Ta||null===(A=Ta.checkInstalledApps)||void 0===A?void 0:A.waitForCheckingApps([...c.usedArgs]))}return{blockingList:o,run(){var r,n,o,i,{app:l,location:c,query:u,match:p,flags:k,sys:I,ctxStore:Z,data:A,event:C}=t,R=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var T of b)switch(T){case"ANCHOR":y[T]=c.hash?c.hash.substring(1):null;break;case"APP":y[T]=(0,a.Z)((0,a.Z)({},(0,m.cloneDeep)(R)),{},{getMenu:null==Ta||null===(n=Ta.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[T]=Y({get:(e,t)=>Z.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[T]=A;break;case"EVENT":y[T]=C;break;case"FLAGS":y[T]=G(k);break;case"FORM_STATE":y[T]=Y({get:(e,t)=>E.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":y[T]=c.hash;break;case"INSTALLED_APPS":y[T]=G({has:Ge});break;case"ITEM":case"INDEX":var P="ITEM"===T?"forEachItem":"forEachIndex";(0,d.hasOwnProperty)(t,P)?y[T]=t[P]:console.error("Using `".concat(T,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":y[T]=G({getItem:Re("local")});break;case"MEDIA":y[T]=G(Ce());break;case"MISC":y[T]=_a().getMiscSettings();break;case"PARAMS":y[T]=new URLSearchParams(u);break;case"PATH":y[T]=G(null!==(o=null==p?void 0:p.params)&&void 0!==o?o:{});break;case"PATH_NAME":y[T]=c.pathname;break;case"PROCESSORS":y[T]=Y({get(e,t){var r=B.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return Y({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of v){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":y[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[T]=G({getItem:Re("session")});break;case"TPL":if(Oe(S,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),S)break;case"STATE":y[T]=Y({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[T]=G(null!=I?I:{});break;case"__WIDGET_FN__":y[T]=Ue;break;case"__WIDGET_IMG__":y[T]=null==Ta||null===(i=Ta.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":y[T]=N}Object.assign(y,de(s.attemptToVisitGlobals,{storyboardFunctions:me,app:t.app,appendI18nNamespace:t.appendI18nNamespace}));try{var _=(0,O.cook)(s.expression,s.source,{globalVariables:(0,M.supply)(s.attemptToVisitGlobals,y)});return V("evaluation",{raw:e,context:y,result:_}),_}catch(t){var x="".concat(t.message,', in "').concat(e,'"');throw new(vt(t))(x)}}}}var gt=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 yt(e){switch(e){case gt.USE_BRICK_PROPERTIES:case gt.USE_BRICK_TRANSFORM:case gt.USE_BRICK_EVENTS:case gt.USE_BRICK_IF:case gt.USE_BRICK_LIFECYCLE:case gt.USE_BRICK_DATA_SOURCE:return!0}return!1}function bt(e,t,r){if(yt(e))return e;if(t)switch(e){case gt.USE_BRICK:return gt.USE_BRICK_ITEM;case gt.USE_BRICK_SLOTS_ITEM_BRICKS:return gt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case gt.INITIAL:if("useBrick"===r)return gt.USE_BRICK;break;case gt.USE_BRICK:case gt.USE_BRICK_ITEM:case gt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return gt.USE_BRICK_PROPERTIES;case"transform":return gt.USE_BRICK_TRANSFORM;case"dataSource":return gt.USE_BRICK_DATA_SOURCE;case"events":return gt.USE_BRICK_EVENTS;case"slots":return gt.USE_BRICK_SLOTS;case"children":return gt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return gt.USE_BRICK_IF;case"lifeCycle":return gt.USE_BRICK_LIFECYCLE}break;case gt.USE_BRICK_SLOTS:return gt.USE_BRICK_SLOTS_ITEM;case gt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return gt.USE_BRICK_SLOTS_ITEM_BRICKS}return gt.INITIAL}function wt(e,t){return Et.apply(this,arguments)}function Et(){return Et=(0,o.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ut(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&yt(r.$$stateOfUseBrick),i=o;return n||(0,O.isEvaluable)(e)?(a=yield function(e,t,r){return ht.apply(this,arguments)}(e,t,{lazy:o}),i=pt(e)):a=o?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?_.transform:_.transformAndInject:r.noInject?It:_.inject)(e,t),i||tt(a),a}if(!(0,d.isObject)(e)||rt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=kt(r,!0);return Promise.all(e.map((e=>wt(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([wt(n,t),wt(a,t,kt(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),Et.apply(this,arguments)}function St(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=ut(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&yt(r.$$stateOfUseBrick),i=o;return n||(0,O.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=mt(e,t,void 0,!1);return n()}(e,t),i=pt(e)):a=o?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?_.transform:_.transformAndInject:r.noInject?It:_.inject)(e,t),i||tt(a),a}if(!(0,d.isObject)(e)||rt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=kt(r,!0);return e.map((e=>St(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[St(n,t),St(a,t,kt(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function kt(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:bt(e.$$stateOfUseBrick,t,r)}):e}function It(e){return e}function Zt(e,t){return At.apply(this,arguments)}function At(){return(At=(0,o.Z)((function*(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ut(e.if)?yield wt(e.if,t):e.if)}))).apply(this,arguments)}function Ct(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||ut(e.if)?St(e.if,t):e.if)}function Rt(e){return!(0,d.hasOwnProperty)(e,"if")||!!e.if}function Tt(){return(Tt=(0,o.Z)((function*(e,t){return(0,d.isObject)(e.if)&&!ut(e.if)?Rt(yield at(e.if,t)):Zt(e,t)}))).apply(this,arguments)}var Ot=function(){var e=I();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Ct(e,{data:t})};function Pt(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,O.isEvaluable)(e):ut(e)){var a="string"==typeof e?e:dt(e);if((0,O.isTrackAll)(a)){var o=(0,P.trackAll)(a);o&&(t=o.context,r=o.state,n=o.formState)}else t=(0,P.track)(a,"track context","CTX"),r=(0,P.track)(a,"track state","STATE"),n=(0,P.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function _t(e,t){return Mt.apply(this,arguments)}function Mt(){return(Mt=(0,o.Z)((function*(e,t){for(var[r,n,a]of e)if(r===t){var o=yield n;if(void 0!==o||!a)return o}}))).apply(this,arguments)}function xt(e){return Bt.apply(this,arguments)}function Bt(){return(Bt=(0,o.Z)((function*(e){var t={};for(var[r,n,a]of e){var o=yield n;void 0===o&&a||!("style"!==r&&"dataset"!==r||(0,d.isObject)(o))||(t[r]=o)}return t}))).apply(this,arguments)}function Lt(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,o]of Object.entries(n))e[r][a]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Ut(e,t,r){var n=function(e,t){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=St(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?gt.USE_BRICK:gt.INITIAL});if("style"!==r&&"dataset"!==r||(0,d.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Lt(e,n)}))}function Nt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ft(e){return e&&e.sensitive?"":"i"}function $t(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,i=void 0===o||o,s=r.end,l=void 0===s||s,c=r.encode,u=void 0===c?function(e){return e}:c,d=r.delimiter,p=void 0===d?"/#?":d,f=r.endsWith,v="[".concat(Nt(void 0===f?"":f),"]|$"),h="[".concat(Nt(p),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=Nt(u(b));else{var w=Nt(u(b.prefix)),E=Nt(u(b.suffix));if(b.pattern)if(t&&t.push(b),w||E)if("+"===b.modifier||"*"===b.modifier){var S="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(E).concat(w,"(?:").concat(b.pattern,"))*)").concat(E,")").concat(S)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(E,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(w).concat(E,")").concat(b.modifier)}}if(l)a||(m+="".concat(h,"?")),m+=r.endsWith?"(?=".concat(v,")"):"$";else{var k=e[e.length-1],I="string"==typeof k?h.indexOf(k[k.length-1])>-1:void 0===k;a||(m+="(?:".concat(h,"(?=").concat(v,"))?")),I||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,Ft(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var a=1,o="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--a){s++;break}}else if("("===e[s]&&(a++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(a)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var i="",s=r+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,a=void 0===n?"./":n,o="[^".concat(Nt(t.delimiter||"/#?"),"]+?"),i=[],s=0,l=0,c="",u=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[l],a=n.type,o=n.index;throw new TypeError("Unexpected ".concat(a," at ").concat(o,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var f=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=f||"";-1===a.indexOf(m)&&(c+=m,m=""),c&&(i.push(c),c=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=f||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(i.push(c),c=""),u("OPEN")){m=p();var y=u("NAME")||"",b=u("PATTERN")||"",w=p();d("CLOSE"),i.push({name:y||(b?s++:""),pattern:y&&!b?o:b,prefix:m,suffix:w,modifier:u("MODIFIER")||""})}else d("END")}}return i}(e,r),t,r)}function jt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,a=r.exec(e.source);a;)t.push({name:a[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),a=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return jt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),Ft(r))}(e,t,r):$t(e,t,r)}var Dt=new Map,Kt=1e4,Wt=0;function Vt(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:o=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:i,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Dt.get(r);n||Dt.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:jt(e,o,t),keys:o};return Wt<Kt&&(n.set(e,i),Wt++),i}(r,{end:n,strict:a,sensitive:o}),l=i.exec(e);if(!l)return null;var[c,...u]=l,d=e===c;return n&&!d?null:{path:r,url:"/"===r&&""===c?"/":c,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function Ht(){return(Ht=(0,o.Z)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=zt(r,t.app.homepage,t.location.pathname);if(n&&(yield Zt(r,t)))return t.app.noAuthGuard||r.public||null==Ta||!Ta.auth||Ta.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function zt(e,t,r){return Vt(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var qt,Gt=Symbol.for("tpl.asyncComputedPropsFromHost"),Yt=Symbol.for("tpl.stateStoreId"),Jt=Symbol.for("tpl.externalForEachItem"),Qt=Symbol.for("tpl.externalForEachIndex"),Xt=r(6666),er=new Set,tr=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}({}),rr={[tr.REQUEST_FAILED]:"Request Failed",[tr.SOMETHING_WENT_WRONG]:"Something went wrong!",[tr.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[tr.NETWORK_ERROR]:"Network error, please check your network."},nr={[tr.REQUEST_FAILED]:"请求失败",[tr.SOMETHING_WENT_WRONG]:"出现了一些问题!",[tr.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[tr.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},ar="core/runtime",or={en:rr,zh:nr},ir=Object.freeze({show:function(e){return qt?qt.resolve(e):"confirm"===e.type?confirm(e.content)?new Promise((e=>setTimeout((()=>{e()}),1))):new Promise(((e,t)=>setTimeout((()=>{t()}),1))):(alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1e3))))}});function sr(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof T.HttpFetchError)return c.i18n.t("".concat(ar,":").concat(tr.NETWORK_ERROR));if(e instanceof T.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 lr(e){return e instanceof T.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var cr,ur,dr=!1;function pr(e){if(!(e instanceof T.HttpAbortError)){if(lr(e)&&!window.NO_AUTH_GUARD){if(dr)return;return dr=!0,void ir.show({type:"confirm",content:c.i18n.t("".concat(ar,":").concat(tr.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=_a().getFeatureFlags()["sso-enabled"],(t=A()).push(e?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},t.location),{},{state:void 0})}),dr=!1}),(()=>{dr=!1}))}console.error(e);var t=sr(e);t!==cr&&(cr=t,ir.show({type:"error",title:c.i18n.t("".concat(ar,":").concat(tr.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap"}}).then((()=>{cr=void 0})))}}var fr=Object.freeze({show:function(e){ur?ur.resolve(e):alert(e.message)}});function vr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=br(a,r,{element:e});for(var i of(e.addEventListener(n,o),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,o]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,i])}))}function hr(e){return"string"==typeof e.action}function mr(e){return"string"==typeof e.useProvider}function gr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function yr(e){return!!e.then}function br(e,t,r){return function(n){var o,i;for(var s of[].concat(e))if(Ct(s,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(yr(s))br(s.then,t,r)(n);else if(hr(s)){var[l,c]=s.action.split(".");switch(s.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":Zr(n,c,s.args,s.callback,t);break;case"window.open":Ar(n,s.args,t);break;case"location.reload":case"location.assign":Pr(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":_r(n,l,c,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":Mr(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":xr(n,c,s.args,t);break;case"handleHttpError":pr(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Rr(n,c,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":Tr(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=Nr(s.args,t,n);Be(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":Or(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Br(n,c,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ne("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[p]=Nr(s.args,t,n);ne(p);break;case"mode.setDashboardMode":case"mode.setDefaultMode":ce("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else mr(s)?wr(n,s,t,r):gr(s)?Sr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&br(s.else,t,r)(n)}}function wr(e,t,r,n){return Er.apply(this,arguments)}function Er(){return(Er=(0,o.Z)((function*(e,t,r,n){try{kr(e,yield Qe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(sr(e))}}))).apply(this,arguments)}function Sr(e,t,r,n){var o=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,O.isEvaluable)(i):ut(i))&&(l=St(i,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&o.push(c)}else if(l)l instanceof HTMLElement?o.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,O.isEvaluable)(s):ut(s))&&(u=St(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var d=[].concat(u),p=Be(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{kr(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Ut(o,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",i||s)}function kr(e,t,r,n,a,o,i){return Ir.apply(this,arguments)}function Ir(){return Ir=(0,o.Z)((function*(e,t,r,n,i,s,l){var c;if("function"==typeof t[n]){var u=function(){var a=(0,o.Z)((function*(){var a,o=Nr(r.args,i,e,l);return mr(r)&&null!=Ta&&null!==(a=Ta.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(o=yield Ta.flowApi.getArgsOfFlowApi(r.useProvider,o,n)),t[n](...o)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var d,p=Ur(r.callback,i,s),f={progress:p("progress"),success:p("success"),error:p("error"),finally:p("finally")};if(mr(r)&&(d=St(r.poll,(0,a.Z)((0,a.Z)({},i),{},{event:e}))),null!==(c=d)&&void 0!==c&&c.enabled)!function(e,t,r){var n,{progress:a,success:i,error:s,finally:l}=t,{interval:c,leadingRequestDelay:u,continueOnError:d,delegateLoadingBar:p,expectPollEnd:f,expectPollStopImmediately:v}=r,h=Ua();function m(){return g.apply(this,arguments)}function g(){return(g=(0,o.Z)((function*(){var t;er.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==Ua())||(null==a||a(r),null!=f&&f(r)?(p&&window.dispatchEvent(new Event("request.end")),null==i||i(r),null==l||l()):y(null!=c?c:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==Ua())||(null==s||s(e),d?y(null!=c?c:3e3):null==l||l())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function y(e){n=setTimeout(m,e),er.add(n)}y(null!=u?u:0),p&&window.dispatchEvent(new Event("request.start"))}(u,f,d);else try{var v=yield u();f.success(v)}catch(e){f.error(e)}finally{f.finally()}}else u()}else console.error("target has no method:",{target:t,method:n})})),Ir.apply(this,arguments)}function Zr(e,t,r,n,a){var o=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":o=2,i=!0;break;case"reload":i=!0;break;case"block":o=1,s="setBlockMessage"}var l=[];if(o>0&&((l=Nr(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var c=Ur(n,a,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}A()[s](...l)}function Ar(e,t,r){var[n,a,o]=Nr(t,r,e);window.open(n,a||"_self",o)}function Cr(e,t,r,n,a,o){t?n.updateValues(e,r,(e=>Nr(e,a,o)[0])):e.forEach((e=>{var{name:t,value:i}=Nr([e],a,o)[0];n.updateValue(t,i,r)}))}function Rr(e,t,r,n,a,o){if(!Array.isArray(r)||!r.every(d.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=Nr(r,o,e);o.ctxStore.updateValue(i,s,t,a,o)}else Cr(r,n,t,o.ctxStore,o,e)}function Tr(e,t,r,n,a,o){if(Array.isArray(r)&&r.every(d.isObject)&&"update"===t)Cr(r,n,"replace",xe(o,"state.".concat(t),": ".concat(JSON.stringify(r))),o,e);else{var[i,s]=Nr(r,o,e);xe(o,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,a,o)}}function Or(e,t,r,n){var[a,o]=Nr(t,n,e);Ye(n,"formstate.update",": ".concat(a)).updateValue(a,o,"replace",r,n)}function Pr(e,t,r,n){if("assign"===t){var[a]=Nr(r,n,e);location.assign(a)}else location[t]()}function _r(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=Nr(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function Mr(e,t,r,n){console[t](...Nr(r,n,e,{useEventAsDefault:!0}))}function xr(e,t,r,n){var a=Nr(r,n,e,{useEventAsDefault:!0});fr.show({type:t,message:a[0]})}function Br(e,t,r,n,a,o){return Lr.apply(this,arguments)}function Lr(){return(Lr=(0,o.Z)((function*(e,t,r,n,a,o){var i=()=>{var a,o=Nr(r,n,e);return null==Ta||null===(a=Ta.messageDispatcher)||void 0===a?void 0:a[t](...o)};if(o){var s=Ur(o,n,a);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Ur(e,t,r){return function(n){return function(a){var o=null==e?void 0:e[n];if(o)try{var i=new CustomEvent("callback.".concat(n),{detail:a});br(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function Nr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?St(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}var Fr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class $r{constructor(e,t,r){(0,Xt.Z)(this,"type",void 0),(0,Xt.Z)(this,"data",new Map),(0,Xt.Z)(this,"changeEventType",void 0),(0,Xt.Z)(this,"pendingStack",[]),(0,Xt.Z)(this,"hostBrick",void 0),(0,Xt.Z)(this,"batchUpdate",!1),(0,Xt.Z)(this,"batchUpdateContextsNames",[]),(0,Xt.Z)(this,"rendererContext",void 0),(0,Xt.Z)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){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");var n={},a={},o=[];e.forEach((e=>{var{name:a,value:i}=r([e]),s=this.data.get(a);o.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,i,t)})),o.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[e]=t)}));var i=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};i(n),i(a),this.batchUpdate=!1}updateValue(e,t,r,n,o){var i=this.data.get(e);if(!i)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?i.value=t:(0,d.isObject)(i.value)?Object.assign(i.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(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.load)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which has no resolve'));var s;if("load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading)),s||(s=i.loading=i.load((0,a.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{i.loaded=!0,i.value=e,i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}))}),(e=>{null!=n&&n.error||pr(e)})),n){var l=Ur(n,o);s.then((e=>{l("success")({value:e}),l("finally")()}),(e=>{l("error")(e),l("finally")()}))}}}define(e,t,r,n){if(Array.isArray(e)&&e.length>0){var a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX",n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",r=new Map;for(var n of e){var a=(0,P.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;a.set(i,(null!==(s=a.get(i))&&void 0!==s?s:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),c=new WeakSet,u=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),p=function(){var e=(0,o.Z)((function*(e){var r;c.add(e);var o=yield t(e);n.delete(e);var i=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(o){if(u.get(e.name).resolve(),a.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,i-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=l;function v(){return h.apply(this,arguments)}function h(){return h=(0,o.Z)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(a,f)).map((e=>e[0])).filter((e=>!c.has(e)));yield Promise.all(e.map(p))})),h.apply(this,arguments)}return{pendingResult:v().then((0,o.Z)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),a=()=>{var e=!1;for(var[t,o]of r.entries())[...o.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r,n)),this.type);this.pendingStack.push(a)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,o.Z)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,o.Z)((function*(){for(var{pendingContexts:t}of e.pendingStack)for(var r of t.values())r.catch((()=>{}));for(var{pendingResult:n}of e.pendingStack)yield n}))()}mountAsyncData(e){this.data.forEach((t=>{var r;if(t.async&&(!e||null!==(r=this.routeMap.get(e))&&void 0!==r&&r.has(t.name))){if(t.asyncMounted)return void console.error('Async data "'.concat(t.name,'" already mounted. This is a bug of Brick Next, please report it.'));t.asyncMounted=!0,t.loading.then((e=>{t.loaded=!0,t.value=e,t.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:e}))}))}}))}resolve(e,t,r,n){var i=this;return(0,o.Z)((function*(){if(!(yield Zt(e,t)))return!1;var s,l,c;r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield _t(r,e.name));var u="eager";if(void 0===s){if(e.resolve){var p=(0,a.Z)({transform:"value"},e.resolve);if(yield Zt(e.resolve,t))l=function(){var e=(0,o.Z)((function*(e){return(yield at(p,t,e)).value}));return function(t){return e.apply(this,arguments)}}(),"eager"==(u=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield l():"async"===u&&(c=l());else if(!(0,d.hasOwnProperty)(e,"value"))return!1}l&&"eager"===u||void 0===e.value||(s=yield wt(e.value,t))}var f={name:e.name,value:s,eventTarget:new we,load:l,loaded:"eager"===u,loading:c,async:"async"===u,deps:[]};if("lazy"===u){var v,{trigger:h}=e.resolve;h&&Fr.includes(h)&&(null===(v=i.rendererContext)||void 0===v||v.registerArbitraryLifeCycle(h,(()=>{i.updateValue(e.name,void 0,"load")})))}if(e.onChange&&f.eventTarget.addEventListener(i.changeEventType,br(e.onChange,t)),e.track){var m=(0,P.strictCollectMemberUsage)(l?e.resolve:e.value,i.type);for(var g of(!l&&(f.deps=[...m]),m))i.onChange(g,i.batchAddListener((()=>{l?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,St(e.value,t),"replace")}),e))}if(i.data.has(e.name))throw new Error("".concat(i.type," '").concat(e.name,"' has already been declared"));if(i.data.set(e.name,f),Array.isArray(n))for(var y of n){var b=i.routeMap.get(y);b?b.add(e.name):i.routeMap.set(y,new Set([e.name]))}return!0}))()}disposeDataInRoutes(e){for(var t of e){var r=this.routeMap.get(t);if(void 0!==r)for(var n of r)this.data.delete(n)}}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function jr(e,t,r){var n,a,{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&o){var u=o.properties.get(t);u&&(a=i,n=u.map((e=>{var{from:t,to:r}=e,n=a.filter((e=>e[0]===t));if(n.length>0&&r.refProperty)return[r.refProperty,_t(n,t),!0]})).filter(Boolean));var p=o.slots.get(t);if(p&&s){var f=new Map;for(var{from:v,to:h}of p){var g,y,b,w,E=null!==(g=null===(y=s[v])||void 0===y?void 0:y.bricks)&&void 0!==g?g:[];if(E.length){var S=null!==(b=h.refSlot)&&void 0!==b?b:v,k=f.get(S);if(!k){k=[];for(var I=(0,d.hasOwnProperty)(r,S)?r[S].bricks.length+1:1,Z=0;Z<I;Z+=1)k.push([]);f.set(S,k)}var A=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,m.clamp)(A<0?k.length+A:A,0,k.length-1)].push(...(0,d.hasOwnProperty)(c.runtimeContext,"forEachItem")?Dr(E,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex):E)}}var C=function(){(0,d.hasOwnProperty)(r,R)||(r[R]={type:"bricks",bricks:[]});var e=r[R];e.bricks=T.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[R]};for(var[R,T]of f.entries())C()}}return{[Gt]:n,[Yt]:l}}function Dr(e,t,r){return e.map((e=>{var n;return(0,a.Z)((0,a.Z)({},e),{},{[Jt]:t,[Qt]:r,slots:Object.fromEntries(Object.entries(null!==(n=e.slots)&&void 0!==n?n:{}).map((e=>{var n,[a,o]=e;return[a,"routes"===o.type?{type:"routes",routes:Kr(o.routes,t,r)}:{type:"bricks",bricks:Dr(null!==(n=o.bricks)&&void 0!==n?n:[],t,r)}]})))})}))}function Kr(e,t,r){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Dr(e.bricks,t,r)})))}var Wr=["properties","slots","children"];function Vr(e,t){function r(e){return(0,d.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,d.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:o,slots:i,children:s}=e,l=(0,h.Z)(e,Wr),c=bn(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t,[r,a]=e;return[r,{type:"bricks",bricks:(null!==(t=a.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,a.Z)((0,a.Z)({},l),{},{properties:r(o),slots:u},jr(t,l.ref,u))}return r(e)}var Hr=["slots","children"],zr=["properties","slots","children"];function qr(e,t,r,n,o){var i,s=(0,m.uniqueId)("tpl-state-"),l=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.forEachIndex,delete l.formStateStoreId;var c=new $r("STATE",r,o);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:p,contracts:f}=Me.get(e);null==Ta||null===(i=Ta.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(p,l,n);var{slots:v,children:g}=t,y=(0,h.Z)(t,Hr),b=(0,a.Z)((0,a.Z)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var w={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[E,S]of Object.entries(d.properties)){var k=w.properties.get(S.ref);k||(k=[],w.properties.set(S.ref,k)),k.push({from:E,to:S})}if(null!=d&&d.slots)for(var[I,Z]of Object.entries(d.slots)){var A=w.slots.get(Z.ref);A||(A=[],w.slots.set(Z.ref,A)),A.push({from:I,to:Z})}var C={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:bn(g,v),tplStateStoreId:s,hostBrick:r};return b.slots={"":{type:"bricks",bricks:u.map((e=>Gr(e,C)))}},b}function Gr(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,h.Z)(e,zr),s=bn(o,n),l=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,a]=e;return[n,{type:"bricks",bricks:(null!==(r=a.bricks)&&void 0!==r?r:[]).map((e=>Gr(e,t)))}]})));return(0,a.Z)((0,a.Z)({},i),{},{properties:Vr(r,t),slots:l},jr(t,i.ref,l))}var Yr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({}),Jr="form-renderer.form-renderer",Qr=Symbol.for("form.stateStoreId"),Xr=["forms.general-form","form.general-form","eo-form"];function en(e,t,r){var{id:n,bricks:o,events:i,context:s,mountPoint:l,instanceId:c}=e,{brick:u,properties:p}=e,f=t.find((e=>e.fieldId===n));if(f){var v=function(e){var t,r={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},n=()=>{var t,r;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(r=e.limit)||void 0===r?void 0:r.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,a.Z)((0,a.Z)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUMS":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{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:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{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:(0,a.Z)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,a.Z)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,a.Z)((0,a.Z)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),p=(0,a.Z)((0,a.Z)({},v.properties),p)}var h={brick:u,properties:p,iid:c,slot:l,events:i,context:s,children:tn(o,t,r),[Qr]:r};return(0,d.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function tn(e,t,r){if(Array.isArray(e))return e.map((e=>en(e,t,r)))}var rn=["blockingList","node","menuRequests","hasTrackingControls"],nn=["if","permissionsPreCheck"],an=["formData"],on=["src"],sn=["href"];function ln(e,t,r,n,a,o,i){return cn.apply(this,arguments)}function cn(){return cn=(0,o.Z)((function*(e,t,r,n,o,i,s){var l=yield function(e,t){return Ht.apply(this,arguments)}(t,r),c={blockingList:[],menuRequests:[]};switch(l){case"missed":break;case"unauthenticated":c.unauthenticated=!0;break;default:var d,p=c.route=l.route;c.path=l.match.path;var f=(0,a.Z)((0,a.Z)({},r),{},{match:l.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=o.concat(p);f.ctxStore.define(p.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==Ta||null===(d=Ta.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(p,(e=>wt(e,f))));var{preLoadBricks:h}=p;if(Array.isArray(h)&&c.blockingList.push((0,u.loadBricksImperatively)(h,La())),"redirect"===p.type){var m;if("string"!=typeof(m="string"==typeof p.redirect?yield wt(p.redirect,f):(yield at((0,a.Z)({transform:"redirect"},p.redirect),f)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));c.redirect={path:m}}else{var g=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 wt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(p.menu,f);g&&c.menuRequests.push(g),"routes"===p.type?yn(c,yield ln(e,p.routes,f,n,v,i)):yn(c,yield un(e,p.bricks,f,n,v,i)),e.tag===Yr.BRICK&&n.memoizeMenuRequests(p,c.menuRequests)}}return c})),cn.apply(this,arguments)}function un(e,t,r,n,a,o,i,s){return dn.apply(this,arguments)}function dn(){return(dn=(0,o.Z)((function*(e,t,r,n,a,o,i,s){var l={blockingList:[],menuRequests:[]},c=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>pn(e,t,r,n,a,o,c.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(o,c.concat(r),t.node,e),yn(l,t)})),l}))).apply(this,arguments)}function pn(e,t,r,n,a,o){return fn.apply(this,arguments)}function fn(){return fn=(0,o.Z)((function*(e,t,r,n,i,s){var l,c,p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,v={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),v;var{if:g,permissionsPreCheck:b}=t,w=(0,h.Z)(t,nn);if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):ut(e)&&(0,O.isTrackAll)(dt(e))}(g))return pn(e,(0,a.Z)({brick:":if",dataSource:g,permissionsPreCheck:b,slots:{"":{type:"bricks",bricks:[w]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.Z)((0,a.Z)({},e),{},{[r]:t[r]})),{})),r,n,i,s,p,f);var E=t[Yt],S=t[Qr],k=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:E,formStateStoreId:S});(0,d.hasOwnProperty)(t,Jt)&&(k.forEachItem=t[Jt],k.forEachIndex=t[Qt]);var{context:I}=t;if(Array.isArray(I)&&I.length>0){var Z=Te(k);Oe(Z,"Defining context on bricks","check your brick:",t),Z||k.ctxStore.define(I,k)}if(k.pendingPermissionsPreCheck.push(null==Ta||null===(l=Ta.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>wt(e,k)))),!(yield function(e,t){return Tt.apply(this,arguments)}(t,k)))return v;var A=t.brick;if(A.startsWith(":")){var C;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(A);var{dataSource:R}=t,T=function(){var r=(0,o.Z)((function*(r){var a,o=yield wt(R,r),l=":forEach"===A?"":":switch"===A?String(o):o?"":"else",c=bn(t.children,t.slots),u=c&&(0,d.hasOwnProperty)(c,l)&&(null===(a=c[l])||void 0===a?void 0:a.bricks);if(!Array.isArray(u))return{blockingList:[],menuRequests:[]};switch(A){case":forEach":return Array.isArray(o)?function(e,t,r,n,a,o,i,s,l){return vn.apply(this,arguments)}(e,o,u,r,n,i,s,f,p):{blockingList:[],menuRequests:[]};case":if":case":switch":return un(e,u,r,n,i,s,f,p)}}));return function(e){return r.apply(this,arguments)}}(),_=function(){var t=(0,o.Z)((function*(t){var r,n=yield T(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Yr.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),M=yield _(k),{onMount:x,onUnmount:B}=null!==(C=t.lifeCycle)&&void 0!==C?C:{},{contextNames:L,stateNames:U}=Pt(R);if(L||U){M.hasTrackingControls=!0;var N=0,F=function(){var t=(0,o.Z)((function*(){var t=++N,[r,a,o]=gn(k),i=yield _(r),l=[...a,...o];if(yield mn(i,r,l),N===t)for(var c of(B&&br(B,k)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,p,i.node,e),x&&br(x,r)(new CustomEvent("mount",{detail:{rerender:!0}})),l))c.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),$=(0,m.debounce)(F);if(L)for(var j of L)k.ctxStore.onChange(j,$);if(U)for(var D of U)xe(k,"STATE",': "'.concat(R,'"')).onChange(D,$)}return x&&n.registerArbitraryLifeCycle("onMount",(()=>{br(x,k)(new CustomEvent("mount",{detail:{rerender:!1}}))})),B&&n.registerArbitraryLifeCycle("onUnmount",(()=>{br(B,k)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),M}/\.tpl-/.test(A)&&!Me.get(A)&&(yield wn((0,u.loadBricksImperatively)([A],La()),"brick",A,n.unknownBricks));var K,W,V=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(Me.get(r))return r}return!!Me.get(e)&&e}(A,null===(c=k.app)||void 0===c?void 0:c.id);if(V){var H,z=null!==(H=f.get(V))&&void 0!==H?H:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(V,'"'));f.set(V,z+1)}else A.includes("-")&&!customElements.get(A)&&(A===Jr?customElements.define(Jr,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):v.blockingList.push(wn((0,u.enqueueStableLoadBricks)([A],La()),"brick",A,n.unknownBricks)));if(A===Jr){var q,G=null!==(q=t.properties)&&void 0!==q?q:{};({formData:K}=G),W=(0,h.Z)(G,an)}else W=t.properties;var Y=[],J=function(e,t,r){return(0,d.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:o,stateNames:i,formStateNames:s}=Pt(a);return(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a}),[n,wt(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?gt.USE_BRICK:gt.INITIAL})]})):[]}(W,k,Y),Q=t[Gt];Q&&J.push(...Q);var X="script"===A;if(X||"link"===A){var ee=yield xt(J);if(X?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(X){var{src:ne}=ee,ae=(0,h.Z)(ee,on);yield wn((0,u.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:oe}=ee;ae=(0,h.Z)(ee,sn),yield wn((0,u.loadStyle)(oe,re,ae),"stylesheet",oe,"silent")}return v}}var ie={tag:Yr.BRICK,type:V||A,return:e,slotId:s,events:t.events,runtimeContext:k,portal:t.portal,iid:t.iid,ref:t.ref};v.node=ie;var se=(0,P.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&v.blockingList.push(wn((0,u.loadProcessorsImperatively)(se,La()),"processors",[...se].join(", "),n.unknownBricks));var le=[],ce=function(){var e=(0,o.Z)((function*(){ie.properties=yield xt(J),function(e,t){var r=function(t){var r=()=>{e.element&&Ut(e.element,{[t.propName]:t.propValue},e.runtimeContext)};if(t.contextNames)for(var n of t.contextNames)e.runtimeContext.ctxStore.onChange(n,r);if(t.stateNames){var a=xe(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}if(t.formStateNames){var i=Ye(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)i.onChange(s,r)}};for(var n of t)r(n)}(ie,Y)}));return function(){return e.apply(this,arguments)}}();le.push(ce()),n.registerBrickLifeCycle(ie,t.lifeCycle);var ue,de=t;V?de=qr(V,t,ie,J,n):A===Jr&&(de=function(e,t,r,n,o){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,m.uniqueId)("form-state-"),u=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var p=new $r("FORM_STATE",void 0,o);u.formStateStoreMap.set(c,p),u.formStateStoreScope&&u.formStateStoreScope.push(p);var f=null!==(i=l.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),p.define(f,u,n);var v=en(l.formSchema,l.fields,c);return Xr.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,d.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[v]})}(K,t,ie,J,n)),de.portal&&(ie.slotId=void 0),V?(delete(ue=(0,a.Z)({},k)).forEachItem,delete ue.forEachIndex):ue=k;var pe=function(){var e=(0,o.Z)((function*(){var e=bn(de.children,de.slots);if(e){var t=new Set,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var[s,l]=e;return"routes"!==l.type?un(ie,l.bricks,ue,n,i,s,f):(k.flags["incremental-sub-route-rendering"]&&(t.add(r),n.performIncrementalRender(function(){var e=(0,o.Z)((function*(e){var{homepage:t}=ue.app,{pathname:r}=e;if(!y(t,r)||!i.every((e=>zt(e,t,r))))return!1;var o,[c,u,d]=gn((0,a.Z)((0,a.Z)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),p=!1,f=[];try{if(!(o=yield ln(ie,l.routes,c,n,i,s,!0)).route)return!1;if(n.reBailout(o))return!0;f=[...u,...d],yield mn(o,c,[c.ctxStore,...f]),yield n.reMergeMenuRequests(l.routes,o.route,o.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var v=n.reCatch(e,ie);if(!v)return!0;({failed:p,output:o}=v),yield n.reMergeMenuRequests(l.routes,o.route,o.menuRequests)}if(n.reRender(s,[],o.node,ie),!p)for(var h of(c.ctxStore.mountAsyncData(o.route),f))h.mountAsyncData();return!0}));return function(t){return e.apply(this,arguments)}}())),ln(ie,l.routes,ue,n,i,s))}))),l=(0,a.Z)((0,a.Z)({},v),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(s,[],e.node,ie),yn(l,e)})),l.node&&(ie.child=l.node),yn(v,(0,a.Z)((0,a.Z)({},l),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return le.push(pe()),yield Promise.all(le),v})),fn.apply(this,arguments)}function vn(){return(vn=(0,o.Z)((function*(e,t,r,n,o,i,s,l,c){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,p)=>pn(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t,forEachIndex:u}),o,i,s,c.concat(u*d+p),l&&new Map(l))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&o.memoize(s,c.concat(r),t.node,e),yn(u,t)})),u}))).apply(this,arguments)}function hn(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function mn(e,t,r){return(0,u.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function gn(e){var t=[],r=[];return[(0,a.Z)((0,a.Z)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function yn(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,h.Z)(t,rn);if(e.blockingList.push(...r),e.menuRequests.push(...a),n)if(e.node){for(var s=e.node;s.sibling;)s=s.sibling;s.sibling=n}else e.node=n;Object.assign(e,i)}function bn(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,o=null!==(a=n.slot)&&void 0!==a?a:"";(0,d.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function wn(e,t,r,n){return"silent"===n?e.catch((e=>{console.error("Load ".concat(t,' "').concat(r,'" failed:'),e)})):e}function En(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=xe(n,"bindTemplateProxy"),i=o.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var l=function(e){if(u.ref===r){var t,n,i,s=t=>{t.bubbles&&t.stopPropagation(),o.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(t=u.refEvent)&&void 0!==t?t:e;a.addEventListener(l,s),null!==(i=(n=a).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),a.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function Sn(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=xe(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}function kn(e){e.replaceChildren()}function In(e,t){for(var r=e.child,n=[];r;){if(r.tag===Yr.BRICK){var a,o=r.type;o.includes("-")&&!customElements.get(o)&&console.error("Undefined custom element: ".concat(o)),"basic-bricks.script-brick"===o&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(o);r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Lt(i,r.properties),vr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=xe({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),En(r),r.portal?n.push(i):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(i))}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var s,l=r.return;l;){var c;if(l.childElements)l.tag===Yr.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0;if(l.tag===Yr.ROOT&&n.length>0&&("function"==typeof l.createPortal?l.createPortal():l.createPortal).append(...n),l.sibling)break;l=l.return}r=null===(s=l)||void 0===s?void 0:s.sibling}}}var Zn,An,Cn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Rn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],Tn=new WeakMap,On=new WeakMap,Pn=new WeakMap,_n=new WeakMap,Mn=new WeakMap,xn=new WeakMap,Bn=new WeakMap,Ln=new WeakMap,Un=new WeakMap,Nn=new WeakSet,Fn=new WeakSet,$n=new WeakSet,jn=new WeakSet;class Dn{constructor(e,t){var r;(0,C.Z)(this,jn),(0,C.Z)(this,$n),(0,C.Z)(this,Fn),(0,C.Z)(this,Nn),(0,Xt.Z)(this,"scope",void 0),(0,Xt.Z)(this,"unknownBricks",void 0),(0,i.Z)(this,Tn,{writable:!0,value:void 0}),(0,i.Z)(this,On,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,i.Z)(this,Pn,{writable:!0,value:new Map}),(0,i.Z)(this,_n,{writable:!0,value:void 0}),(0,i.Z)(this,Mn,{writable:!0,value:new Map}),(0,i.Z)(this,xn,{writable:!0,value:void 0}),(0,i.Z)(this,Bn,{writable:!0,value:void 0}),(0,i.Z)(this,Ln,{writable:!0,value:void 0}),(0,i.Z)(this,Un,{writable:!0,value:[]}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",(0,s.Z)(this,Tn,null==t?void 0:t.routeHelper)}setInitialMenuRequests(e){(0,s.Z)(this,Bn,e)}memoizeMenuRequests(e,t){(0,l.Z)(this,Ln)||(0,s.Z)(this,Ln,new WeakMap),(0,l.Z)(this,Ln).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,o.Z)((function*(){var a,o;for(var i of e)if(a=(0,l.Z)(n,Ln).get(i)){o=i;break}var s=(0,l.Z)(n,Bn),c=a?s.indexOf(a):-1;if(-1===c){if(!r.length)return;s.push(...r)}else s.splice(c,s.length-c,...r);o&&o!==t&&(0,l.Z)(n,Ln).delete(o),yield(0,l.Z)(n,Tn).mergeMenus(s)}))()}reBailout(e){return(0,l.Z)(this,Tn).bailout(e)}reCatch(e,t){return(0,l.Z)(this,Tn).catch(e,t)}didPerformIncrementalRender(e){var t=this;return(0,o.Z)((function*(){return(yield Promise.all((0,l.Z)(t,Un).map((t=>t(e))))).some((e=>e))}))()}performIncrementalRender(e){(0,l.Z)(this,Un).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Cn,..."page"===this.scope?Rn:[]];for(var n of r){var a=t[n];a&&(0,l.Z)(this,On)[n].push({brick:e,handlers:a})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,l.Z)(this,Mn).get(e);r?r.add(t):(0,l.Z)(this,Mn).set(e,new Set([t]))}memoize(e,t,r,n){(0,l.Z)(this,xn)||(0,s.Z)(this,xn,new WeakMap);var a=[null!=e?e:"",...t].join("."),o=(0,l.Z)(this,xn).get(n);o||(o=new Map,(0,l.Z)(this,xn).set(n,o)),o.set(a,{node:r,last:zn(r),lastNormal:qn(r),lastPortal:Yn(r)})}reRender(e,t,r,n){var a,o,i,s,c,u,d,p,f,v,h=[null!=e?e:"",...t].join("."),m=(0,l.Z)(this,xn).get(n).get(h),{node:g,last:y,lastNormal:b,lastPortal:w}=m;(null==g?void 0:g.tag)===Yr.PLACEHOLDER?(a=null!==(i=null===(s=function(e){return Gn(e,!0)}(g))||void 0===s?void 0:s.element)&&void 0!==i?i:null,o=null!==(c=null===(u=function(e){return Jn(e,!0)}(g))||void 0===u?void 0:u.element)&&void 0!==c?c:null):(a=null!==(d=null==b||null===(p=b.element)||void 0===p?void 0:p.nextSibling)&&void 0!==d?d:null,o=null!==(f=null==w||null===(v=w.element)||void 0===v?void 0:v.nextSibling)&&void 0!==f?f:null);var E,S=zn(r);m.node=r,m.last=S,m.lastNormal=qn(r),m.lastPortal=Yn(r);for(var k=n.child;k&&k!==y;){if(k.sibling===g){E=k;break}k=k.sibling}var I=document.createDocumentFragment(),Z=document.createDocumentFragment(),A={tag:Yr.ROOT,container:I,createPortal:Z,child:r};for(k=r;k;)k.return=A,k=k.sibling;var C,T,O=Qn(g,y);for((0,R.Z)(this,Nn,Kn).call(this,O),In(A),E?E.sibling=r:n.child=r,S&&(S.sibling=null==y?void 0:y.sibling),k=r;k;)k.return=n,k=k.sibling;if(n.tag===Yr.ROOT?null===(C=n.container)||void 0===C||C.insertBefore(I,a):null===(T=n.element)||void 0===T||T.insertBefore(I,a),Z.childNodes.length>0){for(var P,_=r;_&&_.return;)_=_.return;if((null===(P=_)||void 0===P?void 0:P.tag)!==Yr.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");("function"==typeof _.createPortal?_.createPortal():_.createPortal).insertBefore(Z,o)}var M=Qn(r,S);(0,R.Z)(this,Fn,Wn).call(this,M)}dispose(){for(var e of Object.values((0,l.Z)(this,On)))e.length=0;for(var t of(0,l.Z)(this,Pn).values()){for(var r of t)r.disconnect();t.length=0}(0,l.Z)(this,Pn).clear(),(0,l.Z)(this,_n)&&(ke.removeEventListener("change",(0,l.Z)(this,_n)),(0,s.Z)(this,_n,void 0)),(0,s.Z)(this,xn,void 0),(0,s.Z)(this,Bn,void 0),(0,s.Z)(this,Ln,void 0),(0,l.Z)(this,Mn).clear(),(0,l.Z)(this,Un).length=0}dispatchBeforePageLoad(){(0,R.Z)(this,$n,Vn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,R.Z)(this,$n,Vn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,R.Z)(this,$n,Vn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,R.Z)(this,$n,Vn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=A().location;e&&"#"!==e?(0,R.Z)(this,$n,Vn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,R.Z)(this,$n,Vn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,l.Z)(this,On).onScrollIntoView)(0,R.Z)(this,jn,Hn).call(this,e,t)}initializeMediaChange(){(0,s.Z)(this,_n,(e=>{(0,R.Z)(this,$n,Vn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:G(e.detail)}))})),ke.addEventListener("change",(0,l.Z)(this,_n))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==Ta||null===(r=Ta.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{br(t.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:r}))}))};for(var r of[].concat(n))t(r)};for(var{brick:r,handlers:n}of(0,l.Z)(this,On).onMessage)t(r);null==Ta||null===(e=Ta.messageDispatcher)||void 0===e||e.onClose((()=>{(0,R.Z)(this,$n,Vn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,R.Z)(this,$n,Vn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,R.Z)(this,$n,Vn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Kn(e){var t=[...Cn,..."page"===this.scope?Rn:[]],r=[];for(var n of t){var a=(0,m.remove)((0,l.Z)(this,On)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var i,s,c=(0,l.Z)(this,Pn).get(o);if(null!=c&&c.length){for(var u of c)u.disconnect();c.length=0,(0,l.Z)(this,Pn).delete(o)}Sn(o),null===(i=o.element)||void 0===i||delete i.$$tplStateStore,null===(s=o.element)||void 0===s||s.remove()}var d=new CustomEvent("unmount");for(var{brick:p,handlers:f}of r)br(f,p.runtimeContext,p)(d)}function Wn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,l.Z)(this,On).onMount)e.has(r)&&br(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of(0,l.Z)(this,On).onScrollIntoView)e.has(a)&&(0,R.Z)(this,jn,Hn).call(this,a,o)}function Vn(e,t){for(var{brick:r,handlers:n}of(0,l.Z)(this,On)[e])br(n,r.runtimeContext,r)(t);var a=(0,l.Z)(this,Mn).get(e);if(a)for(var o of a)o()}function Hn(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,a=new IntersectionObserver(((r,a)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(br(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=(0,l.Z)(this,Pn).get(e);o||(o=[],(0,l.Z)(this,Pn).set(e,o)),o.push(a)}function zn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function qn(e){return Gn(e,!1)}function Gn(e,t){for(var r,n=e;n;){if(n.tag===Yr.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function Yn(e){return Jn(e,!1)}function Jn(e,t){for(var r,n=e;n;){if(n.tag===Yr.BRICK&&n.portal){if(t)return n;r=n}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&!o.sibling;)o=o.return;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function Qn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Yr.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&o!==t&&!o.sibling;)o=o.return;if(o===t)break;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function Xn(){if(!Zn){if(Zn={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){Zn.isInIframe=!0;try{if(window.origin===window.parent.origin){Zn.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");Zn.isInIframeOfNext=0==(Number(e)^Number(r)),Zn.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),Zn.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(Zn)}return Zn}function ea(e){var t;if(!e.$$registerCustomTemplateProcessed){e.$$registerCustomTemplateProcessed=!0;var r=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(r))for(var n of r){var a=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);Me.define(a,n)}}}function ta(){return ta=(0,o.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return ra.apply(this,arguments)}(e)),e.$$fulfilling})),ta.apply(this,arguments)}function ra(){return(ra=(0,o.Z)((function*(e){var t;yield null==Ta||null===(t=Ta.fulfilStoryboard)||void 0===t?void 0:t.call(Ta,e),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}var na=new WeakMap,aa=new WeakMap,oa=new WeakMap,ia=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap,ua=new WeakMap,da=new WeakMap,pa=new WeakMap,fa=new WeakMap,va=new WeakMap,ha=new WeakSet,ma=new WeakSet,ga=new WeakSet,ya=new WeakSet;class ba{constructor(e){(0,C.Z)(this,ya),(0,C.Z)(this,ga),(0,C.Z)(this,ma),(0,C.Z)(this,ha),(0,i.Z)(this,na,{writable:!0,value:void 0}),(0,i.Z)(this,aa,{writable:!0,value:!1}),(0,i.Z)(this,oa,{writable:!0,value:void 0}),(0,i.Z)(this,ia,{writable:!0,value:void 0}),(0,i.Z)(this,sa,{writable:!0,value:void 0}),(0,i.Z)(this,la,{writable:!0,value:void 0}),(0,i.Z)(this,ca,{writable:!0,value:new Set}),(0,i.Z)(this,ua,{writable:!0,value:0}),(0,i.Z)(this,da,{writable:!0,value:void 0}),(0,i.Z)(this,pa,{writable:!0,value:void 0}),(0,i.Z)(this,fa,{writable:!0,value:void 0}),(0,i.Z)(this,va,{writable:!0,value:void 0}),(0,s.Z)(this,na,e);var t=A();window.addEventListener("beforeunload",(e=>{(0,R.Z)(this,ha,wa).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,R.Z)(this,ha,wa).call(this,{location:e,action:t})))}getRenderId(){return(0,l.Z)(this,da)}getRuntimeContext(){return(0,l.Z)(this,sa)}getRecentApps(){return{currentApp:(0,l.Z)(this,pa),previousApp:(0,l.Z)(this,fa)}}getNavConfig(){return(0,l.Z)(this,va)}bootstrap(){var e=this;window.AbortController&&(An=new AbortController,T.http.interceptors.request.use((e=>{var t;return(0,a.Z)((0,a.Z)({},e),{},{options:(0,a.Z)((0,a.Z)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:An.signal})})})));var t=A();(0,s.Z)(this,oa,t.location);var r=0;return t.listen(function(){var t=(0,o.Z)((function*(t,n){var o,i,c,u,d,p=++r,v={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==(0,l.Z)(e,oa).key&&!1!==(null===(o=(0,l.Z)(e,oa).state)||void 0===o?void 0:o.notify))||(v.key=void 0),((0,f.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,l.Z)(e,oa)),v),(0,a.Z)((0,a.Z)({},t),v))||"POP"!==n&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(u=!0),u||(u=yield null===(d=(0,l.Z)(e,la))||void 0===d?void 0:d.didPerformIncrementalRender(t)),r===p)if(u)(0,s.Z)(e,oa,t);else{if(An&&(An.abort(),An=new AbortController),(0,s.Z)(e,oa,t),null===(c=(0,l.Z)(e,la))||void 0===c||c.dispatchPageLeave(),"POP"===n&&b(g((0,l.Z)(e,na),t.pathname)))return void window.location.reload();(0,l.Z)(e,aa)?(0,s.Z)(e,ia,t):(V("locationChange"),(0,R.Z)(e,ga,Sa).call(e,t).catch(pr))}}));return function(e,r){return t.apply(this,arguments)}}()),(0,R.Z)(this,ga,Sa).call(this,t.location)}}function wa(e){var t,r=A(),n=r.getBlockMessage();null===(t=(0,l.Z)(this,la))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function Ea(e,t,r){var n,a;if((0,s.Z)(this,ua,(n=(0,l.Z)(this,ua),a=n++,n)),a>10){var o='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(o)}A().replace(e,t)}function Sa(e){return ka.apply(this,arguments)}function ka(){return(ka=(0,o.Z)((function*(e){(0,s.Z)(this,aa,!0);try{yield(0,R.Z)(this,ya,Ia).call(this,e)}finally{if((0,s.Z)(this,aa,!1),(0,l.Z)(this,ia)){var t=(0,l.Z)(this,ia);(0,s.Z)(this,ia,void 0),yield(0,R.Z)(this,ga,Sa).call(this,t)}}}))).apply(this,arguments)}function Ia(e){return Za.apply(this,arguments)}function Za(){return Za=(0,o.Z)((function*(e){var t,r,n,i=this;(0,s.Z)(this,da,(0,m.uniqueId)("render-id-1")),et=new WeakSet,nt.clear(),null==Ta||null===(t=Ta.flowApi)||void 0===t||t.clearCollectWidgetContract(),A().unblock();var c=null==Ta||null===(r=Ta.pageView)||void 0===r?void 0:r.create(),u=g((0,l.Z)(this,na),e.pathname),d=null===(n=(0,l.Z)(this,sa))||void 0===n?void 0:n.app;null!=u&&u.app&&(yield function(e){return ta.apply(this,arguments)}(u));var p,f=(0,s.Z)(this,pa,null==u?void 0:u.app),v=d&&f?d.id!==f.id:d!==f,h=_a().getFeatureFlags(),y=(0,l.Z)(this,la),b=(t,r)=>{null==c||c({status:"redirected"}),(0,l.Z)(this,ca).add(y),(0,R.Z)(this,ma,Ea).call(this,t,r,e)},w=()=>{var t=h["sso-enabled"]?"/sso-auth/login":"/auth/login";b(t,{from:e})},E=document.querySelector("#main-mount-point"),S=document.querySelector("#portal-mount-point"),k={tag:Yr.ROOT,container:E,createPortal:S},I=()=>{var e;for(var t of(kn(E),kn(S),(0,l.Z)(this,ca).add(y),(0,l.Z)(this,ca)))t&&(t.dispatchOnUnmount(),t.dispose());(0,l.Z)(this,ca).clear(),null==Ta||null===(e=Ta.messageDispatcher)||void 0===e||e.reset(),v&&((0,s.Z)(this,fa,d),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:d,currentApp:f}})))};if(ee(f&&(oe()[f.id]||f.theme)||"light"),se("default"),f){var Z,C,O,P,_,M;null==Ta||null===(Z=Ta.checkInstalledApps)||void 0===Z||Z.preCheckInstalledApps(u,(e=>!!$a(e)));var x={bailout:e=>e.unauthenticated?(w(),!0):e.redirect?(b(e.redirect.path,e.redirect.state),!0):void(0,s.Z)(this,ua,0),mergeMenus:(p=(0,o.Z)((function*(e){var t=yield Promise.all(e);(0,s.Z)(i,va,function(e){var t={breadcrumb:[]};for(var r of e){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(t))})),function(e){return p.apply(this,arguments)}),catch:(t,r)=>{if(!lr(t)||window.NO_AUTH_GUARD){if(!(t instanceof T.HttpAbortError)){var n=_a().getMiscSettings().noAuthGuardLoginPath;return lr(t)&&n?void b(n,{from:e}):{failed:!0,output:{node:{tag:Yr.BRICK,type:"div",properties:{textContent:sr(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}(0,l.Z)(this,ca).add(y)}else w()}},B=(0,s.Z)(this,la,new Dn("page",{routeHelper:x})),L=(0,s.Z)(this,sa,{app:f,location:e,query:new URLSearchParams(e.search),flags:h,sys:(0,a.Z)((0,a.Z)((0,a.Z)({},null==Ta||null===(C=Ta.auth)||void 0===C?void 0:C.getAuth()),Xn()),{},{settings:{brand:_a().getBrandSettings()}}),ctxStore:new $r("CTX",void 0,B),pendingPermissionsPreCheck:[null==Ta||null===(O=Ta.checkPermissions)||void 0===O?void 0:O.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.Z)(this,va,void 0),ea(u),ge(null===(P=u.meta)||void 0===P?void 0:P.functions,f),null==Ta||null===(_=Ta.flowApi)||void 0===_||_.collectContract(null===(M=u.meta)||void 0===M?void 0:M.contracts);var U,N=!1,F=[];try{if(U=yield ln(k,function(e){if(window.parent===window)return e;var t=e,r=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(u.routes),L,B,[]),x.bailout(U))return;F=hn(L),yield mn(U,L,F),yield x.mergeMenus(U.menuRequests),B.setInitialMenuRequests(U.menuRequests)}catch(e){console.error("Router failed:",e);var $=x.catch(e,k);if(!$)return;({failed:N,output:U}=$)}if(k.child=U.node,I(),U.route&&"routes"!==U.route.type||N){if(N||B.dispatchBeforePageLoad(),ne(),ce(),window.DISABLE_REACT_FLUSH_SYNC=!1,In(k),setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0})),window.scrollTo(0,0),N)null==c||c({status:"failed"});else{for(var j of(B.dispatchPageLoad(),B.dispatchAnchorLoad(),B.dispatchOnMount(),B.initializeScrollIntoView(),B.initializeMediaChange(),B.initializeMessageDispatcher(),F))j.mountAsyncData();null==c||c({status:"ok",path:U.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Ta&&Ta.auth&&!Ta.auth.isLoggedIn())return void w();I()}ne(),ce();var D={tag:Yr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:k};k.child=D,In(k),window.scrollTo(0,0),null==c||c({status:"not-found"}),V("rendered")})),Za.apply(this,arguments)}var Aa,Ca,Ra,Ta,Oa="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function Pa(e){if(Aa)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===j){var r=t.payload;switch(null==r?void 0:r.type){case D:W=r.active;break;case K:F=r.panel}}})),Ta=null==e?void 0:e.hooks,(0,c.initializeI18n)(ar,or),p.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{p.locale(c.i18n.language)})),Z(),Aa=new Ba}var _a=function(){var e=I();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 Aa},Ma=new WeakMap,xa=new WeakMap;class Ba{constructor(){(0,i.Z)(this,Ma,{writable:!0,value:!1}),(0,i.Z)(this,xa,{writable:!0,value:!1})}initialize(e){var t,r;if((0,l.Z)(this,Ma))throw new Error("The runtime cannot be initialized more than once");(0,s.Z)(this,Ma,!0),function(e){if(Array.isArray(e.storyboards)){var t=function(){if(r.locales){var e="tmp/".concat(r.id);Object.entries(r.locales).forEach((t=>{var[r,n]=t;c.i18n.addResourceBundle(r,e,n)})),r.localeName=c.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{c.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,d.isObject)(e.settings)&&(0,d.deepFreeze)(e.settings),e.brickPackages&&(0,d.deepFreeze)(e.brickPackages)}(e),Ca=e;var n,{notification:a,dialog:o}=null!==(t=null===(r=e.settings)||void 0===r?void 0:r.presetBricks)&&void 0!==t?t:{};!1!==a&&(n=null!=a?a:"basic.show-notification",(0,this.loadBricks)([n]).then((()=>{ur=document.createElement(n)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{qt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks)}bootstrap(e){var t=this;return(0,o.Z)((function*(){if(e&&t.initialize(e),(0,l.Z)(t,xa))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.Z)(t,xa,!0),Ra=new ba(Ca.storyboards),yield Ra.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=Ra)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=Ra)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Ge(e,t)}getFeatureFlags(){var e,t;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=Ca)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=Ra)||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(0,a.Z)((0,a.Z)({},null===(e=Ca)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=Ra)||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(0,a.Z)({base_title:"DevOps 管理专家"},null===(e=Ca)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,a.Z)({columns:7,rows:4},null===(e=Ca)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=Ca)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=Ca)||void 0===t?void 0:t.siteSort)&&void 0!==e?e:[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t=this.getBrandSettings().base_title;document.title=e?"".concat(e," - ").concat(t):t}getNavConfig(){var e;return null===(e=Ra)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,La())}}function La(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=Ca)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:Oa)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function Ua(){var e;return null===(e=Ra)||void 0===e?void 0:e.getRenderId()}function Na(){var e;return null===(e=Ra)||void 0===e?void 0:e.getRuntimeContext()}function Fa(e){var t;return null===(t=Ca)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function $a(e){var t;return null===(t=Fa(e))||void 0===t?void 0:t.app}function ja(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==Ta||null===(e=Ta.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Da(){var e;return null==Ta||null===(e=Ta.auth)||void 0===e?void 0:e.getAuth()}function Ka(){var e,t;return null==Ta||null===(e=Ta.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Wa(){var e;return null==Ta||null===(e=Ta.auth)||void 0===e?void 0:e.isLoggedIn()}function Va(e,t,r){return Ha.apply(this,arguments)}function Ha(){return(Ha=(0,o.Z)((function*(e,t,r){return it(yield Qe(e),e,"resolve",t,r)}))).apply(this,arguments)}function za(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;t=r||(()=>((i=document.createElement("div")).style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));var s,l,c=!1;return{render(r){var u=arguments;return(0,o.Z)((function*(){var{theme:o,context:d,functions:p,templates:f,i18n:v}=u.length>1&&void 0!==u[1]?u[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");var h=[].concat(r),m=s;s=new Dn(n,{unknownBricks:a});var g={ctxStore:new $r("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},y={tag:Yr.ROOT,container:e,createPortal:t};if("page"===n){var b;ee(null!=o?o:"light"),se("default");var w={id:"demo",homepage:"/demo"};g.app=w;var E={app:w,meta:{i18n:v,customTemplates:f}};null===(b=l)||void 0===b||b(),l=L(E),ea(E),ge(p,w)}g.ctxStore.define(d,g);var S,k=!1,I=[];try{S=yield un(y,h,g,s,[]),I=hn(g),yield mn(S,g,I)}catch(e){k=!0,S={node:{tag:Yr.BRICK,type:"div",properties:{textContent:sr(e)},return:y,runtimeContext:null},blockingList:[],menuRequests:[]}}if(y.child=S.node,null==m||m.dispatchOnUnmount(),null==m||m.dispose(),kn(e),i&&kn(i),"page"===n&&(k||s.dispatchBeforePageLoad(),ne(),ce()),In(y),"page"===n&&window.scrollTo(0,0),!k){for(var Z of I)Z.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,kn(e),i&&(kn(i),r||i.remove()))}}}function qa(e,t){return Ga.apply(this,arguments)}function Ga(){return(Ga=(0,o.Z)((function*(e,t){var r,n,o,i,[s,l,c]=gn((0,a.Z)((0,a.Z)({},Na()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(r=s.tplStateStoreMap)&&void 0!==r||(s.tplStateStoreMap=new Map),null!==(n=s.formStateStoreMap)&&void 0!==n||(s.formStateStoreMap=new Map);var u=new Dn("fragment"),d={tag:Yr.ROOT,createPortal:null},p=e.transform,f=Te();p&&Oe(f,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var v=yield pn(d,f?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),p)}),s,u,[]),h=[...l,...c];if(yield mn(v,s,h),(null===(o=v.node)||void 0===o?void 0:o.tag)===Yr.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(i=v.node)&&void 0!==i&&i.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return d.child=v.node,{tagName:v.node?v.node.type:null,renderRoot:d,rendererContext:u,scopedStores:h}}))).apply(this,arguments)}function Ya(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:o}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},In(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),o))i.mountAsyncData();return{portal:r}}function Ja(e,t){var{rendererContext:r}=e;t.portal&&(kn(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function Qa(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return St(t,(0,a.Z)((0,a.Z)({},Na()),{},{data:e}),{noInject:!0})}function Xa(e,t){var r=Fa(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),L(r)}function eo(e,t){var r=Fa(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),o=(e,r)=>e.map((e=>{var i=a(e);return"routes"===e.type?(e.routes=o(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=o(r.routes,a(t)),n||r.routes.unshift(t)}function to(e,t,r){var n="".concat(e,".").concat(t.name);Me.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),ro(e,t.name,r)}function ro(e,t,r){io(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context"))])}function no(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function ao(e,t){var r;io(e,no(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var oo=ao;function io(e,t,r,n){var{routes:a}=Fa(e),o=a.findIndex((e=>e.path===t)),i={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===o?a.unshift(i):a.splice(o,1,i)}function so(e,t){var{tplStateStoreId:r}=t,n=Na();return r?xe((0,a.Z)((0,a.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function lo(e){var{tplStateStoreId:t}=e,r=Na();return t?xe((0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function co(e){return La().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function uo(){return Ua()}function po(e,t){return fo.apply(this,arguments)}function fo(){return(fo=(0,o.Z)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:o}=t,i=Fa(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,l=no(e.snippetId);r={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===l))]}}var c=[];return r&&o&&(yield o(r)).forEach((e=>{var t,[r,n,a]=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===n&&e.name===a))||c.push(e)})),c}))).apply(this,arguments)}}}]);
|
|
2
|
+
//# sourceMappingURL=5491.ac01ea3b.js.map
|