@next-core/brick-container 3.6.8 → 3.6.9
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/core.58a13236.js +2 -0
- package/dist/core.58a13236.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/main.41e5243c.js +2 -0
- package/dist/{main.965b28bf.js.map → main.41e5243c.js.map} +1 -1
- package/dist/{polyfill.b4c2b5c5.js → polyfill.adf6af71.js} +1 -1
- package/dist/preview/core.f19a1eec.js +1 -0
- package/dist/preview/core.f19a1eec.js.map +1 -0
- package/dist/preview/index.html +1 -1
- package/dist/preview/main.def64c00.js +1 -0
- package/dist/preview/main.def64c00.js.map +1 -0
- package/package.json +9 -9
- package/dist/core.48ab8f99.js +0 -2
- package/dist/core.48ab8f99.js.map +0 -1
- package/dist/main.965b28bf.js +0 -2
- package/dist/preview/core.52a717b4.js +0 -1
- package/dist/preview/core.52a717b4.js.map +0 -1
- package/dist/preview/main.cbc7a0d9.js +0 -1
- package/dist/preview/main.cbc7a0d9.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_core_brick_container=self.webpackChunk_next_core_brick_container||[]).push([[321],{3350:(e,t,r)=>{r.r(t);var n=r(4795),a=r(3028),i=r(1181),o=r(9516),s=r(178),c=r(510);r(5745),XMLHttpRequest.prototype.origOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.origOpen.apply(this,t);var n=c.auth.getAuth().csrfToken;n&&this.setRequestHeader("X-CSRF-Token",n)};var l=r(1989);function u(){return d.apply(this,arguments)}function d(){return(d=(0,n.Z)((function*(){if(!window.NO_AUTH_GUARD){var e=yield(0,l.u)();e.loggedIn&&c.auth.authenticate(e)}}))).apply(this,arguments)}var p=r(2159),f=r(9397),v=r(9505),h=r(8843),m=r(9686),g=r(5178),y=r(9169),b=r(3934);function w(e,t,r){return{get(n){if(t)return"".concat((0,i.getBasePath)(),"api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/").concat(n);var a=window.APP_ROOT?"".concat(window.APP_ROOT,"-/"):"";return window.APP_ID&&window.APP_ID!==e&&(a=a.replace(new RegExp("(^|/)".concat((0,g.escapeRegExp)(window.APP_ID),"/")),"$1".concat(e,"/")).replace(/\/\d+\.\d+\.\d+\//,"/".concat(r,"/"))),a.startsWith("/")||(a=(0,i.getBasePath)()+a),"".concat(a,"micro-apps/").concat(e,"/images/").concat(n)}}}var E=["feature_flags"],S=["featureFlags","misc"];function k(){return(k=(0,n.Z)((function*(){var e=[o.http.get(window.BOOTSTRAP_FILE),o.http.get("".concat(window.APP_ROOT,"conf.yaml"),{responseType:"text"}),(0,v.I)().catch((e=>{console.warn("request runtime api from api-gateway failed: ",e,", something might went wrong running standalone micro app")}))];if(!window.NO_AUTH_GUARD){var t,r=window.APP_ID||(window.APP_ROOT&&(t=window.APP_ROOT.match(/^(?:(?:\/next)?\/)?sa-static\/([^/]+)\/versions\//))?t[1]:null);r&&Z(r)}var[n,i,s]=yield Promise.all(e);return function(e,t){var r;try{r=t?(0,y.safeLoad)(t,{schema:y.JSON_SCHEMA,json:!0}):void 0}catch(e){throw console.error("Parse conf.yaml failed",e),new Error("Invalid conf.yaml")}if(r){var{sys_settings:n,user_config:i,user_config_by_apps:o}=r;if(n){var{feature_flags:s}=n,c=(0,p.Z)(n,E);e.settings=(0,a.Z)({featureFlags:s},c)}if(i&&1===e.storyboards.length)e.storyboards[0].app.userConfig=i;else if(o)for(var{app:l}of e.storyboards)(0,m.hasOwnProperty)(o,l.id)&&(l.userConfig=o[l.id])}}(n,i),function(e,t){var r;if(t){var{featureFlags:n,misc:i}=t,o=(0,p.Z)(t,S),s=null!==(r=e.settings)&&void 0!==r?r:e.settings={};s.featureFlags=(0,a.Z)((0,a.Z)({},s.featureFlags),n),s.misc=(0,a.Z)((0,a.Z)({},s.misc),i),Object.assign(s,o)}}(n,null==s?void 0:s.settings),n}))).apply(this,arguments)}var A=new Map;function Z(e){return I.apply(this,arguments)}function I(){return(I=(0,n.Z)((function*(e){if(A.has(e))return A.get(e);var t=(0,b.z)(e).catch((e=>{console.warn("request standalone runtime api from micro-app-standalone failed: ",e,", something might went wrong running standalone micro app")}));return A.set(e,t),t}))).apply(this,arguments)}function P(){return(P=(0,n.Z)((function*(e){if(window.STANDALONE_MICRO_APPS){if(!window.NO_AUTH_GUARD){var t=yield Z(e.app.id);if(t){var{userConfig:r,injectMenus:n}=t;e.app.userConfig=(0,a.Z)((0,a.Z)({},e.app.userConfig),r),function(e){if(Array.isArray(e))for(var t of e)t.overrideApp&&O(t.overrideApp)}(n),e.meta=(0,a.Z)((0,a.Z)({},e.meta),{},{injectMenus:n})}}}else{var{routes:i,meta:o,app:s}=yield(0,h.i)(e.app.id,{});Object.assign(e,{routes:i,meta:o,app:(0,a.Z)((0,a.Z)({},e.app),s)})}!function(e){var t;if(e.app.menuIcon&&"imgSrc"in e.app.menuIcon&&null!==(t=e.app.menuIcon.imgSrc)&&void 0!==t&&t.startsWith("api/")){var r=e.app.menuIcon.imgSrc.split("/"),n=r[r.length-1],a=w(e.app.id,e.app.isBuildPush,e.app.currentVersion).get(n);e.app.menuIcon.imgSrc=a}}(e),O(e.app)}))).apply(this,arguments)}function O(e){e.config=(0,m.deepFreeze)((0,g.merge)({},e.defaultConfig,e.userConfig))}var C=r(3913),x=!1,T=/^https?:\/\/localhost(?:$|:)/;function R(){return(R=(0,n.Z)((function*(e,t){if(x||!t)return!1;if("failed"===(yield e))return!1;x=!0;var r=t===location.origin||T.test(t)||T.test(location.origin);if(!r){var{allowedPreviewFromOrigins:n}=(0,i.getRuntime)().getMiscSettings();Array.isArray(n)&&(r=n.some((e=>e===t))),r||console.error("Preview is disallowed, from origin: ".concat(t,", while allowing: ").concat(JSON.stringify(n)))}return r}))).apply(this,arguments)}var B=["agent"];function M(e,t){var r;null!==(r=t.options)&&void 0!==r&&null!==(r=r.interceptorParams)&&void 0!==r&&r.ignoreLoadingBar||window.dispatchEvent(new Event(e))}c.analytics.initialize("".concat((0,i.getBasePath)(),"api/gateway/data_exchange.store.ClickHouseInsertData/api/v1/data_exchange/frontend_stat")),o.http.interceptors.request.use(c.analytics.http.onRequest),o.http.interceptors.request.use((e=>{var t,r;M("request.start",e);var n=new Headers((null===(t=e.options)||void 0===t?void 0:t.headers)||{});n.set("lang",null!==(r=s.i18n.resolvedLanguage)&&void 0!==r?r:s.i18n.language);var{csrfToken:i}=c.auth.getAuth();i&&n.set("X-CSRF-Token",i);var o=(()=>{for(var e="",t=0;t<16;t+=1)e+="0123456789abcdef"[Math.floor(16*Math.random())];return e})();return n.set("X-B3-Traceid","ffffffffffffffff".concat(o)),n.set("X-B3-Spanid",o),n.set("X-B3-Sampled","1"),(0,a.Z)((0,a.Z)({},e),{},{options:(0,a.Z)((0,a.Z)({},e.options),{},{headers:n})})})),o.http.interceptors.response.use((function(e,t){return M("request.end",t),e}),(function(e,t){return M("request.end",t),Promise.reject(e)})),o.http.interceptors.response.use(c.analytics.http.onResponse,c.analytics.http.onResponseError);var _=document.querySelector("#global-loading-bar");_.classList.add("rendered");var L=!1,F=0;function U(){var e=F>0;e!==L&&(L=e,_.classList[e?"add":"remove"]("loading"))}window.addEventListener("request.start",(()=>{F++,U()})),window.addEventListener("request.end",(()=>{F>0&&(F--,U())}));var N=(0,i.createRuntime)({hooks:{auth:c.auth,fulfilStoryboard:function(e){return P.apply(this,arguments)},checkPermissions:c.checkPermissions,flowApi:c.flowApi,checkInstalledApps:c.checkInstalledApps,menu:c.menu,images:{imagesFactory:w,widgetImagesFactory:function(e,t){return{get(r){var n;return"".concat(null!==(n=window.PUBLIC_ROOT)&&void 0!==n?n:"","bricks/").concat(e,"/").concat(window.PUBLIC_ROOT_WITH_VERSION&&t?"".concat(t,"/"):"","dist/assets/").concat(r)}}}},messageDispatcher:c.messageDispatcher,pageView:c.analytics.pageView}});function j(){return(j=(0,n.Z)((function*(){try{var[,e]=yield Promise.all([u(),window.STANDALONE_MICRO_APPS?function(){return k.apply(this,arguments)}():(0,f.S)({appFields:"defaultConfig,userConfig,locales,name,homepage,id,currentVersion,installStatus,internal,status,icons,standaloneMode",ignoreTemplateFields:"templates",ignoreBrickFields:"bricks,processors,providers,editors"})]);return yield N.bootstrap(e),"ok"}catch(e){return console.error("bootstrap failed:",e),document.body.classList.add("bootstrap-error"),document.querySelector("#main-mount-point").textContent="bootstrap failed: ".concat((0,i.httpErrorToString)(e)),"failed"}}))).apply(this,arguments)}var D=function(){return j.apply(this,arguments)}();window.parent!==window&&function(e){var t=function(){var r=(0,n.Z)((function*(r){var{data:n,origin:a}=r,i=function(e){return"preview-container"===(null==e?void 0:e.sender)&&"start-preview"===e.type}(n),o=function(e){return"ui-test-preview"===(null==e?void 0:e.channel)&&"initialize"===e.type}(n);if(i||o){window.removeEventListener("message",t);var s=yield function(e,t){return R.apply(this,arguments)}(e,a);if(s){var c,l;if(i){var u=n.options;({agent:c}=u),l=(0,p.Z)(u,B)}else({agent:c,options:l}=n.payload);yield(0,C.loadBricksImperatively)([c.brick],[c.pkg]);var d=document.createElement(c.brick);yield d.resolve(a,l)}}}));return function(e){return r.apply(this,arguments)}}();window.addEventListener("message",t)}(D)},6919:(e,t,r)=>{r.r(t),r.d(t,{cook:()=>F,isEvaluable:()=>z,isTrackAll:()=>G,precook:()=>D,precookFunction:()=>$,preevaluate:()=>H,shouldAllowRecursiveEvaluations:()=>K});var n=r(6666);class a{constructor(){(0,n.Z)(this,"VariableEnvironment",void 0),(0,n.Z)(this,"LexicalEnvironment",void 0),(0,n.Z)(this,"Function",void 0)}}class i{constructor(e){(0,n.Z)(this,"OuterEnv",void 0),(0,n.Z)(this,"bindingMap",new Map),this.OuterEnv=e}HasBinding(e){return this.bindingMap.has(e)}CreateMutableBinding(e,t){return this.bindingMap.set(e,{mutable:!0,deletable:t}),h(void 0)}CreateImmutableBinding(e,t){return this.bindingMap.set(e,{strict:t}),h(void 0)}InitializeBinding(e,t){var r=this.bindingMap.get(e);return Object.assign(r,{initialized:!0,value:t}),h(void 0)}SetMutableBinding(e,t,r){var n=this.bindingMap.get(e);if(!n.initialized)throw new ReferenceError("".concat(e," is not initialized"));if(!n.mutable)throw new TypeError("Assignment to constant variable");return n.value=t,h(void 0)}GetBindingValue(e,t){var r=this.bindingMap.get(e);if(!r.initialized)throw new ReferenceError("".concat(e," is not initialized"));return r.value}}class o extends i{}class s extends i{}var c=Symbol.for("SourceNode"),l=Symbol.for("FormalParameters"),u=Symbol.for("ECMAScriptCode"),d=Symbol.for("Environment"),p=Symbol.for("IsConstructor");class f{constructor(e,t,r){(0,n.Z)(this,"Base",void 0),(0,n.Z)(this,"ReferenceName",void 0),(0,n.Z)(this,"Strict",void 0),this.Base=e,this.ReferenceName=t,this.Strict=r}}class v{constructor(e,t){(0,n.Z)(this,"Type",void 0),(0,n.Z)(this,"Value",void 0),this.Type=e,this.Value=t}}function h(e){return new v("normal",e)}var m=Symbol("empty completion");function g(e){var t=new Set,r=e=>{if(Array.isArray(e))for(var n of e)r(n);else if(e)switch(e.type){case"Identifier":return void t.add(e.name);case"VariableDeclaration":return r(e.declarations);case"VariableDeclarator":case"FunctionDeclaration":return r(e.id);case"ArrayPattern":return r(e.elements);case"AssignmentPattern":return r(e.left);case"ObjectPattern":return r(e.properties);case"Property":return r(e.value);case"RestElement":return r(e.argument)}};return r(e),Array.from(t)}function y(e){var t=e=>{if(Array.isArray(e))return e.some(t);if(e)switch(e.type){case"ArrayPattern":return t(e.elements);case"AssignmentPattern":return!0;case"ObjectPattern":return t(e.properties);case"Property":return e.computed||t(e.value);case"RestElement":return t(e.argument)}};return t(e)}function b(e,t){var r=[],n={var:t.var},a=(e,t)=>{if(Array.isArray(e))for(var i of e)a(i,t);else if(e){switch(e.type){case"FunctionDeclaration":return void(Number(!t.var)^Number(t.topLevel)&&r.push(e));case"VariableDeclaration":return void(Number(!t.var)^Number("var"===e.kind)&&r.push(e));case"SwitchCase":return void a(e.consequent,n);case"CatchClause":return void a(e.body,n)}if(t.var)switch(e.type){case"BlockStatement":case"DoWhileStatement":case"WhileStatement":return void a(e.body,n);case"IfStatement":return a(e.consequent,n),void a(e.alternate,n);case"ForStatement":return a(e.init,n),void a(e.body,n);case"ForInStatement":case"ForOfStatement":return a(e.left,n),void a(e.body,n);case"SwitchStatement":return void a(e.cases,n);case"TryStatement":return a(e.block,n),a(e.handler,n),void a(e.finalizer,n)}}};return a(e,t),r}function w(e){return"unresolvable"!==e.Base&&!(e.Base instanceof i)}function E(e,t){return e.Base.InitializeBinding(e.ReferenceName,t)}function S(e,t,r){if(null==t)return e;var n=Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t));for(var a of n)if(!r.has(a)){var i=Object.getOwnPropertyDescriptor(t,a);null!=i&&i.enumerable&&(e[a]=t[a])}return e}function k(e,t){var r="const"===e.kind;for(var n of g(e))r?t.CreateImmutableBinding(n,!0):t.CreateMutableBinding(n,!1)}function A(e){return"normal"===e.Type||"continue"==e.Type}function Z(e,t){return e.Value!==m?e:new v(e.Type,t)}function I(e){if(e instanceof v&&(e=e.Value),!(e instanceof f))return e;if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof i?e.Base.GetBindingValue(e.ReferenceName,e.Strict):e.Base[e.ReferenceName]}function P(e){return"symbol"==typeof e?e:String(e)}function O(e,t){return e[t]}function C(e,t){if("unresolvable"===e.Base)throw new ReferenceError("".concat(e.ReferenceName," is not defined"));return e.Base instanceof i?e.Base.SetMutableBinding(e.ReferenceName,t,e.Strict):(e.Base[e.ReferenceName]=t,h(void 0))}function x(e){if(t=e,!(Array.isArray(t)||null!=t&&"function"==typeof t[Symbol.iterator]))throw new TypeError("".concat(typeof e," is not iterable"));var t;return e[Symbol.iterator]()}function T(e){if(null==e)throw new TypeError("Cannot destructure properties of undefined or null")}function R(e,t,r){return e?e.HasBinding(t)?new f(e,t,r):R(e.OuterEnv,t,r):new f("unresolvable",t,r)}function B(e,t,r){switch(t){case"+":return e+r;case"-":return e-r;case"/":return e/r;case"%":return e%r;case"*":return e*r;case"**":return e**r;case"==":return e==r;case"===":return e===r;case"!=":return e!=r;case"!==":return e!==r;case">":return e>r;case"<":return e<r;case">=":return e>=r;case"<=":return e<=r}throw new SyntaxError("Unsupported binary operator `".concat(t,"`"))}var M=new WeakSet([Function,Object,Function.prototype,Object.prototype,function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}()]);function _(e){if(M.has(e))throw new TypeError("Cannot access reserved objects such as `Function`.")}var L=new WeakSet([Array,Map,Set,URLSearchParams,WeakMap,WeakSet,RegExp]);function F(e,t){var r,{rules:n,globalVariables:i={},hooks:M={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},F="FunctionDeclaration"!==e.type,U=new o(null),N=new a;N.VariableEnvironment=U,N.LexicalEnvironment=U;var j=[N];for(var[D,V]of Object.entries(i))U.CreateImmutableBinding(D,!0),U.InitializeBinding(D,V);var W=new WeakMap;function q(e,r){var n,a,i;switch(null===(n=M.beforeEvaluate)||void 0===n||n.call(M,e),e.type){case"ArrayExpression":var s=[];for(var c of e.elements)if(c)if("SpreadElement"===c.type){var l=I(q(c.argument));s.push(...l)}else s.push(I(q(c)));else s.length+=1;return h(s);case"ArrowFunctionExpression":return de(e),h(ie(e,$().LexicalEnvironment,!1));case"BinaryExpression":var u=I(q(e.left)),d=q(e.right).Value,y=I(d);if(F&&"|>"===e.operator){if("function"!=typeof y){var b=t.substring(e.right.start,e.right.end);throw new TypeError("".concat(b," is not a function"))}var O;return d instanceof f&&w(d)&&(O=d.Base),h(y.call(O,u))}return h(B(u,e.operator,y));case"CallExpression":var T=q(e.callee,r).Value,R=I(T);return null==R&&(e.optional||null!=r&&r.skipped)?(r.skipped=!0,h(void 0)):(_(R),te(R,T,e.arguments,e.callee));case"ChainExpression":return q(e.expression,{});case"ConditionalExpression":return h(I(q(I(q(e.test))?e.consequent:e.alternate)));case"Identifier":return h(H(e.name));case"Literal":if(e.regex){if(null===e.value)throw new SyntaxError("Invalid regular expression: ".concat(e.raw));if(e.regex.flags.includes("u"))throw new SyntaxError("Unsupported unicode flag in regular expression: ".concat(e.raw))}return h(e.value);case"LogicalExpression":var U=I(q(e.left));switch(e.operator){case"&&":return h(U&&I(q(e.right)));case"||":return h(U||I(q(e.right)));case"??":return h(null!=U?U:I(q(e.right)));default:throw new SyntaxError("Unsupported logical operator '".concat(e.operator,"'"))}case"MemberExpression":var N=I(q(e.object,r).Value);if(null==N&&(e.optional||null!=r&&r.skipped))return r.skipped=!0,h(void 0);_(N);var j=e.computed?function(e,t,r){var n=P(I(q(t)));return new f(e,n,!0)}(N,e.property):function(e,t,r){var n=t.name;return new f(e,n,!0)}(N,e.property);return _(j),h(j);case"NewExpression":return function(e,r){var n=I(q(e)),a=re(r);if("function"!=typeof n||!1===n[p]){var i=t.substring(e.start,e.end);throw new TypeError("".concat(i," is not a constructor"))}if(!function(e){return L.has(e)||e===Date}(n)){var o=t.substring(e.start,e.end);throw new TypeError("".concat(o," is not an allowed constructor"))}return h(new n(...a))}(e.callee,e.arguments);case"ObjectExpression":var D={};for(var V of e.properties)if("SpreadElement"===V.type)S(D,I(q(V.argument)),new Set);else{if("init"!==V.kind)throw new SyntaxError("Unsupported object getter/setter");var W=V.computed||"Identifier"!==V.key.type?se(V.key):V.key.name;if("__proto__"===W)throw new TypeError("Setting '__proto__' property is not allowed");D[W]=I(q(V.value))}return h(D);case"SequenceExpression":var J;for(var X of e.expressions)J=h(I(q(X)));return J;case"TemplateLiteral":var Q=[e.quasis[0].value.cooked],ae=0;for(var ce of e.expressions){var le=I(q(ce));Q.push(String(le)),Q.push(e.quasis[ae+=1].value.cooked)}return h(Q.join(""));case"TaggedTemplateExpression":var ue=q(e.tag).Value,pe=I(ue);return _(pe),te(pe,ue,e.quasi,e.tag);case"UnaryExpression":var fe=q(e.argument).Value;if(!F&&"delete"===e.operator){if(!(fe instanceof f))return h(!0);if(w(fe))return h(delete fe.Base[fe.ReferenceName])}return"typeof"===e.operator?fe instanceof f&&"unresolvable"===fe.Base?h("undefined"):h(typeof I(fe)):h(function(e,t){switch(t){case"!":return!e;case"+":return+e;case"-":return-e;case"void":return}throw new SyntaxError("Unsupported unary operator `".concat(t,"`"))}(I(fe),e.operator))}if(!F)switch(e.type){case"AssignmentExpression":if("="===e.operator){if("ArrayPattern"!==e.left.type&&"ObjectPattern"!==e.left.type){var ve=q(e.left).Value,he=I(q(e.right));return C(ve,he),h(he)}var me=I(q(e.right));return Y(e.left,me),h(me)}var ge=q(e.left).Value,ye=I(ge),be=I(q(e.right)),we=function(e,t,r){switch(t){case"+=":case"-=":case"*=":case"/=":case"%=":case"**=":return B(e,t.substr(0,t.length-1),r)}throw new SyntaxError("Unsupported assignment operator `".concat(t,"`"))}(ye,e.operator,be);return C(ge,we),h(we);case"BlockStatement":if(!e.body.length)return h(m);var Ee=$().LexicalEnvironment,Se=new o(Ee);ee(e.body,Se),$().LexicalEnvironment=Se;var ke=ne(e.body);return $().LexicalEnvironment=Ee,ke;case"BreakStatement":return new v("break",m);case"ContinueStatement":return new v("continue",m);case"EmptyStatement":case"FunctionDeclaration":return h(m);case"DoWhileStatement":return z(function(e){for(var t;;){var r=q(e.body);if(!A(r))return Z(r,t);if(r.Value!==m&&(t=r.Value),!I(q(e.test)))return h(t)}}(e));case"ExpressionStatement":case"TSAsExpression":return q(e.expression);case"ForInStatement":case"ForOfStatement":return z(function(e){var t=e.left,r="VariableDeclaration"===t.type?"var"===t.kind?"varBinding":"lexicalBinding":"assignment",n="lexicalBinding"===r?g(t):[],a="ForInStatement"===e.type?"enumerate":"iterate",i=function(e,t,r){var n=$(),a=n.LexicalEnvironment;if(e.length>0){var i=new o(a);for(var s of e)i.CreateMutableBinding(s,!1);n.LexicalEnvironment=i}var c=q(t);n.LexicalEnvironment=a;var l=I(c);if("enumerate"===r){if(null==l)return new v("break",m);var u=function*(e){for(var t in e)yield t}(l);return h(u)}return h(x(l))}(n,e.right,a);return"normal"!==i.Type?i:function(e,t,r,n,a){for(var i,s="assignment"===a?e:e.declarations[0].id,c=$().LexicalEnvironment,l="ObjectPattern"===s.type||"ArrayPattern"===s.type;;){var{done:u,value:d}=r.next();if(u)return h(i);var p=void 0,f=void 0;if("lexicalBinding"===a){if(k(e,f=new o(c)),$().LexicalEnvironment=f,!l){var[v]=g(s);p=H(v)}}else l||(p=q(s).Value);l?"assignment"===a?Y(s,d):oe(s,d,"varBinding"===a?void 0:f):"lexicalBinding"===a?E(p,d):C(p,d);var y=q(t);if($().LexicalEnvironment=c,!A(y)){var b=Z(y,i);if("enumerate"!==n&&void 0!==r.return){var w=r.return();if(!w||!["object","function"].includes(typeof w))throw new TypeError("Iterator result is not an object")}return b}y.Value!==m&&(i=y.Value)}}(t,e.body,i.Value,a,r)}(e));case"ForStatement":return z(function(e){var t;if("VariableDeclaration"===(null===(t=e.init)||void 0===t?void 0:t.type)){if("var"===e.init.kind)return q(e.init),G(e.test,e.update,e.body,[]);var r=$().LexicalEnvironment,n=new o(r),a="const"===e.init.kind,i=g(e.init);for(var s of i)a?n.CreateImmutableBinding(s,!0):n.CreateMutableBinding(s,!1);$().LexicalEnvironment=n,q(e.init);var c=a?[]:Array.from(i),l=G(e.test,e.update,e.body,c);return $().LexicalEnvironment=r,l}return e.init&&I(q(e.init)),G(e.test,e.update,e.body,[])}(e));case"FunctionExpression":return de(e),h(function(e){var t=$().LexicalEnvironment;if(e.id){var r=e.id.name,n=new o(t);n.CreateImmutableBinding(r,!1);var a=ie(e,n,!0);return n.InitializeBinding(r,a),a}return ie(e,t,!0)}(e));case"IfStatement":return I(q(e.test))?(null!==(a=M.beforeBranch)&&void 0!==a&&a.call(M,e,"if"),Z(q(e.consequent),void 0)):(null!==(i=M.beforeBranch)&&void 0!==i&&i.call(M,e,"else"),e.alternate?Z(q(e.alternate),void 0):h(void 0));case"ReturnStatement":var Ae;return e.argument&&(Ae=I(q(e.argument))),new v("return",Ae);case"ThrowStatement":throw I(q(e.argument));case"UpdateExpression":var Ze=q(e.argument).Value,Ie=Number(I(Ze)),Pe="++"===e.operator?Ie+1:Ie-1;return C(Ze,Pe),h(e.prefix?Pe:Ie);case"SwitchCase":return ne(e.consequent);case"SwitchStatement":var Oe=I(q(e.discriminant)),Ce=$().LexicalEnvironment,xe=new o(Ce);ee(e.cases,xe),$().LexicalEnvironment=xe;var Te=function(e,t){var r,n=e.findIndex((e=>!e.test)),a=n>=0,i=a?e.slice(0,n):e,o=!1;for(var s of i)if(o||(o=K(s,t)),o){var c=q(s);if(c.Value!==m&&(r=c.Value),"normal"!==c.Type)return Z(c,r)}if(!a)return h(r);var l=!1,u=e.slice(n+1);if(!o)for(var d of u)if(l||(l=K(d,t)),l){var p=q(d);if(p.Value!==m&&(r=p.Value),"normal"!==p.Type)return Z(p,r)}if(l)return h(r);var f=q(e[n]);if(f.Value!==m&&(r=f.Value),"normal"!==f.Type)return Z(f,r);for(var v of u){var g=q(v);if(g.Value!==m&&(r=g.Value),"normal"!==g.Type)return Z(g,r)}return h(r)}(e.cases,Oe);return $().LexicalEnvironment=Ce,z(Te);case"TryStatement":var Re;try{Re=q(e.block)}catch(t){if(!e.handler)throw t;var Be;null===(Be=M.beforeEvaluate)||void 0===Be||Be.call(M,e.handler),Re=function(e,t){if(!e.param)return q(e.body);var r=$().LexicalEnvironment,n=new o(r);for(var a of g(e.param))n.CreateMutableBinding(a,!1);$().LexicalEnvironment=n,oe(e.param,t,n);var i=q(e.body);return $().LexicalEnvironment=r,i}(e.handler,t)}finally{if(e.finalizer){var Me=q(e.finalizer);"normal"!==Me.Type&&(Re=Me)}}return Re;case"VariableDeclaration":var _e;for(var Le of e.declarations)if(Le.init)if("Identifier"===Le.id.type){var Fe=H(Le.id.name),Ue=I(q(Le.init));_e="var"===e.kind?C(Fe,Ue):E(Fe,Ue)}else{var Ne=I(q(Le.init));_e=oe(Le.id,Ne,"var"===e.kind?void 0:$().LexicalEnvironment)}else _e="var"===e.kind?h(m):E(H(Le.id.name),void 0);return _e;case"WhileStatement":return z(function(e){for(var t;;){if(!I(q(e.test)))return h(t);var r=q(e.body);if(!A(r))return Z(r,t);r.Value!==m&&(t=r.Value)}}(e))}throw new SyntaxError("Unsupported node type `".concat(e.type,"`"))}function $(){return j[j.length-1]}function H(e,t){return t||(t=$().LexicalEnvironment),R(t,e,!0)}function z(e){return"break"===e.Type?e.Value===m?h(void 0):h(e.Value):e}function K(e,t){return t===I(q(e.test))}function G(e,t,r,n){var a;for(J(n);;){if(e&&!I(q(e)))return h(a);var i=q(r);if(!A(i))return Z(i,a);i.Value&&(a=i.Value),J(n),t&&I(q(t))}}function J(e){if(0!==e.length){var t=$().LexicalEnvironment,r=t.OuterEnv,n=new o(r);for(var a of e){n.CreateMutableBinding(a,!1);var i=t.GetBindingValue(a,!1);n.InitializeBinding(a,i)}$().LexicalEnvironment=n}}function Y(e,t){if("ObjectPattern"===e.type)return T(t),e.properties.length>0&&function(e,t){var r=new Set;for(var n of e)if("Property"===n.type){var a=n.computed||"Identifier"!==n.key.type?se(n.key):n.key.name,i="AssignmentPattern"===n.value.type?n.value.left:n.value;if("Identifier"===i.type){var o=H(i.name),s=O(t,a);"AssignmentPattern"===n.value.type&&void 0===s&&(s=I(q(n.value.right))),C(o,s),r.add(a)}else X(n.value,t,a),r.add(a)}else Q(n,t,r)}(e.properties,t),h(m);var r=x(t);return function(e,t){var r=h(m);for(var n of e)if(n){var a="RestElement"===n.type?n.argument:"AssignmentPattern"===n.type?n.left:n,i="ArrayPattern"===a.type||"ObjectPattern"===a.type,o=void 0;i||(o=q(a).Value);var s=void 0;if("RestElement"!==n.type){var{done:c,value:l}=t.next(),u=c?void 0:l;s="AssignmentPattern"===n.type&&void 0===u?I(q(n.right)):u}else{s=[];for(var d=0;;){var{done:p,value:f}=t.next();if(p)break;s[d]=f,d++}}r=i?Y(a,s):C(o,s)}else t.next(),r=h(m);return r}(e.elements,r)}function X(e,t,r){var n,a="AssignmentPattern"===e.type?e.left:e,i="ArrayPattern"===a.type||"ObjectPattern"===a.type;i||(n=q(a).Value);var o,s=O(t,r);return o="AssignmentPattern"===e.type&&void 0===s?I(q(e.right)):s,i?Y(a,o):C(n,o)}function Q(e,t,r){return C(q(e.argument).Value,S({},t,r))}function ee(e,t){var r=b(e,{var:!1,topLevel:!1});for(var n of r){var a="VariableDeclaration"===n.type&&"const"===n.kind;for(var i of g(n))a?t.CreateImmutableBinding(i,!0):t.CreateMutableBinding(i,!1);if("FunctionDeclaration"===n.type){var[o]=g(n),s=ae(n,t);t.InitializeBinding(o,s)}}}function te(e,r,n,a){var i;r instanceof f&&w(r)&&(i=r.Base);var o=re(n);if("function"!=typeof e){var s=t.substring(a.start,a.end);throw new TypeError("".concat(s," is not a function"))}var c=e.apply(i,o);return _(c),h(c)}function re(e){var t=[];if(Array.isArray(e))for(var r of e)if("SpreadElement"===r.type){var n=I(q(r.argument));t.push(...n)}else t.push(I(q(r)));else for(var a of(t.push(function(e){var t=W.get(e);if(t)return t;var r=e.quasis.map((e=>e.value.raw)),n=e.quasis.map((e=>e.value.cooked));return Object.freeze(r),Object.defineProperty(n,"raw",{value:r,writable:!1,enumerable:!1,configurable:!1}),Object.freeze(n),W.set(e,n),n}(e)),e.expressions))t.push(I(q(a)));return t}function ne(e){var t=h(m);for(var r of e){var n=q(r);if("normal"!==n.Type)return n;t=Z(t,n.Value)}return t}function ae(e,t){return ie(e,t,!0)}function ie(e,t,r){var i=function(){return function(e,t){var r;null===(r=M.beforeCall)||void 0===r||r.call(M,e[c]),function(e){var t=new a;t.Function=e;var r=new s(e[d]);t.VariableEnvironment=r,t.LexicalEnvironment=r,j.push(t)}(e);var i=function(e,t){return function(e,t,r){return function(e,t){for(var r=$(),a=e[u],i=e[l],s=g(i),c=y(i),d=b(a,{var:!0,topLevel:!0}),p=g(d),f=[],v=[],h=d.length-1;h>=0;h--){var m=d[h];if("FunctionDeclaration"===m.type){de(m);var[w]=g(m);f.includes(w)||(f.unshift(w),v.unshift(m))}else if(null!=n&&n.noVar)throw new SyntaxError("Var declaration is not recommended, use `let` or `const` instead")}var E,S=r.LexicalEnvironment;for(var k of s)S.CreateMutableBinding(k,!1);if(le(i,x(t),S),c)for(var A of(E=new o(S),r.VariableEnvironment=E,p)){E.CreateMutableBinding(A,!1);var Z=void 0;s.includes(A)&&!f.includes(A)&&(Z=S.GetBindingValue(A,!1)),E.InitializeBinding(A,Z)}else{for(var I of p)s.includes(I)||(S.CreateMutableBinding(I,!1),S.InitializeBinding(I,void 0));E=S}var P=E;r.LexicalEnvironment=P;var O=b(a,{var:!1,topLevel:!0});for(var C of O)for(var T of g(C))"const"===C.kind?P.CreateImmutableBinding(T,!0):P.CreateMutableBinding(T,!1);for(var R of v){var[B]=g(R),M=ae(R,P);E.SetMutableBinding(B,M,!1)}}(t,r),Array.isArray(e)?ne(e):new v("return",I(q(e)))}(e[u],e,t)}(e,t);if(j.pop(),"return"===i.Type)return i.Value}(i,arguments)};return Object.defineProperties(i,{[c]:{value:e},[l]:{value:e.params},[u]:{value:"BlockStatement"===e.body.type?e.body.body:e.body},[d]:{value:t},[p]:{value:r}}),i}function oe(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){return r.InitializeBinding(e,t),h(m)}(e.name,t,r);case"ObjectPattern":return T(t),function(e,t,r){var n=new Set;for(var a of e){if("RestElement"===a.type)return ce(a,t,r,n);if(a.computed||"Identifier"!==a.key.type){var i=se(a.key);ue(a.value,t,r,i),n.add(i)}else ue(a.value,t,r,a.key.name),n.add(a.key.name)}return h(m)}(e.properties,t,r);case"ArrayPattern":var n=x(t);return le(e.elements,n,r)}}function se(e){return P(I(q(e)))}function ce(e,t,r,n){var a=H(e.argument.name,r),i=S({},t,n);return r?E(a,i):C(a,i)}function le(e,t,r){if(0===e.length)return h(m);var n;for(var a of e)if(a)if("RestElement"===a.type)if("Identifier"===a.argument.type)for(var i=H(a.argument.name,r),o=[],s=0;;){var{done:c,value:l}=t.next();if(c){n=r?E(i,o):C(i,o);break}o[s]=l,s++}else for(var u=[],d=0;;){var{done:p,value:f}=t.next();if(p){n=oe(a.argument,u,r);break}u[d]=f,d++}else{var v="AssignmentPattern"===a.type?a.left:a;switch(v.type){case"ObjectPattern":case"ArrayPattern":var g=void 0,{done:y,value:b}=t.next();y||(g=b),"AssignmentPattern"===a.type&&void 0===g&&(g=I(q(a.right))),n=oe(v,g,r);break;case"Identifier":var w=H(v.name,r),S=void 0,{done:k,value:A}=t.next();k||(S=A),"AssignmentPattern"===a.type&&void 0===S&&(S=I(q(a.right))),n=r?E(w,S):C(w,S)}}else t.next(),n=h(m);return n}function ue(e,t,r,n){if("Identifier"===e.type||"AssignmentPattern"===e.type&&"Identifier"===e.left.type){var a=H("Identifier"===e.type?e.name:e.left.name,r),i=O(t,n);return"AssignmentPattern"===e.type&&void 0===i&&(i=I(q(e.right))),r?E(a,i):C(a,i)}var o=O(t,n);return"AssignmentPattern"===e.type&&void 0===o&&(o=I(q(e.right))),oe("AssignmentPattern"===e.type?e.left:e,o,r)}function de(e){if(e.async||e.generator)throw new SyntaxError("".concat(e.async?"Async":"Generator"," function is not allowed"));if(F&&!e.expression)throw new SyntaxError("Only an `Expression` is allowed in `ArrowFunctionExpression`'s body")}if(F)return I(q(e));null===(r=M.beforeEvaluate)||void 0===r||r.call(M,e),de(e);var[pe]=g(e);U.CreateImmutableBinding(pe,!0);var fe=ae(e,U);return U.InitializeBinding(pe,fe),fe}var U=r(3028);class N{constructor(){(0,n.Z)(this,"VariableEnvironment",void 0),(0,n.Z)(this,"LexicalEnvironment",void 0)}}class j{constructor(e){(0,n.Z)(this,"OuterEnv",void 0),(0,n.Z)(this,"bindingSet",new Set),this.OuterEnv=e}HasBinding(e){return this.bindingSet.has(e)}CreateBinding(e){this.bindingSet.add(e)}}function D(e){var{expressionOnly:t,visitors:r,withParent:n,hooks:a={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new Set,o=[],s=new j(null),c=new N;function l(){return o[o.length-1]}function u(e,t,r){for(var n of t)d(e[n],null==r?void 0:r.concat({node:e,key:n}))}function d(e,n){if(Array.isArray(e))e.forEach(((e,t)=>{d(e,n?n.slice(0,-1).concat((0,U.Z)((0,U.Z)({},n[n.length-1]),{},{index:t})):n)}));else if(e){var o,s;switch(null===(o=a.beforeVisit)||void 0===o||o.call(a,e,n),function(e){var t,n;r&&(t=r,n=e.type,Object.prototype.hasOwnProperty.call(t,n))&&r[e.type](e)}(e),e.type){case"Identifier":var c;return V=e.name,void(f(l().LexicalEnvironment,V)||(null===(c=a.beforeVisitGlobal)||void 0===c||c.call(a,e,n),i.add(e.name)));case"ArrayExpression":case"ArrayPattern":return void u(e,["elements"],n);case"ArrowFunctionExpression":return void h(m(e,l().LexicalEnvironment),n);case"AssignmentPattern":case"BinaryExpression":case"LogicalExpression":return void u(e,["left","right"],n);case"CallExpression":case"NewExpression":return void u(e,["callee","arguments"],n);case"ChainExpression":return void u(e,["expression"],n);case"ConditionalExpression":return void u(e,["test","consequent","alternate"],n);case"MemberExpression":return u(e,["object"],n),void(e.computed&&u(e,["property"],n));case"ObjectExpression":case"ObjectPattern":return void u(e,["properties"],n);case"Property":return e.computed&&u(e,["key"],n),void u(e,["value"],n);case"RestElement":case"SpreadElement":case"UnaryExpression":return void u(e,["argument"],n);case"SequenceExpression":case"TemplateLiteral":return void u(e,["expressions"],n);case"TaggedTemplateExpression":return void u(e,["tag","quasi"],n);case"Literal":return}if(!t)switch(e.type){case"AssignmentExpression":return void u(e,["right","left"],n);case"BlockStatement":if(!e.body.length)return;var y=l(),b=y.LexicalEnvironment,w=new j(b);return v(e.body,w),y.LexicalEnvironment=w,u(e,["body"],n),void(y.LexicalEnvironment=b);case"BreakStatement":case"ContinueStatement":case"EmptyStatement":return;case"CatchClause":var E=l(),S=E.LexicalEnvironment,k=new j(S);return p(e.param,k),E.LexicalEnvironment=k,u(e,["param","body"],n),void(E.LexicalEnvironment=S);case"DoWhileStatement":return void u(e,["body","test"],n);case"ExpressionStatement":case"TSAsExpression":return void u(e,["expression"],n);case"ForInStatement":case"ForOfStatement":var A="VariableDeclaration"===e.left.type&&"var"!==e.left.kind,Z=l(),I=Z.LexicalEnvironment;if(A){var P=new j(I);p(e.left,P),Z.LexicalEnvironment=P}if(u(e,["right"],n),Z.LexicalEnvironment=I,A){var O=new j(I);p(e.left,O),Z.LexicalEnvironment=O}return u(e,["left","body"],n),void(Z.LexicalEnvironment=I);case"ForStatement":var C,x="VariableDeclaration"===(null===(C=e.init)||void 0===C?void 0:C.type)&&"var"!==e.init.kind,T=l(),R=T.LexicalEnvironment;if(x){var B=new j(R);p(e.init,B),T.LexicalEnvironment=B}return u(e,["init","test","body","update"],n),void(T.LexicalEnvironment=R);case"FunctionDeclaration":var[M]=g(e),_=l().LexicalEnvironment,L=m(e,_);return _.CreateBinding(M),void h(L,n);case"FunctionExpression":return void h(function(e){var t=l().LexicalEnvironment;if(!e.id)return m(e,t);var r=e.id.name,n=new j(t);return n.CreateBinding(r),m(e,n)}(e),n);case"IfStatement":return void u(e,["test","consequent","alternate"],n);case"ReturnStatement":case"ThrowStatement":case"UpdateExpression":return void u(e,["argument"],n);case"SwitchCase":return void u(e,["test","consequent"],n);case"SwitchStatement":u(e,["discriminant"],n);var F=l(),N=F.LexicalEnvironment,D=new j(N);return v(e.cases,D),F.LexicalEnvironment=D,u(e,["cases"],n),void(F.LexicalEnvironment=N);case"TryStatement":return void u(e,["block","handler","finalizer"],n);case"VariableDeclaration":return void u(e,["declarations"],n);case"VariableDeclarator":return void u(e,["id","init"],n);case"WhileStatement":return void u(e,["test","body"],n)}(null===(s=a.beforeVisitUnknown)||void 0===s?void 0:s.call(a,e,n))||console.warn("Unsupported node type `".concat(e.type,"`"))}var V}function p(e,t){for(var r of g(e))t.CreateBinding(r)}function f(e,t){return!!e&&(e.HasBinding(t)||f(e.OuterEnv,t))}function v(e,t){p(b(e,{var:!1,topLevel:!1}),t)}function h(e,t){var r,n,a;r=e,n=new N,a=new j(r.Environment),n.VariableEnvironment=a,n.LexicalEnvironment=a,o.push(n),function(e,t){var r,n=l(),a=e.ECMAScriptCode,i=e.FormalParameters,o=y(i),s=g(b(a,{var:!0,topLevel:!0})),c=n.LexicalEnvironment;if(p(i,c),d(i,null==t?void 0:t.concat({node:e.Function,key:"params"})),o)for(var u of(r=new j(c),n.VariableEnvironment=r,s))r.CreateBinding(u);else{for(var f of s)c.CreateBinding(f);r=c}var v=r;n.LexicalEnvironment=v,p(b(a,{var:!1,topLevel:!0}),v)}(e,t),d(e.ECMAScriptCode,null==t?void 0:t.concat({node:e.Function,key:"body"}).concat("BlockStatement"===e.Function.body.type?{node:e.Function.body,key:"body"}:[])),o.pop()}function m(e,t){return{Function:e,FormalParameters:e.params,ECMAScriptCode:"BlockStatement"===e.body.type?e.body.body:e.body,Environment:t}}return c.VariableEnvironment=s,c.LexicalEnvironment=s,o.push(c),d(e,n?[]:void 0),i}var V=r(2159),W=r(907),q=["typescript"];function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{typescript:r}=t,n=(0,V.Z)(t,q),a=function(e){var{typescript:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,W.parse)(e,{plugins:["estree",t&&"typescript"].filter(Boolean),strictMode:!0,attachComment:!1}).program.body,n=t?[]:r;if(t)for(var a of r)if(a.type.startsWith("TS")){if(/Enum|Import|Export/.test(a.type))throw new SyntaxError("Unsupported TypeScript syntax: ".concat(a.type))}else n.push(a);if(0===n.length)throw new SyntaxError("Function declaration not found");if(n.length>1||"FunctionDeclaration"!==n[0].type)throw new SyntaxError("Expect a single function declaration at top level, but received: ".concat(n.map((e=>'"'.concat(e.type,'"'))).join(", ")));return n[0]}(e,{typescript:r});return{function:a,attemptToVisitGlobals:D(a,n)}}function H(e,t){var r=[],n=e.replace(/^\s*<%[~=]?\s|\s%>\s*$/g,(e=>(r.push(e),""))),a=function(e){return(0,W.parseExpression)(e,{plugins:["estree",["pipelineOperator",{proposal:"minimal"}]],attachComment:!1})}(n);return{expression:a,attemptToVisitGlobals:D(a,(0,U.Z)((0,U.Z)({},t),{},{expressionOnly:!0})),source:n,prefix:r[0],suffix:r[1]}}function z(e){return/^\s*<%[~=]?\s/.test(e)&&/\s%>\s*$/.test(e)}function K(e){return/^\s*<%~\s/.test(e)}function G(e){return/^\s*<%=\s/.test(e)&&/\s%>\s*$/.test(e)}},4370:(e,t,r)=>{r.r(t),r.d(t,{analytics:()=>l,auth:()=>n,checkInstalledApps:()=>a,checkPermissions:()=>ft,flowApi:()=>i,menu:()=>o,messageDispatcher:()=>vt});var n={};r.r(n),r.d(n,{authenticate:()=>m,getAuth:()=>g,isLoggedIn:()=>b,logout:()=>y});var a={};r.r(a),r.d(a,{getCheckedApp:()=>oe,preCheckInstalledApps:()=>ne,waitForCheckingApps:()=>ae});var i={};r.r(i),r.d(i,{FLOW_API_PROVIDER:()=>le,clearCollectWidgetContract:()=>Ee,collectContract:()=>be,collectWidgetContract:()=>we,getArgsOfFlowApi:()=>Ae,isFlowApiProvider:()=>ke,registerFlowApiProvider:()=>fe});var o={};r.r(o),r.d(o,{fetchMenuById:()=>Qe,getMenuById:()=>Xe});var s={};r.r(s),r.d(s,{onRequest:()=>ct,onResponse:()=>lt,onResponseError:()=>ut});var c={};r.r(c),r.d(c,{create:()=>pt});var l={};r.r(l),r.d(l,{http:()=>s,initialize:()=>ot,pageView:()=>c});var u=r(4795),d=r(5178),p=r(3105),f=r(485),v=r(3028),h={};function m(e){Object.assign(h,{org:e.org,username:e.username,userInstanceId:e.userInstanceId,loginFrom:e.loginFrom,accessRule:e.accessRule,isAdmin:e.isAdmin,csrfToken:e.csrfToken,license:e.license,userShowValue:e.userShowValue})}function g(){return(0,v.Z)({},h)}function y(){for(var e of Object.keys(h))h[e]=void 0;w.length=0,E.clear()}function b(){return void 0!==h.username}var w=[],E=new Map;function S(){return(S=(0,u.Z)((function*(e,t){if(b()&&!g().isAdmin&&Array.isArray(e.permissionsPreCheck))return A(yield t(e.permissionsPreCheck))}))).apply(this,arguments)}function k(e){if(b()&&!g().isAdmin)return A((0,p.scanPermissionActionsInAny)(e))}function A(e){return Z.apply(this,arguments)}function Z(){return(Z=(0,u.Z)((function*(e){var t=(0,d.difference)(e,[...w]);if(0!==t.length){w.push(...t);try{var r=yield(0,f.w)({actions:t});for(var n of r.actions)E.set(n.action,n.authorizationStatus),"undefined"===n.authorizationStatus&&console.error('Undefined permission action: "'.concat(n.action,'"'))}catch(e){console.error("Pre-check permissions failed",e)}}}))).apply(this,arguments)}var I=r(5866),P=r(3395),O=r(6171),C=r(381),x=r(687),T=r(1181),R=1e3,B=6,M=new WeakMap,_=new WeakMap,L=new WeakMap,F=new WeakMap,U=new WeakMap,N=new WeakMap,j=new WeakMap,D=new WeakSet,V=new WeakSet;class W{constructor(e){(0,I.Z)(this,V),(0,I.Z)(this,D),(0,P.Z)(this,M,{writable:!0,value:void 0}),(0,P.Z)(this,_,{writable:!0,value:void 0}),(0,P.Z)(this,L,{writable:!0,value:[]}),(0,P.Z)(this,F,{writable:!0,value:new Set}),(0,P.Z)(this,U,{writable:!0,value:new Set}),(0,P.Z)(this,N,{writable:!0,value:0}),(0,P.Z)(this,j,{writable:!0,value:!1}),(0,C.Z)(this,M,e)}send(e){(0,x.Z)(this,_)||(0,C.Z)(this,_,(0,O.Z)(this,D,q).call(this));var t=JSON.stringify(e);(0,x.Z)(this,_).readyState===WebSocket.OPEN?(0,x.Z)(this,_).send(t):(0,x.Z)(this,L).push(t)}onMessage(e){(0,x.Z)(this,F).add(e)}onClose(e){(0,x.Z)(this,U).add(e)}reset(){(0,x.Z)(this,L).length=0,(0,x.Z)(this,F).clear(),(0,x.Z)(this,U).clear()}close(){var e;(0,C.Z)(this,j,!0),(null===(e=(0,x.Z)(this,_))||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(0,x.Z)(this,_).close()}}function q(){console.log("WebSocket connecting ...");var e=new WebSocket((0,x.Z)(this,M));return e.addEventListener("open",(t=>{for(var r of(console.log("WebSocket open:",t),(0,C.Z)(this,N,0),(0,x.Z)(this,L)))e.send(r);(0,x.Z)(this,L).length=0})),e.addEventListener("close",(e=>{if(!(0,x.Z)(this,j)){for(var t of(console.log("WebSocket close:",e),(0,x.Z)(this,U)))t();1e3!==e.code&&(0,O.Z)(this,V,$).call(this)}})),e.addEventListener("error",(e=>{console.error("WebSocket error:",e)})),e.addEventListener("message",(e=>{var t=JSON.parse(e.data);for(var r of(0,x.Z)(this,F))r(t)})),e}function $(){if((0,x.Z)(this,N)>=B)console.error("WebSocket connect retry limit exceeded");else{var e=Math.pow(2,(0,x.Z)(this,N))*R;console.log("WebSocket will reconnect after %d seconds",e/1e3),setTimeout((()=>{var e;(0,C.Z)(this,N,(e=(0,x.Z)(this,N),++e)),(0,C.Z)(this,_,(0,O.Z)(this,D,q).call(this))}),e)}}var H=new WeakMap,z=new WeakMap,K=new WeakMap,G=new WeakMap,J=new WeakSet;function Y(){if(!(0,x.Z)(this,H)){var e="https:"===location.protocol?"wss:":"ws:",t="".concat(e,"//").concat(window.location.host).concat((0,T.getBasePath)(),"api/websocket_service/v1/ws");(0,C.Z)(this,H,new W(t))}return(0,x.Z)(this,H)}function X(e,t,r,n){var a=(0,x.Z)(this,z)[e].get(n);if(a)return a;var i={event:"sub"===e?"TOPIC.SUB":"TOPIC.UNSUB",payload:r},o=new Promise(((t,n)=>{var a=Q(r);(0,x.Z)(this,G).onMessage((r=>{var i=r.event===("sub"===e?"TOPIC.SUB_SUCCESS":"TOPIC.UNSUB_SUCCESS"),o=r.event===("sub"===e?"TOPIC.SUB_FAILED":"TOPIC.UNSUB_FAILED");(i||o)&&a===Q(r.payload)&&(i?t:n)(r)})),(0,x.Z)(this,G).send(i)}));return"sub"===e&&(0,x.Z)(this,K).set(t,n),(0,x.Z)(this,z)[e].set(n,o),o}function Q(e){var{system:t,topic:r}=e;return JSON.stringify({system:t,topic:r})}var ee=r(5049),te=new Map,re=new Map;function ne(e,t){if(window.STANDALONE_MICRO_APPS&&!window.NO_AUTH_GUARD){var r=function(e){var t,r={usedArgs:new Set},{customTemplates:n,menus:a}=null!==(t=e.meta)&&void 0!==t?t:{};return(0,p.traverseStoryboardExpressions)([e.routes,n,a],((e,t)=>{(0,p.collectInstalledAppsHasUsage)(r,e,t)}),"INSTALLED_APPS"),[...r.usedArgs]}(e),n=[];for(var a of r)te.has(a)||t(a)||n.push(a);if(0===n.length)return;var i=(0,ee.$)({query:{appId:{$in:n}},fields:["appId","currentVersion","installStatus"]}).catch((e=>{console.error("Get off site standalone micro-apps failed",e)})),o=function(e){te.set(e,i.then((t=>{var r,n=null==t||null===(r=t.list)||void 0===r?void 0:r.find((t=>t.appId===e)),a=n?(0,v.Z)((0,v.Z)({},n),{},{id:e}):void 0;return re.set(e,a),a})))};for(var s of n)o(s)}}function ae(e){return ie.apply(this,arguments)}function ie(){return(ie=(0,u.Z)((function*(e){yield Promise.all(e.map((e=>te.get(e))))}))).apply(this,arguments)}function oe(e){if(window.STANDALONE_MICRO_APPS)return re.get(e)}var se=r(9686),ce=r(9516),le="core.provider-flow-api";function ue(e,t){return e.some((e=>e.source===t))}function de(e){return pe.apply(this,arguments)}function pe(){return pe=(0,u.Z)((function*(e){for(var t,{url:r,originalUri:n,method:a="GET",responseWrapper:i=!0,ext_fields:o=[],request:s,isFileType:c}=e,l=["get","delete","head"].includes(a.toLowerCase()),u=c?{responseType:"blob"}:{},p=arguments.length,f=new Array(p>1?p-1:0),h=1;h<p;h++)f[h-1]=arguments[h];if(l){var m,g,y,b,w,E;n&&"object"===(null==s?void 0:s.type)&&(null!==(m=null===(g=n.match(/:([^/]+)/g))||void 0===g?void 0:g.length)&&void 0!==m?m:0)===(null!==(y=null===(b=s.fields)||void 0===b?void 0:b.length)&&void 0!==y?y:0)?[E]=f:[w,E]=f,t=yield ce.http.simpleRequest(a,r,(0,v.Z)((0,v.Z)({params:w},u),E))}else{var S=function(e){if(!e||"object"!==e.type)return!1;var t=e=>!(0,d.isEmpty)(e)&&e.some((e=>["file","file[]"].includes(e.type)||t(e.fields)));return t(e.fields)}(s),k=function(e){for(var t=ue(e,"query"),r=ue(e,"body"),n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];if(t){if(r){var[o,s,c]=a;return{data:o,options:(0,v.Z)({params:s},c)}}var[l,u]=a;return{data:{},options:(0,v.Z)({params:l},u)}}var[d,p]=a;return{data:d,options:p}}(o,...f);t=yield ce.http.requestWithBody(a,r,S?function(e){if(e instanceof FormData)return e;var t=new FormData,r=function(e){Array.isArray(a)?a.forEach((r=>{t.append(e,r)})):!(0,d.isObject)(a)||a instanceof Blob||a instanceof Date?t.append(e,a):Object.entries(a).forEach((r=>{var[n,a]=r;t.append("".concat(e,"[").concat(n,"]"),a)}))};for(var[n,a]of Object.entries(e))r(n);return t}(k.data):k.data,(0,v.Z)((0,v.Z)({},u),k.options))}return!c&&i?t.data:t})),pe.apply(this,arguments)}function fe(){customElements.define(le,(0,se.createProviderClass)(de))}var ve=r(9169),he=r(7301),me=new Map,ge=new Map,ye=(e,t)=>{null==e||e.forEach((e=>{t.set("".concat(e.namespaceId,".").concat(e.name),e)}))};function be(e){ye(e,me)}function we(e){ye(e,ge)}function Ee(){ge.clear()}var Se=new Map;function ke(e){return e.includes("@")}function Ae(e,t,r){return Ze.apply(this,arguments)}function Ze(){return Ze=(0,u.Z)((function*(e,t,r){if(!e.includes(":"))throw new Error("You're using legacy Custom API \"".concat(e,'" which is dropped in v3, please use Flow API instead'));var n=yield function(e){var t=Se.get(e);return t||(t=function(e){return Ie.apply(this,arguments)}(e),Se.set(e,t)),t}(e);if(!n)throw new Error('Flow API not found: "'.concat(e,'"'));var a=function(e,t){var r,n,a="string"==typeof t.contract?ve.safeLoad(t.contract,{schema:ve.JSON_SCHEMA,json:!0}):t.contract,{uri:i,method:o="GET",ext_fields:s}=null!==(r=null==a?void 0:a.endpoint)&&void 0!==r?r:{},c=!(null==a||!a.response)&&!1!==a.response.wrapper;if(!i)throw new Error('Missing endpoint.uri in contract of provider "'.concat(e,'"'));return{uri:i,method:"list"===o.toLowerCase()?"get":o,ext_fields:s,name:t.name,namespace:t.namespace,serviceName:t.serviceName,version:t.version,isFileType:"file"===(null==a||null===(n=a.response)||void 0===n?void 0:n.type),responseWrapper:c,request:null==a?void 0:a.request}}(e,n);return function(e,t,r){var n,{uri:a,method:i,ext_fields:o,name:s,namespace:c,serviceName:l,responseWrapper:u,version:d,isFileType:p,request:f}=e,v=p&&"saveAs"===r;v&&(n=t.shift());var{url:h,args:m}=function(e,t,r,n,a,i){var o=i?a?"api/gateway/".concat(a):"api/gateway/".concat(n,".").concat(r,"@").concat(i):"api/gateway/api_service.".concat(n,".").concat(r),s=t.slice();return{url:o+e.replace(/:([^/]+)/g,(()=>s.shift())),args:s}}(a,t,s,c,l,d);return[...v?[n]:[],{url:h,originalUri:a,method:i,ext_fields:o,responseWrapper:u,request:f,isFileType:p},...m]}(a,t,r)})),Ze.apply(this,arguments)}function Ie(){return(Ie=(0,u.Z)((function*(e){var[t,r]=e.split("@"),[n,a]=r.split(":"),i=function(e){return me.get(e)||ge.get(e)}("".concat(t,".").concat(n));if(i)return{name:i.name,namespace:i.namespaceId,serviceName:i.serviceName,version:i.version,contract:{endpoint:i.endpoint,response:i.response,request:i.request}};var o,{contractData:s}=yield(0,he.e)({contractName:"".concat(t,".").concat(n),version:a});return s?{name:s.name,namespace:null===(o=s.namespace)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.name,serviceName:s.serviceName,version:s.version,contract:{endpoint:s.endpoint,response:s.response,request:s.request}}:void 0}))).apply(this,arguments)}var Pe=r(2159),Oe=r(2021),Ce=r(1206),xe=r(178),Te=Symbol("appId"),Re=Symbol("menuI18nNamespace"),Be=Symbol("overrideApp");function Me(){return(Me=(0,u.Z)((function*(e,t,r,n){if(e.dynamicItems&&e.itemsResolve){var a=e.app[0].appId,i=t;if(a!==t.app.id){var o,s=window.STANDALONE_MICRO_APPS?e.overrideApp:null===(o=n.getStoryboardByAppId(a))||void 0===o?void 0:o.app;i=(0,v.Z)((0,v.Z)({},t),{},{overrideApp:s,appendI18nNamespace:r.get(e)})}var c=yield n.resolveData((0,v.Z)({transform:"items"},e.itemsResolve),i);e.items=c.items}}))).apply(this,arguments)}function _e(){return _e=(0,u.Z)((function*(e,t,r){var n=e.find((e=>"inject"!==e.type));if(n){var a=[],i=new Map,o=new WeakMap,s=function*(){if(c.i18n){var e="menu/".concat(c.menuId,"~").concat(c.app[0].appId,"+").concat(c.instanceId);Object.entries(c.i18n).forEach((t=>{var[r,n]=t;xe.i18n.addResourceBundle(r,e,n)})),o.set(c,e)}};for(var c of e)yield*s();for(var l of(yield Promise.all(e.map((e=>function(e,t,r,n){return Me.apply(this,arguments)}(e,t,o,r)))),e)){var u;if(null!==(u=l.items)&&void 0!==u&&u.length)if("inject"===l.type&&l.injectMenuGroupId){var d=i.get(l.injectMenuGroupId);d||(d=[],i.set(l.injectMenuGroupId,d)),d.push(l)}else a.push(l)}return(0,v.Z)((0,v.Z)({},n),{},{items:a.flatMap((e=>Le(e.items,e,i,o))),[Re]:o.get(n),[Be]:n.overrideApp})}})),_e.apply(this,arguments)}function Le(e,t,r,n){return null==e?void 0:e.map((e=>{var a,i=e.groupId&&r.get(e.groupId);return i&&r.delete(e.groupId),(0,v.Z)((0,v.Z)({},e),{},{children:(null!==(a=Le(e.children,t,r,n))&&void 0!==a?a:[]).concat(i?i.flatMap((e=>Le(e.items,e,r,n))):[]),[Te]:t.app[0].appId,[Re]:n.get(t),[Be]:t.overrideApp})}))}function Fe(e){e.items=Ue(e.items)}function Ue(e){return function(e){return(0,d.sortBy)(e,(e=>{var t;return null!==(t=e.sort)&&void 0!==t?t:-1/0}))}(e).map((e=>(0,v.Z)((0,v.Z)({},e),{},{children:Ue(e.children)})))}var Ne=r(74),je=r(1414),De=["children"];function Ve(e,t,r,n){if("titleDataSource"in e&&(0,se.isObject)(e.titleDataSource)&&Object.entries(e.titleDataSource).every((e=>{var[t,r]=e;return null===r||""===r}))&&delete e.titleDataSource,"if"in e&&null===e.if&&delete e.if,"to"in e&&e.to&&!(0,je.isEvaluable)(e.to)){var a=Ne.pipes.yaml(e.to);(0,se.isObject)(a)&&["pathname","search","hash"].some((e=>(0,se.hasOwnProperty)(a,e)))&&(e.to=a)}var i=r;if(t!==r.app.id){var o,s=window.STANDALONE_MICRO_APPS?e[Be]:null===(o=n.getStoryboardByAppId(t))||void 0===o?void 0:o.app;i=(0,v.Z)((0,v.Z)({},r),{},{overrideApp:s,appendI18nNamespace:e[Re]})}return n.asyncComputeRealValue(e,i,{ignoreSymbols:!0})}function We(e,t,r){return Promise.all(e.map(function(){var e=(0,u.Z)((function*(e){var{children:n}=e,a=(0,Pe.Z)(e,De),[i,o]=yield Promise.all([Ve(a,a[Te],t,r),n&&(yield We(n,t,r))]);return(0,v.Z)((0,v.Z)({},i),{},{children:o})}));return function(t){return e.apply(this,arguments)}}()))}var qe=r(682),$e=new Map;function He(e){return ze.apply(this,arguments)}function ze(){return(ze=(0,u.Z)((function*(e){if(e.title||(0,d.isEmpty)(e.titleDataSource))return e.title;var t=JSON.stringify(e.titleDataSource);if($e.has(t))return $e.get(t);var r,{objectId:n,instanceId:a,attributeId:i}=e.titleDataSource,o=null!=i?i:"name",s=yield(0,qe.q)(n,a,{fields:o});if("#showKey"===i&&Array.isArray(s[o])){var[c,...l]=s[o];r=l.length>0?"".concat(c,"(").concat(l.join(","),")"):String(c)}else r=String(s[o]);return $e.set(t,r),r}))).apply(this,arguments)}var Ke=["items","app"],Ge=new Map,Je=new Map;function Ye(e){return null==e?void 0:e.filter(T.checkIfOfComputed).map((e=>{var t=Ye(e.children);return"group"===e.type?{type:"group",title:e.text,childLayout:e.childLayout,items:t}:null!=t&&t.length?{type:"subMenu",childLayout:e.childLayout,title:e.text,icon:e.icon,items:t,defaultExpanded:e.defaultExpanded}:e}))}function Xe(e){return Je.get(e)}function Qe(e,t,r){var n=Ge.get(e);return n||(n=function(e,t,r){return et.apply(this,arguments)}(e,t,r)),n}function et(){return et=(0,u.Z)((function*(e,t,r){var n=window.STANDALONE_MICRO_APPS?function(e,t,r){var n,a,i,o,s=r.getStoryboardByAppId(t);return(null!==(n=null!==(a=null===(i=s.meta)||void 0===i?void 0:i.injectMenus)&&void 0!==a?a:null===(o=s.meta)||void 0===o?void 0:o.menus)&&void 0!==n?n:[]).filter((t=>t.menuId===e)).map((e=>{var r;return(0,v.Z)((0,v.Z)({},e),null!==(r=e.app)&&void 0!==r&&null!==(r=r[0])&&void 0!==r&&r.appId?{}:{app:[{appId:t}]})}))}(e,t.app.id,r):t.flags["three-level-menu-layout"]?(yield(0,Ce.h)(e,{menuObjectId:"EASYOPS_STORYBOARD_MENU"})).menus:(yield(0,Oe.x)("EASYOPS_STORYBOARD_MENU",{page:1,page_size:200,fields:{menuId:!0,title:!0,icon:!0,link:!0,titleDataSource:!0,defaultCollapsed:!0,defaultCollapsedBreakpoint:!0,type:!0,injectMenuGroupId:!0,dynamicItems:!0,itemsResolve:!0,items:!0,i18n:!0,"items.children":!0,"app.appId":!0},query:{menuId:{$eq:e},app:{$size:{$gt:0}}}})).list,a=yield function(e,t,r){return _e.apply(this,arguments)}(n,t,r);if(!a)throw new Error("Menu not found: ".concat(e));Fe(a);var{items:i,app:o}=a,s=(0,Pe.Z)(a,Ke),c=(0,v.Z)((0,v.Z)({},t),{},{pendingPermissionsPreCheck:[...t.pendingPermissionsPreCheck,k([i,s])]});delete c.tplStateStoreId,delete c.forEachItem,delete c.forEachIndex;var l=o[0].appId,[u,p]=yield Promise.all([Ve(s,l,c,r),We(i,c,r)]),f=(0,v.Z)((0,v.Z)({title:yield He(u)},(0,d.pick)(u,["icon","link","defaultCollapsed","defaultCollapsedBreakpoint"])),{},{menuItems:Ye(p)});Je.set(e,f)})),et.apply(this,arguments)}var tt=!1,rt=null,nt=!0,at=[],it=[];function ot(e){tt||(tt=!0,window.addEventListener("beforeunload",(function(){if(0!==it.length){var t={model:"easyops.FRONTEND_STAT",columns:["_ver","st","et","lt","size","time","traceId","code","duration","page","uid","username","api","type","msg","status","pageId","route","apiCount","maxApiTimeCost","apiSizeCost","pageTitle"],data:it},r=new Blob([JSON.stringify(t)],{type:"application/json"});it.length=0,window.navigator.sendBeacon(e,r)}}),!1))}var st=Symbol("HttpAnalytics");function ct(e){var t=Math.round(performance.now()),r=Date.now();return e[st]={st:r,time:Math.round(r/1e3),perfStartTime:t},e}function lt(e,t){return dt(!1,e,t)}function ut(e,t){return dt(!0,e,t)}function dt(e,t,r){var n,a=Math.round(performance.now()),i=Date.now(),{[st]:o,url:s}=r;if(o&&!(e&&t instanceof ce.HttpAbortError)){var c,l,u;delete r[st];var d,p,f,h,m,y,b,{st:w,time:E,perfStartTime:S}=o,{userInstanceId:k,username:A}=g();if(e){var Z=t instanceof ce.HttpResponseError;(Z||t instanceof ce.HttpParseError)&&(({status:m,headers:y}=t.response),Z&&(b=t.responseJson))}else({status:m,data:b,headers:y}=t);(0,se.isObject)(b)&&({code:d,message:p}=b),y instanceof Headers&&(f=y.get("x-b3-traceid"),h=y.get("content-length")),n={st:w,_ver:w,uid:k,username:A,time:E,et:i,page:location.href,duration:a-S,api:s,type:"api",code:null!==(c=d)&&void 0!==c?c:-1,msg:null!==(l=p)&&void 0!==l?l:"",status:m,traceId:null!==(u=f)&&void 0!==u?u:"",size:h?Number(h):-1},rt?it.push((0,v.Z)((0,v.Z)({},n),{},{type:"apiRequest"},rt)):at.push(n)}return e?Promise.reject(t):t}function pt(){var e=Math.round(performance.now()),t=Date.now();return at.length=0,rt=null,function(r){var{status:n,path:a,pageTitle:i}=r;if("ok"!==n)return it.push(...at),void(at.length=0);var o=Math.round(performance.now())-e,s=Date.now(),{username:c}=g();(function(e){var t,r,n=(t=URL.createObjectURL(new Blob([])),r=t.substring(t.lastIndexOf("/")+1),URL.revokeObjectURL(t),nt&&(r="88-"+r,nt=!1),r),{lt:a,route:i}=e;for(var o of(rt={lt:a,route:i,pageId:n},it.push((0,v.Z)((0,v.Z)({},e),{},{pageId:n,apiCount:at.length,maxApiTimeCost:Math.max(0,...at.map((e=>e.duration))),size:at.map((e=>e.size)).filter((e=>e>0)).reduce(((e,t)=>e+t),0)})),at))it.push((0,v.Z)((0,v.Z)({},o),rt));at.length=0})({type:"page",page:location.href,_ver:t,time:Math.round(t/1e3),st:t,et:s,lt:o,pageTitle:i,username:c,route:a}),window.dispatchEvent(new CustomEvent("route.render",{detail:{renderTime:o}}))}}var ft=Object.freeze({checkPermissions:function(){if(!b())return!1;if(g().isAdmin)return!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n of t)switch(E.get(n)){case"unauthorized":case"undefined":return!1;case void 0:return console.error('Un-checked permission action: "'.concat(n,'", please make sure the permission to check is defined in permissionsPreCheck.')),!1}return!0},preCheckPermissions:function(e){if(b()&&!g().isAdmin)return A((0,p.scanPermissionActionsInStoryboard)(e))},preCheckPermissionsForBrickOrRoute:function(e,t){return S.apply(this,arguments)}}),vt=new class{constructor(){(0,I.Z)(this,J),(0,P.Z)(this,G,{get:Y,set:void 0}),(0,P.Z)(this,H,{writable:!0,value:void 0}),(0,P.Z)(this,z,{writable:!0,value:{sub:new Map,unsub:new Map}}),(0,P.Z)(this,K,{writable:!0,value:new Map})}subscribe(e,t){var r=JSON.stringify(t);return(0,O.Z)(this,J,X).call(this,"sub",e,t,r)}unsubscribe(e){var t=(0,x.Z)(this,K).get(e);if(!t){var r='The message channel to unsubscribe "'.concat(e,'" is not found');return console.error(r),Promise.reject(new Error(r))}var n=JSON.parse(t),a=(0,O.Z)(this,J,X).call(this,"unsub",e,n,t);return(0,x.Z)(this,z).sub.delete(t),a.then((()=>{(0,x.Z)(this,K).delete(e)})),a}onMessage(e,t){var r=(0,x.Z)(this,K).get(e);r?(0,x.Z)(this,G).onMessage((e=>{"MESSAGE.PUSH"===e.event&&function(e,t){var r=JSON.parse(e);return r.system===t.system&&(r.topic===t.topic||"string"==typeof r.topic&&r.topic.includes("*")&&new RegExp("^".concat(r.topic.replace(/([^*]*)\*([^*]*)/g,((e,t,r)=>"".concat((0,d.escapeRegExp)(t),"[^/]*").concat((0,d.escapeRegExp)(r)))),"$")).test(t.topic))}(r,e.payload)&&t(e.payload.message)})):console.error('Message channel: "'.concat(e,'" not found'))}onClose(e){(0,x.Z)(this,G).onClose(e)}reset(){var e;(0,x.Z)(this,z).sub.clear(),(0,x.Z)(this,z).unsub.clear(),(0,x.Z)(this,K).clear(),null===(e=(0,x.Z)(this,H))||void 0===e||e.reset()}}},2424:(e,t,r)=>{r.r(t),r.d(t,{HttpAbortError:()=>m,HttpFetchError:()=>f,HttpParseError:()=>h,HttpResponseError:()=>v,createHttpInstance:()=>M,defaultAdapter:()=>O,fetch:()=>n,getUrlWithParams:()=>I,http:()=>B,isHttpAbortError:()=>A});var n=(e,t)=>{var r=new Request(e,Object.assign({credentials:"same-origin"},t));return self.fetch(r)},a=r(5866),i=r(3395),o=r(6666),s=r(687),c=r(6171),l=r(381),u=r(3028),d=r(2159),p=r(4795);class f extends Error{constructor(e){super(e),this.name="HttpFetchError",Error.captureStackTrace&&Error.captureStackTrace(this,f)}}class v extends Error{constructor(e,t){super(e.statusText),(0,o.Z)(this,"response",void 0),(0,o.Z)(this,"responseJson",void 0),this.name="HttpResponseError",Error.captureStackTrace&&Error.captureStackTrace(this,v),this.response=e,this.responseJson=t}}class h extends Error{constructor(e){super(e.statusText),(0,o.Z)(this,"response",void 0),this.name="HttpParseError",Error.captureStackTrace&&Error.captureStackTrace(this,h),this.response=e}}class m extends Error{constructor(e){super(e),this.name="HttpAbortError"}}class g{constructor(){(0,o.Z)(this,"handlers",[])}use(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}forEach(e){this.handlers.forEach((t=>{null!==t&&e(t)}))}}var y=["params","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache"],b=["params","headers","responseType","interceptorParams","observe","noAbortOnRouteChange","useCache"],w=["body","method"];function E(e){return null==e}var S=document.querySelector("base"),k=S?S.href:location.origin+"/",A=e=>e instanceof DOMException&&20===e.code,Z=function(){var e=(0,p.Z)((function*(e,t,r){return new Promise(function(){var a=(0,p.Z)((function*(a,i){var o;r.url=e;var{responseType:s}=r.options||{};s||(s="json");try{o=yield n(e,t)}catch(e){return void i(A(e)?new m(e.toString()):new f(e.toString()))}if(o.ok){var c;try{c=yield o[s]()}catch(e){return void i(A(e)?new m(e.toString()):new h(o))}a({status:o.status,statusText:o.statusText,headers:o.headers,data:c})}else{var l;try{l=yield o.json()}catch(e){}i(new v(o,l))}}));return function(e,t){return a.apply(this,arguments)}}())}));return function(t,r,n){return e.apply(this,arguments)}}(),I=(e,t)=>{if(t){var r=new URL(e,k);t instanceof URLSearchParams?t.forEach((function(e,t){r.searchParams.append(t,e)})):Object.entries(t).forEach((e=>{var[t,n]=e;Array.isArray(n)?n.forEach((e=>{r.searchParams.append(t,E(e)?"":e)})):r.searchParams.append(t,E(n)?"":n)}));var{href:n}=r;return n.startsWith(k)?n.substr(k.length):n}return e},P=(e,t)=>{if(void 0!==e){var r=new Headers(t||{}),n="Content-Type",a=e;return r.has(n)||("string"==typeof e?r.set(n,"application/x-www-form-urlencoded"):e instanceof FormData||(r.set(n,"application/json"),a=JSON.stringify(e))),{body:a,headers:r}}return{headers:t}},O=e=>{var{url:t,method:r,data:n}=e;return["DELETE","GET","HEAD"].includes(e.method)?((e,t,r)=>{var n=r.options||{},{params:a,responseType:i,interceptorParams:o,observe:s,noAbortOnRouteChange:c,useCache:l}=n,p=(0,d.Z)(n,y);return Z(I(t,a),(0,u.Z)((0,u.Z)({},p),{},{method:e}),r)})(r,t,e):((e,t,r,n)=>{var a=n.options||{},{params:i,headers:o,responseType:s,interceptorParams:c,observe:l,noAbortOnRouteChange:p,useCache:f}=a,v=(0,d.Z)(a,b);return Z(I(t,i),(0,u.Z)((0,u.Z)({},v),{},{method:e},P(r,o)),n)})(r,t,n,e)},C=new WeakMap,x=new WeakSet;class T{constructor(e){var t=this;(0,a.Z)(this,x),(0,o.Z)(this,"interceptors",void 0),(0,i.Z)(this,C,{writable:!0,value:O}),(0,o.Z)(this,"request",function(){var e=(0,p.Z)((function*(e,r,n){var a=r||{},{body:i,method:o}=a,s=(0,d.Z)(a,w);return(0,c.Z)(t,x,R).call(t,{url:e,data:i,method:o||"GET",options:(0,u.Z)((0,u.Z)({},n||{}),s)})}));return function(t,r,n){return e.apply(this,arguments)}}()),(0,o.Z)(this,"simpleRequest",(function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,c.Z)(t,x,R).call(t,{url:r,method:e,options:n})})),(0,o.Z)(this,"requestWithBody",(function(e,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,c.Z)(t,x,R).call(t,{url:r,method:e,data:n,options:a})})),this.interceptors={request:new g,response:new g},null!=e&&e.adapter&&(0,l.Z)(this,C,e.adapter)}getUrlWithParams(e,t){return I(e,t)}getBodyAndHeaders(e,t){return P(e,t)}get(e,t){return(0,c.Z)(this,x,R).call(this,{url:e,method:"GET",options:t})}delete(e,t){return(0,c.Z)(this,x,R).call(this,{url:e,method:"DELETE",options:t})}head(e,t){return(0,c.Z)(this,x,R).call(this,{url:e,method:"HEAD",options:t})}post(e,t,r){return(0,c.Z)(this,x,R).call(this,{url:e,method:"POST",data:t,options:r})}put(e,t,r){return(0,c.Z)(this,x,R).call(this,{url:e,method:"PUT",data:t,options:r})}patch(e,t,r){return(0,c.Z)(this,x,R).call(this,{url:e,method:"PATCH",data:t,options:r})}}function R(e){var t=[],r=Promise.resolve(e);for(this.interceptors.request.forEach((e=>{t.push(e.fulfilled,e.rejected)})),t.push((e=>(0,s.Z)(this,C).call(this,e)),void 0),this.interceptors.response.forEach((r=>{t.push((t=>{var n;return null===(n=r.fulfilled)||void 0===n?void 0:n.call(r,t,e)}),(t=>{var n;return null===(n=r.rejected)||void 0===n?void 0:n.call(r,t,e)}))})),t.push((t=>{var r;return"response"===(null===(r=e.options)||void 0===r?void 0:r.observe)?t:t.data}),void 0);t.length;)r=r.then(t.shift(),t.shift());return r}var B=new T;function M(e){B=new T(e)}},4034:(e,t,r)=>{r.r(t),r.d(t,{i18n:()=>d,i18nText:()=>u,initializeI18n:()=>c});var n=r(1434),a=r(178),i=r(6473),o=!1,s=new Set;function c(e,t){if(o||(o=!0,a.i18n.use(i.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&t&&!s.has(e))for(var[r,n]of(s.add(e),Object.entries(t)))a.i18n.addResourceBundle(r,e,n)}var l=r(9686);function u(e){var t;if(e){var r=null!==(t=a.i18n.language)&&void 0!==t?t:"zh-CN";if((0,l.hasOwnProperty)(e,r))return e[r];var n=r.split("-")[0];if(n!==r)return(0,l.hasOwnProperty)(e,n)?e[n]:void 0;var i="".concat(n,"-");for(var o of Object.keys(e))if(o.startsWith(i))return e[o]}}var d=n.default},7920:(e,t,r)=>{r.r(t),r.d(t,{inject:()=>k,transform:()=>S,transformAndInject:()=>A});var n=r(5178),a=r(74),i=function(e){return e[e.Initial=0]="Initial",e[e.ExpectField=1]="ExpectField",e[e.ExpectOptionalBeginDefault=2]="ExpectOptionalBeginDefault",e[e.ExpectDefaultValue=3]="ExpectDefaultValue",e[e.ExpectOptionalBeginPipe=4]="ExpectOptionalBeginPipe",e[e.ExpectPipeIdentifier=5]="ExpectPipeIdentifier",e[e.ExpectOptionalBeginPipeParameter=6]="ExpectOptionalBeginPipeParameter",e[e.ExpectPipeParameter=7]="ExpectPipeParameter",e[e.ExpectPlaceholderEnd=8]="ExpectPlaceholderEnd",e}({}),o=function(e){return e.Raw="Raw",e.BeginPlaceHolder="BeginPlaceHolder",e.Field="Field",e.BeginDefault="BeginDefault",e.LiteralString="LiteralString",e.BeginPipe="BeginPipe",e.PipeIdentifier="PipeIdentifier",e.BeginPipeParameter="BeginPipeParameter",e.EndPlaceHolder="EndPlaceHolder",e.JsonValue="JsonValue",e}({}),s=function(e){return e[e.Array=0]="Array",e[e.Object=1]="Object",e[e.String=2]="String",e[e.Others=3]="Others",e}({});function c(e){return new RegExp("(".concat([].concat(e).map((e=>(0,n.escapeRegExp)(e))).join("|"),")\\{"))}function l(e){var t,r=E(e),n=null===(t=r.match(e.beginPlaceholder))||void 0===t?void 0:t[0],a=n?r.indexOf(n):-1;if(a>=0&&n&&"{"!==r.charAt(a+n.length)){var s=e.cursor+a;a>0&&e.tokens.push({type:o.Raw,value:r.substring(0,a)}),e.tokens.push({type:o.BeginPlaceHolder,loc:{start:s,end:s+n.length},value:n.substring(0,n.length-1)}),e.cursor+=a+n.length,e.status=i.ExpectField}else e.tokens.push({type:o.Raw,value:r}),e.cursor=e.raw.length}function u(e){e.cursor+=E(e).match(/^[ \r\n\t]*/)[0].length}function d(e){var[t]=E(e).match(/^(?:[\*\x2D\.0-9A-\[\]_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);e.tokens.push({type:o.Field,value:t}),e.cursor+=t.length,e.status=i.ExpectOptionalBeginDefault}function p(e){"="===E(e).charAt(0)?(e.tokens.push({type:o.BeginDefault}),e.cursor+=1,e.status=i.ExpectDefaultValue):e.status=i.ExpectOptionalBeginPipe}function f(e){w(e,i.ExpectOptionalBeginPipe)}function v(e){"|"===E(e).charAt(0)?(e.tokens.push({type:o.BeginPipe}),e.cursor+=1,e.status=i.ExpectPipeIdentifier):e.status=i.ExpectPlaceholderEnd}function h(e){var t=E(e).match(/^[a-zA-Z]\w*/);if(!t)throw new Error("Expected a pipe identifier at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));var r=t[0];e.tokens.push({type:o.PipeIdentifier,value:r}),e.cursor+=r.length,e.status=i.ExpectOptionalBeginPipeParameter}function m(e){":"===E(e).charAt(0)?(e.tokens.push({type:o.BeginPipeParameter}),e.cursor+=1,e.status=i.ExpectPipeParameter):e.status=i.ExpectOptionalBeginPipe}function g(e){w(e,i.ExpectOptionalBeginPipeParameter)}function y(e){if("}"!==E(e).charAt(0))throw new Error("Expected a placeholder end '}' at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:o.EndPlaceHolder,loc:{start:e.cursor,end:e.cursor+1}}),e.cursor+=1,e.status=i.Initial}var b=new Map([["false",!1],["null",null],["true",!0]]);function w(e,t){var r=E(e);if(/[0-9[{"]/.test(r.charAt(0))||/-[0-9]/.test(r.substring(0,2)))!function(e,t){for(var r=E(e),n=r.charAt(0),a="["===n?s.Array:"{"===n?s.Object:'"'===n?s.String:s.Others,i=0,c=0,l=0,u=!1,d=!1,p=!1;i<r.length;){var f=r.charAt(i);if(d)d=!1;else if(u)'"'===f?u=!1:"\\"===f&&(d=!0);else switch(f){case"[":l+=1;break;case"{":c+=1;break;case"]":l-=1;break;case"}":c-=1;break;case'"':u=!0}switch(i+=1,a){case s.Array:p=!l;break;case s.Object:p=!c;break;case s.String:p=!u;break;default:p=i<r.length&&/[^a-z0-9E.+-]/.test(r.charAt(i))}if(p)break}if(!p)throw new Error("Failed to match a JSON value at index ".concat(e.cursor," near: ").concat(JSON.stringify(e.raw.substring(e.cursor))));e.tokens.push({type:o.JsonValue,value:JSON.parse(r.substring(0,i))}),e.cursor+=i,e.status=t}(e,t);else{var[n]=E(e).match(/^(?:[\x2D0-9A-Z_a-z\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/);b.has(n)?e.tokens.push({type:o.JsonValue,value:b.get(n)}):e.tokens.push({type:o.LiteralString,value:n}),e.cursor+=n.length,e.status=t}}function E(e){return e.raw.substring(e.cursor)}function S(e,t){return Z(e,"@",t)}function k(e,t){return Z(e,"$",t)}function A(e,t){return Z(e,["@","$"],t)}function Z(e,t,r){if(!function(e,t){return c(t).test(e)}(e,t))return e;var s,b,w=(s=r.data,function(e){var t=e.field?(0,n.get)(s,e.field):s;return void 0===t&&(t=e.defaultValue),(0,a.processPipes)(t,e.pipes)}),E=function(e,t){return function(r){var i,o,s=r.field.match(/^(?:(QUERY(?:_ARRAY)?|EVENT|query|event|APP|HASH|ANCHOR|SYS|FLAGS|CTX)\.)?(.+)$/);if(!s)return t.substring(r.loc.start,r.loc.end);var c,[,l,u]=s;!l&&/^[A-Z_]+$/.test(u)&&(l=u,u="*");var d={SYS:"sys",FLAGS:"flags"};switch(l){case"QUERY":case"query":c="*"===u?e.query:e.query.has(u)?e.query.get(u):void 0;break;case"QUERY_ARRAY":c=e.query.has(u)?e.query.getAll(u):void 0;break;case"EVENT":case"event":if(void 0===e.event)return t.substring(r.loc.start,r.loc.end);c="*"===u?e.event:(0,n.get)(e.event,u);break;case"APP":c="*"===u?null!==(i=e.overrideApp)&&void 0!==i?i:e.app:(0,n.get)(null!==(o=e.overrideApp)&&void 0!==o?o:e.app,u);break;case"HASH":c=e.location.hash;break;case"SYS":case"FLAGS":c="*"===u?e[d[l]]:(0,n.get)(e[d[l]],u);break;case"ANCHOR":var p=e.location.hash?e.location.hash.substr(1):null;c="*"===u?p:(0,n.get)(p,u);break;case"CTX":var f=t.substring(r.loc.start,r.loc.end);return console.error('CTX is not supported in placeholder any more: "'.concat(f,'"')),f;default:if(!e.match)return t.substring(r.loc.start,r.loc.end);c=e.match.params[u]}return void 0===c&&(c=r.defaultValue),(0,a.processPipes)(c,r.pipes)}}(r,e);return b=function(e,t){return function(e){var t,r={type:"InjectableString",elements:[]};function n(r){return r===e[0].type&&(t=e.shift(),!0)}function a(r){if(t=e.shift(),Array.isArray(r)?!r.includes(t.type):r!==t.type)throw new Error("Expected token: ".concat(r,", received token: ").concat(t.type))}for(;e.length>0;)if(n(o.Raw))r.elements.push({type:"RawString",value:t.value});else{a(o.BeginPlaceHolder);var i=t.loc.start,s=t.value;a(o.Field);var c={type:"Placeholder",symbol:s,field:t.value,defaultValue:void 0,pipes:[],loc:{start:i,end:i}};for(r.elements.push(c),n(o.BeginDefault)&&(a([o.JsonValue,o.LiteralString]),c.defaultValue=t.value);n(o.BeginPipe);){a(o.PipeIdentifier);var l={type:"PipeCall",identifier:t.value,parameters:[]};for(c.pipes.push(l);n(o.BeginPipeParameter);)a([o.JsonValue,o.LiteralString]),l.parameters.push(t.value)}a(o.EndPlaceHolder),c.loc.end=t.loc.end}return r}(function(e,t){for(var r={beginPlaceholder:c(t),raw:e,cursor:0,status:i.Initial,tokens:[]};r.cursor<e.length;)switch(r.status){case i.Initial:l(r);break;case i.ExpectField:u(r),d(r);break;case i.ExpectOptionalBeginDefault:u(r),p(r);break;case i.ExpectDefaultValue:u(r),f(r);break;case i.ExpectOptionalBeginPipe:u(r),v(r);break;case i.ExpectPipeIdentifier:u(r),h(r);break;case i.ExpectOptionalBeginPipeParameter:u(r),m(r);break;case i.ExpectPipeParameter:u(r),g(r);break;case i.ExpectPlaceholderEnd:u(r),y(r)}if(r.status!==i.Initial)throw new Error("Expected a placeholder end '}' at the end");return r.tokens}(e,t))}(e,t).elements.map((e=>"RawString"===e.type?e.value:"$"===e.symbol?E(e):w(e))),1===b.length?b[0]:b.join("")}},8524:(e,t,r)=>{r.r(t),r.d(t,{enqueueStableLoadBricks:()=>m,enqueueStableLoadProcessors:()=>g,flushStableLoadBricks:()=>h,loadBricksImperatively:()=>y,loadProcessorsImperatively:()=>w,loadScript:()=>o,loadSharedModule:()=>u,loadStyle:()=>s});var n=r(3028),a=new Map;function i(e,t,r,o){if(Array.isArray(t))return Promise.all(t.map((t=>i(e,t,r))));var s=r&&!/^https?:/.test(t)?"".concat(r).concat(t):t,c=a.get(s);if(c)return c;var l=new Promise(((t,r)=>{var a=()=>{window.dispatchEvent(new Event("request.end"))},i=document.createElement("style"===e?"link":"script");"script"===e?Object.assign(i,(0,n.Z)((0,n.Z)({type:"text/javascript",async:!0},o),{},{src:s})):Object.assign(i,(0,n.Z)((0,n.Z)({rel:"stylesheet"},o),{},{href:s})),i.onload=()=>{t(s),a()},i.onerror=e=>{r(e),a()};var c=document.currentScript||document.getElementsByTagName("script")[0];c.parentNode.insertBefore(i,c),window.dispatchEvent(new Event("request.start"))}));return a.set(s,l),l}function o(e,t,r){return i("script",e,t,r)}function s(e,t,r){return i("style",e,t,r)}var c,l=r(4795);function u(e,t){return d.apply(this,arguments)}function d(){return(d=(0,l.Z)((function*(e,t){yield r.I("default");var n=window[e];return yield n.init(r.S.default),(yield n.get(t))()}))).apply(this,arguments)}var p,f=!1,v=new Promise((e=>{c=e}));function h(){f||c()}function m(e,t){return O(I("bricks",e,t))}function g(e,t){return O(I("processors",e,t))}function y(e,t){return b.apply(this,arguments)}function b(){return(b=(0,l.Z)((function*(e,t){var r=I("bricks",e,t);return h(),O(r)}))).apply(this,arguments)}function w(e,t){var r=I("processors",e,t);return h(),O(r)}var E="v2-adapter.load-bricks";function S(e,t,r){var n=new Map,a=new Set,i=t=>{var o;if(!a.has(t)){var s,c,l;if(a.add(t),"processors"===e||t.includes(".")){[c,l]=t.split(".");var u="bricks/".concat("processors"===e?c.replace(/[A-Z]/g,(e=>"-".concat(e[0].toLocaleLowerCase()))).replace(/_[0-9]/g,(e=>"-".concat(e[1]))):c);s=r.get(u)}else for(var d of(l=t,r.values())){var p;if(null!==(p=d.elements)&&void 0!==p&&p.some((e=>e===l))){s=d;break}}if(s){var f=n.get(s);f||(f=[],n.set(s,f)),f.push(l);var v=null===(o=s.dependencies)||void 0===o?void 0:o[t];if(v)for(var h of v)i(h)}else console.error("Package for ".concat(t," not found."))}};for(var o of t)i(o);return n}function k(e,t,r){return A.apply(this,arguments)}function A(){return(A=(0,l.Z)((function*(e,t,r){var n="".concat("processors"===e?"./processors/":"./").concat(r);try{yield u(t,n)}catch(r){throw console.error(r),new Error("Load ".concat(e,' of "').concat(t.split("/").pop(),".").concat(n.split("/").pop(),'" failed'))}}))).apply(this,arguments)}function Z(e,t,r){return t.map(function(){var t=(0,l.Z)((function*(t){var n;return yield o(t.filePath,null!==(n=window.PUBLIC_ROOT)&&void 0!==n?n:""),yield v,Promise.all(r.get(t).map((r=>k(e,t.id,r))))}));return function(e){return t.apply(this,arguments)}}())}function I(e,t,r){return P.apply(this,arguments)}function P(){return P=(0,l.Z)((function*(e,t,r){var n=new Map;for(var a of r){var i,s=null!==(i=a.id)&&void 0!==i?i:x(a.filePath);n.set(s,a)}var u,d,v=S(e,t,n),h=[],m=[];for(var g of v.keys())g.id?"bricks/basic"===g.id?u=g:m.push(g):(h.push(g),(d=n.get("bricks/v2-adapter"))||console.error("Using v2 bricks, but v2-adapter not found"));var y,b=d,w=u;if(w){var A,I=o(w.filePath,null!==(A=window.PUBLIC_ROOT)&&void 0!==A?A:"");f||(f=!0,I.then((()=>Promise.resolve())).then(c)),y=I.then((()=>Promise.all(v.get(w).map((t=>k(e,w.id,t))))))}var P=[y].concat(Z(e,m,v));if(b&&h.length>0){if(!p){var O=S("bricks",[E],n),C=[...O.keys()],T=function(){var e=(0,l.Z)((function*(){return yield Promise.all(Z("bricks",C,O)),document.createElement(E)}));return function(){return e.apply(this,arguments)}}();p=T()}P.push(p.then((t=>Promise.all(h.map((n=>{var a=x(n.filePath).split("/")[1];return t.resolve(b.filePath,n.filePath,"bricks"===e?v.get(n).map((e=>"".concat(a,".").concat(e))):[],n.dll,r)}))))))}yield Promise.all(P)})),P.apply(this,arguments)}function O(e){return C.apply(this,arguments)}function C(){return(C=(0,l.Z)((function*(e){window.dispatchEvent(new Event("request.start"));try{yield e}finally{window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function x(e){return e.split("/").slice(0,2).join("/")}},5152:(e,t,r)=>{r.r(t),r.d(t,{pipes:()=>n.pipes,processPipes:()=>i,utils:()=>n.utils});var n=r(665),a=new Map(Array.from(Object.entries(n.pipes)));function i(e,t){if(0===t.length)return e;var r=e;for(var n of t){var i=a.get(n.identifier);if(!i)return void console.warn("Unknown pipe: ".concat(n.identifier));r=i(r,...n.parameters)}return r}},2263:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>$t,Notification:()=>Xt,StoryboardFunctionRegistryFactory:()=>fe,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>Ia,batchSetAppsLocalTheme:()=>re,checkIfByTransform:()=>yt,checkIfOfComputed:()=>mt,createHistory:()=>A,createRuntime:()=>ma,customProcessors:()=>M,customTemplates:()=>xe,fetchByProvider:()=>xa,getAuth:()=>Pa,getBasePath:()=>v,getCssPropertyValue:()=>ce,getCurrentMode:()=>oe,getCurrentTheme:()=>ee,getHistory:()=>Z,getPageInfo:()=>Un,getRuntime:()=>ga,handleHttpError:()=>Yt,httpErrorToString:()=>Ht,isLoggedIn:()=>Ca,isUnauthenticatedError:()=>zt,logout:()=>Oa,matchPath:()=>xt,registerWidgetFunctions:()=>_e,registerWidgetI18n:()=>F,unstable_createRoot:()=>Ra});var n={};r.r(n),r.d(n,{getAddedContracts:()=>Ja,getAllContextValues:()=>za,getBrickPackagesById:()=>Ka,getContextValue:()=>Ha,getRenderId:()=>Ga,legacyDoTransform:()=>Fa,mountUseBrick:()=>_a,renderUseBrick:()=>Ba,unmountUseBrick:()=>La,updateSnippetPreviewSettings:()=>qa,updateStoryboard:()=>Ua,updateStoryboardByRoute:()=>Na,updateStoryboardBySnippet:()=>Wa,updateStoryboardByTemplate:()=>ja,updateTemplatePreviewSettings:()=>Da});var a=r(3028),i=r(4795),o=r(3395),s=r(381),c=r(687),l=r(178),u=r(3913),d=r(9686),p=r(8874),f=(r(8525),r(7857));function v(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=r(2159),m=r(5178);function g(e,t){var r=(0,m.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&y(a,t))return n}}function y(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function b(e){var t;return!e||(null===(t=ga().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var w,E=["extraQuery","clear","keepHash"],S=!1;function k(e,t){t(!(S=!confirm(e)))}function A(){if(!w){var e=(0,f.createBrowserHistory)({basename:v().replace(/\/$/,""),getUserConfirmation:k});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function i(e,t,n){S=!1,r(e,t),null==n||n(S)}function o(e,t,r){S=!1,n(e,t),null==r||r(S)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:c,keepHash:l}=n,u=(0,h.Z)(n,E),d=new URLSearchParams(c?"":e.location.search),p={};for(var[f,v]of(Object.assign(p,r,s),Object.entries(p)))if(Array.isArray(v))for(var m of(d.delete(f),v))d.append(f,m);else null==v||""===v?d.delete(f):d.set(f,v);("push"===t?i:o)("?".concat(d.toString()).concat(l?e.location.hash:""),u,a)}}return(0,a.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){i((0,a.Z)((0,a.Z)({},e.location),{},{key:void 0,hash:t,state:(0,a.Z)({notify:!1},r)}),void 0,n)},reload:function(t){o((0,a.Z)((0,a.Z)({},e.location),{},{state:(0,a.Z)((0,a.Z)({},e.location.state),{},{notify:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(a,i,o){var s,c="string"==typeof a;return"string"==typeof(s=c?(0,f.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&b(function(e){var t,r;return g(null!==(t=null===(r=pa)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](c?v()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,i,o)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:i,replace:o})))}(e)),w=e}return w}function Z(){var e;return null!==(e=w)&&void 0!==e?e:function(){var{dll:e}=window;if("function"==typeof e)return e("tYg3").getHistory()}()}var I=r(5866),P=r(6171),O=r(9516),C=r(1414),x=r(3105),T=r(3140),R=r(6685),B=new WeakMap,M=new class{constructor(){(0,o.Z)(this,B,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,c.Z)(this,B).get(r);if(a||(a=new Map,(0,c.Z)(this,B).set(r,a)),a.has(n))throw new Error('Custom processor of "'.concat(e,'" already registered'));a.set(n,t)}get(e){return(0,c.Z)(this,B).get(e)}};function _(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=L("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;l.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)l.i18n.removeResourceBundle(e,n)}}}function L(e,t){return"".concat(e,"/").concat(t)}function F(e,t){var r=L("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;l.i18n.addResourceBundle(t,r,n)}))}function U(e){return l.i18n.getFixedT(null,L("widget",e))}var N,j="brick-next-devtools-panel",D="devtools-frame-active-change",V="devtools-panel-change",W=!0;function q(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var $=()=>{throw new Error("Can't modify read-only proxy object")},H={set:$,defineProperty:$,deleteProperty:$,setPrototypeOf:$};function z(e){return new Proxy(e,H)}function K(e){var{get:t,ownKeys:r}=e;return q()?z(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var G="light",J=new d.JsonStorage(localStorage),Y="apps-theme";function X(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));G=e}function Q(){return G}function ee(){return document.documentElement.dataset.theme}function te(e){e?X(e):e=Q(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function re(e){J.setItem(Y,(0,a.Z)((0,a.Z)({},ne()),e))}function ne(){var e,t;try{t=J.getItem(Y)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var ae="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));ae=e}function oe(){return document.documentElement.dataset.mode}function se(e){e?ie(e):e=ae,e!==oe()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(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 le(e,t){var r={};for(var n of e){var a=ue(n,t);void 0!==a&&(r[n]=a)}return r}function ue(e,t){var r,n,a,{collectCoverage:i,widgetId:o,widgetVersion:s,app:c,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return i?"/next":v().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>"mock/images/".concat(e)}:o?null==va||null===(r=va.images)||void 0===r?void 0:r.widgetImagesFactory(o,s):null==va||null===(n=va.images)||void 0===n?void 0:n.imagesFactory(c.id,c.isBuildPush,c.currentVersion);case"I18N":return i?m.identity:o?U(o):l.i18n.getFixedT(null,[u,L("app",c.id)].filter(Boolean));case"I18N_TEXT":return i?de:l.i18nText;case"PERMISSIONS":return z({check:i?pe:null==va||null===(a=va.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return z({getTheme:i?()=>"light":Q});case"console":return p?z(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function pe(){return!0}function fe(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new Map,o=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,c=i.get(a);if(c){if(c.processed)return c.cooked;n&&(s=n.createCollector(a));var l=(0,C.precookFunction)(c.source,{typescript:c.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return c.cooked=(0,C.cook)(l.function,c.source,{rules:{noVar:!0},globalVariables:(0,R.supply)(l.attemptToVisitGlobals,le(l.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:o,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),c.processed=!0,c.cooked}}(s)});return{storyboardFunctions:o,registerStoryboardFunctions:function(t,r){if(r&&(e=r),i.clear(),Array.isArray(t))for(var a of t){var o=(0,x.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,x.collectMemberUsageInFunction)(a,"PERMISSIONS",!!n).has("check");i.set(a.name,{source:a.source,typescript:a.typescript,deps:o,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,x.collectMemberUsageInFunction)(r,"FN",!0),o=(0,x.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");i.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:o})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=i.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:ve,registerStoryboardFunctions:he,checkPermissionsUsage:me}=fe(),ge=r(761),ye=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),be=new Map([[ye.xLarge,"1920px"],[ye.large,"1600px"],[ye.medium,"1280px"],[ye.small,"1024px"],[ye.xSmall,0]]),we=new ge.Z,Ee={},Se={};function ke(e,t){var r=!1;for(var[n]of(Ee[t]=e.matches,be))if(Ee[n]&&Se.breakpoint!==n){Se.breakpoint=n,r=!0;break}r&&we.dispatchEvent(new CustomEvent("change",{detail:Se}))}be.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));ke(r,t),r.addEventListener?r.addEventListener("change",(e=>{ke(e,t)})):r.addListener((e=>{ke(e,t)}))}));var Ae=()=>Se;function Ze(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 Ie(e){var t,r;return!(null===(t=e?e.flags:null===(r=ga())||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 i=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(i),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(i),...n)}var Oe=new Set(["prefix"]),Ce=new WeakMap,xe=new class{constructor(){(0,o.Z)(this,Ce,{writable:!0,value:new Map})}define(e,t){var r,n,i,o,s=(0,c.Z)(this,Ce).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 l=Ie(),u=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},d=[],p=[];for(var[f,v]of Object.entries(u))v.asVariable?(Pe(l,"Template `asVariable`",e,f),l||p.push(f)):v.mergeProperty||v.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,f):v.ref&&d.push([f,v]);var h=(0,a.Z)((0,a.Z)({},t),{},{proxy:(0,a.Z)((0,a.Z)({},t.proxy),{},{properties:Object.fromEntries(d)}),state:(t.state?l?t.state:t.state.map((e=>(0,a.Z)({expose:!0},e))):[]).concat(p.map((e=>({name:e,expose:!0}))))});(0,c.Z)(this,Ce).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var g,y,b=(g=h.state,(0,m.uniq)(null!==(y=null==g?void 0:g.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==y?y:[])),w=Object.entries(null!==(i=null===(o=h.proxy)||void 0===o?void 0:o.methods)&&void 0!==i?i:{}),E=b.concat(d.map((e=>e[0]))),S=w.map((e=>e[0])),k=E.concat(S).filter((e=>e in HTMLElement.prototype&&!Oe.has(e)));if(k.length>0&&(Pe(l,"Using native HTMLElement properties as template properties or methods",e,...k),l))throw new Error('In custom template "'.concat(e,'", ').concat(k.map((e=>'"'.concat(e,'"'))).join(", ")," are native HTMLElement properties, and should be avoid to be used as brick properties or methods."));if(!s){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return E}static get _dev_only_definedMethods(){return S}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var A=function(r){if(d.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),1;Object.defineProperty(t.prototype,r,{get(){return this.$$tplStateStore.getValue(r)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(r,e,"replace")},enumerable:!0})};for(var Z of b)A(Z);var I=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,i=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);i&&(i[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[P,O]of d)I(P,O);var C=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,T]of w)C(x,T);customElements.define(e,t)}}get(e){return(0,c.Z)(this,Ce).get(e)}};function Te(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 i=a.get(n);if(!i)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 i}function Re(e,t,r){var n=Te(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 Be=new Map,Me=new Proxy(Object.freeze({}),{get:(e,t)=>Be.get(t)});function _e(e,t,r){if(Be.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=fe({widgetId:e,widgetVersion:r});Be.set(e,n),a(t)}var Le=r(953);function Fe(e,t){var r=Za(e);if(!r&&null!=va&&va.checkInstalledApps&&(r=va.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(0,Le.q)(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ue(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 i=a.get(n);if(!i)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 i}var Ne=new Map;function je(e){return De.apply(this,arguments)}function De(){return De=(0,i.Z)((function*(e){var t,r=null==va||null===(t=va.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=va.flowApi.FLOW_API_PROVIDER);var n=Ne.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)va.flowApi.registerFlowApiProvider();else if(yield(0,u.loadBricksImperatively)([e],Ea()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Ne.set(e,n),n})),De.apply(this,arguments)}var Ve=new WeakSet;function We(e){if((0,d.isObject)(e)&&!qe(e))if(Ve.add(e),Array.isArray(e))e.forEach(We);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(We)}}function qe(e){return Ve.has(e)}var $e=new Map;function He(e,t,r){return ze.apply(this,arguments)}function ze(){return(ze=(0,i.Z)((function*(e,t,r){var{useProvider:n,method:i="resolve",args:o=[],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=Ie();if(Pe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([je(n),ct(o,t)]),h=Ke(f,n,i,v,r,o),{transform:g}=e;try{var y=yield h;We(p=u?(0,m.get)(y,l):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,p=e}return g?"string"==typeof g?{[g]:p}:ct(g,(0,a.Z)((0,a.Z)({},t),{},{data:p})):p}))).apply(this,arguments)}function Ke(e,t,r,n,a,i){return Ge.apply(this,arguments)}function Ge(){return Ge=(0,i.Z)((function*(e,t,r,n,a,o){var s,c;try{s=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!o)throw e;s=JSON.stringify({useProvider:t,method:r,originalArgs:o})}return"reload"!==(null==a?void 0:a.cache)&&(c=$e.get(s)),c||(c=(0,i.Z)((function*(){var a,i=null!=va&&null!==(a=va.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield va.flowApi.getArgsOfFlowApi(t,n,r):n;return e.resolve(...i)}))(),$e.set(s,c)),c})),Ge.apply(this,arguments)}var Je=Symbol.for("pre.evaluated.raw"),Ye=Symbol.for("pre.evaluated.context");function Xe(e){return!(null==e||!e[Je])}function Qe(e){return e[Je]}function et(e){return"string"==typeof e?(0,C.shouldAllowRecursiveEvaluations)(e):(0,C.shouldAllowRecursiveEvaluations)(e[Je])}var tt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function rt(e){return tt.has(e.constructor)?e.constructor:TypeError}function nt(){return(nt=(0,i.Z)((function*(e,t,r){var{blockingList:n,run:a}=at(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function at(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,i=[];if("string"!=typeof e){var o=(0,m.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.Z)((0,a.Z)({},e[Ye]),o),e=e[Je]}var s,c={usedArgs:new Set},l={usedArgs:new Set};try{s=(0,C.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,x.collectAppGetMenuUsage)(c,e,t),(0,x.collectInstalledAppsHasUsage)(l,e,t)}}})}catch(t){var p="".concat(t.message,', in "').concat(e,'"');throw new(rt(t))(p)}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 f,v,h,g,y={},{attemptToVisitGlobals:b}=s;if(r.lazy||b.has("EVENT")&&!(0,d.hasOwnProperty)(t,"event")||b.has("DATA")&&!(0,d.hasOwnProperty)(t,"data"))return{blockingList:i,run:()=>Object.keys(t).length>0?{[Je]:e,[Ye]:t}:e};var w,E,S=Ie(t);(b.has("STATE")||!S&&b.has("TPL"))&&(g=Te(t,"STATE",': "'.concat(e,'"'))),b.has("FORM_STATE")&&(E=Ue(t,"FORM_STATE",': "'.concat(e,'"')));var k=q();if(n||k){if(b.has("CTX")&&(f=(0,x.strictCollectMemberUsage)(e,"CTX"),n&&i.push(t.ctxStore.waitFor(f))),g){if(h=(0,x.strictCollectMemberUsage)(e,"STATE"),!S){var A=(0,x.strictCollectMemberUsage)(e,"TPL");for(var Z of A)h.add(Z)}n&&i.push(g.waitFor(h))}E&&(w=(0,x.strictCollectMemberUsage)(e,"FORM_STATE"),n&&i.push(E.waitFor(w))),b.has("PROCESSORS")&&(v=(0,x.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&i.push((0,u.loadProcessorsImperatively)(v,Ea())))}if(n){var I,P=b.has("PERMISSIONS");if(!P&&b.has("FN")){var O=[...(0,x.strictCollectMemberUsage)(e,"FN")];P=me(O)}if(P&&i.push(...t.pendingPermissionsPreCheck),c.usedArgs.size>0&&null!=va&&va.menu){var T=[...c.usedArgs];i.push(Promise.all(T.map((e=>va.menu.fetchMenuById(e,t,{getStoryboardByAppId:Aa,resolveData:He,asyncComputeRealValue:ct})))))}l.usedArgs.size>0&&i.push(null==va||null===(I=va.checkInstalledApps)||void 0===I?void 0:I.waitForCheckingApps([...l.usedArgs]))}return{blockingList:i,run(){var r,n,i,o,{app:c,location:l,query:u,match:p,flags:k,sys:A,ctxStore:Z,data:I,event:P}=t,O=null!==(r=t.overrideApp)&&void 0!==r?r:c;for(var x of b)switch(x){case"ANCHOR":y[x]=l.hash?l.hash.substring(1):null;break;case"APP":y[x]=(0,a.Z)((0,a.Z)({},(0,m.cloneDeep)(O)),{},{getMenu:null==va||null===(n=va.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":y[x]=K({get:(e,t)=>Z.getValue(t),ownKeys:()=>Array.from(f)});break;case"DATA":y[x]=I;break;case"EVENT":y[x]=P;break;case"FLAGS":y[x]=z(k);break;case"FORM_STATE":y[x]=K({get:(e,t)=>E.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":y[x]=l.hash;break;case"INSTALLED_APPS":y[x]=z({has:Fe});break;case"ITEM":case"INDEX":var T="ITEM"===x?"forEachItem":"forEachIndex";(0,d.hasOwnProperty)(t,T)?y[x]=t[T]:console.error("Using `".concat(x,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":y[x]=z({getItem:Ze("local")});break;case"MEDIA":y[x]=z(Ae());break;case"MISC":y[x]=ga().getMiscSettings();break;case"PARAMS":y[x]=new URLSearchParams(u);break;case"PATH":y[x]=z(null!==(i=null==p?void 0:p.params)&&void 0!==i?i:{});break;case"PATH_NAME":y[x]=l.pathname;break;case"PROCESSORS":y[x]=K({get(e,t){var r=M.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return K({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of v){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":y[x]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":y[x]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":y[x]=z({getItem:Ze("session")});break;case"TPL":if(Pe(S,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),S)break;case"STATE":y[x]=K({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":y[x]=z(null!=A?A:{});break;case"__WIDGET_FN__":y[x]=Me;break;case"__WIDGET_IMG__":y[x]=null==va||null===(o=va.images)||void 0===o?void 0:o.widgetImagesFactory;break;case"__WIDGET_I18N__":y[x]=U}Object.assign(y,le(s.attemptToVisitGlobals,{storyboardFunctions:ve,app:t.app,appendI18nNamespace:t.appendI18nNamespace}));try{var B=(0,C.cook)(s.expression,s.source,{globalVariables:(0,R.supply)(s.attemptToVisitGlobals,y)});return function(e,t){var r=q();if(r&&W&&(!N||"Evaluations"===N)){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)}}("evaluation",{raw:e,context:y,result:B}),B}catch(t){var _="".concat(t.message,', in "').concat(e,'"');throw new(rt(t))(_)}}}}var it=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 ot(e){switch(e){case it.USE_BRICK_PROPERTIES:case it.USE_BRICK_TRANSFORM:case it.USE_BRICK_EVENTS:case it.USE_BRICK_IF:case it.USE_BRICK_LIFECYCLE:case it.USE_BRICK_DATA_SOURCE:return!0}return!1}function st(e,t,r){if(ot(e))return e;if(t)switch(e){case it.USE_BRICK:return it.USE_BRICK_ITEM;case it.USE_BRICK_SLOTS_ITEM_BRICKS:return it.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case it.INITIAL:if("useBrick"===r)return it.USE_BRICK;break;case it.USE_BRICK:case it.USE_BRICK_ITEM:case it.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return it.USE_BRICK_PROPERTIES;case"transform":return it.USE_BRICK_TRANSFORM;case"dataSource":return it.USE_BRICK_DATA_SOURCE;case"events":return it.USE_BRICK_EVENTS;case"slots":return it.USE_BRICK_SLOTS;case"children":return it.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return it.USE_BRICK_IF;case"lifeCycle":return it.USE_BRICK_LIFECYCLE}break;case it.USE_BRICK_SLOTS:return it.USE_BRICK_SLOTS_ITEM;case it.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return it.USE_BRICK_SLOTS_ITEM_BRICKS}return it.INITIAL}function ct(e,t){return lt.apply(this,arguments)}function lt(){return lt=(0,i.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Xe(e);if(n||"string"==typeof e){var a,i=r.$$lazyForUseBrick&&ot(r.$$stateOfUseBrick),o=i;return n||(0,C.isEvaluable)(e)?(a=yield function(e,t,r){return nt.apply(this,arguments)}(e,t,{lazy:i}),o=et(e)):a=i?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?pt:T.inject)(e,t),o||We(a),a}if(!(0,d.isObject)(e)||qe(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=dt(r,!0);return Promise.all(e.map((e=>ct(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([ct(n,t),ct(a,t,dt(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),lt.apply(this,arguments)}function ut(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Xe(e);if(n||"string"==typeof e){var a,i=r.$$lazyForUseBrick&&ot(r.$$stateOfUseBrick),o=i;return n||(0,C.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=at(e,t,void 0,!1);return n()}(e,t),o=et(e)):a=i?e:((0,d.hasOwnProperty)(t,"data")?r.noInject?T.transform:T.transformAndInject:r.noInject?pt:T.inject)(e,t),o||We(a),a}if(!(0,d.isObject)(e)||qe(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=dt(r,!0);return e.map((e=>ut(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[ut(n,t),ut(a,t,dt(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function dt(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:st(e.$$stateOfUseBrick,t,r)}):e}function pt(e){return e}function ft(e,t){return vt.apply(this,arguments)}function vt(){return(vt=(0,i.Z)((function*(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||Xe(e.if)?yield ct(e.if,t):e.if)}))).apply(this,arguments)}function ht(e,t){return!(0,d.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||Xe(e.if)?ut(e.if,t):e.if)}function mt(e){return!(0,d.hasOwnProperty)(e,"if")||!!e.if}function gt(){return(gt=(0,i.Z)((function*(e,t){return(0,d.isObject)(e.if)&&!Xe(e.if)?mt(yield He(e.if,t)):ft(e,t)}))).apply(this,arguments)}function yt(e,t){return ht(e,{data:t})}function bt(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,C.isEvaluable)(e):Xe(e)){var a="string"==typeof e?e:Qe(e);if((0,C.isTrackAll)(a)){var i=(0,x.trackAll)(a);i&&(t=i.context,r=i.state,n=i.formState)}else t=(0,x.track)(a,"track context","CTX"),r=(0,x.track)(a,"track state","STATE"),n=(0,x.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function wt(e,t){return Et.apply(this,arguments)}function Et(){return(Et=(0,i.Z)((function*(e,t){for(var[r,n,a]of e)if(r===t){var i=yield n;if(void 0!==i||!a)return i}}))).apply(this,arguments)}function St(e){return kt.apply(this,arguments)}function kt(){return(kt=(0,i.Z)((function*(e){var t={};for(var[r,n,a]of e){var i=yield n;void 0===i&&a||!("style"!==r&&"dataset"!==r||(0,d.isObject)(i))||(t[r]=i)}return t}))).apply(this,arguments)}function At(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,i]of Object.entries(n))e[r][a]=i;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Zt(e,t,r){var n=function(e,t){return(0,d.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=ut(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?it.USE_BRICK:it.INITIAL});if("style"!==r&&"dataset"!==r||(0,d.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{At(e,n)}))}var It=r(6903),Pt=new Map,Ot=1e4,Ct=0;function xt(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:i=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:o,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Pt.get(r);n||Pt.set(r,n=new Map);var a=n.get(e);if(a)return a;var i=[],o={regexp:(0,It.Bo)(e,i,t),keys:i};return Ct<Ot&&(n.set(e,o),Ct++),o}(r,{end:n,strict:a,sensitive:i}),c=o.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 Tt(){return(Tt=(0,i.Z)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=Rt(r,t.app.homepage,t.location.pathname);if(n&&(yield ft(r,t)))return t.app.noAuthGuard||r.public||null==va||!va.auth||va.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function Rt(e,t,r){return xt(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Bt,Mt=Symbol.for("tpl.asyncComputedPropsFromHost"),_t=Symbol.for("tpl.stateStoreId"),Lt=Symbol.for("tpl.externalForEachItem"),Ft=Symbol.for("tpl.externalForEachIndex"),Ut=r(6666),Nt=new Set,jt=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}({}),Dt={[jt.REQUEST_FAILED]:"Request Failed",[jt.SOMETHING_WENT_WRONG]:"Something went wrong!",[jt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[jt.NETWORK_ERROR]:"Network error, please check your network."},Vt={[jt.REQUEST_FAILED]:"请求失败",[jt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[jt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[jt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},Wt="core/runtime",qt={en:Dt,zh:Vt},$t=Object.freeze({show:function(e){return Bt?Bt.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 Ht(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof O.HttpFetchError)return l.i18n.t("".concat(Wt,":").concat(jt.NETWORK_ERROR));if(e instanceof O.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 zt(e){return e instanceof O.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var Kt,Gt,Jt=!1;function Yt(e){if(!(e instanceof O.HttpAbortError)){if(zt(e)&&!window.NO_AUTH_GUARD){if(Jt)return;return Jt=!0,void $t.show({type:"confirm",content:l.i18n.t("".concat(Wt,":").concat(jt.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=ga().getFeatureFlags()["sso-enabled"],(t=Z()).push(e?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},t.location),{},{state:void 0})}),Jt=!1}),(()=>{Jt=!1}))}console.error(e);var t=Ht(e);t!==Kt&&(Kt=t,$t.show({type:"error",title:l.i18n.t("".concat(Wt,":").concat(jt.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap"}}).then((()=>{Kt=void 0})))}}var Xt=Object.freeze({show:function(e){Gt?Gt.resolve(e):alert(e.message)}});function Qt(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,i=ar(a,r,{element:e});for(var o of(e.addEventListener(n,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,i]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,o])}))}function er(e){return"string"==typeof e.action}function tr(e){return"string"==typeof e.useProvider}function rr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function nr(e){return!!e.then}function ar(e,t,r){return function(n){var i,o;for(var s of[].concat(e))if(ht(s,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(nr(s))ar(s.then,t,r)(n);else if(er(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":ur(n,l,s.args,s.callback,t);break;case"window.open":dr(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":gr(n,c,l,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"console.log":case"console.error":case"console.warn":case"console.info":yr(n,l,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":br(n,l,s.args,t);break;case"handleHttpError":Yt(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":fr(n,l,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":vr(n,l,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=kr(s.args,t,n);Re(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":hr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":wr(n,l,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[p]=kr(s.args,t,n);te(p);break;case"mode.setDashboardMode":case"mode.setDefaultMode":se("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else tr(s)?ir(n,s,t,r):rr(s)?sr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&ar(s.else,t,r)(n)}}function ir(e,t,r,n){return or.apply(this,arguments)}function or(){return(or=(0,i.Z)((function*(e,t,r,n){try{cr(e,yield je(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(Ht(e))}}))).apply(this,arguments)}function sr(e,t,r,n){var i=[],o=t.target,s=t.targetRef,c=o;if(("string"==typeof o?(0,C.isEvaluable)(o):Xe(o))&&(c=ut(o,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof c)if("_self"===c)i.push(n.element);else if(t.multiple)i=Array.from(document.querySelectorAll(c));else{var l=document.querySelector(c);null!==l&&i.push(l)}else if(c)c instanceof HTMLElement?i.push(c):console.error("unexpected target:",c);else if(s){var u=s;("string"==typeof s?(0,C.isEvaluable)(s):Xe(s))&&(u=ut(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var d=[].concat(u),p=Re(r,"targetRef",": ".concat(d.join(", ")));i.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==i.length?function(e){return!!e.method}(t)?i.forEach((a=>{cr(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Zt(i,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",o||s)}function cr(e,t,r,n,a,i,o){return lr.apply(this,arguments)}function lr(){return lr=(0,i.Z)((function*(e,t,r,n,o,s,c){var l;if("function"==typeof t[n]){var u=function(){var a=(0,i.Z)((function*(){var a,i=kr(r.args,o,e,c);return tr(r)&&null!=va&&null!==(a=va.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(i=yield va.flowApi.getArgsOfFlowApi(r.useProvider,i,n)),t[n](...i)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var d,p=Sr(r.callback,o,s),f={progress:p("progress"),success:p("success"),error:p("error"),finally:p("finally")};if(tr(r)&&(d=ut(r.poll,(0,a.Z)((0,a.Z)({},o),{},{event:e}))),null!==(l=d)&&void 0!==l&&l.enabled)!function(e,t,r){var n,{progress:a,success:o,error:s,finally:c}=t,{interval:l,leadingRequestDelay:u,continueOnError:d,delegateLoadingBar:p,expectPollEnd:f,expectPollStopImmediately:v}=r,h=Sa();function m(){return g.apply(this,arguments)}function g(){return(g=(0,i.Z)((function*(){var t;Nt.delete(n);try{if(!(t=null==v?void 0:v())){var r=yield e();(t=(null==v?void 0:v())||h!==Sa())||(null==a||a(r),null!=f&&f(r)?(p&&window.dispatchEvent(new Event("request.end")),null==o||o(r),null==c||c()):y(null!=l?l:3e3))}}catch(e){(t=(null==v?void 0:v())||h!==Sa())||(null==s||s(e),d?y(null!=l?l:3e3):null==c||c())}finally{p&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function y(e){n=setTimeout(m,e),Nt.add(n)}y(null!=u?u:0),p&&window.dispatchEvent(new Event("request.start"))}(u,f,d);else try{var v=yield u();f.success(v)}catch(e){f.error(e)}finally{f.finally()}}else u()}else console.error("target has no method:",{target:t,method:n})})),lr.apply(this,arguments)}function ur(e,t,r,n,a){var i=0,o=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,o=!0;break;case"reload":o=!0;break;case"block":i=1,s="setBlockMessage"}var c=[];if(i>0&&((c=kr(r,a,e,{useEventDetailAsDefault:!0})).length=i),o&&n){var l=Sr(n,a,void 0);c.push((e=>{l(e?"error":"success")({blocked:e}),l("finally")({blocked:e})}))}Z()[s](...c)}function dr(e,t,r){var[n,a,i]=kr(t,r,e);window.open(n,a||"_self",i)}function pr(e,t,r,n,a,i){t?n.updateValues(e,r,(e=>kr(e,a,i)[0])):e.forEach((e=>{var{name:t,value:o}=kr([e],a,i)[0];n.updateValue(t,o,r)}))}function fr(e,t,r,n,a,i){if(!Array.isArray(r)||!r.every(d.isObject)||"assign"!==t&&"replace"!==t){var[o,s]=kr(r,i,e);i.ctxStore.updateValue(o,s,t,a,i)}else pr(r,n,t,i.ctxStore,i,e)}function vr(e,t,r,n,a,i){if(Array.isArray(r)&&r.every(d.isObject)&&"update"===t)pr(r,n,"replace",Te(i,"state.".concat(t),": ".concat(JSON.stringify(r))),i,e);else{var[o,s]=kr(r,i,e);Te(i,"state.".concat(t),": ".concat(o)).updateValue(o,s,"update"===t?"replace":t,a,i)}}function hr(e,t,r,n){var[a,i]=kr(t,n,e);Ue(n,"formstate.update",": ".concat(a)).updateValue(a,i,"replace",r,n)}function mr(e,t,r,n){if("assign"===t){var[a]=kr(r,n,e);location.assign(a)}else location[t]()}function gr(e,t,r,n,a){var i="localStorage"===t?localStorage:sessionStorage,[o,s]=kr(n,a,e);"setItem"===r?void 0!==s&&i.setItem(o,JSON.stringify(s)):i.removeItem(o)}function yr(e,t,r,n){console[t](...kr(r,n,e,{useEventAsDefault:!0}))}function br(e,t,r,n){var a=kr(r,n,e,{useEventAsDefault:!0});Xt.show({type:t,message:a[0]})}function wr(e,t,r,n,a,i){return Er.apply(this,arguments)}function Er(){return(Er=(0,i.Z)((function*(e,t,r,n,a,i){var o=()=>{var a,i=kr(r,n,e);return null==va||null===(a=va.messageDispatcher)||void 0===a?void 0:a[t](...i)};if(i){var s=Sr(i,n,a);try{var c=yield o();s("success")(c)}catch(e){s("error")(e)}finally{s("finally")()}}else o()}))).apply(this,arguments)}function Sr(e,t,r){return function(n){return function(a){var i=null==e?void 0:e[n];if(i)try{var o=new CustomEvent("callback.".concat(n),{detail:a});ar(i,t,r)(o)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function kr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?ut(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}var Ar=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Zr{constructor(e,t,r){(0,Ut.Z)(this,"type",void 0),(0,Ut.Z)(this,"data",new Map),(0,Ut.Z)(this,"changeEventType",void 0),(0,Ut.Z)(this,"pendingStack",[]),(0,Ut.Z)(this,"hostBrick",void 0),(0,Ut.Z)(this,"batchUpdate",!1),(0,Ut.Z)(this,"batchUpdateContextsNames",[]),(0,Ut.Z)(this,"rendererContext",void 0),(0,Ut.Z)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");var n={},a={},i=[];e.forEach((e=>{var{name:a,value:o}=r([e]),s=this.data.get(a);i.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,o,t)})),i.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[e]=t)}));var o=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}))}};o(n),o(a),this.batchUpdate=!1}updateValue(e,t,r,n,i){var o=this.data.get(e);if(!o)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?o.value=t:(0,d.isObject)(o.value)?Object.assign(o.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(e,'" for "context.assign", try "context.replace" instead.')),o.value=t),this.batchUpdate||o.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:o.value}));else{if(!o.load)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which has no resolve'));var s;if("load"===r&&(o.loaded?s=Promise.resolve(o.value):o.loading&&(s=o.loading)),s||(s=o.loading=o.load((0,a.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{o.loaded=!0,o.value=e,o.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:o.value}))}),(e=>{null!=n&&n.error||Yt(e)})),n){var c=Sr(n,i);s.then((e=>{c("success")({value:e}),c("finally")()}),(e=>{c("error")(e),c("finally")()}))}}}define(e,t,r,n){if(Array.isArray(e)&&e.length>0){var a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX",n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",r=new Map;for(var n of e){var a=(0,x.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var o of Array.from(n.keys()).map((e=>e.name))){var s;a.set(o,(null!==(s=a.get(o))&&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})}))]))),p=function(){var e=(0,i.Z)((function*(e){var r;l.add(e);var i=yield t(e);n.delete(e);var o=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(i){if(u.get(e.name).resolve(),a.delete(e.name),0===o)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===o?(u.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,o-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=c;function v(){return h.apply(this,arguments)}function h(){return h=(0,i.Z)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(a,f)).map((e=>e[0])).filter((e=>!l.has(e)));yield Promise.all(e.map(p))})),h.apply(this,arguments)}return{pendingResult:v().then((0,i.Z)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),a=()=>{var e=!1;for(var[t,i]of r.entries())[...i.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r,n)),this.type);this.pendingStack.push(a)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,i.Z)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,i.Z)((function*(){for(var{pendingContexts:t}of e.pendingStack)for(var r of t.values())r.catch((()=>{}));for(var{pendingResult:n}of e.pendingStack)yield n}))()}mountAsyncData(e){this.data.forEach((t=>{var r;if(t.async&&(!e||null!==(r=this.routeMap.get(e))&&void 0!==r&&r.has(t.name))){if(t.asyncMounted)return void console.error('Async data "'.concat(t.name,'" already mounted. This is a bug of Brick Next, please report it.'));t.asyncMounted=!0,t.loading.then((e=>{t.loaded=!0,t.value=e,t.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:e}))}))}}))}resolve(e,t,r,n){var o=this;return(0,i.Z)((function*(){if(!(yield ft(e,t)))return!1;var s,c,l;r&&("STATE"===o.type?e.expose:"FORM_STATE"===o.type)&&(s=yield wt(r,e.name));var u="eager";if(void 0===s){if(e.resolve){var p=(0,a.Z)({transform:"value"},e.resolve);if(yield ft(e.resolve,t))c=function(){var e=(0,i.Z)((function*(e){return(yield He(p,t,e)).value}));return function(t){return e.apply(this,arguments)}}(),"eager"==(u=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield c():"async"===u&&(l=c());else if(!(0,d.hasOwnProperty)(e,"value"))return!1}c&&"eager"===u||void 0===e.value||(s=yield ct(e.value,t))}var f={name:e.name,value:s,eventTarget:new ge.Z,load:c,loaded:"eager"===u,loading:l,async:"async"===u,deps:[]};if("lazy"===u){var v,{trigger:h}=e.resolve;h&&Ar.includes(h)&&(null===(v=o.rendererContext)||void 0===v||v.registerArbitraryLifeCycle(h,(()=>{o.updateValue(e.name,void 0,"load")})))}if(e.onChange&&f.eventTarget.addEventListener(o.changeEventType,ar(e.onChange,t)),e.track){var m=(0,x.strictCollectMemberUsage)(c?e.resolve:e.value,o.type);for(var g of(!c&&(f.deps=[...m]),m))o.onChange(g,o.batchAddListener((()=>{c?o.updateValue(e.name,{cache:"default"},"refresh"):o.updateValue(e.name,ut(e.value,t),"replace")}),e))}if(o.data.has(e.name))throw new Error("".concat(o.type," '").concat(e.name,"' has already been declared"));if(o.data.set(e.name,f),Array.isArray(n))for(var y of n){var b=o.routeMap.get(y);b?b.add(e.name):o.routeMap.set(y,new Set([e.name]))}return!0}))()}disposeDataInRoutes(e){for(var t of e){var r=this.routeMap.get(t);if(void 0!==r)for(var n of r)this.data.delete(n)}}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function Ir(e,t,r){var n,a,{reversedProxies:i,asyncHostPropertyEntries:o,externalSlots:s,tplStateStoreId:c,hostBrick:l}=e;if(t&&i){var u=i.properties.get(t);u&&(a=o,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,wt(n,t),!0]})).filter(Boolean));var p=i.slots.get(t);if(p&&s){var f=new Map;for(var{from:v,to:h}of p){var g,y,b,w,E=null!==(g=null===(y=s[v])||void 0===y?void 0:y.bricks)&&void 0!==g?g:[];if(E.length){var S=null!==(b=h.refSlot)&&void 0!==b?b:v,k=f.get(S);if(!k){k=[];for(var A=(0,d.hasOwnProperty)(r,S)?r[S].bricks.length+1:1,Z=0;Z<A;Z+=1)k.push([]);f.set(S,k)}var I=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,m.clamp)(I<0?k.length+I:I,0,k.length-1)].push(...(0,d.hasOwnProperty)(l.runtimeContext,"forEachItem")?Pr(E,l.runtimeContext.forEachItem,l.runtimeContext.forEachIndex):E)}}var P=function(){(0,d.hasOwnProperty)(r,O)||(r[O]={type:"bricks",bricks:[]});var e=r[O];e.bricks=C.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[O]};for(var[O,C]of f.entries())P()}}return{[Mt]:n,[_t]:c}}function Pr(e,t,r){return e.map((e=>{var n;return(0,a.Z)((0,a.Z)({},e),{},{[Lt]:t,[Ft]:r,slots:Object.fromEntries(Object.entries(null!==(n=e.slots)&&void 0!==n?n:{}).map((e=>{var n,[a,i]=e;return[a,"routes"===i.type?{type:"routes",routes:Or(i.routes,t,r)}:{type:"bricks",bricks:Pr(null!==(n=i.bricks)&&void 0!==n?n:[],t,r)}]})))})}))}function Or(e,t,r){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Pr(e.bricks,t,r)})))}var Cr=["properties","slots","children"];function xr(e,t){function r(e){return(0,d.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,d.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:i,slots:o,children:s}=e,c=(0,h.Z)(e,Cr),l=nn(s,o),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.Z)((0,a.Z)({},c),{},{properties:r(i),slots:u},Ir(t,c.ref,u))}return r(e)}var Tr=["slots","children"],Rr=["properties","slots","children"];function Br(e,t,r,n,i){var o,s=(0,m.uniqueId)("tpl-state-"),c=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete c.forEachItem,delete c.forEachIndex,delete c.formStateStoreId;var l=new Zr("STATE",r,i);c.tplStateStoreMap.set(s,l),c.tplStateStoreScope&&c.tplStateStoreScope.push(l);var{bricks:u,proxy:d,state:p,contracts:f}=xe.get(e);null==va||null===(o=va.flowApi)||void 0===o||o.collectWidgetContract(f),l.define(p,c,n);var{slots:v,children:g}=t,y=(0,h.Z)(t,Tr),b=(0,a.Z)((0,a.Z)({},y),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var w={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[E,S]of Object.entries(d.properties)){var k=w.properties.get(S.ref);k||(k=[],w.properties.set(S.ref,k)),k.push({from:E,to:S})}if(null!=d&&d.slots)for(var[A,Z]of Object.entries(d.slots)){var I=w.slots.get(Z.ref);I||(I=[],w.slots.set(Z.ref,I)),I.push({from:A,to:Z})}var P={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:nn(g,v),tplStateStoreId:s,hostBrick:r};return b.slots={"":{type:"bricks",bricks:u.map((e=>Mr(e,P)))}},b}function Mr(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:i}=e,o=(0,h.Z)(e,Rr),s=nn(i,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=>Mr(e,t)))}]})));return(0,a.Z)((0,a.Z)({},o),{},{properties:xr(r,t),slots:c},Ir(t,o.ref,c))}var _r=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({}),Lr="form-renderer.form-renderer",Fr=Symbol.for("form.stateStoreId"),Ur=["forms.general-form","form.general-form","eo-form"];function Nr(e,t,r){var{id:n,bricks:i,events:o,context:s,mountPoint:c,instanceId:l}=e,{brick:u,properties:p}=e,f=t.find((e=>e.fieldId===n));if(f){var v=function(e){var t,r={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},n=()=>{var t,r;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(r=e.limit)||void 0===r?void 0:r.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}})};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:(0,a.Z)((0,a.Z)({},r),n())};break;case"FLOAT":t={brick:"forms.general-input-number",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUM":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"ENUMS":t={brick:"forms.general-select",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}})};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})};break;case"IP":t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}})};break;case"JSON":t={brick:"forms.general-textarea",properties:(0,a.Z)({},r)};break;case"ARRAY":t={brick:"forms.general-select",properties:(0,a.Z)({},r)};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:(0,a.Z)((0,a.Z)({},r),n())};break;default:t={brick:"forms.general-input",properties:(0,a.Z)((0,a.Z)((0,a.Z)({},r),n()),{},{placeholder:e.description})}}return t}(f);u||(u=v.brick),p=(0,a.Z)((0,a.Z)({},v.properties),p)}var h={brick:u,properties:p,iid:l,slot:c,events:o,context:s,children:jr(i,t,r),[Fr]:r};return(0,d.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function jr(e,t,r){if(Array.isArray(e))return e.map((e=>Nr(e,t,r)))}var Dr=["blockingList","node","menuRequests","hasTrackingControls"],Vr=["if","permissionsPreCheck"],Wr=["formData"],qr=["src"],$r=["href"];function Hr(e,t,r,n,a,i,o){return zr.apply(this,arguments)}function zr(){return zr=(0,i.Z)((function*(e,t,r,n,i,o,s){var c=yield function(e,t){return Tt.apply(this,arguments)}(t,r),l={blockingList:[],menuRequests:[]};switch(c){case"missed":break;case"unauthenticated":l.unauthenticated=!0;break;default:var d,p=l.route=c.route;l.path=c.match.path;var f=(0,a.Z)((0,a.Z)({},r),{},{match:c.match});s&&f.ctxStore.disposeDataInRoutes(t);var v=i.concat(p);f.ctxStore.define(p.context,f,void 0,v),f.pendingPermissionsPreCheck.push(null==va||null===(d=va.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(p,(e=>ct(e,f))));var{preLoadBricks:h}=p;if(Array.isArray(h)&&l.blockingList.push((0,u.loadBricksImperatively)(h,Ea())),"redirect"===p.type){var m;if("string"!=typeof(m="string"==typeof p.redirect?yield ct(p.redirect,f):(yield He((0,a.Z)({transform:"redirect"},p.redirect),f)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));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 ct(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(p.menu,f);g&&l.menuRequests.push(g),"routes"===p.type?rn(l,yield Hr(e,p.routes,f,n,v,o)):rn(l,yield Kr(e,p.bricks,f,n,v,o)),e.tag===_r.BRICK&&n.memoizeMenuRequests(p,l.menuRequests)}}return l})),zr.apply(this,arguments)}function Kr(e,t,r,n,a,i,o,s){return Gr.apply(this,arguments)}function Gr(){return(Gr=(0,i.Z)((function*(e,t,r,n,a,i,o,s){var c={blockingList:[],menuRequests:[]},l=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>Jr(e,t,r,n,a,i,l.concat(s),o&&new Map(o)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(i,l.concat(r),t.node,e),rn(c,t)})),c}))).apply(this,arguments)}function Jr(e,t,r,n,a,i){return Yr.apply(this,arguments)}function Yr(){return Yr=(0,i.Z)((function*(e,t,r,n,o,s){var c,l,p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,v={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),v;var{if:g,permissionsPreCheck:b}=t,w=(0,h.Z)(t,Vr);if(function(e){return"string"==typeof e?(0,C.isTrackAll)(e):Xe(e)&&(0,C.isTrackAll)(Qe(e))}(g))return Jr(e,(0,a.Z)({brick:":if",dataSource:g,permissionsPreCheck:b,slots:{"":{type:"bricks",bricks:[w]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.Z)((0,a.Z)({},e),{},{[r]:t[r]})),{})),r,n,o,s,p,f);var E=t[_t],S=t[Fr],k=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:E,formStateStoreId:S});(0,d.hasOwnProperty)(t,Lt)&&(k.forEachItem=t[Lt],k.forEachIndex=t[Ft]);var{context:A}=t;if(Array.isArray(A)&&A.length>0){var Z=Ie(k);Pe(Z,"Defining context on bricks","check your brick:",t),Z||k.ctxStore.define(A,k)}if(k.pendingPermissionsPreCheck.push(null==va||null===(c=va.checkPermissions)||void 0===c?void 0:c.preCheckPermissionsForBrickOrRoute(t,(e=>ct(e,k)))),!(yield function(e,t){return gt.apply(this,arguments)}(t,k)))return v;var I=t.brick;if(I.startsWith(":")){var P;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(I);var{dataSource:O}=t,T=function(){var r=(0,i.Z)((function*(r){var a,i=yield ct(O,r),c=":forEach"===I?"":":switch"===I?String(i):i?"":"else",l=nn(t.children,t.slots),u=l&&(0,d.hasOwnProperty)(l,c)&&(null===(a=l[c])||void 0===a?void 0:a.bricks);if(!Array.isArray(u))return{blockingList:[],menuRequests:[]};switch(I){case":forEach":return Array.isArray(i)?function(e,t,r,n,a,i,o,s,c){return Xr.apply(this,arguments)}(e,i,u,r,n,o,s,f,p):{blockingList:[],menuRequests:[]};case":if":case":switch":return Kr(e,u,r,n,o,s,f,p)}}));return function(e){return r.apply(this,arguments)}}(),R=function(){var t=(0,i.Z)((function*(t){var r,n=yield T(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:_r.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),B=yield R(k),{onMount:M,onUnmount:_}=null!==(P=t.lifeCycle)&&void 0!==P?P:{},{contextNames:L,stateNames:F}=bt(O);if(L||F){B.hasTrackingControls=!0;var U=0,N=function(){var t=(0,i.Z)((function*(){var t=++U,[r,a,i]=tn(k),o=yield R(r),c=[...a,...i];if(yield en(o,r,c),U===t)for(var l of(_&&ar(_,k)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,p,o.node,e),M&&ar(M,r)(new CustomEvent("mount",{detail:{rerender:!0}})),c))l.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),j=(0,m.debounce)(N);if(L)for(var D of L)k.ctxStore.onChange(D,j);if(F)for(var V of F)Te(k,"STATE",': "'.concat(O,'"')).onChange(V,j)}return M&&n.registerArbitraryLifeCycle("onMount",(()=>{ar(M,k)(new CustomEvent("mount",{detail:{rerender:!1}}))})),_&&n.registerArbitraryLifeCycle("onUnmount",(()=>{ar(_,k)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),B}/\.tpl-/.test(I)&&!xe.get(I)&&(yield an((0,u.loadBricksImperatively)([I],Ea()),"brick",I,n.unknownBricks));var W,q,$=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){var r="".concat(t,".").concat(e);if(xe.get(r))return r}return!!xe.get(e)&&e}(I,null===(l=k.app)||void 0===l?void 0:l.id);if($){var H,z=null!==(H=f.get($))&&void 0!==H?H:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat($,'"'));f.set($,z+1)}else I.includes("-")&&!customElements.get(I)&&(I===Lr?customElements.define(Lr,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):v.blockingList.push(an((0,u.enqueueStableLoadBricks)([I],Ea()),"brick",I,n.unknownBricks)));if(I===Lr){var K,G=null!==(K=t.properties)&&void 0!==K?K:{};({formData:W}=G),q=(0,h.Z)(G,Wr)}else q=t.properties;var J=[],Y=function(e,t,r){return(0,d.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:i,stateNames:o,formStateNames:s}=bt(a);return(i||o||s)&&r.push({contextNames:i,stateNames:o,formStateNames:s,propName:n,propValue:a}),[n,ct(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?it.USE_BRICK:it.INITIAL})]})):[]}(q,k,J),X=t[Mt];X&&Y.push(...X);var Q="script"===I;if(Q||"link"===I){var ee=yield St(Y);if(Q?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(Q){var{src:ne}=ee,ae=(0,h.Z)(ee,qr);yield an((0,u.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:ie}=ee;ae=(0,h.Z)(ee,$r),yield an((0,u.loadStyle)(ie,re,ae),"stylesheet",ie,"silent")}return v}}var oe={tag:_r.BRICK,type:$||I,return:e,slotId:s,events:t.events,runtimeContext:k,portal:t.portal,iid:t.iid,ref:t.ref};v.node=oe;var se=(0,x.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&v.blockingList.push(an((0,u.loadProcessorsImperatively)(se,Ea()),"processors",[...se].join(", "),n.unknownBricks));var ce=[],le=function(){var e=(0,i.Z)((function*(){oe.properties=yield St(Y),function(e,t){var r=function(t){var r=()=>{e.element&&Zt(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=Te(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var i of t.stateNames)a.onChange(i,r)}if(t.formStateNames){var o=Ue(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)o.onChange(s,r)}};for(var n of t)r(n)}(oe,J)}));return function(){return e.apply(this,arguments)}}();ce.push(le()),n.registerBrickLifeCycle(oe,t.lifeCycle);var ue,de=t;$?de=Br($,t,oe,Y,n):I===Lr&&(de=function(e,t,r,n,i){var o,s,c="string"==typeof e?JSON.parse(e):e,l=(0,m.uniqueId)("form-state-"),u=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{formStateStoreId:l});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var p=new Zr("FORM_STATE",void 0,i);u.formStateStoreMap.set(l,p),u.formStateStoreScope&&u.formStateStoreScope.push(p);var f=null!==(o=c.context)&&void 0!==o?o:[];f.some((e=>"params"===e.name))||f.push({name:"params"}),p.define(f,u,n);var v=Nr(c.formSchema,c.fields,l);return Ur.includes(v.brick)&&t.events&&(v.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,d.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(v.events,t.events)),"boolean"!=typeof(null===(s=t.properties)||void 0===s?void 0:s.renderRoot)||t.properties.renderRoot?(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[v]}]}):(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[v]})}(W,t,oe,Y,n)),de.portal&&(oe.slotId=void 0),$?(delete(ue=(0,a.Z)({},k)).forEachItem,delete ue.forEachIndex):ue=k;var pe=function(){var e=(0,i.Z)((function*(){var e=nn(de.children,de.slots);if(e){var t=new Set,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var[s,c]=e;return"routes"!==c.type?Kr(oe,c.bricks,ue,n,o,s,f):(k.flags["incremental-sub-route-rendering"]&&(t.add(r),n.performIncrementalRender(function(){var e=(0,i.Z)((function*(e){var{homepage:t}=ue.app,{pathname:r}=e;if(!y(t,r)||!o.every((e=>Rt(e,t,r))))return!1;var i,[l,u,d]=tn((0,a.Z)((0,a.Z)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),p=!1,f=[];try{if(!(i=yield Hr(oe,c.routes,l,n,o,s,!0)).route)return!1;if(n.reBailout(i))return!0;f=[...u,...d],yield en(i,l,[l.ctxStore,...f]),yield n.reMergeMenuRequests(c.routes,i.route,i.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var v=n.reCatch(e,oe);if(!v)return!0;({failed:p,output:i}=v),yield n.reMergeMenuRequests(c.routes,i.route,i.menuRequests)}if(n.reRender(s,[],i.node,oe),!p)for(var h of(l.ctxStore.mountAsyncData(i.route),f))h.mountAsyncData();return!0}));return function(t){return e.apply(this,arguments)}}())),Hr(oe,c.routes,ue,n,o,s))}))),c=(0,a.Z)((0,a.Z)({},v),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(s,[],e.node,oe),rn(c,e)})),c.node&&(oe.child=c.node),rn(v,(0,a.Z)((0,a.Z)({},c),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return ce.push(pe()),yield Promise.all(ce),v})),Yr.apply(this,arguments)}function Xr(){return(Xr=(0,i.Z)((function*(e,t,r,n,i,o,s,c,l){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,p)=>Jr(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t,forEachIndex:u}),i,o,s,l.concat(u*d+p),c&&new Map(c))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&i.memoize(s,l.concat(r),t.node,e),rn(u,t)})),u}))).apply(this,arguments)}function Qr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function en(e,t,r){return(0,u.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function tn(e){var t=[],r=[];return[(0,a.Z)((0,a.Z)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function rn(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:i}=t,o=(0,h.Z)(t,Dr);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,o)}function nn(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,i=null!==(a=n.slot)&&void 0!==a?a:"";(0,d.hasOwnProperty)(r,i)||(r[i]={type:"bricks",bricks:[]}),r[i].bricks.push(n)}return r}function an(e,t,r,n){return"silent"===n?e.catch((e=>{console.error("Load ".concat(t,' "').concat(r,'" failed:'),e)})):e}function on(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:i}=Te(n,"bindTemplateProxy"),o=i.tplHostMetadata;o.internalBricksByRef.set(r,e);var s=null===(t=o.proxy)||void 0===t?void 0:t.events;if(s){var c=function(e){if(u.ref===r){var t,n,o,s=t=>{t.bubbles&&t.stopPropagation(),i.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!==(o=(n=a).$$proxyListeners)&&void 0!==o||(n.$$proxyListeners=[]),a.$$proxyListeners.push([c,s])}};for(var[l,u]of Object.entries(s))c(l)}}}function sn(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=Te(r,"unbindTemplateProxy"),i=a.tplHostMetadata;for(var[o,s]of(i.internalBricksByRef.delete(t),null!==(c=n.$$proxyListeners)&&void 0!==c?c:[])){var c;n.removeEventListener(o,s)}delete n.$$proxyListeners}}function cn(e){e.replaceChildren()}function ln(e,t){for(var r=e.child,n=[];r;){if(r.tag===_r.BRICK){var a,i=r.type;i.includes("-")&&!customElements.get(i)&&console.error("Undefined custom element: ".concat(i)),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var o=t&&r===e.child?t:document.createElement(i);r.element=o,r.slotId&&o.setAttribute("slot",r.slotId),r.iid&&(o.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(o.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),At(o,r.properties),Qt(o,r.events,r.runtimeContext),r.tplHostMetadata&&(o.$$tplStateStore=Te({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),on(r),r.portal?n.push(o):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(o))}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===_r.ROOT?null===(l=c.container)||void 0===l||l.append(...c.childElements):c.element.append(...c.childElements),c.childElements=void 0;if(c.tag===_r.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}}}var un,dn,pn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],fn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],vn=new WeakMap,hn=new WeakMap,mn=new WeakMap,gn=new WeakMap,yn=new WeakMap,bn=new WeakMap,wn=new WeakMap,En=new WeakMap,Sn=new WeakMap,kn=new WeakSet,An=new WeakSet,Zn=new WeakSet,In=new WeakSet;class Pn{constructor(e,t){var r;(0,I.Z)(this,In),(0,I.Z)(this,Zn),(0,I.Z)(this,An),(0,I.Z)(this,kn),(0,Ut.Z)(this,"scope",void 0),(0,Ut.Z)(this,"unknownBricks",void 0),(0,o.Z)(this,vn,{writable:!0,value:void 0}),(0,o.Z)(this,hn,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,o.Z)(this,mn,{writable:!0,value:new Map}),(0,o.Z)(this,gn,{writable:!0,value:void 0}),(0,o.Z)(this,yn,{writable:!0,value:new Map}),(0,o.Z)(this,bn,{writable:!0,value:void 0}),(0,o.Z)(this,wn,{writable:!0,value:void 0}),(0,o.Z)(this,En,{writable:!0,value:void 0}),(0,o.Z)(this,Sn,{writable:!0,value:[]}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",(0,s.Z)(this,vn,null==t?void 0:t.routeHelper)}setInitialMenuRequests(e){(0,s.Z)(this,wn,e)}memoizeMenuRequests(e,t){(0,c.Z)(this,En)||(0,s.Z)(this,En,new WeakMap),(0,c.Z)(this,En).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,i.Z)((function*(){var a,i;for(var o of e)if(a=(0,c.Z)(n,En).get(o)){i=o;break}var s=(0,c.Z)(n,wn),l=a?s.indexOf(a):-1;if(-1===l){if(!r.length)return;s.push(...r)}else s.splice(l,s.length-l,...r);i&&i!==t&&(0,c.Z)(n,En).delete(i),yield(0,c.Z)(n,vn).mergeMenus(s)}))()}reBailout(e){return(0,c.Z)(this,vn).bailout(e)}reCatch(e,t){return(0,c.Z)(this,vn).catch(e,t)}didPerformIncrementalRender(e){var t=this;return(0,i.Z)((function*(){return(yield Promise.all((0,c.Z)(t,Sn).map((t=>t(e))))).some((e=>e))}))()}performIncrementalRender(e){(0,c.Z)(this,Sn).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...pn,..."page"===this.scope?fn:[]];for(var n of r){var a=t[n];a&&(0,c.Z)(this,hn)[n].push({brick:e,handlers:a})}(0,m.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,c.Z)(this,yn).get(e);r?r.add(t):(0,c.Z)(this,yn).set(e,new Set([t]))}memoize(e,t,r,n){(0,c.Z)(this,bn)||(0,s.Z)(this,bn,new WeakMap);var a=[null!=e?e:"",...t].join("."),i=(0,c.Z)(this,bn).get(n);i||(i=new Map,(0,c.Z)(this,bn).set(n,i)),i.set(a,{node:r,last:Rn(r),lastNormal:Bn(r),lastPortal:_n(r)})}reRender(e,t,r,n){var a,i,o,s,l,u,d,p,f,v,h=[null!=e?e:"",...t].join("."),m=(0,c.Z)(this,bn).get(n).get(h),{node:g,last:y,lastNormal:b,lastPortal:w}=m;(null==g?void 0:g.tag)===_r.PLACEHOLDER?(a=null!==(o=null===(s=function(e){return Mn(e,!0)}(g))||void 0===s?void 0:s.element)&&void 0!==o?o:null,i=null!==(l=null===(u=function(e){return Ln(e,!0)}(g))||void 0===u?void 0:u.element)&&void 0!==l?l:null):(a=null!==(d=null==b||null===(p=b.element)||void 0===p?void 0:p.nextSibling)&&void 0!==d?d:null,i=null!==(f=null==w||null===(v=w.element)||void 0===v?void 0:v.nextSibling)&&void 0!==f?f:null);var E,S=Rn(r);m.node=r,m.last=S,m.lastNormal=Bn(r),m.lastPortal=_n(r);for(var k=n.child;k&&k!==y;){if(k.sibling===g){E=k;break}k=k.sibling}var A=document.createDocumentFragment(),Z=document.createDocumentFragment(),I={tag:_r.ROOT,container:A,createPortal:Z,child:r};for(k=r;k;)k.return=I,k=k.sibling;var O,C,x=Fn(g,y);for((0,P.Z)(this,kn,On).call(this,x),ln(I),E?E.sibling=r:n.child=r,S&&(S.sibling=null==y?void 0:y.sibling),k=r;k;)k.return=n,k=k.sibling;if(n.tag===_r.ROOT?null===(O=n.container)||void 0===O||O.insertBefore(A,a):null===(C=n.element)||void 0===C||C.insertBefore(A,a),Z.childNodes.length>0){for(var T,R=r;R&&R.return;)R=R.return;if((null===(T=R)||void 0===T?void 0:T.tag)!==_r.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");("function"==typeof R.createPortal?R.createPortal():R.createPortal).insertBefore(Z,i)}var B=Fn(r,S);(0,P.Z)(this,An,Cn).call(this,B)}dispose(){for(var e of Object.values((0,c.Z)(this,hn)))e.length=0;for(var t of(0,c.Z)(this,mn).values()){for(var r of t)r.disconnect();t.length=0}(0,c.Z)(this,mn).clear(),(0,c.Z)(this,gn)&&(we.removeEventListener("change",(0,c.Z)(this,gn)),(0,s.Z)(this,gn,void 0)),(0,s.Z)(this,bn,void 0),(0,s.Z)(this,wn,void 0),(0,s.Z)(this,En,void 0),(0,c.Z)(this,yn).clear(),(0,c.Z)(this,Sn).length=0}dispatchBeforePageLoad(){(0,P.Z)(this,Zn,xn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,P.Z)(this,Zn,xn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,P.Z)(this,Zn,xn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,P.Z)(this,Zn,xn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=Z().location;e&&"#"!==e?(0,P.Z)(this,Zn,xn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,P.Z)(this,Zn,xn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,c.Z)(this,hn).onScrollIntoView)(0,P.Z)(this,In,Tn).call(this,e,t)}initializeMediaChange(){(0,s.Z)(this,gn,(e=>{(0,P.Z)(this,Zn,xn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:z(e.detail)}))})),we.addEventListener("change",(0,c.Z)(this,gn))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==va||null===(r=va.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{ar(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,c.Z)(this,hn).onMessage)t(r);null==va||null===(e=va.messageDispatcher)||void 0===e||e.onClose((()=>{(0,P.Z)(this,Zn,xn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,P.Z)(this,Zn,xn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,P.Z)(this,Zn,xn).call(this,"onUnmount",new CustomEvent("unmount"))}}function On(e){var t=[...pn,..."page"===this.scope?fn:[]],r=[];for(var n of t){var a=(0,m.remove)((0,c.Z)(this,hn)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var i of e){var o,s,l=(0,c.Z)(this,mn).get(i);if(null!=l&&l.length){for(var u of l)u.disconnect();l.length=0,(0,c.Z)(this,mn).delete(i)}sn(i),null===(o=i.element)||void 0===o||delete o.$$tplStateStore,null===(s=i.element)||void 0===s||s.remove()}var d=new CustomEvent("unmount");for(var{brick:p,handlers:f}of r)ar(f,p.runtimeContext,p)(d)}function Cn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,c.Z)(this,hn).onMount)e.has(r)&&ar(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:i}of(0,c.Z)(this,hn).onScrollIntoView)e.has(a)&&(0,P.Z)(this,In,Tn).call(this,a,i)}function xn(e,t){for(var{brick:r,handlers:n}of(0,c.Z)(this,hn)[e])ar(n,r.runtimeContext,r)(t);var a=(0,c.Z)(this,yn).get(e);if(a)for(var i of a)i()}function Tn(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&&(ar(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var i=(0,c.Z)(this,mn).get(e);i||(i=[],(0,c.Z)(this,mn).set(e,i)),i.push(a)}function Rn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function Bn(e){return Mn(e,!1)}function Mn(e,t){for(var r,n=e;n;){if(n.tag===_r.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function _n(e){return Ln(e,!1)}function Ln(e,t){for(var r,n=e;n;){if(n.tag===_r.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,i=n.return;i&&!i.sibling;)i=i.return;n=null===(a=i)||void 0===a?void 0:a.sibling}}return r}function Fn(e,t){for(var r=new Set,n=e;n;)if(n.tag===_r.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var a,i=n.return;i&&i!==t&&!i.sibling;)i=i.return;if(i===t)break;n=null===(a=i)||void 0===a?void 0:a.sibling}}return r}function Un(){if(!un){if(un={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){un.isInIframe=!0;try{if(window.origin===window.parent.origin){un.isInIframeOfSameSite=!0;var e="/next/"===v(),t=window.parent.location.pathname,r=t.startsWith("/next/");un.isInIframeOfNext=0==(Number(e)^Number(r)),un.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),un.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(un)}return un}function Nn(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);xe.define(a,n)}}}function jn(){return jn=(0,i.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return Dn.apply(this,arguments)}(e)),e.$$fulfilling})),jn.apply(this,arguments)}function Dn(){return(Dn=(0,i.Z)((function*(e){var t;yield null==va||null===(t=va.fulfilStoryboard)||void 0===t?void 0:t.call(va,e),_(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}var Vn=new WeakMap,Wn=new WeakMap,qn=new WeakMap,$n=new WeakMap,Hn=new WeakMap,zn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,Jn=new WeakMap,Yn=new WeakMap,Xn=new WeakMap,Qn=new WeakMap,ea=new WeakSet,ta=new WeakSet,ra=new WeakSet,na=new WeakSet;class aa{constructor(e){(0,I.Z)(this,na),(0,I.Z)(this,ra),(0,I.Z)(this,ta),(0,I.Z)(this,ea),(0,o.Z)(this,Vn,{writable:!0,value:void 0}),(0,o.Z)(this,Wn,{writable:!0,value:!1}),(0,o.Z)(this,qn,{writable:!0,value:void 0}),(0,o.Z)(this,$n,{writable:!0,value:void 0}),(0,o.Z)(this,Hn,{writable:!0,value:void 0}),(0,o.Z)(this,zn,{writable:!0,value:void 0}),(0,o.Z)(this,Kn,{writable:!0,value:new Set}),(0,o.Z)(this,Gn,{writable:!0,value:0}),(0,o.Z)(this,Jn,{writable:!0,value:void 0}),(0,o.Z)(this,Yn,{writable:!0,value:void 0}),(0,o.Z)(this,Xn,{writable:!0,value:void 0}),(0,o.Z)(this,Qn,{writable:!0,value:void 0}),(0,s.Z)(this,Vn,e);var t=Z();window.addEventListener("beforeunload",(e=>{(0,P.Z)(this,ea,ia).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,P.Z)(this,ea,ia).call(this,{location:e,action:t})))}getRenderId(){return(0,c.Z)(this,Jn)}getRuntimeContext(){return(0,c.Z)(this,Hn)}getRecentApps(){return{currentApp:(0,c.Z)(this,Yn),previousApp:(0,c.Z)(this,Xn)}}getNavConfig(){return(0,c.Z)(this,Qn)}bootstrap(){var e=this;window.AbortController&&(dn=new AbortController,O.http.interceptors.request.use((e=>{var t;return(0,a.Z)((0,a.Z)({},e),{},{options:(0,a.Z)((0,a.Z)({},e.options),{},{signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:dn.signal})})})));var t=Z();(0,s.Z)(this,qn,t.location);var r=0;return t.listen(function(){var t=(0,i.Z)((function*(t,n){var i,o,l,u,d,p=++r,v={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==(0,c.Z)(e,qn).key&&!1!==(null===(i=(0,c.Z)(e,qn).state)||void 0===i?void 0:i.notify))||(v.key=void 0),((0,f.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,c.Z)(e,qn)),v),(0,a.Z)((0,a.Z)({},t),v))||"POP"!==n&&!1===(null===(o=t.state)||void 0===o?void 0:o.notify))&&(u=!0),u||(u=yield null===(d=(0,c.Z)(e,zn))||void 0===d?void 0:d.didPerformIncrementalRender(t)),r===p)if(u)(0,s.Z)(e,qn,t);else{if(dn&&(dn.abort(),dn=new AbortController),(0,s.Z)(e,qn,t),null===(l=(0,c.Z)(e,zn))||void 0===l||l.dispatchPageLeave(),"POP"===n&&b(g((0,c.Z)(e,Vn),t.pathname)))return void window.location.reload();(0,c.Z)(e,Wn)?(0,s.Z)(e,$n,t):(0,P.Z)(e,ra,sa).call(e,t).catch(Yt)}}));return function(e,r){return t.apply(this,arguments)}}()),(0,P.Z)(this,ra,sa).call(this,t.location)}}function ia(e){var t,r=Z(),n=r.getBlockMessage();null===(t=(0,c.Z)(this,zn))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function oa(e,t,r){var n,a;if((0,s.Z)(this,Gn,(n=(0,c.Z)(this,Gn),a=n++,n)),a>10){var i='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(i)}Z().replace(e,t)}function sa(e){return ca.apply(this,arguments)}function ca(){return(ca=(0,i.Z)((function*(e){(0,s.Z)(this,Wn,!0);try{yield(0,P.Z)(this,na,la).call(this,e)}finally{if((0,s.Z)(this,Wn,!1),(0,c.Z)(this,$n)){var t=(0,c.Z)(this,$n);(0,s.Z)(this,$n,void 0),yield(0,P.Z)(this,ra,sa).call(this,t)}}}))).apply(this,arguments)}function la(e){return ua.apply(this,arguments)}function ua(){return ua=(0,i.Z)((function*(e){var t,r,n,o=this;(0,s.Z)(this,Jn,(0,m.uniqueId)("render-id-1")),Ve=new WeakSet,$e.clear(),null==va||null===(t=va.flowApi)||void 0===t||t.clearCollectWidgetContract(),Z().unblock();var l=null==va||null===(r=va.pageView)||void 0===r?void 0:r.create(),u=g((0,c.Z)(this,Vn),e.pathname),d=null===(n=(0,c.Z)(this,Hn))||void 0===n?void 0:n.app;null!=u&&u.app&&(yield function(e){return jn.apply(this,arguments)}(u));var p,f=(0,s.Z)(this,Yn,null==u?void 0:u.app),v=d&&f?d.id!==f.id:d!==f,h=ga().getFeatureFlags(),y=(0,c.Z)(this,zn),b=(t,r)=>{null==l||l({status:"redirected"}),(0,c.Z)(this,Kn).add(y),(0,P.Z)(this,ta,oa).call(this,t,r,e)},w=()=>{var t=h["sso-enabled"]?"/sso-auth/login":"/auth/login";b(t,{from:e})},E=document.querySelector("#main-mount-point"),S=document.querySelector("#portal-mount-point"),k={tag:_r.ROOT,container:E,createPortal:S},A=()=>{var e;for(var t of(cn(E),cn(S),(0,c.Z)(this,Kn).add(y),(0,c.Z)(this,Kn)))t&&(t.dispatchOnUnmount(),t.dispose());(0,c.Z)(this,Kn).clear(),null==va||null===(e=va.messageDispatcher)||void 0===e||e.reset(),v&&((0,s.Z)(this,Xn,d),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:d,currentApp:f}})))};if(X(f&&(ne()[f.id]||f.theme)||"light"),ie("default"),f){var I,C,x,T,R,B;null==va||null===(I=va.checkInstalledApps)||void 0===I||I.preCheckInstalledApps(u,(e=>!!Za(e)));var M={bailout:e=>e.unauthenticated?(w(),!0):e.redirect?(b(e.redirect.path,e.redirect.state),!0):void(0,s.Z)(this,Gn,0),mergeMenus:(p=(0,i.Z)((function*(e){var t=yield Promise.all(e);(0,s.Z)(o,Qn,function(e){var t={breadcrumb:[]};for(var r of e){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(t))})),function(e){return p.apply(this,arguments)}),catch:(t,r)=>{if(!zt(t)||window.NO_AUTH_GUARD){if(!(t instanceof O.HttpAbortError)){var n=ga().getMiscSettings().noAuthGuardLoginPath;return zt(t)&&n?void b(n,{from:e}):{failed:!0,output:{node:{tag:_r.BRICK,type:"div",properties:{textContent:Ht(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}(0,c.Z)(this,Kn).add(y)}else w()}},_=(0,s.Z)(this,zn,new Pn("page",{routeHelper:M})),L=(0,s.Z)(this,Hn,{app:f,location:e,query:new URLSearchParams(e.search),flags:h,sys:(0,a.Z)((0,a.Z)((0,a.Z)({},null==va||null===(C=va.auth)||void 0===C?void 0:C.getAuth()),Un()),{},{settings:{brand:ga().getBrandSettings()}}),ctxStore:new Zr("CTX",void 0,_),pendingPermissionsPreCheck:[null==va||null===(x=va.checkPermissions)||void 0===x?void 0:x.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.Z)(this,Qn,void 0),Nn(u),he(null===(T=u.meta)||void 0===T?void 0:T.functions,f),null==va||null===(R=va.flowApi)||void 0===R||R.collectContract(null===(B=u.meta)||void 0===B?void 0:B.contracts);var F,U=!1,N=[];try{if(F=yield Hr(k,function(e){if(window.parent===window)return e;var t=e,r=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,m.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(u.routes),L,_,[]),M.bailout(F))return;N=Qr(L),yield en(F,L,N),yield M.mergeMenus(F.menuRequests),_.setInitialMenuRequests(F.menuRequests)}catch(e){console.error("Router failed:",e);var j=M.catch(e,k);if(!j)return;({failed:U,output:F}=j)}if(k.child=F.node,A(),F.route&&"routes"!==F.route.type||U){if(U||_.dispatchBeforePageLoad(),te(),se(),ln(k),window.scrollTo(0,0),U)null==l||l({status:"failed"});else{for(var D of(_.dispatchPageLoad(),_.dispatchAnchorLoad(),_.dispatchOnMount(),_.initializeScrollIntoView(),_.initializeMediaChange(),_.initializeMessageDispatcher(),N))D.mountAsyncData();null==l||l({status:"ok",path:F.path,pageTitle:document.title})}return}}else{if(!window.NO_AUTH_GUARD&&null!=va&&va.auth&&!va.auth.isLoggedIn())return void w();A()}te(),se();var V={tag:_r.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:k};k.child=V,ln(k),window.scrollTo(0,0),null==l||l({status:"not-found"})})),ua.apply(this,arguments)}var da,pa,fa,va,ha="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;function ma(e){if(da)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===j){var r=t.payload;switch(null==r?void 0:r.type){case D:W=r.active;break;case V:N=r.panel}}})),va=null==e?void 0:e.hooks,(0,l.initializeI18n)(Wt,qt),p.locale(l.i18n.language),l.i18n.on("languageChanged",(()=>{p.locale(l.i18n.language)})),A(),da=new wa}function ga(){return da}var ya=new WeakMap,ba=new WeakMap;class wa{constructor(){(0,o.Z)(this,ya,{writable:!0,value:!1}),(0,o.Z)(this,ba,{writable:!0,value:!1})}initialize(e){var t,r;if((0,c.Z)(this,ya))throw new Error("The runtime cannot be initialized more than once");(0,s.Z)(this,ya,!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;l.i18n.addResourceBundle(r,e,n)})),r.localeName=l.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{l.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,d.isObject)(e.settings)&&(0,d.deepFreeze)(e.settings),e.brickPackages&&(0,d.deepFreeze)(e.brickPackages)}(e),pa=e;var n,{notification:a,dialog:i}=null!==(t=null===(r=e.settings)||void 0===r?void 0:r.presetBricks)&&void 0!==t?t:{};!1!==a&&(n=null!=a?a:"basic.show-notification",(0,this.loadBricks)([n]).then((()=>{Gt=document.createElement(n)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==i&&function(e,t){t([e]).then((()=>{Bt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=i?i:"basic.show-dialog",this.loadBricks)}bootstrap(e){var t=this;return(0,i.Z)((function*(){if(e&&t.initialize(e),(0,c.Z)(t,ba))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.Z)(t,ba,!0),fa=new aa(pa.storyboards),yield fa.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=fa)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=fa)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Fe(e,t)}getFeatureFlags(){var e,t;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=fa)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags),{},{"migrate-to-brick-next-v3":!0})}getMiscSettings(){var e,t;return(0,a.Z)((0,a.Z)({},null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=fa)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc)}getBrandSettings(){var e;return(0,a.Z)({base_title:"DevOps 管理专家"},null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand)}getLaunchpadSettings(){var e;return(0,a.Z)({columns:7,rows:4},null===(e=pa)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=pa)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=pa)||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=fa)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,u.loadBricksImperatively)(e,Ea())}}function Ea(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=pa)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:ha)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function Sa(){var e;return null===(e=fa)||void 0===e?void 0:e.getRenderId()}function ka(){var e;return null===(e=fa)||void 0===e?void 0:e.getRuntimeContext()}function Aa(e){var t;return null===(t=pa)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function Za(e){var t;return null===(t=Aa(e))||void 0===t?void 0:t.app}function Ia(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==va||null===(e=va.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Pa(){var e;return null==va||null===(e=va.auth)||void 0===e?void 0:e.getAuth()}function Oa(){var e,t;return null==va||null===(e=va.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Ca(){var e;return null==va||null===(e=va.auth)||void 0===e?void 0:e.isLoggedIn()}function xa(e,t,r){return Ta.apply(this,arguments)}function Ta(){return(Ta=(0,i.Z)((function*(e,t,r){return Ke(yield je(e),e,"resolve",t,r)}))).apply(this,arguments)}function Ra(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r;t=r||(()=>((o=document.createElement("div")).style.position="absolute",o.style.width=o.style.height="0",document.body.append(o),o));var s,c,l=!1;return{render(r){var u=arguments;return(0,i.Z)((function*(){var{theme:i,context:d,functions:p,templates:f,i18n:v}=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 h=[].concat(r),m=s;s=new Pn(n,{unknownBricks:a});var g={ctxStore:new Zr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},y={tag:_r.ROOT,container:e,createPortal:t};if("page"===n){var b;X(null!=i?i:"light"),ie("default");var w={id:"demo",homepage:"/demo"};g.app=w;var E={app:w,meta:{i18n:v,customTemplates:f}};null===(b=c)||void 0===b||b(),c=_(E),Nn(E),he(p,w)}g.ctxStore.define(d,g);var S,k=!1,A=[];try{S=yield Kr(y,h,g,s,[]),A=Qr(g),yield en(S,g,A)}catch(e){k=!0,S={node:{tag:_r.BRICK,type:"div",properties:{textContent:Ht(e)},return:y,runtimeContext:null},blockingList:[],menuRequests:[]}}if(y.child=S.node,null==m||m.dispatchOnUnmount(),null==m||m.dispose(),cn(e),o&&cn(o),"page"===n&&(k||s.dispatchBeforePageLoad(),te(),se()),ln(y),"page"===n&&window.scrollTo(0,0),!k){for(var Z of A)Z.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){l||(l=!0,cn(e),o&&(cn(o),r||o.remove()))}}}function Ba(e,t){return Ma.apply(this,arguments)}function Ma(){return(Ma=(0,i.Z)((function*(e,t){var r,n,i,o,[s,c,l]=tn((0,a.Z)((0,a.Z)({},ka()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(r=s.tplStateStoreMap)&&void 0!==r||(s.tplStateStoreMap=new Map),null!==(n=s.formStateStoreMap)&&void 0!==n||(s.formStateStoreMap=new Map);var u=new Pn("fragment"),d={tag:_r.ROOT,createPortal:null},p=e.transform,f=Ie();p&&Pe(f,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var v=yield Jr(d,f?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),p)}),s,u,[]),h=[...c,...l];if(yield en(v,s,h),(null===(i=v.node)||void 0===i?void 0:i.tag)===_r.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(o=v.node)&&void 0!==o&&o.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return d.child=v.node,{tagName:v.node?v.node.type:null,renderRoot:d,rendererContext:u,scopedStores:h}}))).apply(this,arguments)}function _a(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:i}=e;for(var o of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},ln(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),i))o.mountAsyncData();return{portal:r}}function La(e,t){var{rendererContext:r}=e;t.portal&&(cn(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function Fa(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return ut(t,(0,a.Z)((0,a.Z)({},ka()),{},{data:e}),{noInject:!0})}function Ua(e,t){var r=Aa(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),_(r)}function Na(e,t){var r=Aa(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),i=(e,r)=>e.map((e=>{var o=a(e);return"routes"===e.type?(e.routes=i(e.routes,r),e):o===r?(n=!0,t):e}));r.routes=i(r.routes,a(t)),n||r.routes.unshift(t)}function ja(e,t,r){var n="".concat(e,".").concat(t.name);xe.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),Da(e,t.name,r)}function Da(e,t,r){$a(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,m.pick)(r,"properties","events","lifeCycle","context"))])}function Va(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function Wa(e,t){var r;$a(e,Va(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var qa=Wa;function $a(e,t,r,n){var{routes:a}=Aa(e),i=a.findIndex((e=>e.path===t)),o={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===i?a.unshift(o):a.splice(i,1,o)}function Ha(e,t){var{tplStateStoreId:r}=t,n=ka();return r?Te((0,a.Z)((0,a.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function za(e){var{tplStateStoreId:t}=e,r=ka();return t?Te((0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Ka(e){return Ea().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Ga(){return Sa()}function Ja(e,t){return Ya.apply(this,arguments)}function Ya(){return(Ya=(0,i.Z)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:i}=t,o=Aa(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,c=Va(e.snippetId);r={routes:[null==o||null===(s=o.routes)||void 0===s?void 0:s.find((e=>e.path===c))]}}var l=[];return r&&i&&(yield i(r)).forEach((e=>{var t,[r,n,a]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=o&&null!==(t=o.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)}},7929:(e,t,r)=>{r.r(t),r.d(t,{supply:()=>s});var n=r(3028),a=r(5178),i=r(8874),o=r(74);function s(e,t,r){var a=(0,n.Z)({},t);for(var i of(a[void 0]=void 0,e))if(!Object.prototype.hasOwnProperty.call(a,i)){var o=d(i,r);void 0!==o&&(a[i]=o)}return a}var c=new Set(["fill","pull","pullAll","pullAllBy","pullAllWith","pullAt","remove","reverse","assign","assignIn","assignInWith","assignWith","defaults","defaultsDeep","merge","mergeWith","set","setWith","unset","update","updateWith","after","ary","before","bind","bindKey","curry","curryRight","debounce","defer","delay","flip","memoize","negate","once","overArgs","partial","partialRight","rearg","rest","spread","throttle","unary","wrap"]),l=new Set(["lang","langData","locale","localeData","defineLocale","updateLocale","updateOffset"]),u=new Set(["Array","Boolean","Date","Infinity","JSON","Math","NaN","Number","String","RegExp","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","isFinite","isNaN","parseFloat","parseInt","Map","Set","URLSearchParams","WeakMap","WeakSet","atob","btoa"]);function d(e,t){switch(e){case"Object":return r=Object,n=["entries","fromEntries","keys","values"],Object.fromEntries(n.map((e=>[e,function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r[e].apply(r,n)}])));case"_":return Object.fromEntries(Object.entries(a).filter((e=>!c.has(e[0]))).concat(t?[["uniqueId",e=>"".concat(null!=e?e:"","42")]]:[]));case"moment":return Object.assign((function(){return i(...arguments)}),Object.fromEntries(Object.entries(i).filter((e=>!l.has(e[0])))));case"PIPES":return o.pipes;case"TAG_URL":return p(!0);case"SAFE_TAG_URL":return p();default:if(u.has(e))return window[e]}var r,n}function p(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var i=[];return t.forEach(((t,r)=>{i.push(t),r<n.length&&i.push(e?String(n[r]).replace(/[^/]+/g,(e=>encodeURIComponent(e))):encodeURIComponent(String(n[r])))})),i.join("")}}},8486:(e,t,r)=>{function n(e){return class extends HTMLElement{get $$typeof(){return"provider"}resolve(){return e(...arguments)}}}function a(e){var t=Object.getOwnPropertyNames(e);for(var r of t){var n=e[r];n&&"object"==typeof n&&a(n)}return Object.freeze(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}r.r(t),r.d(t,{JsonStorage:()=>s,createProviderClass:()=>n,deepFreeze:()=>a,hasOwnProperty:()=>i,isObject:()=>o,unwrapProvider:()=>l});class s{constructor(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"brick-next-";this.storage=e,this.prefix=t}setItem(e,t){this.storage.setItem(this.prefix+e,JSON.stringify(t))}getItem(e){var t;return JSON.parse(null!==(t=this.storage.getItem(this.prefix+e))&&void 0!==t?t:"null")}removeItem(e){return this.storage.removeItem(this.prefix+e)}clear(){return this.storage.clear()}}var c=new Map;function l(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=function(e){var t=c.get(e);return t||(t=document.createElement(e),c.set(e,t),t)}(e);return a.resolve(...r)}}},1259:(e,t,r)=>{function n(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(a,i){if("string"==typeof t?a.name===t:t.includes(a.name)){for(var o=[],s=1;s<=r;s++){var c=i[i.length-s];if("MemberExpression"===(null==c?void 0:c.node.type)&&"object"===c.key){var l=c.node;l.computed||"Identifier"!==l.property.type?l.computed&&"Literal"===l.property.type&&"string"==typeof l.property.value?o.push(n?"".concat(a.name,".").concat(l.property.value):l.property.value):e.hasNonStaticUsage=!0:o.push(n?"".concat(a.name,".").concat(l.property.name):l.property.name)}else e.hasNonStaticUsage=!0}o.length===r&&e.usedProperties.add(o.join("."))}}}function a(e,t){return function(r,n,a){if(n.name===e){var i=a[a.length-1],o=a[a.length-2];if("CallExpression"===(null==o?void 0:o.node.type)&&"callee"===(null==o?void 0:o.key)&&"MemberExpression"===(null==i?void 0:i.node.type)&&"object"===i.key&&(i.node.computed?"Literal"===i.node.property.type&&i.node.property.value===t:"Identifier"===i.node.property.type&&i.node.property.name===t)){var s=o.node.arguments;if(s.length>0){var c=s[0];"Literal"===c.type&&"string"==typeof c.value?r.usedArgs.add(c.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>n,collectAppGetMenuUsage:()=>i,collectInstalledAppsHasUsage:()=>o,collectMemberUsage:()=>d,collectMemberUsageInFunction:()=>m,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>w,scanPermissionActionsInStoryboard:()=>b,strictCollectMemberUsage:()=>u,track:()=>p,trackAll:()=>f,traverseStoryboardExpressions:()=>l,traverseStoryboardFunction:()=>h,traverseStoryboardFunctions:()=>v,unwrapProvider:()=>c.unwrapProvider});var i=a("APP","getMenu"),o=a("INSTALLED_APPS","has"),s=r(1414),c=r(9686);function l(e,t,r){var n=new WeakSet,{matchExpressionString:a,visitNotMatchedExpressionString:i,visitNonExpressionString:o,visitObject:l}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,s.isEvaluable)(r))if(a(r))try{(0,s.preevaluate)(r,{withParent:!0,hooks:{beforeVisitGlobal(e,n){t(e,n,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==i||i(r);else null==o||o(r);else if((0,c.isObject)(r)){if(n.has(r))return;for(var u of(n.add(r),null==l||l(r),Array.isArray(r)?r:Object.values(r)))e(u)}}(e)}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:n,nonStaticUsage:a,usedProperties:i}=d(e,t,r);if(n)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your expression: "').concat(a,'"'));return i}function d(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a={usedProperties:new Set,hasNonStaticUsage:!1},i=n(a,t,r);return l(e,((e,t,r)=>{i(e,t),a.hasNonStaticUsage&&(a.nonStaticUsage=r)}),t),a}function p(e,t,r){if(e.includes(t)){var a,i={usedProperties:new Set,hasNonStaticUsage:!1},{expression:o}=(0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(i,r)}});if("SequenceExpression"===o.type&&(a=o.expressions[0])&&"Literal"===a.type&&a.value===t){if(i.usedProperties.size>0)return i.usedProperties;console.warn('You are using "'.concat(t,'" but no `').concat(r,"` usage found in your expression: ").concat(JSON.stringify(e)))}}return!1}function f(e){if(e){var t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:n(t,["CTX","STATE","FORM_STATE"],1,!0)}}),t.usedProperties.size>0){var r=[...t.usedProperties],a={context:!1,state:!1,formState:!1},i={CTX:"context",STATE:"state",FORM_STATE:"formState"};return r.forEach((e=>{var[t,r]=e.split(".");a[i[t]]||(a[i[t]]=[]),a[i[t]].push(r)})),a}console.warn('You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: '.concat(JSON.stringify(e)))}return!1}function v(e,t){if(Array.isArray(e))for(var r of e)h(r,t)}function h(e,t,r){try{(0,s.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t}})}catch(t){r||console.error('Parse storyboard function "'.concat(e.name,'" failed:'),t)}}function m(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i={usedProperties:new Set,hasNonStaticUsage:!1};if(h(e,n(i,t,a),r),i.hasNonStaticUsage&&!r)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your function: "').concat(e.name,'"'));return i.usedProperties.delete(e.name),i.usedProperties}var g="PERMISSIONS",y="check";function b(e){var t,r=new Set,n=E(r),{customTemplates:a,functions:i}=null!==(t=e.meta)&&void 0!==t?t:{};return l([e.routes,a],n,g),v(i,n),Array.from(r)}function w(e){var t=new Set;return l(e,E(t),g),Array.from(t)}function E(e){return function(t,r){if(t.name===g){var n=r[r.length-1],a=r[r.length-2];if("CallExpression"===(null==a?void 0:a.node.type)&&"callee"===(null==a?void 0:a.key)&&"MemberExpression"===(null==n?void 0:n.node.type)&&"object"===n.key&&(n.node.computed?"Literal"===n.node.property.type&&n.node.property.value===y:"Identifier"===n.node.property.type&&n.node.property.name===y))for(var i of a.node.arguments)"Literal"===i.type&&"string"==typeof i.value&&e.add(i.value)}}}}}]);
|
|
2
|
+
//# sourceMappingURL=core.58a13236.js.map
|