@next-bricks/form-platform 0.3.13 → 0.3.14

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 CHANGED
@@ -12,5 +12,5 @@
12
12
  "eo-select"
13
13
  ]
14
14
  },
15
- "filePath": "bricks/form-platform/dist/index.02cead75.js"
15
+ "filePath": "bricks/form-platform/dist/index.2f311fe4.js"
16
16
  }
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_next_bricks_form_platform=self.webpackChunk_next_bricks_form_platform||[]).push([[3322],{3322:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>ir,Notification:()=>vr,StoryboardFunctionRegistryFactory:()=>me,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ae,authenticate:()=>Xo,batchSetAppsLocalTheme:()=>oe,checkIfByTransform:()=>Pt,checkIfOfComputed:()=>Ot,createHistory:()=>T,createRuntime:()=>$o,customProcessors:()=>U,customTemplates:()=>Be,fetchByProvider:()=>ri,getAuth:()=>Zo,getBasePath:()=>g,getCssPropertyValue:()=>de,getCurrentMode:()=>le,getCurrentTheme:()=>ne,getHistory:()=>O,getPageInfo:()=>Aa,getRuntime:()=>Do,getV2RuntimeFromDll:()=>R,handleHttpError:()=>pr,httpErrorToString:()=>cr,isLoggedIn:()=>ti,isUnauthenticatedError:()=>lr,logout:()=>ei,matchPath:()=>qt,registerWidgetFunctions:()=>je,registerWidgetI18n:()=>D,setUIVersion:()=>Oa,unstable_createRoot:()=>ai});var n={};r.r(n),r.d(n,{addRealTimeDataInspectHook:()=>Dn,getAddedContracts:()=>Fn,getAllContextValues:()=>Bn,getBrickPackagesById:()=>Ln,getContextValue:()=>_n,getRenderId:()=>Un,legacyDoTransform:()=>kn,mountUseBrick:()=>Sn,renderUseBrick:()=>bn,setRealTimeDataInspectRoot:()=>$n,symbolForRootRuntimeContext:()=>yn,unmountUseBrick:()=>En,updateSnippetPreviewSettings:()=>Pn,updateStoryboard:()=>In,updateStoryboardByRoute:()=>An,updateStoryboardBySnippet:()=>On,updateStoryboardByTemplate:()=>Cn,updateTemplatePreviewSettings:()=>Rn});var a=r(4412),o=r(8944),i=r(7204),s=r(7392),c=r(2504),l=r(7940),u=r(5866),d=r(1412),f=r(1340),p=r(3608),v=r(4516),h=r(7292),m=(r(8989),r(7676));function g(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var y=r(640),b=r(9604);function w(e,t){var r=(0,b.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]&&S(a,t))return n}}function S(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function E(e){var t;return!e||(null===(t=Do().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var k,I=["extraQuery","clear","keepHash"],A=!1;function C(e,t){t(!(A=!confirm(e)))}function R(){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 T(){if(!k){var e=(0,m.createBrowserHistory)({basename:g().replace(/\/$/,""),getUserConfirmation:C});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){A=!1,r(e,t),null==n||n(A)}function i(e,t,r){A=!1,n(e,t),null==r||r(A)}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:c,keepHash:l}=n,u=(0,y.c)(n,I),d=new URLSearchParams(c?"":e.location.search),f={};for(var[p,v]of(Object.assign(f,r,s),Object.entries(f)))if(Array.isArray(v))for(var h of(d.delete(p),v))d.append(p,h);else null==v||""===v?d.delete(p):d.set(p,v);("push"===t?o:i)("?".concat(d.toString()).concat(l?e.location.hash:""),u,a)}}return(0,a.c)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.c)((0,a.c)({},e.location),{},{key:void 0,hash:t,state:(0,a.c)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.c)((0,a.c)({},e.location),{},{state:(0,a.c)((0,a.c)({},e.location.state),{},{notify:!0,noIncremental:!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,c="string"==typeof a;return"string"==typeof(s=c?(0,m.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&E(function(e){var t,r;return w(null!==(t=null===(r=Oo)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](c?g()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.c)((0,a.c)({},e),{},{push:o,replace:i})))}(e)),k=e}return k}var O=function(){var e=R();if(e)return e.getHistory}()||function(){return k},x=r(5832),P=r(824),M=r(6700),_=r(5796),B=r(6776),L=new WeakMap,U=function(){var e=R();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,c.c)(this,L,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,d.c)(this,L).get(r);if(a||(a=new Map,(0,d.c)(this,L).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,d.c)(this,L).get(e)}};function F(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=N("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;f.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)f.i18n.removeResourceBundle(e,n)}}}function N(e,t){return"".concat(e,"/").concat(t)}function j(e){return f.i18n.getFixedT(null,N("widget",e))}var $,D=function(){var e=R();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=N("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;f.i18n.addResourceBundle(t,r,n)}))},K="brick-next-devtools-panel",V="devtools-frame-active-change",W="devtools-panel-change",H=!0;function q(e,t){var r=z();if(r&&("evaluation"!==e||H&&(!$||"Evaluations"===$))){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 z(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var G=()=>{throw new Error("Can't modify read-only proxy object")},J={set:G,defineProperty:G,deleteProperty:G,setPrototypeOf:G};function Y(e){return new Proxy(e,J)}function Q(e){var{get:t,ownKeys:r}=e;return z()?Y(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var X="light",Z=new v.JsonStorage(localStorage),ee="apps-theme";function te(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));X=e}function re(){return X}function ne(){return document.documentElement.dataset.theme}function ae(e){e?te(e):e=re(),e!==ne()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function oe(e){Z.setItem(ee,(0,a.c)((0,a.c)({},ie()),e))}function ie(){var e,t;try{t=Z.getItem(ee)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var se="default";function ce(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));se=e}function le(){return document.documentElement.dataset.mode}function ue(e){e?ce(e):e=se,e!==le()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function de(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 fe(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:c,appendI18nNamespace:l,storyboardFunctions:u,isStoryboardFunction:d}=t;switch(e){case"BASE_URL":return o?"/next":g().replace(/\/$/,"");case"FN":return u;case"IMG":return o?{get:e=>"mock/images/".concat(e)}:i?null==Po||null===(r=Po.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==Po||null===(n=Po.images)||void 0===n?void 0:n.imagesFactory(c.id,c.isBuildPush,c.currentVersion);case"I18N":return o?b.identity:i?j(i):f.i18n.getFixedT(null,[l,N("app",c.id)].filter(Boolean));case"I18N_TEXT":return o?ve:f.i18nText;case"PERMISSIONS":return Y({check:o?he:null==Po||null===(a=Po.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return Y({getTheme:o?()=>"light":re});case"console":return d?Y(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 ve(e){return null==e?void 0:e.en}function he(){return!0}function me(){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,c=o.get(a);if(c){if(c.processed)return c.cooked;n&&(s=n.createCollector(a));var l=(0,P.precookFunction)(c.source,{typescript:c.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return c.cooked=(0,P.cook)(l.function,c.source,{rules:{noVar:!0},globalVariables:(0,B.supply)(l.attemptToVisitGlobals,fe(l.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}}),c.processed=!0,c.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,M.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,M.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.c)((0,a.c)({},t),{},{name:e}),n=(0,M.collectMemberUsageInFunction)(r,"FN",!0),i=(0,M.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:ge,registerStoryboardFunctions:ye,checkPermissionsUsage:be}=me(),we={};try{we.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)})),we.EventTarget=o}(Object,new WeakMap)}const Se=we.EventTarget;var Ee=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),ke=new Map([[Ee.xLarge,"1920px"],[Ee.large,"1600px"],[Ee.medium,"1280px"],[Ee.small,"1024px"],[Ee.xSmall,0]]),Ie=new Se,Ae={},Ce={};function Re(e,t){var r=!1;for(var[n]of(Ae[t]=e.matches,ke))if(Ae[n]&&Ce.breakpoint!==n){Ce.breakpoint=n,r=!0;break}r&&Ie.dispatchEvent(new CustomEvent("change",{detail:Ce}))}ke.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Re(r,t),r.addEventListener?r.addEventListener("change",(e=>{Re(e,t)})):r.addListener((e=>{Re(e,t)}))}));var Te=()=>Ce;function Oe(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 xe(e){var t,r;return!(null===(t=e?e.flags:null===(r=Do())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Pe(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 Me=new Set(["prefix"]),_e=new WeakMap,Be=function(){var e=R();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,c.c)(this,_e,{writable:!0,value:new Map})}define(e,t){var r,n,o,i,s=(0,d.c)(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=xe(),l=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},u=[],f=[];for(var[p,v]of Object.entries(l))v.asVariable?(Pe(c,"Template `asVariable`",e,p),c||f.push(p)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,p):v.ref&&u.push([p,v]);var h=(0,a.c)((0,a.c)({},t),{},{proxy:(0,a.c)((0,a.c)({},t.proxy),{},{properties:Object.fromEntries(u)}),state:(t.state?c?t.state:t.state.map((e=>(0,a.c)({expose:!0},e))):[]).concat(f.map((e=>({name:e,expose:!0}))))});(0,d.c)(this,_e).set(e,(0,a.c)((0,a.c)({},h),{},{name:e}));var m,g,y=(m=h.state,(0,b.uniq)(null!==(g=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[])),w=Object.entries(null!==(o=null===(i=h.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),S=y.concat(u.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).filter((e=>e in HTMLElement.prototype&&!Me.has(e)));if(k.length>0&&(Pe(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 S}static get _dev_only_definedMethods(){return E}$$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(u.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 A of y)I(A);var C=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[R,T]of u)C(R,T);var O=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[x,P]of w)O(x,P);customElements.define(e,t)}}get(e){return(0,d.c)(this,_e).get(e)}};function Le(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 Ue(e,t,r){var n=Le(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 Fe=new Map,Ne=new Proxy(Object.freeze({}),{get:(e,t)=>Fe.get(t)}),je=function(){var e=R();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Fe.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=me({widgetId:e,widgetVersion:r});Fe.set(e,n),a(t)};const $e=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,De=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match($e);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ke=e=>"*"===e||"x"===e||"X"===e,Ve=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},We=(e,t)=>{if(Ke(e)||Ke(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Ve(e),Ve(t));return r>n?1:r<n?-1:0},He=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=We(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},qe=(e,t,r)=>{Je(r);const n=((e,t)=>{const r=De(e),n=De(t),a=r.pop(),o=n.pop(),i=He(r,n);return 0!==i?i:a&&o?He(a.split("."),o.split(".")):a||o?a?-1:1:0})(e,t);return ze[r].includes(n)},ze={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ge=Object.keys(ze),Je=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===Ge.indexOf(e))throw new Error(`Invalid operator, expected one of ${Ge.join("|")}`)};function Ye(e,t){var r=Qo(e);if(!r&&null!=Po&&Po.checkInstalledApps&&(r=Po.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 qe(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Qe(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 Xe=new Map;function Ze(e){return et.apply(this,arguments)}function et(){return et=(0,o.c)((function*(e){var t,r=null==Po||null===(t=Po.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=Po.flowApi.FLOW_API_PROVIDER);var n=Xe.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)Po.flowApi.registerFlowApiProvider();else if(yield(0,p.loadBricksImperatively)([e],zo()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Xe.set(e,n),n})),et.apply(this,arguments)}var tt=new WeakSet;function rt(e){if((0,v.isObject)(e)&&!nt(e))if(tt.add(e),Array.isArray(e))e.forEach(rt);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(rt)}}function nt(e){return tt.has(e)}var at=new Map;function ot(e,t,r){return it.apply(this,arguments)}function it(){return(it=(0,o.c)((function*(e,t,r){var{useProvider:n,method:o="resolve",args:i=[],onReject:s}=e,{provider:c,field:l}=e;if(c&&!n)throw new Error("You're using \"provider: ".concat(c,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=l;if(u){var d=xe();if(Pe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var f,[p,v]=yield Promise.all([Ze(n),St(i,t)]),h=null==r?void 0:r.renderId,m=st(p,n,o,v,r,i,!!h&&h!==Go()),{transform:g}=e;try{var y=yield m;rt(f=u?(0,b.get)(y,l):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,f=e}return g?"string"==typeof g?{[g]:f}:St(g,(0,a.c)((0,a.c)({},t),{},{data:f})):f}))).apply(this,arguments)}function st(e,t,r,n,a,o,i){return ct.apply(this,arguments)}function ct(){return ct=(0,o.c)((function*(e,t,r,n,a,i,s){var c,l;try{c=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;c=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==a?void 0:a.cache)&&(l=at.get(c)),l||(l=(0,o.c)((function*(){var a,o=null!=Po&&null!==(a=Po.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield Po.flowApi.getArgsOfFlowApi(t,n,r):n;return e[r](...o)}))(),s||at.set(c,l)),l})),ct.apply(this,arguments)}var lt=Symbol.for("pre.evaluated.raw"),ut=Symbol.for("pre.evaluated.context");function dt(e){return!(null==e||!e[lt])}function ft(e){return e[lt]}function pt(e){return"string"==typeof e?(0,P.shouldAllowRecursiveEvaluations)(e):(0,P.shouldAllowRecursiveEvaluations)(e[lt])}var vt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function ht(e){return vt.has(e.constructor)?e.constructor:TypeError}function mt(){return(mt=(0,o.c)((function*(e,t,r){var{blockingList:n,run:a}=gt(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function gt(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,b.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.c)((0,a.c)({},e[ut]),i),e=e[lt]}var s,c={usedArgs:new Set},l={usedArgs:new Set};try{s=(0,P.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,M.collectAppGetMenuUsage)(c,e,t),(0,M.collectInstalledAppsHasUsage)(l,e,t)}}})}catch(t){var u="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(u)}if(c.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(l.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var d,f,h,m,g={},{attemptToVisitGlobals:y}=s;if(r.lazy||y.has("EVENT")&&!(0,v.hasOwnProperty)(t,"event")||y.has("DATA")&&!(0,v.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[lt]:e,[ut]:t}:e};var w,S,E=xe(t);(y.has("STATE")||!E&&y.has("TPL"))&&(m=Le(t,"STATE",': "'.concat(e,'"'))),y.has("FORM_STATE")&&(S=Qe(t,"FORM_STATE",': "'.concat(e,'"')));var k=z();if(n||k){if(y.has("CTX")&&(d=(0,M.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(d))),m){if(h=(0,M.strictCollectMemberUsage)(e,"STATE"),!E){var I=(0,M.strictCollectMemberUsage)(e,"TPL");for(var A of I)h.add(A)}n&&o.push(m.waitFor(h))}S&&(w=(0,M.strictCollectMemberUsage)(e,"FORM_STATE"),n&&o.push(S.waitFor(w))),y.has("PROCESSORS")&&(f=(0,M.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,p.loadProcessorsImperatively)(f,zo())))}if(n){var C,R=y.has("PERMISSIONS");if(!R&&y.has("FN")){var T=[...(0,M.strictCollectMemberUsage)(e,"FN")];R=be(T)}if(R&&o.push(...t.pendingPermissionsPreCheck),c.usedArgs.size>0&&null!=Po&&Po.menu){var O=[...c.usedArgs];o.push(Promise.all(O.map((e=>Po.menu.fetchMenuById(e,t,{getStoryboardByAppId:Yo,resolveData:ot,asyncComputeRealValue:St})))))}l.usedArgs.size>0&&o.push(null==Po||null===(C=Po.checkInstalledApps)||void 0===C?void 0:C.waitForCheckingApps([...l.usedArgs]))}return{blockingList:o,run(){var r,n,o,i,{app:c,location:l,query:u,match:p,flags:k,sys:I,ctxStore:A,data:C,event:R}=t,T=null!==(r=t.overrideApp)&&void 0!==r?r:c;for(var O of y)switch(O){case"ANCHOR":g[O]=l.hash?l.hash.substring(1):null;break;case"APP":g[O]=(0,a.c)((0,a.c)({},(0,b.cloneDeep)(T)),{},{getMenu:null==Po||null===(n=Po.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":g[O]=Q({get:(e,t)=>A.getValue(t),ownKeys:()=>Array.from(d)});break;case"DATA":g[O]=C;break;case"EVENT":g[O]=R;break;case"FLAGS":g[O]=Y(k);break;case"FORM_STATE":g[O]=Q({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":g[O]=l.hash;break;case"INSTALLED_APPS":g[O]=Y({has:Ye});break;case"ITEM":case"INDEX":var x="ITEM"===O?"forEachItem":"forEachIndex";(0,v.hasOwnProperty)(t,x)?g[O]=t[x]:console.error("Using `".concat(O,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":g[O]=Y({getItem:Oe("local")});break;case"MEDIA":g[O]=Y(Te());break;case"MISC":g[O]=Do().getMiscSettings();break;case"PARAMS":g[O]=new URLSearchParams(u);break;case"PATH":g[O]=Y(null!==(o=null==p?void 0:p.params)&&void 0!==o?o:{});break;case"PATH_NAME":g[O]=l.pathname;break;case"PROCESSORS":g[O]=Q({get(e,t){var r=U.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return Q({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of f){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":g[O]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":g[O]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":g[O]=Y({getItem:Oe("session")});break;case"TPL":if(Pe(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":g[O]=Q({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":g[O]=Y(null!=I?I:{});break;case"__WIDGET_FN__":g[O]=Ne;break;case"__WIDGET_IMG__":g[O]=null==Po||null===(i=Po.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":g[O]=j}Object.assign(g,fe(s.attemptToVisitGlobals,{storyboardFunctions:ge,app:T,appendI18nNamespace:t.appendI18nNamespace}));try{var M=(0,P.cook)(s.expression,s.source,{globalVariables:(0,B.supply)(s.attemptToVisitGlobals,g)});return q("evaluation",{raw:e,context:g,result:M}),M}catch(t){var _="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(_)}}}}var yt=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 bt(e){switch(e){case yt.USE_BRICK_PROPERTIES:case yt.USE_BRICK_TRANSFORM:case yt.USE_BRICK_EVENTS:case yt.USE_BRICK_IF:case yt.USE_BRICK_LIFECYCLE:case yt.USE_BRICK_DATA_SOURCE:return!0}return!1}function wt(e,t,r){if(bt(e))return e;if(t)switch(e){case yt.USE_BRICK:return yt.USE_BRICK_ITEM;case yt.USE_BRICK_SLOTS_ITEM_BRICKS:return yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case yt.INITIAL:if("useBrick"===r)return yt.USE_BRICK;break;case yt.USE_BRICK:case yt.USE_BRICK_ITEM:case yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return yt.USE_BRICK_PROPERTIES;case"transform":return yt.USE_BRICK_TRANSFORM;case"dataSource":return yt.USE_BRICK_DATA_SOURCE;case"events":return yt.USE_BRICK_EVENTS;case"slots":return yt.USE_BRICK_SLOTS;case"children":return yt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return yt.USE_BRICK_IF;case"lifeCycle":return yt.USE_BRICK_LIFECYCLE}break;case yt.USE_BRICK_SLOTS:return yt.USE_BRICK_SLOTS_ITEM;case yt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return yt.USE_BRICK_SLOTS_ITEM_BRICKS}return yt.INITIAL}function St(e,t){return Et.apply(this,arguments)}function Et(){return Et=(0,o.c)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,P.isEvaluable)(e)?(a=yield function(e,t,r){return mt.apply(this,arguments)}(e,t,{lazy:o}),i=pt(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?_.transform:_.transformAndInject:r.noInject?At:_.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(r,!0);return Promise.all(e.map((e=>St(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([St(n,t),St(a,t,It(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),Et.apply(this,arguments)}function kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,P.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=gt(e,t,void 0,!1);return n()}(e,t),i=pt(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?_.transform:_.transformAndInject:r.noInject?At:_.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(r,!0);return e.map((e=>kt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[kt(n,t),kt(a,t,It(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function It(e,t,r){return e.$$lazyForUseBrick?(0,a.c)((0,a.c)({},e),{},{$$stateOfUseBrick:wt(e.$$stateOfUseBrick,t,r)}):e}function At(e){return e}function Ct(e,t){return Rt.apply(this,arguments)}function Rt(){return(Rt=(0,o.c)((function*(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?yield St(e.if,t):e.if)}))).apply(this,arguments)}function Tt(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?kt(e.if,t):e.if)}function Ot(e){return!(0,v.hasOwnProperty)(e,"if")||!!e.if}function xt(){return(xt=(0,o.c)((function*(e,t){return(0,v.isObject)(e.if)&&!dt(e.if)?Ot(yield ot(e.if,t)):Ct(e,t)}))).apply(this,arguments)}var Pt=function(){var e=R();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Tt(e,{data:t})};function Mt(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,P.isEvaluable)(e):dt(e)){var a="string"==typeof e?e:ft(e);if((0,P.isTrackAll)(a)){var o=(0,M.trackAll)(a);o&&(t=o.context,r=o.state,n=o.formState)}else t=(0,M.track)(a,"track context","CTX"),r=(0,M.track)(a,"track state","STATE"),n=(0,M.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function _t(e,t){return Bt.apply(this,arguments)}function Bt(){return(Bt=(0,o.c)((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 Lt(e){return Ut.apply(this,arguments)}function Ut(){return(Ut=(0,o.c)((function*(e){var t={};for(var[r,n,a]of e){var o=yield n;void 0===o&&a||!("style"!==r&&"dataset"!==r||(0,v.isObject)(o))||(t[r]=o)}return t}))).apply(this,arguments)}function Ft(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 Nt(e,t,r){var n=function(e,t){return(0,v.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=kt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?yt.USE_BRICK:yt.INITIAL});if("style"!==r&&"dataset"!==r||(0,v.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ft(e,n)}))}function jt(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function $t(e){return e&&e.sensitive?"":"i"}function Dt(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,c=void 0===s||s,l=r.encode,u=void 0===l?function(e){return e}:l,d=r.delimiter,f=void 0===d?"/#?":d,p=r.endsWith,v="[".concat(jt(void 0===p?"":p),"]|$"),h="[".concat(jt(f),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=jt(u(b));else{var w=jt(u(b.prefix)),S=jt(u(b.suffix));if(b.pattern)if(t&&t.push(b),w||S)if("+"===b.modifier||"*"===b.modifier){var E="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(S).concat(w,"(?:").concat(b.pattern,"))*)").concat(S,")").concat(E)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(S,")").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(S,")").concat(b.modifier)}}if(c)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,$t(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 c=e.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))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(jt(t.delimiter||"/#?"),"]+?"),i=[],s=0,c=0,l="",u=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[c],a=n.type,o=n.index;throw new TypeError("Unexpected ".concat(a," at ").concat(o,", expected ").concat(e))},f=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var p=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=p||"";-1===a.indexOf(m)&&(l+=m,m=""),l&&(i.push(l),l=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=p||u("ESCAPED_CHAR");if(g)l+=g;else if(l&&(i.push(l),l=""),u("OPEN")){m=f();var y=u("NAME")||"",b=u("PATTERN")||"",w=f();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 Kt(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 Kt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),$t(r))}(e,t,r):Dt(e,t,r)}var Vt=new Map,Wt=1e4,Ht=0;function qt(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=Vt.get(r);n||Vt.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:Kt(e,o,t),keys:o};return Ht<Wt&&(n.set(e,i),Ht++),i}(r,{end:n,strict:a,sensitive:o}),c=i.exec(e);if(!c)return null;var[l,...u]=c,d=e===l;return n&&!d?null:{path:r,url:"/"===r&&""===l?"/":l,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function zt(){return(zt=(0,o.c)((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=Gt(r,t.app.homepage,t.location.pathname);if(n&&(yield Ct(r,t)))return t.app.noAuthGuard||r.public||null==Po||!Po.auth||Po.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function Gt(e,t,r){return qt(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Jt,Yt=Symbol.for("tpl.asyncComputedPropsFromHost"),Qt=Symbol.for("tpl.stateStoreId"),Xt=Symbol.for("tpl.externalForEachItem"),Zt=Symbol.for("tpl.externalForEachIndex"),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 Jt?Jt.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){var{search:t,pathname:r}=e,n=r?window.btoa(encodeURIComponent(r)):"",a=t?window.btoa(encodeURIComponent(t)):"";document.cookie="SALOGINPATH=".concat(n,"; path=/"),document.cookie="SALOGINQUERY=".concat(a,"; path=/")}function cr(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof x.HttpFetchError)return f.i18n.t("".concat(ar,":").concat(tr.NETWORK_ERROR));if(e instanceof x.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 x.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var ur,dr,fr=!1;function pr(e){if(!(e instanceof x.HttpAbortError)){if(lr(e)&&!window.NO_AUTH_GUARD){if(fr)return;return fr=!0,void ir.show({type:"confirm",content:f.i18n.t("".concat(ar,":").concat(tr.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=Do().getFeatureFlags()["sso-enabled"],sr((t=O()).location),t.push(e?"/sso-auth/login":"/auth/login",{from:(0,a.c)((0,a.c)({},t.location),{},{state:void 0})}),fr=!1}),(()=>{fr=!1}))}console.error(e);var t=cr(e);t!==ur&&(ur=t,ir.show({type:"error",title:f.i18n.t("".concat(ar,":").concat(tr.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{ur=void 0})))}}var vr=Object.freeze({show:function(e){dr?dr.resolve(e):alert(e.message)}});function hr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=wr(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 mr(e){return"string"==typeof e.action}function gr(e){return"string"==typeof e.useProvider}function yr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function br(e){return!!e.then}function wr(e,t,r){return function(n){var o,i;for(var s of[].concat(e))if(Tt(s,(0,a.c)((0,a.c)({},t),{},{event:n})))if(br(s))wr(s.then,t,r)(n);else if(mr(s)){var[c,l]=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":Cr(n,l,s.args,s.callback,t);break;case"window.open":Rr(n,s.args,t);break;case"location.reload":case"location.assign":Mr(n,l,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":_r(n,c,l,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"event.stopPropagation":n.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":Br(n,l,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Lr(n,l,s.args,t);break;case"handleHttpError":pr(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Or(n,l,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":xr(n,l,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=jr(s.args,t,n);Ue(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":Pr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Ur(n,l,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ae("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[f]=jr(s.args,t,n);ae(f);break;case"mode.setDashboardMode":case"mode.setDefaultMode":ue("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else gr(s)?Sr(n,s,t,r):yr(s)?kr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&wr(s.else,t,r)(n)}}function Sr(e,t,r,n){return Er.apply(this,arguments)}function Er(){return(Er=(0,o.c)((function*(e,t,r,n){try{Ir(e,yield Ze(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(cr(e))}}))).apply(this,arguments)}function kr(e,t,r,n){var o=[],i=t.target,s=t.targetRef,c=i;if(("string"==typeof i?(0,P.isEvaluable)(i):dt(i))&&(c=kt(i,(0,a.c)((0,a.c)({},r),{},{event:e}))),"string"==typeof c)if("_self"===c)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(c));else{var l=document.querySelector(c);null!==l&&o.push(l)}else if(c)c instanceof HTMLElement?o.push(c):console.error("unexpected target:",c);else if(s){var u=s;("string"==typeof s?(0,P.isEvaluable)(s):dt(s))&&(u=kt(s,(0,a.c)((0,a.c)({},r),{},{event:e})));var d=[].concat(u),f=Ue(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=f.$$getElementByRef)||void 0===t?void 0:t.call(f,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{Ir(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Nt(o,t.properties,(0,a.c)((0,a.c)({},r),{},{event:e})):console.error("target not found:",i||s)}function Ir(e,t,r,n,a,o,i){return Ar.apply(this,arguments)}function Ar(){return Ar=(0,o.c)((function*(e,t,r,n,i,s,c){if("function"==typeof t[n]){var l=function(){var a=(0,o.c)((function*(){var a,o=jr(r.args,i,e,c);return gr(r)&&null!=Po&&null!==(a=Po.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(o=yield Po.flowApi.getArgsOfFlowApi(r.useProvider,o,n)),t[n](...o)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var u=Nr(r.callback,i,s),d={progress:u("progress"),success:u("success"),error:u("error"),finally:u("finally")};if(gr(r)){var f,p=(0,a.c)((0,a.c)({},i),{},{event:e});if(kt(null===(f=r.poll)||void 0===f?void 0:f.enabled,p))return void function(e,t,r,n){var a,{progress:i,success:s,error:c,finally:l}=t,{expectPollStopImmediately:u,expectPollEnd:d}=r,{interval:f,leadingRequestDelay:p,continueOnError:v,delegateLoadingBar:h}=kt((0,b.pick)(r,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),n),m=Go();function g(){return y.apply(this,arguments)}function y(){return(y=(0,o.c)((function*(){var t;er.delete(a);try{var r;if(!(t=null===(r=kt(u,n))||void 0===r?void 0:r())){var o,p,g=yield e();(t=(null===(o=kt(u,n))||void 0===o?void 0:o())||m!==Go())||(null==i||i(g),null!==(p=kt(d,n))&&void 0!==p&&p(g)?(h&&window.dispatchEvent(new Event("request.end")),null==s||s(g),null==l||l()):w(null!=f?f:3e3))}}catch(e){var y;(t=(null===(y=kt(u,n))||void 0===y?void 0:y())||m!==Go())||(null==c||c(e),v?w(null!=f?f:3e3):null==l||l())}finally{h&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function w(e){a=setTimeout(g,e),er.add(a)}w(null!=p?p:0),h&&window.dispatchEvent(new Event("request.start"))}(l,d,r.poll,p)}try{var v=yield l();d.success(v)}catch(e){d.error(e)}finally{d.finally()}}else l()}else console.error("target has no method:",{target:t,method:n})})),Ar.apply(this,arguments)}function Cr(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 c=[];if(o>0&&((c=jr(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var l=Nr(n,a,void 0);c.push((e=>{l(e?"error":"success")({blocked:e}),l("finally")({blocked:e})}))}O()[s](...c)}function Rr(e,t,r){var[n,a,o]=jr(t,r,e);window.open(n,a||"_self",o)}function Tr(e,t,r,n,a,o){t?n.updateValues(e,r,(e=>jr(e,a,o)[0])):e.forEach((e=>{var{name:t,value:i}=jr([e],a,o)[0];n.updateValue(t,i,r)}))}function Or(e,t,r,n,a,o){if(!Array.isArray(r)||!r.every(v.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=jr(r,o,e);o.ctxStore.updateValue(i,s,t,a,o)}else Tr(r,n,t,o.ctxStore,o,e)}function xr(e,t,r,n,a,o){if(Array.isArray(r)&&r.every(v.isObject)&&"update"===t)Tr(r,n,"replace",Le(o,"state.".concat(t),": ".concat(JSON.stringify(r))),o,e);else{var[i,s]=jr(r,o,e);Le(o,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,a,o)}}function Pr(e,t,r,n){var[a,o]=jr(t,n,e);Qe(n,"formstate.update",": ".concat(a)).updateValue(a,o,"replace",r,n)}function Mr(e,t,r,n){if("assign"===t){var[a]=jr(r,n,e);location.assign(a)}else location[t]()}function _r(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=jr(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function Br(e,t,r,n){console[t](...jr(r,n,e,{useEventAsDefault:!0}))}function Lr(e,t,r,n){var a=jr(r,n,e,{useEventAsDefault:!0});vr.show({type:t,message:a[0]})}function Ur(e,t,r,n,a,o){return Fr.apply(this,arguments)}function Fr(){return(Fr=(0,o.c)((function*(e,t,r,n,a,o){var i=()=>{var a,o=jr(r,n,e);return null==Po||null===(a=Po.messageDispatcher)||void 0===a?void 0:a[t](...o)};if(o){var s=Nr(o,n,a);try{var c=yield i();s("success")(c)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Nr(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});wr(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function jr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?kt(e,(0,a.c)((0,a.c)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}function $r(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=Le(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 c=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}))},c=null!==(t=u.refEvent)&&void 0!==t?t:e;a.addEventListener(c,s),null!==(i=(n=a).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),a.$$proxyListeners.push([c,s])}};for(var[l,u]of Object.entries(s))c(l)}}}function Dr(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=Le(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(c=n.$$proxyListeners)&&void 0!==c?c:[])){var c;n.removeEventListener(i,s)}delete n.$$proxyListeners}}var Kr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Vr(e){e.replaceChildren()}function Wr(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;for(var r=e.child,n=[];r;){if(r.tag===Kr.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),Ft(i,r.properties),hr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Le({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),$r(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,c=r.return;c;){var l;if(c.childElements)c.tag===Kr.ROOT?null===(l=c.container)||void 0===l||l.append(...c.childElements):c.element.append(...c.childElements),c.childElements=void 0;if(c.tag===Kr.ROOT&&n.length>0&&("function"==typeof c.createPortal?c.createPortal():c.createPortal).append(...n),c.sibling)break;c=c.return}r=null===(s=c)||void 0===s?void 0:s.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}var Hr=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],qr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],zr=new WeakMap,Gr=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Qr=new WeakMap,Xr=new WeakMap,Zr=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;class sn{constructor(e,t){var r;(0,i.c)(this,on),(0,i.c)(this,an),(0,i.c)(this,nn),(0,i.c)(this,rn),(0,s.c)(this,"scope",void 0),(0,s.c)(this,"unknownBricks",void 0),(0,s.c)(this,"renderId",void 0),(0,c.c)(this,zr,{writable:!0,value:void 0}),(0,c.c)(this,Gr,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,c.c)(this,Jr,{writable:!0,value:new Map}),(0,c.c)(this,Yr,{writable:!0,value:void 0}),(0,c.c)(this,Qr,{writable:!0,value:new Map}),(0,c.c)(this,Xr,{writable:!0,value:void 0}),(0,c.c)(this,Zr,{writable:!0,value:void 0}),(0,c.c)(this,en,{writable:!0,value:void 0}),(0,c.c)(this,tn,{writable:!0,value:[]}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",(0,u.c)(this,zr,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequests(e){(0,u.c)(this,Zr,e)}memoizeMenuRequests(e,t){(0,d.c)(this,en)||(0,u.c)(this,en,new WeakMap),(0,d.c)(this,en).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,o.c)((function*(){var a,o;for(var i of e){var s;if(a=null===(s=(0,d.c)(n,en))||void 0===s?void 0:s.get(i)){o=i;break}}var c,l=(0,d.c)(n,Zr),u=a?l.indexOf(a):-1;if(-1===u){if(!r.length)return;l.push(...r)}else l.splice(u,l.length-u,...r);o&&o!==t&&(null===(c=(0,d.c)(n,en))||void 0===c||c.delete(o)),yield(0,d.c)(n,zr).mergeMenus(l)}))()}reBailout(e){return(0,d.c)(this,zr).bailout(e)}reCatch(e,t){return(0,d.c)(this,zr).catch(e,t)}didPerformIncrementalRender(e,t){var r=this;return(0,o.c)((function*(){for(var n=(0,d.c)(r,tn).length-1;n>=0;n--){var a=(0,d.c)(r,tn)[n];if(yield a(e,t))return!0}return!1}))()}performIncrementalRender(e){(0,d.c)(this,tn).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Hr,..."page"===this.scope?qr:[]];for(var n of r){var a=t[n];a&&(0,d.c)(this,Gr)[n].push({brick:e,handlers:a})}(0,b.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,d.c)(this,Qr).get(e);r?r.add(t):(0,d.c)(this,Qr).set(e,new Set([t]))}memoize(e,t,r,n){(0,d.c)(this,Xr)||(0,u.c)(this,Xr,new WeakMap);var a=[null!=e?e:"",...t].join("."),o=(0,d.c)(this,Xr).get(n);o||(o=new Map,(0,d.c)(this,Xr).set(n,o)),o.set(a,{node:r,last:fn(r),lastNormal:pn(r),lastPortal:hn(r)})}reRender(e,t,r,n){var a,o=[null!=e?e:"",...t].join("."),i=(0,d.c)(this,Xr).get(n).get(o),{node:s,last:c,lastNormal:u,lastPortal:f}=i,p=[];if((null==s?void 0:s.tag)===Kr.PLACEHOLDER){var v,h,m;a=null!==(v=null===(h=function(e){return vn(e,!0)}(s))||void 0===h?void 0:h.element)&&void 0!==v?v:null;var g=null===(m=function(e){return mn(e,!0)}(s))||void 0===m?void 0:m.element;g&&p.push(g)}else{var y,b,w;a=null!==(y=null==u||null===(b=u.element)||void 0===b?void 0:b.nextSibling)&&void 0!==y?y:null;for(var S=null==f||null===(w=f.element)||void 0===w?void 0:w.nextSibling;S&&(p.push(S),S instanceof HTMLElement&&"DIV"===S.tagName);)S=S.nextSibling}var E,k=fn(r);i.node=r,i.last=k,i.lastNormal=pn(r),i.lastPortal=hn(r);for(var I=n.child;I&&I!==c;){if(I.sibling===s){E=I;break}I=I.sibling}var A=document.createDocumentFragment(),C=document.createDocumentFragment(),R={tag:Kr.ROOT,container:A,createPortal:C,child:r};for(I=r;I;)I.return=R,I=I.sibling;var T,O,x=gn(s,c);for((0,l.c)(this,rn,cn).call(this,x),Wr(R),E?E.sibling=r:n.child=r,k&&(k.sibling=null==c?void 0:c.sibling),I=r;I;)I.return=n,I=I.sibling;if(n.tag===Kr.ROOT?null===(T=n.container)||void 0===T||T.insertBefore(A,a):null===(O=n.element)||void 0===O||O.insertBefore(A,a),C.childNodes.length>0){for(var P,M=r;M&&M.return;)M=M.return;if((null===(P=M)||void 0===P?void 0:P.tag)!==Kr.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");var _="function"==typeof M.createPortal?M.createPortal():M.createPortal,B=null;for(var L of p)if(_.contains(L)){B=L;break}_.insertBefore(C,B)}var U=gn(r,k);(0,l.c)(this,nn,ln).call(this,U)}dispose(){for(var e of Object.values((0,d.c)(this,Gr)))e.length=0;for(var t of(0,d.c)(this,Jr).values()){for(var r of t)r.disconnect();t.length=0}(0,d.c)(this,Jr).clear(),(0,d.c)(this,Yr)&&(Ie.removeEventListener("change",(0,d.c)(this,Yr)),(0,u.c)(this,Yr,void 0)),(0,u.c)(this,Xr,void 0),(0,u.c)(this,Zr,void 0),(0,u.c)(this,en,void 0),(0,d.c)(this,Qr).clear(),(0,d.c)(this,tn).length=0}dispatchBeforePageLoad(){(0,l.c)(this,an,un).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,l.c)(this,an,un).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,l.c)(this,an,un).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,l.c)(this,an,un).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=O().location;e&&"#"!==e?(0,l.c)(this,an,un).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,l.c)(this,an,un).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,d.c)(this,Gr).onScrollIntoView)(0,l.c)(this,on,dn).call(this,e,t)}initializeMediaChange(){(0,u.c)(this,Yr,(e=>{(0,l.c)(this,an,un).call(this,"onMediaChange",new CustomEvent("media.change",{detail:Y(e.detail)}))})),Ie.addEventListener("change",(0,d.c)(this,Yr))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==Po||null===(r=Po.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{wr(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,d.c)(this,Gr).onMessage)t(r);null==Po||null===(e=Po.messageDispatcher)||void 0===e||e.onClose((()=>{(0,l.c)(this,an,un).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,l.c)(this,an,un).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,l.c)(this,an,un).call(this,"onUnmount",new CustomEvent("unmount"))}}function cn(e){var t=[...Hr,..."page"===this.scope?qr:[]],r=[];for(var n of t){var a=(0,b.remove)((0,d.c)(this,Gr)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var i,s,c=(0,d.c)(this,Jr).get(o);if(null!=c&&c.length){for(var l of c)l.disconnect();c.length=0,(0,d.c)(this,Jr).delete(o)}Dr(o),null===(i=o.element)||void 0===i||delete i.$$tplStateStore,null===(s=o.element)||void 0===s||s.remove()}var u=new CustomEvent("unmount");for(var{brick:f,handlers:p}of r)wr(p,f.runtimeContext,f)(u)}function ln(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,d.c)(this,Gr).onMount)e.has(r)&&wr(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of(0,d.c)(this,Gr).onScrollIntoView)e.has(a)&&(0,l.c)(this,on,dn).call(this,a,o)}function un(e,t){for(var{brick:r,handlers:n}of(0,d.c)(this,Gr)[e])wr(n,r.runtimeContext,r)(t);var a=(0,d.c)(this,Qr).get(e);if(a)for(var o of a)o()}function dn(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&&(wr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=(0,d.c)(this,Jr).get(e);o||(o=[],(0,d.c)(this,Jr).set(e,o)),o.push(a)}function fn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function pn(e){return vn(e,!1)}function vn(e,t){for(var r,n=e;n;){if(n.tag===Kr.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function hn(e){return mn(e,!1)}function mn(e,t){for(var r,n=e;n;){if(n.tag===Kr.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 gn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Kr.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}var yn=Symbol.for("root.runtimeContext");function bn(e,t){return wn.apply(this,arguments)}function wn(){return(wn=(0,o.c)((function*(e,t){var r,n,o,i,s,[c,l,u]=Sa((0,a.c)((0,a.c)({},null!==(r=e[yn])&&void 0!==r?r:Jo()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(n=c.tplStateStoreMap)&&void 0!==n||(c.tplStateStoreMap=new Map),null!==(o=c.formStateStoreMap)&&void 0!==o||(c.formStateStoreMap=new Map);var d=new sn("fragment"),f={tag:Kr.ROOT,createPortal:null},p=e.transform,v=xe();p&&Pe(v,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var h=yield ma(f,v?e:(0,a.c)((0,a.c)({},e),{},{properties:(0,a.c)((0,a.c)({},e.properties),p)}),c,d,[]),m=[...l,...u];if(yield wa(h,c,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Kr.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(s=h.node)&&void 0!==s&&s.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return f.child=h.node,{tagName:h.node?h.node.type:null,renderRoot:f,rendererContext:d,scopedStores:m}}))).apply(this,arguments)}function Sn(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},Wr(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),o))i.mountAsyncData();return{portal:r}}function En(e,t){var{rendererContext:r}=e;t.portal&&(Vr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function kn(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return kt(t,(0,a.c)((0,a.c)({},Jo()),{},{data:e}),{noInject:!0})}function In(e,t){var r=Yo(e);Object.assign(r,(0,a.c)((0,a.c)({},t),{},{meta:(0,a.c)((0,a.c)({},r.meta),t.meta),$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),F(r)}function An(e,t){var r=Yo(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 Cn(e,t,r){var n="".concat(e,".").concat(t.name);Be.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Rn(e,t.name,r)}function Rn(e,t,r){Mn(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.c)({brick:t},(0,b.pick)(r,"properties","events","lifeCycle","context","slots","children"))])}function Tn(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function On(e,t){var r;Mn(e,Tn(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var xn,Pn=On;function Mn(e,t,r,n){var{routes:a}=Yo(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 _n(e,t){var{tplStateStoreId:r}=t,n=Jo();return r?Le((0,a.c)((0,a.c)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function Bn(e){var{tplStateStoreId:t}=e,r=Jo();return t?Le((0,a.c)((0,a.c)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Ln(e){return zo().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Un(){return Go()}function Fn(e,t){return Nn.apply(this,arguments)}function Nn(){return(Nn=(0,o.c)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:o}=t,i=Yo(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,c=Tn(e.snippetId);r={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===c))]}}var l=[];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))||l.push(e)})),l}))).apply(this,arguments)}var jn=[];function $n(e){xn=e;var t=Bn({tplStateStoreId:e.tplStateStoreId});Kn({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Dn(e){jn.push(e)}function Kn(e){setTimeout((()=>{for(var t of jn)try{t(e)}catch(t){console.error("RealTimeDataInspectHook failed (".concat(e.changeType,"):"),t)}}))}var Vn=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Wn{constructor(e,t,r,n){(0,s.c)(this,"type",void 0),(0,s.c)(this,"data",new Map),(0,s.c)(this,"changeEventType",void 0),(0,s.c)(this,"pendingStack",[]),(0,s.c)(this,"hostBrick",void 0),(0,s.c)(this,"stateStoreId",void 0),(0,s.c)(this,"batchUpdate",!1),(0,s.c)(this,"batchUpdateContextsNames",[]),(0,s.c)(this,"rendererContext",void 0),(0,s.c)(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,this.stateStoreId=n}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}notifyRealTimeDataChange(e,t){if(xn){var{tplStateStoreId:r}=xn;(r?"STATE"===this.type&&this.stateStoreId===r:"CTX"===this.type)&&Kn({changeType:"update",tplStateStoreId:r,detail:{name:e,value:t}})}}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,v.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.useResolve)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which is not using resolve'));var s;"load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));var c=e=>{var t,r;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(r=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&r!==Go()};if(s||(s=i.loading=i.load((0,a.c)({cache:"load"===r?"default":"reload"},t))).then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||c(e)||null!=n&&n.error||pr(e)})),n){var l=Nr(n,o);s.then((e=>{l("success")({value:e}),l("finally")()}),(e=>{!c(e)&&n.error&&l("error")(e),l("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}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=arguments.length>2?arguments[2]:void 0,n=new Map;for(var a of e){var o=[a.if,a.value,a.resolve],i=(0,M.collectMemberUsage)(o,t);if(!r&&"STATE"===t){var s=(0,M.collectMemberUsage)(o,"TPL");for(var c of s.usedProperties)i.usedProperties.add(c);s.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}n.set(a,i)}return n}(e,r,arguments.length>3?arguments[3]:void 0),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 c=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),l=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})}))]))),f=function(){var e=(0,o.c)((function*(e){var r;l.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)}}(),p=c;function v(){return h.apply(this,arguments)}function h(){return h=(0,o.c)((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,p)).map((e=>e[0])).filter((e=>!l.has(e)));yield Promise.all(e.map(f))})),h.apply(this,arguments)}return{pendingResult:v().then((0,o.c)((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),p=!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,xe(t));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.c)((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.c)((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=>{this.finishLoad(t,e)}))}}))}resolve(e,t,r,n){var i=this;return(0,o.c)((function*(){if(!(yield Ct(e,t)))return!1;var s,c,l,u,d,f;if(r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield _t(r,e.name)),void 0===s){if(e.resolve){var p=(0,v.hasOwnProperty)(e,"value");d=e.track&&p&&(0,v.hasOwnProperty)(e.resolve,"if")&&(0,M.strictCollectMemberUsage)(e.resolve.if,i.type).size>0;var h=(0,a.c)({transform:"value"},e.resolve);if(((u=yield Ct(e.resolve,t))||d)&&(c=function(){var e=(0,o.c)((function*(e){var r;return(yield ot(h,t,(0,a.c)((0,a.c)({},e),{},{renderId:null===(r=i.rendererContext)||void 0===r?void 0:r.renderId}))).value}));return function(t){return e.apply(this,arguments)}}()),u)"eager"==(f=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield c():"async"===f&&(l=c());else if(!p)return!1}u&&"eager"===f||void 0===e.value||(s=yield St(e.value,t))}if(i.data.has(e.name))throw new Error("".concat(i.type," '").concat(e.name,"' has already been declared"));var m={name:e.name,value:s,eventTarget:new Se,useResolve:u,load:c,loaded:"eager"===f,loading:l,async:"async"===f,deps:[]};if("lazy"===f){var g,{trigger:y}=e.resolve;y&&Vn.includes(y)&&(null===(g=i.rendererContext)||void 0===g||g.registerArbitraryLifeCycle(y,(()=>{i.updateValue(e.name,void 0,"load")})))}if(e.onChange&&m.eventTarget.addEventListener(i.changeEventType,wr(e.onChange,t)),e.track){var b=(0,M.strictCollectMemberUsage)(d?[e.resolve,e.value]:c?e.resolve:e.value,i.type);for(var w of(!c&&(m.deps=[...b]),b))i.onChange(w,i.batchAddListener((()=>{m.useResolve=d?Tt(e.resolve,t):!!c,m.useResolve?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,kt(e.value,t),"replace")}),e))}if(m.eventTarget.addEventListener(i.changeEventType,(t=>{i.notifyRealTimeDataChange(e.name,t.detail)})),i.data.set(e.name,m),Array.isArray(n))for(var S of n){var E=i.routeMap.get(S);E?E.add(e.name):i.routeMap.set(S,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 Hn(e,t,r){var n,a,{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:c,hostBrick:l}=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 d=o.slots.get(t);if(d&&s){var f=new Map;for(var{from:p,to:h}of d){var m,g,y,w,S=null!==(m=null===(g=s[p])||void 0===g?void 0:g.bricks)&&void 0!==m?m:[];if(S.length){var E=null!==(y=h.refSlot)&&void 0!==y?y:p,k=f.get(E);if(!k){k=[];for(var I=(0,v.hasOwnProperty)(r,E)?r[E].bricks.length+1:1,A=0;A<I;A+=1)k.push([]);f.set(E,k)}var C=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,b.clamp)(C<0?k.length+C:C,0,k.length-1)].push(...(0,v.hasOwnProperty)(l.runtimeContext,"forEachItem")?qn(S,l.runtimeContext.forEachItem,l.runtimeContext.forEachIndex):S)}}var R=function(){(0,v.hasOwnProperty)(r,T)||(r[T]={type:"bricks",bricks:[]});var e=r[T];e.bricks=O.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[T]};for(var[T,O]of f.entries())R()}}return{[Yt]:n,[Qt]:c}}function qn(e,t,r){return e.map((e=>{var n;return(0,a.c)((0,a.c)({},e),{},{[Xt]:t,[Zt]: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:zn(o.routes,t,r)}:{type:"bricks",bricks:qn(null!==(n=o.bricks)&&void 0!==n?n:[],t,r)}]})))})}))}function zn(e,t,r){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.c)((0,a.c)({},e),{},{bricks:qn(e.bricks,t,r)})))}var Gn=["properties","slots","children"];function Jn(e,t){function r(e){return(0,v.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,v.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,c=(0,y.c)(e,Gn),l=ka(s,i),u=Object.fromEntries(Object.entries(null!=l?l:{}).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.c)((0,a.c)({},c),{},{properties:r(o),slots:u},Hn(t,c.ref,u))}return r(e)}var Yn=["slots","children"],Qn=["properties","slots","children"];function Xn(e,t,r,n,o){var i,s=(0,b.uniqueId)("tpl-state-"),c=(0,a.c)((0,a.c)({},r.runtimeContext),{},{tplStateStoreId:s});delete c.forEachItem,delete c.forEachIndex,delete c.formStateStoreId;var l=new Wn("STATE",r,o,s);c.tplStateStoreMap.set(s,l),c.tplStateStoreScope&&c.tplStateStoreScope.push(l);var{bricks:u,proxy:d,state:f,contracts:p}=Be.get(e);null==Po||null===(i=Po.flowApi)||void 0===i||i.collectWidgetContract(p),l.define(f,c,n);var{slots:v,children:h}=t,m=(0,y.c)(t,Yn),g=(0,a.c)((0,a.c)({},m),{},{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[S,E]of Object.entries(d.properties)){var k=w.properties.get(E.ref);k||(k=[],w.properties.set(E.ref,k)),k.push({from:S,to:E})}if(null!=d&&d.slots)for(var[I,A]of Object.entries(d.slots)){var C=w.slots.get(A.ref);C||(C=[],w.slots.set(A.ref,C)),C.push({from:I,to:A})}var R={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:ka(h,v),tplStateStoreId:s,hostBrick:r};return g.slots={"":{type:"bricks",bricks:u.map((e=>Zn(e,R)))}},g}function Zn(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,y.c)(e,Qn),s=ka(o,n),c=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=>Zn(e,t)))}]})));return(0,a.c)((0,a.c)({},i),{},{properties:Jn(r,t),slots:c},Hn(t,i.ref,c))}var ea="form-renderer.form-renderer",ta=Symbol.for("form.stateStoreId"),ra=["forms.general-form","form.general-form","eo-form"];function na(e,t,r){var{id:n,bricks:o,events:i,context:s,mountPoint:c,instanceId:l}=e,{brick:u,properties:d}=e,f=t.find((e=>e.fieldId===n));if(f){var p=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.c)((0,a.c)((0,a.c)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,a.c)((0,a.c)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,a.c)((0,a.c)((0,a.c)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,a.c)((0,a.c)((0,a.c)({},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.c)((0,a.c)((0,a.c)({},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.c)((0,a.c)((0,a.c)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,a.c)((0,a.c)((0,a.c)({},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.c)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,a.c)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,a.c)((0,a.c)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,a.c)((0,a.c)((0,a.c)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=p.brick),d=(0,a.c)((0,a.c)({},p.properties),d)}var h={brick:u,properties:d,iid:l,slot:c,events:i,context:s,children:aa(o,t,r),[ta]:r};return(0,v.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function aa(e,t,r){if(Array.isArray(e))return e.map((e=>na(e,t,r)))}var oa,ia,sa=["blockingList","node","menuRequests","hasTrackingControls"],ca=["if","permissionsPreCheck"],la=["formData"],ua=["src"],da=["href"];function fa(e,t,r,n,a,o,i){return pa.apply(this,arguments)}function pa(){return pa=(0,o.c)((function*(e,t,r,n,o,i,s){var c=yield function(e,t){return zt.apply(this,arguments)}(t,r),l={blockingList:[],menuRequests:[]};switch(c){case"missed":break;case"unauthenticated":l.unauthenticated=!0;break;default:var u,d=l.route=c.route;l.path=c.match.path;var f=(0,a.c)((0,a.c)({},r),{},{match:c.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=o.concat(d);f.ctxStore.define(d.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==Po||null===(u=Po.checkPermissions)||void 0===u?void 0:u.preCheckPermissionsForBrickOrRoute(d,(e=>St(e,f))));var{preLoadBricks:h}=d;if(Array.isArray(h)&&l.blockingList.push((0,p.loadBricksImperatively)(h,zo())),"redirect"===d.type){var m;if("string"!=typeof(m="string"==typeof d.redirect?yield St(d.redirect,f):(yield ot((0,a.c)({transform:"redirect"},d.redirect),f)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));l.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 St(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(d.menu,f);g&&l.menuRequests.push(g),"routes"===d.type?Ea(l,yield fa(e,d.routes,f,n,v,i)):Ea(l,yield va(e,d.bricks,f,n,v,i)),e.tag===Kr.BRICK&&n.memoizeMenuRequests(d,l.menuRequests)}}return l})),pa.apply(this,arguments)}function va(e,t,r,n,a,o,i,s){return ha.apply(this,arguments)}function ha(){return(ha=(0,o.c)((function*(e,t,r,n,a,o,i,s){var c={blockingList:[],menuRequests:[]},l=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>ma(e,t,r,n,a,o,l.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(o,l.concat(r),t.node,e),Ea(c,t)})),c}))).apply(this,arguments)}function ma(e,t,r,n,a,o){return ga.apply(this,arguments)}function ga(){return ga=(0,o.c)((function*(e,t,r,n,i,s){var c,l,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,f={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;var{if:h,permissionsPreCheck:m}=t,g=(0,y.c)(t,ca);if(function(e){return"string"==typeof e?(0,P.isTrackAll)(e):dt(e)&&(0,P.isTrackAll)(ft(e))}(h))return ma(e,(0,a.c)({brick:":if",dataSource:h,permissionsPreCheck:m,slots:{"":{type:"bricks",bricks:[g]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.c)((0,a.c)({},e),{},{[r]:t[r]})),{})),r,n,i,s,u,d);var w=t[Qt],E=t[ta],k=(0,a.c)((0,a.c)({},r),{},{tplStateStoreId:w,formStateStoreId:E});(0,v.hasOwnProperty)(t,Xt)&&(k.forEachItem=t[Xt],k.forEachIndex=t[Zt]);var{context:I}=t;if(Array.isArray(I)&&I.length>0){var A=xe(k);Pe(A,"Defining context on bricks","check your brick:",t),A||k.ctxStore.define(I,k)}if(k.pendingPermissionsPreCheck.push(null==Po||null===(c=Po.checkPermissions)||void 0===c?void 0:c.preCheckPermissionsForBrickOrRoute(t,(e=>St(e,k)))),!(yield function(e,t){return xt.apply(this,arguments)}(t,k)))return f;var C=t.brick;if(C.startsWith(":")){var R;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(C);var{dataSource:T}=t,O=function(){var r=(0,o.c)((function*(r){var a,o=yield St(T,r),c=":forEach"===C?"":":switch"===C?String(o):o?"":"else",l=ka(t.children,t.slots),f=l&&(0,v.hasOwnProperty)(l,c)&&(null===(a=l[c])||void 0===a?void 0:a.bricks);if(!Array.isArray(f))return{blockingList:[],menuRequests:[]};switch(C){case":forEach":return Array.isArray(o)?function(e,t,r,n,a,o,i,s,c){return ya.apply(this,arguments)}(e,o,f,r,n,i,s,d,u):{blockingList:[],menuRequests:[]};case":if":case":switch":return va(e,f,r,n,i,s,d,u)}}));return function(e){return r.apply(this,arguments)}}(),x=function(){var t=(0,o.c)((function*(t){var r,n=yield O(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Kr.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),_=yield x(k),{onMount:B,onUnmount:L}=null!==(R=t.lifeCycle)&&void 0!==R?R:{},{contextNames:U,stateNames:F}=Mt(T);if(U||F){_.hasTrackingControls=!0;var N=0,j=function(){var t=(0,o.c)((function*(){var t=++N,[r,a,o]=Sa(k),i=yield x(r),c=[...a,...o];if(yield wa(i,r,c),N===t)for(var l of(L&&wr(L,k)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,u,i.node,e),B&&wr(B,r)(new CustomEvent("mount",{detail:{rerender:!0}})),c))l.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),$=(0,b.debounce)(j);if(U)for(var D of U)k.ctxStore.onChange(D,$);if(F)for(var K of F)Le(k,"STATE",': "'.concat(T,'"')).onChange(K,$)}return B&&n.registerArbitraryLifeCycle("onMount",(()=>{wr(B,k)(new CustomEvent("mount",{detail:{rerender:!1}}))})),L&&n.registerArbitraryLifeCycle("onUnmount",(()=>{wr(L,k)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),_}/\.tpl-/.test(C)&&!Be.get(C)&&(yield Ia((0,p.loadBricksImperatively)([C],zo()),"brick",C,n.unknownBricks));var V,W,H=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(Be.get(r))return r}return!!Be.get(e)&&e}(C,null===(l=k.app)||void 0===l?void 0:l.id);if(H){var q,z=null!==(q=d.get(H))&&void 0!==q?q:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(H,'"'));d.set(H,z+1)}else C.includes("-")&&!customElements.get(C)&&(C===ea?customElements.define(ea,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):f.blockingList.push(Ia((0,p.enqueueStableLoadBricks)([C],zo()),"brick",C,n.unknownBricks)));if(C===ea){var G,J=null!==(G=t.properties)&&void 0!==G?G:{};({formData:V}=J),W=(0,y.c)(J,la)}else W=t.properties;var Y=[],Q=function(e,t,r){return(0,v.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:o,stateNames:i,formStateNames:s}=Mt(a);return(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a}),[n,St(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?yt.USE_BRICK:yt.INITIAL})]})):[]}(W,k,Y),X=t[Yt];X&&Q.push(...X);var Z="script"===C;if(Z||"link"===C){var ee=yield Lt(Q);if(Z?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(Z){var{src:ne}=ee,ae=(0,y.c)(ee,ua);yield Ia((0,p.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:oe}=ee;ae=(0,y.c)(ee,da),yield Ia((0,p.loadStyle)(oe,re,ae),"stylesheet",oe,"silent")}return f}}var ie={tag:Kr.BRICK,type:H||C,return:e,slotId:s,events:t.events,runtimeContext:k,portal:t.portal,iid:t.iid,ref:t.ref};f.node=ie;var se=(0,M.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&f.blockingList.push(Ia((0,p.loadProcessorsImperatively)(se,zo()),"processors",[...se].join(", "),n.unknownBricks));var ce=[],le=function(){var e=(0,o.c)((function*(){ie.properties=yield Lt(Q),function(e,t){var r=function(t){var r=()=>{e.element&&Nt(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=Le(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}if(t.formStateNames){var i=Qe(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)}}();ce.push(le()),n.registerBrickLifeCycle(ie,t.lifeCycle);var ue,de=t;H?de=Xn(H,t,ie,Q,n):C===ea&&(de=function(e,t,r,n,o){var i,s,c="string"==typeof e?JSON.parse(e):e,l=(0,b.uniqueId)("form-state-"),u=(0,a.c)((0,a.c)({},r.runtimeContext),{},{formStateStoreId:l});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var d=new Wn("FORM_STATE",void 0,o,l);u.formStateStoreMap.set(l,d),u.formStateStoreScope&&u.formStateStoreScope.push(d);var f=null!==(i=c.context)&&void 0!==i?i:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),d.define(f,u,n);var p=na(c.formSchema,c.fields,l);return ra.includes(p.brick)&&t.events&&(p.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,v.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(p.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,a.c)((0,a.c)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[p]}]}):(0,a.c)((0,a.c)({},t),{},{slots:void 0,children:[p]})}(V,t,ie,Q,n)),de.portal&&(ie.slotId=void 0),H?(delete(ue=(0,a.c)({},k)).forEachItem,delete ue.forEachIndex):ue=k;var fe=function(){var e=(0,o.c)((function*(){var e=ka(de.children,de.slots);if(e){var t=new Map,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var[s,c]=e;if("routes"!==c.type)return va(ie,c.bricks,ue,n,i,s,d);var l=i[i.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(r,s),n.performIncrementalRender(function(){var e=(0,o.c)((function*(e,t){var{homepage:r}=ue.app,{pathname:o}=e;if(!S(r,o)||!i.every((e=>{var n,a;return(n=Gt(e,r,t.pathname))&&(a=Gt(e,r,o))&&(e!==l||(0,b.isEqual)(n.params,a.params))})))return!1;var u,[d,f,p]=Sa((0,a.c)((0,a.c)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),v=!1,h=[];try{if(u=yield fa(ie,c.routes,d,n,i,s,!0),n.reBailout(u))return!0;h=[...f,...p],yield wa(u,d,[d.ctxStore,...h]),yield n.reMergeMenuRequests(c.routes,u.route,u.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var m=n.reCatch(e,ie);if(!m)return!0;({failed:v,output:u}=m),yield n.reMergeMenuRequests(c.routes,u.route,u.menuRequests)}if(n.reRender(s,[],u.node,ie),!v)for(var g of(d.ctxStore.mountAsyncData(u.route),h))g.mountAsyncData();return!0}));return function(t,r){return e.apply(this,arguments)}}())),fa(ie,c.routes,ue,n,i,s)}))),s=(0,a.c)((0,a.c)({},f),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(t.get(r),[],e.node,ie),Ea(s,e)})),s.node&&(ie.child=s.node),Ea(f,(0,a.c)((0,a.c)({},s),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return ce.push(fe()),yield Promise.all(ce),f})),ga.apply(this,arguments)}function ya(){return(ya=(0,o.c)((function*(e,t,r,n,o,i,s,c,l){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,f)=>ma(e,r,(0,a.c)((0,a.c)({},n),{},{forEachItem:t,forEachIndex:u}),o,i,s,l.concat(u*d+f),c&&new Map(c))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&o.memoize(s,l.concat(r),t.node,e),Ea(u,t)})),u}))).apply(this,arguments)}function ba(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function wa(e,t,r){return(0,p.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Sa(e){var t=[],r=[];return[(0,a.c)((0,a.c)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function Ea(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,y.c)(t,sa);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 ka(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,v.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function Ia(e,t,r,n){return"silent"===n?e.catch((e=>{console.error('Load %s "%s" failed:',t,r,e)})):e}function Aa(){if(!oa){if(oa={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){oa.isInIframe=!0;try{if(window.origin===window.parent.origin){oa.isInIframeOfSameSite=!0;var e="/next/"===g(),t=window.parent.location.pathname,r=t.startsWith("/next/");oa.isInIframeOfNext=0==(Number(e)^Number(r)),oa.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),oa.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(oa)}return oa}function Ca(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);Be.define(a,n)}}}function Ra(){return Ra=(0,o.c)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return Ta.apply(this,arguments)}(e)),e.$$fulfilling})),Ra.apply(this,arguments)}function Ta(){return(Ta=(0,o.c)((function*(e){var t;yield null==Po||null===(t=Po.fulfilStoryboard)||void 0===t?void 0:t.call(Po,e),F(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}function Oa(e){var t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}var xa=new WeakMap,Pa=new WeakMap,Ma=new WeakMap,_a=new WeakMap,Ba=new WeakMap,La=new WeakMap,Ua=new WeakMap,Fa=new WeakMap,Na=new WeakMap,ja=new WeakMap,$a=new WeakMap,Da=new WeakMap,Ka=new WeakSet,Va=new WeakSet,Wa=new WeakSet,Ha=new WeakSet;class qa{constructor(e){(0,i.c)(this,Ha),(0,i.c)(this,Wa),(0,i.c)(this,Va),(0,i.c)(this,Ka),(0,c.c)(this,xa,{writable:!0,value:void 0}),(0,c.c)(this,Pa,{writable:!0,value:!1}),(0,c.c)(this,Ma,{writable:!0,value:void 0}),(0,c.c)(this,_a,{writable:!0,value:void 0}),(0,c.c)(this,Ba,{writable:!0,value:void 0}),(0,c.c)(this,La,{writable:!0,value:void 0}),(0,c.c)(this,Ua,{writable:!0,value:new Set}),(0,c.c)(this,Fa,{writable:!0,value:0}),(0,c.c)(this,Na,{writable:!0,value:void 0}),(0,c.c)(this,ja,{writable:!0,value:void 0}),(0,c.c)(this,$a,{writable:!0,value:void 0}),(0,c.c)(this,Da,{writable:!0,value:void 0}),(0,u.c)(this,xa,e);var t=O();window.addEventListener("beforeunload",(e=>{(0,l.c)(this,Ka,za).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,l.c)(this,Ka,za).call(this,{location:e,action:t})))}getRenderId(){return(0,d.c)(this,Na)}getRuntimeContext(){return(0,d.c)(this,Ba)}getRecentApps(){return{currentApp:(0,d.c)(this,ja),previousApp:(0,d.c)(this,$a)}}getNavConfig(){return(0,d.c)(this,Da)}bootstrap(){var e=this;window.AbortController&&(ia=new AbortController,x.http.interceptors.request.use((e=>{var t;return(0,a.c)((0,a.c)({},e),{},{options:(0,a.c)((0,a.c)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:ia.signal})})})));var t=O();(0,u.c)(this,Ma,t.location);var r=0;return t.listen(function(){var t=(0,o.c)((function*(t,n){var o,i,s,c,f,p,v=++r,h={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==(0,d.c)(e,Ma).key&&!1!==(null===(o=(0,d.c)(e,Ma).state)||void 0===o?void 0:o.notify))||(h.key=void 0),((0,m.locationsAreEqual)((0,a.c)((0,a.c)({},(0,d.c)(e,Ma)),h),(0,a.c)((0,a.c)({},t),h))||"POP"!==n&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(f=!0),f||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(f=yield null===(p=(0,d.c)(e,La))||void 0===p?void 0:p.didPerformIncrementalRender(t,(0,d.c)(e,Ma))),r===v)if(f)(0,u.c)(e,Ma,t);else{if(ia&&(ia.abort(),ia=new AbortController),(0,u.c)(e,Ma,t),null===(c=(0,d.c)(e,La))||void 0===c||c.dispatchPageLeave(),"POP"===n&&E(w((0,d.c)(e,xa),t.pathname)))return void window.location.reload();(0,d.c)(e,Pa)?(0,u.c)(e,_a,t):(q("locationChange"),(0,l.c)(e,Wa,Ja).call(e,t).catch(pr))}}));return function(e,r){return t.apply(this,arguments)}}()),(0,l.c)(this,Wa,Ja).call(this,t.location)}}function za(e){var t,r=O(),n=r.getBlockMessage();null===(t=(0,d.c)(this,La))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function Ga(e,t,r){var n,a;if((0,u.c)(this,Fa,(n=(0,d.c)(this,Fa),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)}O().replace(e,t)}function Ja(e){return Ya.apply(this,arguments)}function Ya(){return(Ya=(0,o.c)((function*(e){(0,u.c)(this,Pa,!0);try{yield(0,l.c)(this,Ha,Qa).call(this,e)}finally{if((0,u.c)(this,Pa,!1),(0,d.c)(this,_a)){var t=(0,d.c)(this,_a);(0,u.c)(this,_a,void 0),yield(0,l.c)(this,Wa,Ja).call(this,t)}}}))).apply(this,arguments)}function Qa(e){return Xa.apply(this,arguments)}function Xa(){return Xa=(0,o.c)((function*(e){var t,r,n,i,s=this,c=(0,u.c)(this,Na,(0,b.uniqueId)("render-id-"));tt=new WeakSet,at.clear(),null==Po||null===(t=Po.flowApi)||void 0===t||t.clearCollectWidgetContract(),O().unblock();var f=null==Po||null===(r=Po.pageView)||void 0===r?void 0:r.create(),p=w((0,d.c)(this,xa),e.pathname),v=null===(n=(0,d.c)(this,Ba))||void 0===n?void 0:n.app,h=null==p||null===(i=p.app)||void 0===i?void 0:i.id;window.BOOTSTRAP_UNION_FILE&&h&&h!==(null==v?void 0:v.id)&&function(e){var{appId:t,version:r}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",r))}({appId:h,version:p.app.currentVersion}),null!=p&&p.app&&(yield function(e){return Ra.apply(this,arguments)}(p));var m,g=(0,u.c)(this,ja,null==p?void 0:p.app),y=v&&g?v.id!==g.id:v!==g,S=Do().getFeatureFlags(),E=(0,d.c)(this,La),k=(t,r)=>{null==f||f({status:"redirected"}),(0,d.c)(this,Ua).add(E),(0,l.c)(this,Va,Ga).call(this,t,r,e)},I=()=>{var t=S["sso-enabled"]?"/sso-auth/login":"/auth/login";sr(e),k(t,{from:e})},A=document.querySelector("#main-mount-point"),C=document.querySelector("#portal-mount-point"),R={tag:Kr.ROOT,container:A,createPortal:C},T=()=>{var e;for(var t of(Vr(A),Vr(C),(0,d.c)(this,Ua).add(E),(0,d.c)(this,Ua)))t&&(t.dispatchOnUnmount(),t.dispose());(0,d.c)(this,Ua).clear(),null==Po||null===(e=Po.messageDispatcher)||void 0===e||e.reset(),y&&((0,u.c)(this,$a,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:g}})))};if(te(g&&(ie()[g.id]||g.theme)||"light"),ce("default"),g){var P,M,_,B,L,U;null==Po||null===(P=Po.checkInstalledApps)||void 0===P||P.preCheckInstalledApps(p,(e=>!!Qo(e)));var F={bailout:e=>e.unauthenticated?(I(),!0):e.redirect?(k(e.redirect.path,e.redirect.state),!0):void(0,u.c)(this,Fa,0),mergeMenus:(m=(0,o.c)((function*(e){var t=yield Promise.all(e);(0,u.c)(s,Da,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 m.apply(this,arguments)}),catch:(t,r)=>{if(!lr(t)||window.NO_AUTH_GUARD){if(!(t instanceof x.HttpAbortError)){var n=Do().getMiscSettings().noAuthGuardLoginPath;return lr(t)&&n?void k(n,{from:e}):{failed:!0,output:{node:{tag:Kr.BRICK,type:"div",properties:{textContent:cr(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}(0,d.c)(this,Ua).add(E)}else I()}},N=(0,u.c)(this,La,new sn("page",{routeHelper:F,renderId:c})),j=(0,u.c)(this,Ba,{app:g,location:e,query:new URLSearchParams(e.search),flags:S,sys:(0,a.c)((0,a.c)((0,a.c)({},null==Po||null===(M=Po.auth)||void 0===M?void 0:M.getAuth()),Aa()),{},{settings:{brand:Do().getBrandSettings()}}),ctxStore:new Wn("CTX",void 0,N),pendingPermissionsPreCheck:[null==Po||null===(_=Po.checkPermissions)||void 0===_?void 0:_.preCheckPermissions(p)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,u.c)(this,Da,void 0),Ca(p),ye(null===(B=p.meta)||void 0===B?void 0:B.functions,g),null==Po||null===(L=Po.flowApi)||void 0===L||L.collectContract(null===(U=p.meta)||void 0===U?void 0:U.contracts);var $,D=!1,K=[];try{if($=yield fa(R,function(e){if(window.parent===window)return e;var t=e,r=(0,b.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,b.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)]}(p.routes),j,N,[]),F.bailout($))return;K=ba(j),yield wa($,j,K),yield F.mergeMenus($.menuRequests),N.setInitialMenuRequests($.menuRequests)}catch(e){console.error("Router failed:",e);var V=F.catch(e,R);if(!V)return;({failed:D,output:$}=V)}if(R.child=$.node,T(),$.route&&"routes"!==$.route.type||D){if(D||N.dispatchBeforePageLoad(),ae(),ue(),Oa(null==g?void 0:g.uiVersion),Wr(R),window.scrollTo(0,0),D)null==f||f({status:"failed"});else{for(var W of(N.dispatchPageLoad(),N.dispatchAnchorLoad(),N.dispatchOnMount(),N.initializeScrollIntoView(),N.initializeMediaChange(),N.initializeMessageDispatcher(),K))W.mountAsyncData();null==f||f({status:"ok",path:$.path,pageTitle:document.title})}return void q("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=Po&&Po.auth&&!Po.auth.isLoggedIn())return void I();T()}ae(),ue();var H={tag:Kr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:R};R.child=H,Wr(R),window.scrollTo(0,0),null==f||f({status:"not-found"}),q("rendered")})),Xa.apply(this,arguments)}var Za="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function eo(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function to(e){return e<=1?"".concat(100*Number(e),"%"):e}function ro(e){return 1===e.length?"0"+e:String(e)}function no(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ao(e){return oo(e)/255}function oo(e){return parseInt(e,16)}var io={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function so(e){var t,r,n,a={r:0,g:0,b:0},o=1,i=null,s=null,c=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(io[e])e=io[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=fo.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=fo.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=fo.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=fo.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=fo.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=fo.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=fo.hex8.exec(e))?{r:oo(r[1]),g:oo(r[2]),b:oo(r[3]),a:ao(r[4]),format:t?"name":"hex8"}:(r=fo.hex6.exec(e))?{r:oo(r[1]),g:oo(r[2]),b:oo(r[3]),format:t?"name":"hex"}:(r=fo.hex4.exec(e))?{r:oo(r[1]+r[1]),g:oo(r[2]+r[2]),b:oo(r[3]+r[3]),a:ao(r[4]+r[4]),format:t?"name":"hex8"}:!!(r=fo.hex3.exec(e))&&{r:oo(r[1]+r[1]),g:oo(r[2]+r[2]),b:oo(r[3]+r[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(po(e.r)&&po(e.g)&&po(e.b)?(t=e.r,r=e.g,n=e.b,a={r:255*eo(t,255),g:255*eo(r,255),b:255*eo(n,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):po(e.h)&&po(e.s)&&po(e.v)?(i=to(e.s),s=to(e.v),a=function(e,t,r){e=6*eo(e,360),t=eo(t,100),r=eo(r,100);var n=Math.floor(e),a=e-n,o=r*(1-t),i=r*(1-a*t),s=r*(1-(1-a)*t),c=n%6;return{r:255*[r,i,o,o,s,r][c],g:255*[s,r,r,i,o,o][c],b:255*[o,o,s,r,r,i][c]}}(e.h,i,s),l=!0,u="hsv"):po(e.h)&&po(e.s)&&po(e.l)&&(i=to(e.s),c=to(e.l),a=function(e,t,r){var n,a,o;if(e=eo(e,360),t=eo(t,100),r=eo(r,100),0===t)a=r,o=r,n=r;else{var i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;n=no(s,i,e+1/3),a=no(s,i,e),o=no(s,i,e-1/3)}return{r:255*n,g:255*a,b:255*o}}(e.h,i,c),l=!0,u="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(o=e.a)),o=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(o),{ok:l,format:e.format||u,r:Math.min(255,Math.max(a.r,0)),g:Math.min(255,Math.max(a.g,0)),b:Math.min(255,Math.max(a.b,0)),a:o}}var co="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),lo="[\\s|\\(]+(".concat(co,")[,|\\s]+(").concat(co,")[,|\\s]+(").concat(co,")\\s*\\)?"),uo="[\\s|\\(]+(".concat(co,")[,|\\s]+(").concat(co,")[,|\\s]+(").concat(co,")[,|\\s]+(").concat(co,")\\s*\\)?"),fo={CSS_UNIT:new RegExp(co),rgb:new RegExp("rgb"+lo),rgba:new RegExp("rgba"+uo),hsl:new RegExp("hsl"+lo),hsla:new RegExp("hsla"+uo),hsv:new RegExp("hsv"+lo),hsva:new RegExp("hsva"+uo),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function po(e){return Boolean(fo.CSS_UNIT.exec(String(e)))}var vo=2,ho=.16,mo=.05,go=.05,yo=.15,bo=5,wo=4,So=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Eo(e){var t=function(e,t,r){e=eo(e,255),t=eo(t,255),r=eo(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),o=0,i=n,s=n-a,c=0===n?0:s/n;if(n===a)o=0;else{switch(n){case e:o=(t-r)/s+(t<r?6:0);break;case t:o=(r-e)/s+2;break;case r:o=(e-t)/s+4}o/=6}return{h:o,s:c,v:i}}(e.r,e.g,e.b);return{h:360*t.h,s:t.s,v:t.v}}function ko(e){var t=e.r,r=e.g,n=e.b;return"#".concat(function(e,t,r,n){var a=[ro(Math.round(e).toString(16)),ro(Math.round(t).toString(16)),ro(Math.round(r).toString(16))];return a.join("")}(t,r,n))}function Io(e,t,r){var n;return(n=Math.round(e.h)>=60&&Math.round(e.h)<=240?r?Math.round(e.h)-vo*t:Math.round(e.h)+vo*t:r?Math.round(e.h)+vo*t:Math.round(e.h)-vo*t)<0?n+=360:n>=360&&(n-=360),n}function Ao(e,t,r){return 0===e.h&&0===e.s?e.s:((n=r?e.s-ho*t:t===wo?e.s+ho:e.s+mo*t)>1&&(n=1),r&&t===bo&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function Co(e,t,r){var n;return(n=r?e.v+go*t:e.v-yo*t)>1&&(n=1),Number(n.toFixed(2))}function Ro(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=so(e),a=bo;a>0;a-=1){var o=Eo(n),i=ko(so({h:Io(o,a,!0),s:Ao(o,a,!0),v:Co(o,a,!0)}));r.push(i)}r.push(ko(n));for(var s=1;s<=wo;s+=1){var c=Eo(n),l=ko(so({h:Io(c,s),s:Ao(c,s),v:Co(c,s)}));r.push(l)}return"dark"===t.theme?So.map((function(e){var n,a,o,i=e.index,s=e.opacity;return ko((n=so(t.backgroundColor||"#141414"),o=100*s/100,{r:((a=so(r[i])).r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b}))})):r}var To,Oo,xo,Po,Mo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},_o={},Bo={};function Lo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Uo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Fo(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function No(e,t,r){return"dark"===t?Ro(e,{theme:t,backgroundColor:r})[5]:e}function jo(e){var t=[];if(["light","dark"].forEach((r=>{if(e[r])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Uo:Lo)("string"==typeof(r=t)?" --color-brand: ".concat(r,";\n"):[" --color-brand: ".concat(r.default,";")," --color-brand-hover: ".concat(r.hover,";")," --color-brand-active: ".concat(r.active,";"),""].join("\n"));var r}(r,e[r]));break;case"baseColors":t.push(function(e,t,r){return("dark"===e?Uo:Lo)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[r,n]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(r),n.map(((e,n)=>[" --palette-".concat(r,"-").concat(n+1,"-channel: ").concat(Fo(e),";")].concat("dark"===t?[]:" --palette-".concat(r,"-").concat(n+1,": rgb(var(--palette-").concat(r,"-").concat(n+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,r){return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[n,Ro(a,"dark"===t?{theme:t,backgroundColor:r}:void 0)]})))}(t,e,r),e),"\n").concat(function(e,t,r){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((n=>{var[a,o]=n;return[" --theme-".concat(a,"-color-rgb-channel: ").concat(Fo(No(t[o],e,r)),";"),..."dark"===e?[]:[" --theme-".concat(a,"-color: var(--palette-").concat(o,"-6);")," --theme-".concat(a,"-border-color: var(--palette-").concat(o,"-3);")]," --theme-".concat(a,"-background: var(--palette-").concat(o,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,r)))}(r,e[r],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Uo:Lo)(function(e){return Object.entries(e).map((e=>{var[t,r]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(r,";")})).concat("").join("\n")}(t))}(r,e[r]))}})),t.length>0){var r=document.createElement("style");return r.textContent=t.join("\n\n"),document.head.appendChild(r),()=>{r.remove()}}}function $o(e){if(To)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===K){var r=t.payload;switch(null==r?void 0:r.type){case V:H=r.active;break;case W:$=r.panel}}})),Po=null==e?void 0:e.hooks,(0,f.initializeI18n)(ar,or),h.locale(f.i18n.language),f.i18n.on("languageChanged",(()=>{h.locale(f.i18n.language)})),T(),To=new Ho}Object.keys(Mo).forEach((function(e){_o[e]=Ro(Mo[e]),_o[e].primary=_o[e][5],Bo[e]=Ro(Mo[e],{theme:"dark",backgroundColor:"#141414"}),Bo[e].primary=Bo[e][5]})),_o.red,_o.volcano,_o.gold,_o.orange,_o.yellow,_o.lime,_o.green,_o.cyan,_o.blue,_o.geekblue,_o.purple,_o.magenta,_o.grey;var Do=function(){var e=R();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 To},Ko=new WeakMap,Vo=new WeakMap,Wo=new WeakSet;class Ho{constructor(){(0,i.c)(this,Wo),(0,c.c)(this,Ko,{writable:!0,value:!1}),(0,c.c)(this,Vo,{writable:!0,value:!1}),(0,s.c)(this,"version",3)}initialize(e){var t;if((0,d.c)(this,Ko))throw new Error("The runtime cannot be initialized more than once");(0,u.c)(this,Ko,!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;f.i18n.addResourceBundle(r,e,n)})),r.localeName=f.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{f.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,v.isObject)(e.settings)&&(0,v.deepFreeze)(e.settings),e.brickPackages&&(0,v.deepFreeze)(e.brickPackages)}(e),Oo=e;var r,{notification:n,dialog:o}=(0,l.c)(this,Wo,qo).call(this);!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{dr=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{Jt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?jo((0,a.c)({type:"brandColor"},e.brandColor)):e.baseColors?jo((0,a.c)({type:"baseColors"},e.baseColors)):e.variables&&jo((0,a.c)({type:"variables"},e.variables)))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}bootstrap(e){var t=this;return(0,o.c)((function*(){if(e&&t.initialize(e),(0,d.c)(t,Vo))throw new Error("The runtime cannot be bootstrapped more than once");(0,u.c)(t,Vo,!0),xo=new qa(Oo.storyboards),yield xo.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=xo)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=xo)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Ye(e,t)}getFeatureFlags(){var e,t;return(0,a.c)((0,a.c)((0,a.c)({},null===(e=Oo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=xo)||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.c)((0,a.c)({},null===(e=Oo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=xo)||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.c)({base_title:"DevOps 管理专家"},null===(e=Oo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,a.c)({columns:7,rows:4},null===(e=Oo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=Oo)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=Oo)||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=xo)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,p.loadBricksImperatively)(e,zo())}}function qo(){var e,t;return null!==(e=null===(t=Oo)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function zo(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=Oo)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:Za)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function Go(){var e;return null===(e=xo)||void 0===e?void 0:e.getRenderId()}function Jo(){var e;return null===(e=xo)||void 0===e?void 0:e.getRuntimeContext()}function Yo(e){var t;return null===(t=Oo)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Qo(e){var t;return null===(t=Yo(e))||void 0===t?void 0:t.app}function Xo(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==Po||null===(e=Po.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Zo(){var e;return null==Po||null===(e=Po.auth)||void 0===e?void 0:e.getAuth()}function ei(){var e,t;return null==Po||null===(e=Po.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function ti(){var e;return null==Po||null===(e=Po.auth)||void 0===e?void 0:e.isLoggedIn()}function ri(e,t,r){return ni.apply(this,arguments)}function ni(){return(ni=(0,o.c)((function*(e,t,r){return st(yield Ze(e),e,"resolve",t,r)}))).apply(this,arguments)}function ai(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,c,l=!1;return{render(r){var u=arguments;return(0,o.c)((function*(){var{theme:o,uiVersion:d,context:f,functions:p,templates:h,i18n:m}=u.length>1&&void 0!==u[1]?u[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");var g=[].concat(r),y=s,w=(0,b.uniqueId)("render-id-");s=new sn(n,{unknownBricks:a,renderId:w});var S={ctxStore:new Wn("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},E={tag:Kr.ROOT,container:e,createPortal:t};if("page"===n){var k;!function(e,t){function r(e){if((0,v.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(var[t,a]of Object.entries(e))(0,v.isObject)(a)&&"useBrick"===t?Array.isArray(a)?a.forEach((e=>n(e,!0))):n(a,!0):r(a)}function n(e,a){a&&(e[yn]=t);var{properties:o,slots:i,children:s}=e,c=ka(s,i);for(var l of(r(o),Object.values(null!=c?c:{})))for(var u of null!==(d=l.bricks)&&void 0!==d?d:[]){var d;n(u,a)}}for(var a of e)n(a)}(g,S),te(null!=o?o:"light"),ce("default"),Oa(d);var I={id:"demo",homepage:"/demo"};S.app=I;var A={app:I,meta:{i18n:m,customTemplates:h}};null===(k=c)||void 0===k||k(),c=F(A),Ca(A),ye(p,I)}S.ctxStore.define(f,S);var C,R=!1,T=[];try{C=yield va(E,g,S,s,[]),T=ba(S),yield wa(C,S,T)}catch(e){R=!0,C={node:{tag:Kr.BRICK,type:"div",properties:{textContent:cr(e)},return:E,runtimeContext:null},blockingList:[],menuRequests:[]}}if(E.child=C.node,null==y||y.dispatchOnUnmount(),null==y||y.dispose(),Vr(e),i&&Vr(i),"page"===n&&(R||s.dispatchBeforePageLoad(),ae(),ue()),Wr(E),"page"===n&&window.scrollTo(0,0),!R){for(var O of T)O.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){l||(l=!0,Vr(e),i&&(Vr(i),r||i.remove()))}}}}}]);
2
+ //# sourceMappingURL=3322.bca97c4c.js.map