@next-bricks/advanced 0.22.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/1377.b37cb1a6.js +2 -0
  3. package/dist/chunks/1377.b37cb1a6.js.map +1 -0
  4. package/dist/chunks/1646.677278c0.js +2 -0
  5. package/dist/chunks/{1646.0c0b1e54.js.map → 1646.677278c0.js.map} +1 -1
  6. package/dist/chunks/{2179.752ba7a2.js → 2179.29d3975a.js} +2 -2
  7. package/dist/chunks/{2179.752ba7a2.js.map → 2179.29d3975a.js.map} +1 -1
  8. package/dist/chunks/3948.577db0fb.js +2 -0
  9. package/dist/chunks/3948.577db0fb.js.map +1 -0
  10. package/dist/chunks/5381.d5d5893d.js +2 -0
  11. package/dist/chunks/{5381.2cab1824.js.map → 5381.d5d5893d.js.map} +1 -1
  12. package/dist/chunks/6188.0811929c.js +2 -0
  13. package/dist/chunks/6188.0811929c.js.map +1 -0
  14. package/dist/chunks/{6205.07a29489.js → 6205.584df0fa.js} +2 -2
  15. package/dist/chunks/{6205.07a29489.js.map → 6205.584df0fa.js.map} +1 -1
  16. package/dist/chunks/6660.8a319d7b.js +2 -0
  17. package/dist/chunks/{6660.6b76ad11.js.map → 6660.8a319d7b.js.map} +1 -1
  18. package/dist/chunks/{6980.ec42fa75.js → 6980.f46c634d.js} +2 -2
  19. package/dist/chunks/{6980.ec42fa75.js.map → 6980.f46c634d.js.map} +1 -1
  20. package/dist/chunks/7067.fc777100.js +2 -0
  21. package/dist/chunks/{7067.fbfe21c8.js.map → 7067.fc777100.js.map} +1 -1
  22. package/dist/chunks/{7164.42fad315.js → 7164.ea75c86d.js} +2 -2
  23. package/dist/chunks/{7164.42fad315.js.map → 7164.ea75c86d.js.map} +1 -1
  24. package/dist/chunks/9549.1f936aaa.js +2 -0
  25. package/dist/chunks/{9549.f2e1edf3.js.map → 9549.1f936aaa.js.map} +1 -1
  26. package/dist/chunks/{eo-cascader.5bc6dbd9.js → eo-cascader.b1651443.js} +2 -2
  27. package/dist/chunks/{eo-cascader.5bc6dbd9.js.map → eo-cascader.b1651443.js.map} +1 -1
  28. package/dist/chunks/eo-next-table.44b570ea.js +2 -0
  29. package/dist/chunks/eo-next-table.44b570ea.js.map +1 -0
  30. package/dist/chunks/eo-table.39e4927b.js +2 -0
  31. package/dist/chunks/{eo-table.44492d23.js.map → eo-table.39e4927b.js.map} +1 -1
  32. package/dist/chunks/{eo-workbench-layout.5f0dd748.js → eo-workbench-layout.b5fe6b2e.js} +2 -2
  33. package/dist/chunks/{eo-workbench-layout.5f0dd748.js.map → eo-workbench-layout.b5fe6b2e.js.map} +1 -1
  34. package/dist/chunks/main.649f7e78.js +2 -0
  35. package/dist/chunks/{main.40bc4c2f.js.map → main.649f7e78.js.map} +1 -1
  36. package/dist/examples.json +1 -1
  37. package/dist/index.3d062848.js +2 -0
  38. package/dist/{index.b28a65f8.js.map → index.3d062848.js.map} +1 -1
  39. package/dist/manifest.json +6 -0
  40. package/dist/types.json +68 -18
  41. package/dist-types/next-table/Table.d.ts +2 -1
  42. package/dist-types/next-table/index.d.ts +5 -1
  43. package/dist-types/next-table/interface.d.ts +7 -3
  44. package/docs/eo-next-table.md +46 -0
  45. package/package.json +3 -3
  46. package/dist/chunks/1377.01ee7fe4.js +0 -2
  47. package/dist/chunks/1377.01ee7fe4.js.map +0 -1
  48. package/dist/chunks/1646.0c0b1e54.js +0 -2
  49. package/dist/chunks/3948.05015de3.js +0 -2
  50. package/dist/chunks/3948.05015de3.js.map +0 -1
  51. package/dist/chunks/5381.2cab1824.js +0 -2
  52. package/dist/chunks/6188.7d9672cf.js +0 -2
  53. package/dist/chunks/6188.7d9672cf.js.map +0 -1
  54. package/dist/chunks/6660.6b76ad11.js +0 -2
  55. package/dist/chunks/7067.fbfe21c8.js +0 -2
  56. package/dist/chunks/9549.f2e1edf3.js +0 -2
  57. package/dist/chunks/eo-next-table.43b08ab4.js +0 -2
  58. package/dist/chunks/eo-next-table.43b08ab4.js.map +0 -1
  59. package/dist/chunks/eo-table.44492d23.js +0 -2
  60. package/dist/chunks/main.40bc4c2f.js +0 -2
  61. package/dist/index.b28a65f8.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/2179.752ba7a2.js","mappings":"wOAEIA,GAAc,EACdC,EAAwB,IAAIC,IACzB,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAIjD,IAAK,IAAKgB,EAAMF,KADhBjB,EAAsBoB,IAAIjB,GACIkB,OAAOC,QAAQlB,IAC3C,EAAAC,KAAKkB,kBAAkBJ,EAAMhB,EAAIc,EAErC,C,cCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,GAAKD,EAAL,CAGA,IAAIE,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAEzG,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,IAAIE,EAAkBF,EAASG,MAAM,KAAK,GAC1C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,IAAIC,EAAS,GAAGC,OAAOJ,EAAiB,KACxC,IAAK,IAAIK,KAAOb,OAAOc,KAAKV,GAC1B,GAAIS,EAAIE,WAAWJ,GACjB,OAAOP,EAAKS,EAnBhB,CAsBF,CC3BO,IAAI7B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nvar initialized = false;\nvar initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (var [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n var language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n var primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n var prefix = \"\".concat(primaryLanguage, \"-\");\n for (var key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport var i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","lang","add","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","concat","key","keys","startsWith"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/2179.29d3975a.js","mappings":"wOAEIA,GAAc,EACdC,EAAwB,IAAIC,IACzB,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAIjD,IAAK,IAAKgB,EAAMF,KADhBjB,EAAsBoB,IAAIjB,GACIkB,OAAOC,QAAQlB,IAC3C,EAAAC,KAAKkB,kBAAkBJ,EAAMhB,EAAIc,EAErC,C,cCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,GAAKD,EAAL,CAGA,IAAIE,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAEzG,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,IAAIE,EAAkBF,EAASG,MAAM,KAAK,GAC1C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,IAAIC,EAAS,GAAGC,OAAOJ,EAAiB,KACxC,IAAK,IAAIK,KAAOb,OAAOc,KAAKV,GAC1B,GAAIS,EAAIE,WAAWJ,GACjB,OAAOP,EAAKS,EAnBhB,CAsBF,CC3BO,IAAI7B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nvar initialized = false;\nvar initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (var [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n var language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n var primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n var prefix = \"\".concat(primaryLanguage, \"-\");\n for (var key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport var i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","lang","add","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","concat","key","keys","startsWith"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_next_bricks_advanced=self.webpackChunk_next_bricks_advanced||[]).push([[3948],{6171:(e,t,r)=>{function n(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}r.d(t,{Z:()=>n})},5866:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(5863);function a(e,t){(0,n.Z)(e,t),t.add(e)}},3948:(e,t,r)=>{r.r(t),r.d(t,{Dialog:()=>ir,Notification:()=>vr,StoryboardFunctionRegistryFactory:()=>me,__secret_internals:()=>n,__test_only:()=>{},applyTheme:()=>ae,authenticate:()=>$o,batchSetAppsLocalTheme:()=>oe,checkIfByTransform:()=>Pt,checkIfOfComputed:()=>Tt,createHistory:()=>R,createRuntime:()=>To,customProcessors:()=>L,customTemplates:()=>xe,fetchByProvider:()=>Wo,getAuth:()=>Do,getBasePath:()=>g,getCssPropertyValue:()=>de,getCurrentMode:()=>ce,getCurrentTheme:()=>ne,getHistory:()=>T,getPageInfo:()=>Za,getRuntime:()=>Oo,getV2RuntimeFromDll:()=>A,handleHttpError:()=>fr,httpErrorToString:()=>lr,isLoggedIn:()=>Vo,isUnauthenticatedError:()=>cr,logout:()=>Ko,matchPath:()=>Ht,registerWidgetFunctions:()=>Fe,registerWidgetI18n:()=>$,setUIVersion:()=>Ta,unstable_createRoot:()=>zo});var n={};r.r(n),r.d(n,{addRealTimeDataInspectHook:()=>$n,getAddedContracts:()=>Un,getAllContextValues:()=>xn,getBrickPackagesById:()=>Bn,getContextValue:()=>Mn,getRenderId:()=>Ln,legacyDoTransform:()=>kn,mountUseBrick:()=>Sn,renderUseBrick:()=>bn,setRealTimeDataInspectRoot:()=>jn,symbolForRootRuntimeContext:()=>yn,unmountUseBrick:()=>En,updateSnippetPreviewSettings:()=>Pn,updateStoryboard:()=>In,updateStoryboardByRoute:()=>Zn,updateStoryboardBySnippet:()=>Tn,updateStoryboardByTemplate:()=>Cn,updateTemplatePreviewSettings:()=>An});var a=r(3028),o=r(4795),i=r(5866),s=r(6666),l=r(3395),c=r(6171),u=r(381),d=r(687),p=r(4096),f=r(6974),v=r(9242),h=r(8874),m=(r(8525),r(7857));function g(){var e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var y=r(2159),b=r(5178);function w(e,t){var r=(0,b.orderBy)(e,(e=>{var t,r;return null!==(t=null===(r=e.app.homepage)||void 0===r?void 0:r.length)&&void 0!==t?t:0}),"desc");for(var n of r){var a=n.app.homepage;if("string"==typeof a&&"/"===a[0]&&S(a,t))return n}}function S(e,t){return"/"===e?t===e:"".concat(t.replace(/\/+$/,""),"/").startsWith("".concat(e.replace(/\/+$/,""),"/"))}function E(e){var t;return!e||(null===(t=Oo().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}var k,I=["extraQuery","clear","keepHash"],Z=!1;function C(e,t){t(!(Z=!confirm(e)))}function A(){var e,{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function R(){if(!k){var e=(0,m.createBrowserHistory)({basename:g().replace(/\/$/,""),getUserConfirmation:C});Object.assign(e,function(e){var t,{push:r,replace:n}=e;function o(e,t,n){Z=!1,r(e,t),null==n||n(Z)}function i(e,t,r){Z=!1,n(e,t),null==r||r(Z)}function s(t){return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,{extraQuery:s,clear:l,keepHash:c}=n,u=(0,y.Z)(n,I),d=new URLSearchParams(l?"":e.location.search),p={};for(var[f,v]of(Object.assign(p,r,s),Object.entries(p)))if(Array.isArray(v))for(var h of(d.delete(f),v))d.append(f,h);else null==v||""===v?d.delete(f):d.set(f,v);("push"===t?o:i)("?".concat(d.toString()).concat(c?e.location.hash:""),u,a)}}return(0,a.Z)({pushQuery:s("push"),replaceQuery:s("replace"),pushAnchor:function(t,r,n){o((0,a.Z)((0,a.Z)({},e.location),{},{key:void 0,hash:t,state:(0,a.Z)({notify:!1},r)}),void 0,n)},reload:function(t){i((0,a.Z)((0,a.Z)({},e.location),{},{state:(0,a.Z)((0,a.Z)({},e.location.state),{},{notify:!0,noIncremental:!0})}),void 0,t)},setBlockMessage:function(e){t=e},getBlockMessage:function(){return t},unblock:function(){t=void 0}},function(e){var{push:t,replace:r}=e;function n(n){return function(a,o,i){var s,l="string"==typeof a;return"string"==typeof(s=l?(0,m.parsePath)(a).pathname:a.pathname)&&s.startsWith("/")&&E(function(e){var t,r;return w(null!==(t=null===(r=yo)||void 0===r?void 0:r.storyboards)&&void 0!==t?t:[],e)}(s))?location["push"===n?"assign":"replace"](l?g()+a.substring(1):e.createHref(a)):("push"===n?t:r)(a,o,i)}}return{push:n("push"),replace:n("replace")}}((0,a.Z)((0,a.Z)({},e),{},{push:o,replace:i})))}(e)),k=e}return k}var T=function(){var e=A();if(e)return e.getHistory}()||function(){return k},O=r(5932),P=r(488),_=r(4608),M=r(1694),x=r(7941),B=new WeakMap,L=function(){var e=A();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomProcessor(t,r)})}()||new class{constructor(){(0,l.Z)(this,B,{writable:!0,value:new Map})}define(e,t){var[r,n]=e.split("."),a=(0,d.Z)(this,B).get(r);if(a||(a=new Map,(0,d.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,d.Z)(this,B).get(e)}};function U(e){var{app:t,meta:r}=e;if(null!=r&&r.i18n){var n=N("app",t.id),a=[];return Object.entries(r.i18n).forEach((e=>{var[t,r]=e;p.i18n.addResourceBundle(t,n,r),a.push(t)})),()=>{for(var e of a)p.i18n.removeResourceBundle(e,n)}}}function N(e,t){return"".concat(e,"/").concat(t)}function F(e){return p.i18n.getFixedT(null,N("widget",e))}var j,$=function(){var e=A();if(e)return function(t,r){return e.getRuntime().registerWidgetI18n(t,r)}}()||function(e,t){var r=N("widget",e);Object.entries(t).forEach((e=>{var[t,n]=e;p.i18n.addResourceBundle(t,r,n)}))},D="brick-next-devtools-panel",K="devtools-frame-active-change",V="devtools-panel-change",W=!0;function H(e,t){var r=z();if(r&&("evaluation"!==e||W&&(!j||"Evaluations"===j))){var n=()=>{var n;null===(n=r.emit)||void 0===n||n.call(r,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(n):setTimeout(n,0)}}function z(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}var q=()=>{throw new Error("Can't modify read-only proxy object")},G={set:q,defineProperty:q,deleteProperty:q,setPrototypeOf:q};function J(e){return new Proxy(e,G)}function Y(e){var{get:t,ownKeys:r}=e;return z()?J(Object.fromEntries(r(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}var Q="light",X=new v.JsonStorage(localStorage),ee="apps-theme";function te(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error("Unsupported theme: ".concat(e));Q=e}function re(){return Q}function ne(){return document.documentElement.dataset.theme}function ae(e){e?te(e):e=re(),e!==ne()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function oe(e){X.setItem(ee,(0,a.Z)((0,a.Z)({},ie()),e))}function ie(){var e,t;try{t=X.getItem(ee)}catch(e){console.error("JSON parse error inside `getLocalAppsTheme()`")}return null!==(e=t)&&void 0!==e?e:{}}var se="default";function le(e){if("dashboard"!==e&&"default"!==e)throw new Error("Unsupported mode: ".concat(e));se=e}function ce(){return document.documentElement.dataset.mode}function ue(e){e?le(e):e=se,e!==ce()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function de(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return r&&(null===(t=window.getComputedStyle(r))||void 0===t?void 0:t.getPropertyValue(e))||""}function pe(e,t){var r={};for(var n of e){var a=fe(n,t);void 0!==a&&(r[n]=a)}return r}function fe(e,t){var r,n,a,{collectCoverage:o,widgetId:i,widgetVersion:s,app:l,appendI18nNamespace:c,storyboardFunctions:u,isStoryboardFunction:d}=t;switch(e){case"BASE_URL":return o?"/next":g().replace(/\/$/,"");case"FN":return u;case"IMG":return o?{get:e=>"mock/images/".concat(e)}:i?null==wo||null===(r=wo.images)||void 0===r?void 0:r.widgetImagesFactory(i,s):null==wo||null===(n=wo.images)||void 0===n?void 0:n.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return o?b.identity:i?F(i):p.i18n.getFixedT(null,[c,N("app",l.id)].filter(Boolean));case"I18N_TEXT":return o?ve:p.i18nText;case"PERMISSIONS":return J({check:o?he:null==wo||null===(a=wo.checkPermissions)||void 0===a?void 0:a.checkPermissions});case"THEME":return J({getTheme:o?()=>"light":re});case"console":return d?J(console):void 0;case"location":return o?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function ve(e){return null==e?void 0:e.en}function he(){return!0}function me(){var e,{widgetId:t,widgetVersion:r,collectCoverage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new Map,i=new Proxy(Object.freeze({}),{get:(a,s)=>function(a){var s,l=o.get(a);if(l){if(l.processed)return l.cooked;n&&(s=n.createCollector(a));var c=(0,P.precookFunction)(l.source,{typescript:l.typescript,hooks:s&&{beforeVisit:s.beforeVisit}});return l.cooked=(0,P.cook)(c.function,l.source,{rules:{noVar:!0},globalVariables:(0,x.supply)(c.attemptToVisitGlobals,pe(c.attemptToVisitGlobals,{collectCoverage:n,widgetId:t,widgetVersion:r,app:e,storyboardFunctions:i,isStoryboardFunction:!0}),!!n),hooks:s&&{beforeEvaluate:s.beforeEvaluate,beforeCall:s.beforeCall,beforeBranch:s.beforeBranch}}),l.processed=!0,l.cooked}}(s)});return{storyboardFunctions:i,registerStoryboardFunctions:function(t,r){if(r&&(e=r),o.clear(),Array.isArray(t))for(var a of t){var i=(0,_.collectMemberUsageInFunction)(a,"FN",!!n),s=(0,_.collectMemberUsageInFunction)(a,"PERMISSIONS",!!n).has("check");o.set(a.name,{source:a.source,typescript:a.typescript,deps:i,hasPermissionsCheck:s})}},updateStoryboardFunction(e,t){var r=(0,a.Z)((0,a.Z)({},t),{},{name:e}),n=(0,_.collectMemberUsageInFunction)(r,"FN",!0),i=(0,_.collectMemberUsageInFunction)(r,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,deps:n,hasPermissionsCheck:i})},checkPermissionsUsage(e){var t=new Set,r=e=>{if(!t.has(e)){t.add(e);var n=o.get(e);return!!n&&(n.hasPermissionsCheck||[...n.deps].some(r))}return!1};return e.some(r)}}}var{storyboardFunctions:ge,registerStoryboardFunctions:ye,checkPermissionsUsage:be}=me(),we={};try{we.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var r=e.create,n=e.defineProperty,a=o.prototype;function o(){t.set(this,r(null))}function i(e,t,r){n(e,t,{configurable:!0,writable:!0,value:r})}function s(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}i(a,"addEventListener",(function(e,r,n){for(var a=t.get(this),o=a[e]||(a[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===r)return;o.push({target:this,listener:r,options:n})})),i(a,"dispatchEvent",(function(e){var r=t.get(this)[e.type];return r&&(i(e,"target",this),i(e,"currentTarget",this),r.slice(0).some(s,e),delete e.currentTarget,delete e.target),!0})),i(a,"removeEventListener",(function(e,r){for(var n=t.get(this),a=n[e]||(n[e]=[]),o=0,i=a.length;o<i;o++)if(a[o].listener===r)return void a.splice(o,1)})),we.EventTarget=o}(Object,new WeakMap)}const Se=we.EventTarget;var Ee=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({}),ke=new Map([[Ee.xLarge,"1920px"],[Ee.large,"1600px"],[Ee.medium,"1280px"],[Ee.small,"1024px"],[Ee.xSmall,0]]),Ie=new Se,Ze={},Ce={};function Ae(e,t){var r=!1;for(var[n]of(Ze[t]=e.matches,ke))if(Ze[n]&&Ce.breakpoint!==n){Ce.breakpoint=n,r=!0;break}r&&Ie.dispatchEvent(new CustomEvent("change",{detail:Ce}))}ke.forEach(((e,t)=>{var r=window.matchMedia("(min-width: ".concat(e,")"));Ae(r,t),r.addEventListener?r.addEventListener("change",(e=>{Ae(e,t)})):r.addListener((e=>{Ae(e,t)}))}));var Re=()=>Ce;function Te(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 Oe(e){var t,r;return!(null===(t=e?e.flags:null===(r=Oo())||void 0===r?void 0:r.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Pe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var o=0===n.length?"":",";e?console.error("".concat(t," is dropped in v3 strict mode").concat(o),...n):console.warn("".concat(t," is deprecated in v3 and will be dropped in strict mode").concat(o),...n)}var _e=new Set(["prefix"]),Me=new WeakMap,xe=function(){var e=A();if(e)return Object.freeze({define:(t,r)=>e.getRuntime().registerCustomTemplate(t,r)})}()||new class{constructor(){(0,l.Z)(this,Me,{writable:!0,value:new Map})}define(e,t){var r,n,o,i,s=(0,d.Z)(this,Me).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=Oe(),c=null!==(r=null===(n=t.proxy)||void 0===n?void 0:n.properties)&&void 0!==r?r:{},u=[],p=[];for(var[f,v]of Object.entries(c))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&&u.push([f,v]);var h=(0,a.Z)((0,a.Z)({},t),{},{proxy:(0,a.Z)((0,a.Z)({},t.proxy),{},{properties:Object.fromEntries(u)}),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,d.Z)(this,Me).set(e,(0,a.Z)((0,a.Z)({},h),{},{name:e}));var m,g,y=(m=h.state,(0,b.uniq)(null!==(g=null==m?void 0:m.filter((e=>e.expose)).map((e=>e.name)))&&void 0!==g?g:[])),w=Object.entries(null!==(o=null===(i=h.proxy)||void 0===i?void 0:i.methods)&&void 0!==o?o:{}),S=y.concat(u.map((e=>e[0]))),E=w.map((e=>e[0])),k=S.concat(E).filter((e=>e in HTMLElement.prototype&&!_e.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 S}static get _dev_only_definedMethods(){return E}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){var e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));var t=document.createDocumentFragment(),r=document.createElement("style");r.textContent=":host{display:block}:host([hidden]){display:none}";var n=document.createElement("slot");t.appendChild(r),t.appendChild(n),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}var I=function(r){if(u.some((e=>e[0]===r)))return console.error('Cannot define an exposed state that is also a proxy property: "'.concat(r,'" in ').concat(e)),1;Object.defineProperty(t.prototype,r,{get(){return this.$$tplStateStore.getValue(r)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(r,e,"replace")},enumerable:!0})};for(var Z of y)I(Z);var C=function(e,r){Object.defineProperty(t.prototype,e,{get(){var t;return this.$$getElementByRef(r.ref)[null!==(t=r.refProperty)&&void 0!==t?t:e]},set(t){var n,a,o=null===(n=this.$$getElementByRef)||void 0===n?void 0:n.call(this,r.ref);o&&(o[null!==(a=r.refProperty)&&void 0!==a?a:e]=t)},enumerable:!0})};for(var[A,R]of u)C(A,R);var T=function(e,r){Object.defineProperty(t.prototype,e,{value(){var t;this.$$getElementByRef(r.ref)[null!==(t=r.refMethod)&&void 0!==t?t:e](...arguments)},enumerable:!0})};for(var[O,P]of w)T(O,P);customElements.define(e,t)}}get(e){return(0,d.Z)(this,Me).get(e)}};function Be(e,t,r){var{tplStateStoreId:n,tplStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of a custom template').concat(null!=r?r:""));var o=a.get(n);if(!o)throw new Error('Template state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return o}function Le(e,t,r){var n=Be(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 Ue=new Map,Ne=new Proxy(Object.freeze({}),{get:(e,t)=>Ue.get(t)}),Fe=function(){var e=A();if(e)return function(t,r,n){return e.getRuntime().registerWidgetFunctions(t,r,n)}}()||function(e,t,r){if(Ue.has(e))throw new Error('Widget functions of "'.concat(e,'" already registered'));var{storyboardFunctions:n,registerStoryboardFunctions:a}=me({widgetId:e,widgetVersion:r});Ue.set(e,n),a(t)};const je=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$e=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(je);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},De=e=>"*"===e||"x"===e||"X"===e,Ke=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Ve=(e,t)=>{if(De(e)||De(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(Ke(e),Ke(t));return r>n?1:r<n?-1:0},We=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ve(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},He=(e,t,r)=>{Ge(r);const n=((e,t)=>{const r=$e(e),n=$e(t),a=r.pop(),o=n.pop(),i=We(r,n);return 0!==i?i:a&&o?We(a.split("."),o.split(".")):a||o?a?-1:1:0})(e,t);return ze[r].includes(n)},ze={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},qe=Object.keys(ze),Ge=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===qe.indexOf(e))throw new Error(`Invalid operator, expected one of ${qe.join("|")}`)};function Je(e,t){var r=jo(e);if(!r&&null!=wo&&wo.checkInstalledApps&&(r=wo.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 He(r.currentVersion,n[2],n[1])}catch(e){console.error(e)}return!1}function Ye(e,t,r){var{formStateStoreId:n,formStateStoreMap:a}=e;if(!n)throw new Error('Using "'.concat(t,'" outside of form renderer').concat(null!=r?r:""));var o=a.get(n);if(!o)throw new Error('Form state store is not found when using "'.concat(t,'"').concat(null!=r?r:"",".\nThis is a bug of Brick Next, please report it."));return o}var Qe=new Map;function Xe(e){return et.apply(this,arguments)}function et(){return et=(0,o.Z)((function*(e){var t,r=null==wo||null===(t=wo.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);r&&(e=wo.flowApi.FLOW_API_PROVIDER);var n=Qe.get(e);if(n)return n;if(e.includes("-")&&!customElements.get(e))if(r)wo.flowApi.registerFlowApiProvider();else if(yield(0,f.loadBricksImperatively)([e],Lo()),!customElements.get(e))throw new Error('Provider not defined: "'.concat(e,'".'));return n=document.createElement(e),Qe.set(e,n),n})),et.apply(this,arguments)}var tt=new WeakSet;function rt(e){if((0,v.isObject)(e)&&!nt(e))if(tt.add(e),Array.isArray(e))e.forEach(rt);else{var t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(rt)}}function nt(e){return tt.has(e)}var at=new Map;function ot(e,t,r){return it.apply(this,arguments)}function it(){return(it=(0,o.Z)((function*(e,t,r){var{useProvider:n,method:o="resolve",args:i=[],onReject:s}=e,{provider:l,field:c}=e;if(l&&!n)throw new Error("You're using \"provider: ".concat(l,'" which is dropped in v3, please use "useProvider" instead'));var u=null!=c;if(u){var d=Oe();if(Pe(d,"`resolve.field`"),d)throw new Error("Using deprecated `resolve.field`")}var p,[f,v]=yield Promise.all([Xe(n),St(i,t)]),h=null==r?void 0:r.renderId,m=st(f,n,o,v,r,i,!!h&&h!==Uo()),{transform:g}=e;try{var y=yield m;rt(p=u?(0,b.get)(y,c):y)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,p=e}return g?"string"==typeof g?{[g]:p}:St(g,(0,a.Z)((0,a.Z)({},t),{},{data:p})):p}))).apply(this,arguments)}function st(e,t,r,n,a,o,i){return lt.apply(this,arguments)}function lt(){return lt=(0,o.Z)((function*(e,t,r,n,a,i,s){var l,c;try{l=JSON.stringify({useProvider:t,method:r,args:n})}catch(e){if(!i)throw e;l=JSON.stringify({useProvider:t,method:r,originalArgs:i})}return"reload"!==(null==a?void 0:a.cache)&&(c=at.get(l)),c||(c=(0,o.Z)((function*(){var a,o=null!=wo&&null!==(a=wo.flowApi)&&void 0!==a&&a.isFlowApiProvider(t)?yield wo.flowApi.getArgsOfFlowApi(t,n,r):n;return e[r](...o)}))(),s||at.set(l,c)),c})),lt.apply(this,arguments)}var ct=Symbol.for("pre.evaluated.raw"),ut=Symbol.for("pre.evaluated.context");function dt(e){return!(null==e||!e[ct])}function pt(e){return e[ct]}function ft(e){return"string"==typeof e?(0,P.shouldAllowRecursiveEvaluations)(e):(0,P.shouldAllowRecursiveEvaluations)(e[ct])}var vt=new WeakSet([SyntaxError,TypeError,ReferenceError]);function ht(e){return vt.has(e.constructor)?e.constructor:TypeError}function mt(){return(mt=(0,o.Z)((function*(e,t,r){var{blockingList:n,run:a}=gt(e,t,r,!0);return yield Promise.all(n),a()}))).apply(this,arguments)}function gt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=[];if("string"!=typeof e){var i=(0,b.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t=(0,a.Z)((0,a.Z)({},e[ut]),i),e=e[ct]}var s,l={usedArgs:new Set},c={usedArgs:new Set};try{s=(0,P.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,_.collectAppGetMenuUsage)(l,e,t),(0,_.collectInstalledAppsHasUsage)(c,e,t)}}})}catch(t){var u="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(u)}if(l.hasNonStaticUsage)throw new Error('Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "'.concat(e,'"'));if(c.hasNonStaticUsage)throw new Error('Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "'.concat(e,'"'));var d,p,h,m,g={},{attemptToVisitGlobals:y}=s;if(r.lazy||y.has("EVENT")&&!(0,v.hasOwnProperty)(t,"event")||y.has("DATA")&&!(0,v.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[ct]:e,[ut]:t}:e};var w,S,E=Oe(t);(y.has("STATE")||!E&&y.has("TPL"))&&(m=Be(t,"STATE",': "'.concat(e,'"'))),y.has("FORM_STATE")&&(S=Ye(t,"FORM_STATE",': "'.concat(e,'"')));var k=z();if(n||k){if(y.has("CTX")&&(d=(0,_.strictCollectMemberUsage)(e,"CTX"),n&&o.push(t.ctxStore.waitFor(d))),m){if(h=(0,_.strictCollectMemberUsage)(e,"STATE"),!E){var I=(0,_.strictCollectMemberUsage)(e,"TPL");for(var Z of I)h.add(Z)}n&&o.push(m.waitFor(h))}S&&(w=(0,_.strictCollectMemberUsage)(e,"FORM_STATE"),n&&o.push(S.waitFor(w))),y.has("PROCESSORS")&&(p=(0,_.strictCollectMemberUsage)(e,"PROCESSORS",2),n&&o.push((0,f.loadProcessorsImperatively)(p,Lo())))}if(n){var C,A=y.has("PERMISSIONS");if(!A&&y.has("FN")){var R=[...(0,_.strictCollectMemberUsage)(e,"FN")];A=be(R)}if(A&&o.push(...t.pendingPermissionsPreCheck),l.usedArgs.size>0&&null!=wo&&wo.menu){var T=[...l.usedArgs];o.push(Promise.all(T.map((e=>wo.menu.fetchMenuById(e,t,{getStoryboardByAppId:Fo,resolveData:ot,asyncComputeRealValue:St})))))}c.usedArgs.size>0&&o.push(null==wo||null===(C=wo.checkInstalledApps)||void 0===C?void 0:C.waitForCheckingApps([...c.usedArgs]))}return{blockingList:o,run(){var r,n,o,i,{app:l,location:c,query:u,match:f,flags:k,sys:I,ctxStore:Z,data:C,event:A}=t,R=null!==(r=t.overrideApp)&&void 0!==r?r:l;for(var T of y)switch(T){case"ANCHOR":g[T]=c.hash?c.hash.substring(1):null;break;case"APP":g[T]=(0,a.Z)((0,a.Z)({},(0,b.cloneDeep)(R)),{},{getMenu:null==wo||null===(n=wo.menu)||void 0===n?void 0:n.getMenuById});break;case"CTX":g[T]=Y({get:(e,t)=>Z.getValue(t),ownKeys:()=>Array.from(d)});break;case"DATA":g[T]=C;break;case"EVENT":g[T]=A;break;case"FLAGS":g[T]=J(k);break;case"FORM_STATE":g[T]=Y({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(w)});break;case"HASH":g[T]=c.hash;break;case"INSTALLED_APPS":g[T]=J({has:Je});break;case"ITEM":case"INDEX":var O="ITEM"===T?"forEachItem":"forEachIndex";(0,v.hasOwnProperty)(t,O)?g[T]=t[O]:console.error("Using `".concat(T,'` but no `:forEach` is found, check your expression: "').concat(e,'"'));break;case"LOCAL_STORAGE":g[T]=J({getItem:Te("local")});break;case"MEDIA":g[T]=J(Re());break;case"MISC":g[T]=Oo().getMiscSettings();break;case"PARAMS":g[T]=new URLSearchParams(u);break;case"PATH":g[T]=J(null!==(o=null==f?void 0:f.params)&&void 0!==o?o:{});break;case"PATH_NAME":g[T]=c.pathname;break;case"PROCESSORS":g[T]=Y({get(e,t){var r=L.get(t);if(!r)throw new Error("'PROCESSORS.".concat(t,"' is not registered! Have you installed the relevant brick package?"));return Y({get:(e,t)=>r.get(t),ownKeys:()=>Array.from(r.keys())})},ownKeys(){var e=new Set;for(var t of p){var r=t.split(".")[0];e.add(r)}return Array.from(e)}});break;case"QUERY":g[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.get(e)])));break;case"QUERY_ARRAY":g[T]=Object.fromEntries(Array.from(u.keys()).map((e=>[e,u.getAll(e)])));break;case"SESSION_STORAGE":g[T]=J({getItem:Te("session")});break;case"TPL":if(Pe(E,'Using "TPL" in expression','check your expression: "'.concat(e,'"')),E)break;case"STATE":g[T]=Y({get:(e,t)=>m.getValue(t),ownKeys:()=>Array.from(h)});break;case"SYS":g[T]=J(null!=I?I:{});break;case"__WIDGET_FN__":g[T]=Ne;break;case"__WIDGET_IMG__":g[T]=null==wo||null===(i=wo.images)||void 0===i?void 0:i.widgetImagesFactory;break;case"__WIDGET_I18N__":g[T]=F}Object.assign(g,pe(s.attemptToVisitGlobals,{storyboardFunctions:ge,app:R,appendI18nNamespace:t.appendI18nNamespace}));try{var _=(0,P.cook)(s.expression,s.source,{globalVariables:(0,x.supply)(s.attemptToVisitGlobals,g)});return H("evaluation",{raw:e,context:g,result:_}),_}catch(t){var M="".concat(t.message,', in "').concat(e,'"');throw new(ht(t))(M)}}}}var yt=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function bt(e){switch(e){case yt.USE_BRICK_PROPERTIES:case yt.USE_BRICK_TRANSFORM:case yt.USE_BRICK_EVENTS:case yt.USE_BRICK_IF:case yt.USE_BRICK_LIFECYCLE:case yt.USE_BRICK_DATA_SOURCE:return!0}return!1}function wt(e,t,r){if(bt(e))return e;if(t)switch(e){case yt.USE_BRICK:return yt.USE_BRICK_ITEM;case yt.USE_BRICK_SLOTS_ITEM_BRICKS:return yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case yt.INITIAL:if("useBrick"===r)return yt.USE_BRICK;break;case yt.USE_BRICK:case yt.USE_BRICK_ITEM:case yt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(r){case"properties":return yt.USE_BRICK_PROPERTIES;case"transform":return yt.USE_BRICK_TRANSFORM;case"dataSource":return yt.USE_BRICK_DATA_SOURCE;case"events":return yt.USE_BRICK_EVENTS;case"slots":return yt.USE_BRICK_SLOTS;case"children":return yt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return yt.USE_BRICK_IF;case"lifeCycle":return yt.USE_BRICK_LIFECYCLE}break;case yt.USE_BRICK_SLOTS:return yt.USE_BRICK_SLOTS_ITEM;case yt.USE_BRICK_SLOTS_ITEM:if("bricks"===r)return yt.USE_BRICK_SLOTS_ITEM_BRICKS}return yt.INITIAL}function St(e,t){return Et.apply(this,arguments)}function Et(){return Et=(0,o.Z)((function*(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,P.isEvaluable)(e)?(a=yield function(e,t,r){return mt.apply(this,arguments)}(e,t,{lazy:o}),i=ft(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?M.transform:M.transformAndInject:r.noInject?Zt:M.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(r,!0);return Promise.all(e.map((e=>St(e,t,s))))}return Object.fromEntries((yield Promise.all(Object.entries(e).map((e=>{var[n,a]=e;return Promise.all([St(n,t),St(a,t,It(r,!1,n))])})))).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))})),Et.apply(this,arguments)}function kt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=dt(e);if(n||"string"==typeof e){var a,o=r.$$lazyForUseBrick&&bt(r.$$stateOfUseBrick),i=o;return n||(0,P.isEvaluable)(e)?(a=function(e,t,r){var{run:n}=gt(e,t,void 0,!1);return n()}(e,t),i=ft(e)):a=o?e:((0,v.hasOwnProperty)(t,"data")?r.noInject?M.transform:M.transformAndInject:r.noInject?Zt:M.inject)(e,t),i||rt(a),a}if(!(0,v.isObject)(e)||nt(e)||"function"==typeof e)return e;if(Array.isArray(e)){var s=It(r,!0);return e.map((e=>kt(e,t,s)))}return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[kt(n,t),kt(a,t,It(r,!1,n))]})).concat(r.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function It(e,t,r){return e.$$lazyForUseBrick?(0,a.Z)((0,a.Z)({},e),{},{$$stateOfUseBrick:wt(e.$$stateOfUseBrick,t,r)}):e}function Zt(e){return e}function Ct(e,t){return At.apply(this,arguments)}function At(){return(At=(0,o.Z)((function*(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?yield St(e.if,t):e.if)}))).apply(this,arguments)}function Rt(e,t){return!(0,v.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||dt(e.if)?kt(e.if,t):e.if)}function Tt(e){return!(0,v.hasOwnProperty)(e,"if")||!!e.if}function Ot(){return(Ot=(0,o.Z)((function*(e,t){return(0,v.isObject)(e.if)&&!dt(e.if)?Tt(yield ot(e.if,t)):Ct(e,t)}))).apply(this,arguments)}var Pt=function(){var e=A();if(e)return e.looseCheckIfByTransform}()||function(e,t){return Rt(e,{data:t})};function _t(e){var t=!1,r=!1,n=!1;if("string"==typeof e?(0,P.isEvaluable)(e):dt(e)){var a="string"==typeof e?e:pt(e);if((0,P.isTrackAll)(a)){var o=(0,_.trackAll)(a);o&&(t=o.context,r=o.state,n=o.formState)}else t=(0,_.track)(a,"track context","CTX"),r=(0,_.track)(a,"track state","STATE"),n=(0,_.track)(a,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:r,formStateNames:n}}function Mt(e,t){return xt.apply(this,arguments)}function xt(){return(xt=(0,o.Z)((function*(e,t){for(var[r,n,a]of e)if(r===t){var o=yield n;if(void 0!==o||!a)return o}}))).apply(this,arguments)}function Bt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=(0,o.Z)((function*(e){var t={};for(var[r,n,a]of e){var o=yield n;void 0===o&&a||!("style"!==r&&"dataset"!==r||(0,v.isObject)(o))||(t[r]=o)}return t}))).apply(this,arguments)}function Ut(e,t){if(t)for(var[r,n]of Object.entries(t))switch(r){case"style":case"dataset":for(var[a,o]of Object.entries(n))e[r][a]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error("set `".concat(r,"` is prohibited"));default:e[r]=n}}function Nt(e,t,r){var n=function(e,t){return(0,v.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{var[r,n]=e,a=kt(n,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?yt.USE_BRICK:yt.INITIAL});if("style"!==r&&"dataset"!==r||(0,v.isObject)(a))return[r,a]})).filter(Boolean)):{}}(t,r);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ut(e,n)}))}function Ft(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function jt(e){return e&&e.sensitive?"":"i"}function $t(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,i=void 0===o||o,s=r.end,l=void 0===s||s,c=r.encode,u=void 0===c?function(e){return e}:c,d=r.delimiter,p=void 0===d?"/#?":d,f=r.endsWith,v="[".concat(Ft(void 0===f?"":f),"]|$"),h="[".concat(Ft(p),"]"),m=i?"^":"",g=0,y=e;g<y.length;g++){var b=y[g];if("string"==typeof b)m+=Ft(u(b));else{var w=Ft(u(b.prefix)),S=Ft(u(b.suffix));if(b.pattern)if(t&&t.push(b),w||S)if("+"===b.modifier||"*"===b.modifier){var E="*"===b.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(b.pattern,")(?:").concat(S).concat(w,"(?:").concat(b.pattern,"))*)").concat(S,")").concat(E)}else m+="(?:".concat(w,"(").concat(b.pattern,")").concat(S,")").concat(b.modifier);else"+"===b.modifier||"*"===b.modifier?m+="((?:".concat(b.pattern,")").concat(b.modifier,")"):m+="(".concat(b.pattern,")").concat(b.modifier);else m+="(?:".concat(w).concat(S,")").concat(b.modifier)}}if(l)a||(m+="".concat(h,"?")),m+=r.endsWith?"(?=".concat(v,")"):"$";else{var k=e[e.length-1],I="string"==typeof k?h.indexOf(k[k.length-1])>-1:void 0===k;a||(m+="(?:".concat(h,"(?=").concat(v,"))?")),I||(m+="(?=".concat(h,"|").concat(v,")"))}return new RegExp(m,jt(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)t.push({type:"CHAR",index:r,value:e[r++]});else{var a=1,o="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--a){s++;break}}else if("("===e[s]&&(a++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=e[s++]}else o+=e[s++]+e[s++];if(a)throw new TypeError("Unbalanced pattern at ".concat(r));if(!o)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var i="",s=r+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,a=void 0===n?"./":n,o="[^".concat(Ft(t.delimiter||"/#?"),"]+?"),i=[],s=0,l=0,c="",u=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var n=r[l],a=n.type,o=n.index;throw new TypeError("Unexpected ".concat(a," at ").concat(o,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var f=u("CHAR"),v=u("NAME"),h=u("PATTERN");if(v||h){var m=f||"";-1===a.indexOf(m)&&(c+=m,m=""),c&&(i.push(c),c=""),i.push({name:v||s++,prefix:m,suffix:"",pattern:h||o,modifier:u("MODIFIER")||""})}else{var g=f||u("ESCAPED_CHAR");if(g)c+=g;else if(c&&(i.push(c),c=""),u("OPEN")){m=p();var y=u("NAME")||"",b=u("PATTERN")||"",w=p();d("CLOSE"),i.push({name:y||(b?s++:""),pattern:y&&!b?o:b,prefix:m,suffix:w,modifier:u("MODIFIER")||""})}else d("END")}}return i}(e,r),t,r)}function Dt(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,a=r.exec(e.source);a;)t.push({name:a[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),a=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var n=e.map((function(e){return Dt(e,t,r).source}));return new RegExp("(?:".concat(n.join("|"),")"),jt(r))}(e,t,r):$t(e,t,r)}var Kt=new Map,Vt=1e4,Wt=0;function Ht(e,t){var{path:r,exact:n=!1,strict:a=!1,sensitive:o=!0}=t;return(Array.isArray(r)?r:[r]).reduce(((t,r)=>{if(t)return t;var{regexp:i,keys:s}=function(e,t){var r="".concat(t.end).concat(t.strict).concat(t.sensitive),n=Kt.get(r);n||Kt.set(r,n=new Map);var a=n.get(e);if(a)return a;var o=[],i={regexp:Dt(e,o,t),keys:o};return Wt<Vt&&(n.set(e,i),Wt++),i}(r,{end:n,strict:a,sensitive:o}),l=i.exec(e);if(!l)return null;var[c,...u]=l,d=e===c;return n&&!d?null:{path:r,url:"/"===r&&""===c?"/":c,isExact:d,params:s.reduce(((e,t,r)=>(e[t.name]=u[r],e)),{})}}),null)}function zt(){return(zt=(0,o.Z)((function*(e,t){for(var r of e){if("string"!=typeof r.path)throw console.error("Invalid route with invalid path:",r),new Error("Invalid route with invalid type of path: ".concat(typeof r.path));var n=qt(r,t.app.homepage,t.location.pathname);if(n&&(yield Ct(r,t)))return t.app.noAuthGuard||r.public||null==wo||!wo.auth||wo.auth.isLoggedIn()?{match:n,route:r}:"unauthenticated"}return"missed"}))).apply(this,arguments)}function qt(e,t,r){return Ht(r,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}var Gt,Jt=Symbol.for("tpl.asyncComputedPropsFromHost"),Yt=Symbol.for("tpl.stateStoreId"),Qt=Symbol.for("tpl.externalForEachItem"),Xt=Symbol.for("tpl.externalForEachIndex"),er=new Set,tr=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e}({}),rr={[tr.REQUEST_FAILED]:"Request Failed",[tr.SOMETHING_WENT_WRONG]:"Something went wrong!",[tr.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[tr.NETWORK_ERROR]:"Network error, please check your network."},nr={[tr.REQUEST_FAILED]:"请求失败",[tr.SOMETHING_WENT_WRONG]:"出现了一些问题!",[tr.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[tr.NETWORK_ERROR]:"网络错误,请检查您的网络连接。"},ar="core/runtime",or={en:rr,zh:nr},ir=Object.freeze({show:function(e){return Gt?Gt.resolve(e):"confirm"===e.type?confirm(e.content)?new Promise((e=>setTimeout((()=>{e()}),1))):new Promise(((e,t)=>setTimeout((()=>{t()}),1))):(alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1e3))))}});function sr(e){var{search:t,pathname:r}=e,n=r?window.btoa(encodeURIComponent(r)):"",a=t?window.btoa(encodeURIComponent(t)):"";document.cookie="SALOGINPATH=".concat(n,"; path=/"),document.cookie="SALOGINQUERY=".concat(a,"; path=/")}function lr(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof O.HttpFetchError)return p.i18n.t("".concat(ar,":").concat(tr.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 cr(e){return e instanceof O.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}var ur,dr,pr=!1;function fr(e){if(!(e instanceof O.HttpAbortError)){if(cr(e)&&!window.NO_AUTH_GUARD){if(pr)return;return pr=!0,void ir.show({type:"confirm",content:p.i18n.t("".concat(ar,":").concat(tr.LOGIN_TIMEOUT_MESSAGE))}).then((()=>{var e,t;e=Oo().getFeatureFlags()["sso-enabled"],sr((t=T()).location),t.push(e?"/sso-auth/login":"/auth/login",{from:(0,a.Z)((0,a.Z)({},t.location),{},{state:void 0})}),pr=!1}),(()=>{pr=!1}))}console.error(e);var t=lr(e);t!==ur&&(ur=t,ir.show({type:"error",title:p.i18n.t("".concat(ar,":").concat(tr.REQUEST_FAILED)),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{ur=void 0})))}}var vr=Object.freeze({show:function(e){dr?dr.resolve(e):alert(e.message)}});function hr(e,t,r){t&&Object.entries(t).forEach((t=>{var[n,a]=t,o=wr(a,r,{element:e});for(var i of(e.addEventListener(n,o),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([n,o]),e.$$eventListeners||(e.$$eventListeners=[]),[].concat(a)))e.$$eventListeners.push([n,null,i])}))}function mr(e){return"string"==typeof e.action}function gr(e){return"string"==typeof e.useProvider}function yr(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function br(e){return!!e.then}function wr(e,t,r){return function(n){var o,i;for(var s of[].concat(e))if(Rt(s,(0,a.Z)((0,a.Z)({},t),{},{event:n})))if(br(s))wr(s.then,t,r)(n);else if(mr(s)){var[l,c]=s.action.split(".");switch(s.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":Cr(n,c,s.args,s.callback,t);break;case"window.open":Ar(n,s.args,t);break;case"location.reload":case"location.assign":_r(n,c,s.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Mr(n,l,c,s.args,t);break;case"event.preventDefault":n.preventDefault();break;case"event.stopPropagation":n.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":xr(n,c,s.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":Br(n,c,s.args,t);break;case"handleHttpError":fr(n.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":Tr(n,c,s.args,null===(o=s.batch)||void 0===o||o,s.callback,t);break;case"state.update":case"state.refresh":case"state.load":Or(n,c,s.args,null===(i=s.batch)||void 0===i||i,s.callback,t);break;case"tpl.dispatchEvent":var[u,d]=Fr(s.args,t,n);Le(t,s.action,": ".concat(u)).dispatchEvent(new CustomEvent(u,d));break;case"formstate.update":Pr(n,s.args,s.callback,t);break;case"message.subscribe":case"message.unsubscribe":Lr(n,c,s.args,t,r,s.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":ae("theme.setDarkTheme"===s.action?"dark":"light");break;case"theme.setTheme":var[p]=Fr(s.args,t,n);ae(p);break;case"mode.setDashboardMode":case"mode.setDefaultMode":ue("mode.setDashboardMode"===s.action?"dashboard":"default");break;default:console.error("unknown event listener action:",s.action)}}else gr(s)?Sr(n,s,t,r):yr(s)?kr(n,s,t,r):console.error("unknown event handler:",s);else s.else&&wr(s.else,t,r)(n)}}function Sr(e,t,r,n){return Er.apply(this,arguments)}function Er(){return(Er=(0,o.Z)((function*(e,t,r,n){try{Ir(e,yield Xe(t.useProvider),t,"saveAs"!==t.method?"resolve":"saveAs",r,n)}catch(e){console.error(lr(e))}}))).apply(this,arguments)}function kr(e,t,r,n){var o=[],i=t.target,s=t.targetRef,l=i;if(("string"==typeof i?(0,P.isEvaluable)(i):dt(i))&&(l=kt(i,(0,a.Z)((0,a.Z)({},r),{},{event:e}))),"string"==typeof l)if("_self"===l)o.push(n.element);else if(t.multiple)o=Array.from(document.querySelectorAll(l));else{var c=document.querySelector(l);null!==c&&o.push(c)}else if(l)l instanceof HTMLElement?o.push(l):console.error("unexpected target:",l);else if(s){var u=s;("string"==typeof s?(0,P.isEvaluable)(s):dt(s))&&(u=kt(s,(0,a.Z)((0,a.Z)({},r),{},{event:e})));var d=[].concat(u),p=Le(r,"targetRef",": ".concat(d.join(", ")));o.push(...d.map((e=>{var t;return null===(t=p.$$getElementByRef)||void 0===t?void 0:t.call(p,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((a=>{Ir(e,a,t,t.method,r,n,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Nt(o,t.properties,(0,a.Z)((0,a.Z)({},r),{},{event:e})):console.error("target not found:",i||s)}function Ir(e,t,r,n,a,o,i){return Zr.apply(this,arguments)}function Zr(){return Zr=(0,o.Z)((function*(e,t,r,n,i,s,l){if("function"==typeof t[n]){var c=function(){var a=(0,o.Z)((function*(){var a,o=Fr(r.args,i,e,l);return gr(r)&&null!=wo&&null!==(a=wo.flowApi)&&void 0!==a&&a.isFlowApiProvider(r.useProvider)&&(o=yield wo.flowApi.getArgsOfFlowApi(r.useProvider,o,n)),t[n](...o)}));return function(){return a.apply(this,arguments)}}();if(r.callback){var u=Nr(r.callback,i,s),d={progress:u("progress"),success:u("success"),error:u("error"),finally:u("finally")};if(gr(r)){var p,f=(0,a.Z)((0,a.Z)({},i),{},{event:e});if(kt(null===(p=r.poll)||void 0===p?void 0:p.enabled,f))return void function(e,t,r,n){var a,{progress:i,success:s,error:l,finally:c}=t,{expectPollStopImmediately:u,expectPollEnd:d}=r,{interval:p,leadingRequestDelay:f,continueOnError:v,delegateLoadingBar:h}=kt((0,b.pick)(r,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),n),m=Uo();function g(){return y.apply(this,arguments)}function y(){return(y=(0,o.Z)((function*(){var t;er.delete(a);try{var r;if(!(t=null===(r=kt(u,n))||void 0===r?void 0:r())){var o,f,g=yield e();(t=(null===(o=kt(u,n))||void 0===o?void 0:o())||m!==Uo())||(null==i||i(g),null!==(f=kt(d,n))&&void 0!==f&&f(g)?(h&&window.dispatchEvent(new Event("request.end")),null==s||s(g),null==c||c()):w(null!=p?p:3e3))}}catch(e){var y;(t=(null===(y=kt(u,n))||void 0===y?void 0:y())||m!==Uo())||(null==l||l(e),v?w(null!=p?p:3e3):null==c||c())}finally{h&&t&&window.dispatchEvent(new Event("request.end"))}}))).apply(this,arguments)}function w(e){a=setTimeout(g,e),er.add(a)}w(null!=f?f:0),h&&window.dispatchEvent(new Event("request.start"))}(c,d,r.poll,f)}try{var v=yield c();d.success(v)}catch(e){d.error(e)}finally{d.finally()}}else c()}else console.error("target has no method:",{target:t,method:n})})),Zr.apply(this,arguments)}function Cr(e,t,r,n,a){var o=0,i=!1,s=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":o=2,i=!0;break;case"reload":i=!0;break;case"block":o=1,s="setBlockMessage"}var l=[];if(o>0&&((l=Fr(r,a,e,{useEventDetailAsDefault:!0})).length=o),i&&n){var c=Nr(n,a,void 0);l.push((e=>{c(e?"error":"success")({blocked:e}),c("finally")({blocked:e})}))}T()[s](...l)}function Ar(e,t,r){var[n,a,o]=Fr(t,r,e);window.open(n,a||"_self",o)}function Rr(e,t,r,n,a,o){t?n.updateValues(e,r,(e=>Fr(e,a,o)[0])):e.forEach((e=>{var{name:t,value:i}=Fr([e],a,o)[0];n.updateValue(t,i,r)}))}function Tr(e,t,r,n,a,o){if(!Array.isArray(r)||!r.every(v.isObject)||"assign"!==t&&"replace"!==t){var[i,s]=Fr(r,o,e);o.ctxStore.updateValue(i,s,t,a,o)}else Rr(r,n,t,o.ctxStore,o,e)}function Or(e,t,r,n,a,o){if(Array.isArray(r)&&r.every(v.isObject)&&"update"===t)Rr(r,n,"replace",Be(o,"state.".concat(t),": ".concat(JSON.stringify(r))),o,e);else{var[i,s]=Fr(r,o,e);Be(o,"state.".concat(t),": ".concat(i)).updateValue(i,s,"update"===t?"replace":t,a,o)}}function Pr(e,t,r,n){var[a,o]=Fr(t,n,e);Ye(n,"formstate.update",": ".concat(a)).updateValue(a,o,"replace",r,n)}function _r(e,t,r,n){if("assign"===t){var[a]=Fr(r,n,e);location.assign(a)}else location[t]()}function Mr(e,t,r,n,a){var o="localStorage"===t?localStorage:sessionStorage,[i,s]=Fr(n,a,e);"setItem"===r?void 0!==s&&o.setItem(i,JSON.stringify(s)):o.removeItem(i)}function xr(e,t,r,n){console[t](...Fr(r,n,e,{useEventAsDefault:!0}))}function Br(e,t,r,n){var a=Fr(r,n,e,{useEventAsDefault:!0});vr.show({type:t,message:a[0]})}function Lr(e,t,r,n,a,o){return Ur.apply(this,arguments)}function Ur(){return(Ur=(0,o.Z)((function*(e,t,r,n,a,o){var i=()=>{var a,o=Fr(r,n,e);return null==wo||null===(a=wo.messageDispatcher)||void 0===a?void 0:a[t](...o)};if(o){var s=Nr(o,n,a);try{var l=yield i();s("success")(l)}catch(e){s("error")(e)}finally{s("finally")()}}else i()}))).apply(this,arguments)}function Nr(e,t,r){return function(n){return function(a){var o=null==e?void 0:e[n];if(o)try{var i=new CustomEvent("callback.".concat(n),{detail:a});wr(o,t,r)(i)}catch(e){console.error(e)}else"error"===n&&console.error("Unhandled callback error:",a)}}}function Fr(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?kt(e,(0,a.Z)((0,a.Z)({},t),{},{event:r})):n.useEventAsDefault?[r]:n.useEventDetailAsDefault?[r.detail]:[]}function jr(e){var t,{ref:r,runtimeContext:n,element:a}=e;if(r&&n.tplStateStoreId){var{hostBrick:o}=Be(n,"bindTemplateProxy"),i=o.tplHostMetadata;i.internalBricksByRef.set(r,e);var s=null===(t=i.proxy)||void 0===t?void 0:t.events;if(s){var l=function(e){if(u.ref===r){var t,n,i,s=t=>{t.bubbles&&t.stopPropagation(),o.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},l=null!==(t=u.refEvent)&&void 0!==t?t:e;a.addEventListener(l,s),null!==(i=(n=a).$$proxyListeners)&&void 0!==i||(n.$$proxyListeners=[]),a.$$proxyListeners.push([l,s])}};for(var[c,u]of Object.entries(s))l(c)}}}function $r(e){var{ref:t,runtimeContext:r,element:n}=e;if(null!=r&&r.tplStateStoreId&&t){var{hostBrick:a}=Be(r,"unbindTemplateProxy"),o=a.tplHostMetadata;for(var[i,s]of(o.internalBricksByRef.delete(t),null!==(l=n.$$proxyListeners)&&void 0!==l?l:[])){var l;n.removeEventListener(i,s)}delete n.$$proxyListeners}}var Dr=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Kr(e){e.replaceChildren()}function Vr(e,t){for(var r=e.child,n=[];r;){if(r.tag===Dr.BRICK){var a,o=r.type;o.includes("-")&&!customElements.get(o)&&console.error("Undefined custom element: ".concat(o)),"basic-bricks.script-brick"===o&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");var i=t&&r===e.child?t:document.createElement(o);r.element=i,r.slotId&&i.setAttribute("slot",r.slotId),r.iid&&(i.dataset.iid=r.iid),null!==(a=r.tplHostMetadata)&&void 0!==a&&a.tplStateStoreId&&(i.dataset.tplStateStoreId=r.tplHostMetadata.tplStateStoreId),Ut(i,r.properties),hr(i,r.events,r.runtimeContext),r.tplHostMetadata&&(i.$$tplStateStore=Be({tplStateStoreId:r.tplHostMetadata.tplStateStoreId,tplStateStoreMap:r.runtimeContext.tplStateStoreMap},"mount")),jr(r),r.portal?n.push(i):r.return&&(r.return.childElements||(r.return.childElements=[]),r.return.childElements.push(i))}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{for(var s,l=r.return;l;){var c;if(l.childElements)l.tag===Dr.ROOT?null===(c=l.container)||void 0===c||c.append(...l.childElements):l.element.append(...l.childElements),l.childElements=void 0;if(l.tag===Dr.ROOT&&n.length>0&&("function"==typeof l.createPortal?l.createPortal():l.createPortal).append(...n),l.sibling)break;l=l.return}r=null===(s=l)||void 0===s?void 0:s.sibling}}}var Wr=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Hr=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"],zr=new WeakMap,qr=new WeakMap,Gr=new WeakMap,Jr=new WeakMap,Yr=new WeakMap,Qr=new WeakMap,Xr=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;class sn{constructor(e,t){var r;(0,i.Z)(this,on),(0,i.Z)(this,an),(0,i.Z)(this,nn),(0,i.Z)(this,rn),(0,s.Z)(this,"scope",void 0),(0,s.Z)(this,"unknownBricks",void 0),(0,s.Z)(this,"renderId",void 0),(0,l.Z)(this,zr,{writable:!0,value:void 0}),(0,l.Z)(this,qr,{writable:!0,value:{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}}),(0,l.Z)(this,Gr,{writable:!0,value:new Map}),(0,l.Z)(this,Jr,{writable:!0,value:void 0}),(0,l.Z)(this,Yr,{writable:!0,value:new Map}),(0,l.Z)(this,Qr,{writable:!0,value:void 0}),(0,l.Z)(this,Xr,{writable:!0,value:void 0}),(0,l.Z)(this,en,{writable:!0,value:void 0}),(0,l.Z)(this,tn,{writable:!0,value:[]}),this.scope=e,this.unknownBricks=null!==(r=null==t?void 0:t.unknownBricks)&&void 0!==r?r:"throw",(0,u.Z)(this,zr,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequests(e){(0,u.Z)(this,Xr,e)}memoizeMenuRequests(e,t){(0,d.Z)(this,en)||(0,u.Z)(this,en,new WeakMap),(0,d.Z)(this,en).set(e,t[0])}reMergeMenuRequests(e,t,r){var n=this;return(0,o.Z)((function*(){var a,o;for(var i of e){var s;if(a=null===(s=(0,d.Z)(n,en))||void 0===s?void 0:s.get(i)){o=i;break}}var l,c=(0,d.Z)(n,Xr),u=a?c.indexOf(a):-1;if(-1===u){if(!r.length)return;c.push(...r)}else c.splice(u,c.length-u,...r);o&&o!==t&&(null===(l=(0,d.Z)(n,en))||void 0===l||l.delete(o)),yield(0,d.Z)(n,zr).mergeMenus(c)}))()}reBailout(e){return(0,d.Z)(this,zr).bailout(e)}reCatch(e,t){return(0,d.Z)(this,zr).catch(e,t)}didPerformIncrementalRender(e){var t=this;return(0,o.Z)((function*(){return(yield Promise.all((0,d.Z)(t,tn).map((t=>t(e))))).some((e=>e))}))()}performIncrementalRender(e){(0,d.Z)(this,tn).push(e)}registerBrickLifeCycle(e,t){if(t){var r=[...Wr,..."page"===this.scope?Hr:[]];for(var n of r){var a=t[n];a&&(0,d.Z)(this,qr)[n].push({brick:e,handlers:a})}(0,b.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}}registerArbitraryLifeCycle(e,t){var r=(0,d.Z)(this,Yr).get(e);r?r.add(t):(0,d.Z)(this,Yr).set(e,new Set([t]))}memoize(e,t,r,n){(0,d.Z)(this,Qr)||(0,u.Z)(this,Qr,new WeakMap);var a=[null!=e?e:"",...t].join("."),o=(0,d.Z)(this,Qr).get(n);o||(o=new Map,(0,d.Z)(this,Qr).set(n,o)),o.set(a,{node:r,last:pn(r),lastNormal:fn(r),lastPortal:hn(r)})}reRender(e,t,r,n){var a,o,i,s,l,u,p,f,v,h,m=[null!=e?e:"",...t].join("."),g=(0,d.Z)(this,Qr).get(n).get(m),{node:y,last:b,lastNormal:w,lastPortal:S}=g;(null==y?void 0:y.tag)===Dr.PLACEHOLDER?(a=null!==(i=null===(s=function(e){return vn(e,!0)}(y))||void 0===s?void 0:s.element)&&void 0!==i?i:null,o=null!==(l=null===(u=function(e){return mn(e,!0)}(y))||void 0===u?void 0:u.element)&&void 0!==l?l:null):(a=null!==(p=null==w||null===(f=w.element)||void 0===f?void 0:f.nextSibling)&&void 0!==p?p:null,o=null!==(v=null==S||null===(h=S.element)||void 0===h?void 0:h.nextSibling)&&void 0!==v?v:null);var E,k=pn(r);g.node=r,g.last=k,g.lastNormal=fn(r),g.lastPortal=hn(r);for(var I=n.child;I&&I!==b;){if(I.sibling===y){E=I;break}I=I.sibling}var Z=document.createDocumentFragment(),C=document.createDocumentFragment(),A={tag:Dr.ROOT,container:Z,createPortal:C,child:r};for(I=r;I;)I.return=A,I=I.sibling;var R,T,O=gn(y,b);for((0,c.Z)(this,rn,ln).call(this,O),Vr(A),E?E.sibling=r:n.child=r,k&&(k.sibling=null==b?void 0:b.sibling),I=r;I;)I.return=n,I=I.sibling;if(n.tag===Dr.ROOT?null===(R=n.container)||void 0===R||R.insertBefore(Z,a):null===(T=n.element)||void 0===T||T.insertBefore(Z,a),C.childNodes.length>0){for(var P,_=r;_&&_.return;)_=_.return;if((null===(P=_)||void 0===P?void 0:P.tag)!==Dr.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");("function"==typeof _.createPortal?_.createPortal():_.createPortal).insertBefore(C,o)}var M=gn(r,k);(0,c.Z)(this,nn,cn).call(this,M)}dispose(){for(var e of Object.values((0,d.Z)(this,qr)))e.length=0;for(var t of(0,d.Z)(this,Gr).values()){for(var r of t)r.disconnect();t.length=0}(0,d.Z)(this,Gr).clear(),(0,d.Z)(this,Jr)&&(Ie.removeEventListener("change",(0,d.Z)(this,Jr)),(0,u.Z)(this,Jr,void 0)),(0,u.Z)(this,Qr,void 0),(0,u.Z)(this,Xr,void 0),(0,u.Z)(this,en,void 0),(0,d.Z)(this,Yr).clear(),(0,d.Z)(this,tn).length=0}dispatchBeforePageLoad(){(0,c.Z)(this,an,un).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){var e=new CustomEvent("page.load");(0,c.Z)(this,an,un).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,c.Z)(this,an,un).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,c.Z)(this,an,un).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){var{hash:e}=T().location;e&&"#"!==e?(0,c.Z)(this,an,un).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,c.Z)(this,an,un).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(var{brick:e,handlers:t}of(0,d.Z)(this,qr).onScrollIntoView)(0,c.Z)(this,on,dn).call(this,e,t)}initializeMediaChange(){(0,u.Z)(this,Jr,(e=>{(0,c.Z)(this,an,un).call(this,"onMediaChange",new CustomEvent("media.change",{detail:J(e.detail)}))})),Ie.addEventListener("change",(0,d.Z)(this,Jr))}initializeMessageDispatcher(){var e,t=function(e){var t=function(t){var r;null==wo||null===(r=wo.messageDispatcher)||void 0===r||r.onMessage(t.channel,(r=>{wr(t.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:r}))}))};for(var r of[].concat(n))t(r)};for(var{brick:r,handlers:n}of(0,d.Z)(this,qr).onMessage)t(r);null==wo||null===(e=wo.messageDispatcher)||void 0===e||e.onClose((()=>{(0,c.Z)(this,an,un).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,c.Z)(this,an,un).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,c.Z)(this,an,un).call(this,"onUnmount",new CustomEvent("unmount"))}}function ln(e){var t=[...Wr,..."page"===this.scope?Hr:[]],r=[];for(var n of t){var a=(0,b.remove)((0,d.Z)(this,qr)[n],(t=>e.has(t.brick)));"onUnmount"===n&&r.push(...a)}for(var o of e){var i,s,l=(0,d.Z)(this,Gr).get(o);if(null!=l&&l.length){for(var c of l)c.disconnect();l.length=0,(0,d.Z)(this,Gr).delete(o)}$r(o),null===(i=o.element)||void 0===i||delete i.$$tplStateStore,null===(s=o.element)||void 0===s||s.remove()}var u=new CustomEvent("unmount");for(var{brick:p,handlers:f}of r)wr(f,p.runtimeContext,p)(u)}function cn(e){var t=new CustomEvent("mount");for(var{brick:r,handlers:n}of(0,d.Z)(this,qr).onMount)e.has(r)&&wr(n,r.runtimeContext,r)(t);for(var{brick:a,handlers:o}of(0,d.Z)(this,qr).onScrollIntoView)e.has(a)&&(0,c.Z)(this,on,dn).call(this,a,o)}function un(e,t){for(var{brick:r,handlers:n}of(0,d.Z)(this,qr)[e])wr(n,r.runtimeContext,r)(t);var a=(0,d.Z)(this,Yr).get(e);if(a)for(var o of a)o()}function dn(e,t){var r,n=null!==(r=t.threshold)&&void 0!==r?r:.1,a=new IntersectionObserver(((r,a)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(wr(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),a.disconnect())}))}),{threshold:n});a.observe(e.element);var o=(0,d.Z)(this,Gr).get(e);o||(o=[],(0,d.Z)(this,Gr).set(e,o)),o.push(a)}function pn(e){for(var t=e;null!==(r=t)&&void 0!==r&&r.sibling;){var r;t=t.sibling}return t}function fn(e){return vn(e,!1)}function vn(e,t){for(var r,n=e;n;){if(n.tag===Dr.BRICK&&!n.portal){if(t)return n;r=n}n=n.sibling}return r}function hn(e){return mn(e,!1)}function mn(e,t){for(var r,n=e;n;){if(n.tag===Dr.BRICK&&n.portal){if(t)return n;r=n}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&!o.sibling;)o=o.return;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}function gn(e,t){for(var r=new Set,n=e;n;)if(n.tag===Dr.BRICK&&r.add(n),n.child)n=n.child;else{if(n===t)break;if(n.sibling)n=n.sibling;else{for(var a,o=n.return;o&&o!==t&&!o.sibling;)o=o.return;if(o===t)break;n=null===(a=o)||void 0===a?void 0:a.sibling}}return r}var yn=Symbol.for("root.runtimeContext");function bn(e,t){return wn.apply(this,arguments)}function wn(){return(wn=(0,o.Z)((function*(e,t){var r,n,o,i,s,[l,c,u]=Sa((0,a.Z)((0,a.Z)({},null!==(r=e[yn])&&void 0!==r?r:No()),{},{data:t,pendingPermissionsPreCheck:[]}));null!==(n=l.tplStateStoreMap)&&void 0!==n||(l.tplStateStoreMap=new Map),null!==(o=l.formStateStoreMap)&&void 0!==o||(l.formStateStoreMap=new Map);var d=new sn("fragment"),p={tag:Dr.ROOT,createPortal:null},f=e.transform,v=Oe();f&&Pe(v,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);var h=yield ma(p,v?e:(0,a.Z)((0,a.Z)({},e),{},{properties:(0,a.Z)((0,a.Z)({},e.properties),f)}),l,d,[]),m=[...c,...u];if(yield wa(h,l,m),(null===(i=h.node)||void 0===i?void 0:i.tag)===Dr.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(s=h.node)&&void 0!==s&&s.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return p.child=h.node,{tagName:h.node?h.node.type:null,renderRoot:p,rendererContext:d,scopedStores:m}}))).apply(this,arguments)}function Sn(e,t){var r,{renderRoot:n,rendererContext:a,scopedStores:o}=e;for(var i of(n.createPortal=()=>{var e=document.querySelector("#portal-mount-point");return r=document.createElement("div"),e.appendChild(r),r},Vr(n,t),a.dispatchOnMount(),a.initializeScrollIntoView(),a.initializeMediaChange(),a.initializeMessageDispatcher(),o))i.mountAsyncData();return{portal:r}}function En(e,t){var{rendererContext:r}=e;t.portal&&(Kr(t.portal),t.portal.remove()),r.dispatchOnUnmount(),r.dispose()}function kn(e,t,r){if(r)throw new Error("Legacy doTransform does not support options in v3");return kt(t,(0,a.Z)((0,a.Z)({},No()),{},{data:e}),{noInject:!0})}function In(e,t){var r=Fo(e);Object.assign(r,(0,a.Z)((0,a.Z)({},t),{},{meta:(0,a.Z)((0,a.Z)({},r.meta),t.meta),$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1})),U(r)}function Zn(e,t){var r=Fo(e),n=!1,a=e=>"".concat(e.path,".").concat(e.exact),o=(e,r)=>e.map((e=>{var i=a(e);return"routes"===e.type?(e.routes=o(e.routes,r),e):i===r?(n=!0,t):e}));r.routes=o(r.routes,a(t)),n||r.routes.unshift(t)}function Cn(e,t,r){var n="".concat(e,".").concat(t.name);xe.define(n,{bricks:t.bricks,proxy:t.proxy,state:t.state}),An(e,t.name,r)}function An(e,t,r){_n(e,"${APP.homepage}/_dev_only_/template-preview/".concat(t),[(0,a.Z)({brick:t},(0,b.pick)(r,"properties","events","lifeCycle","context","slots","children"))])}function Rn(e){return"${APP.homepage}/_dev_only_/snippet-preview/".concat(e)}function Tn(e,t){var r;_n(e,Rn(t.snippetId),null!==(r=t.bricks)&&void 0!==r&&r.length?t.bricks:[{brick:"span"}],t.context)}var On,Pn=Tn;function _n(e,t,r,n){var{routes:a}=Fo(e),o=a.findIndex((e=>e.path===t)),i={path:t,bricks:r,context:n,menu:!1,exact:!0};-1===o?a.unshift(i):a.splice(o,1,i)}function Mn(e,t){var{tplStateStoreId:r}=t,n=No();return r?Be((0,a.Z)((0,a.Z)({},n),{},{tplStateStoreId:r}),"STATE").getValue(e):n.ctxStore.getValue(e)}function xn(e){var{tplStateStoreId:t}=e,r=No();return t?Be((0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:t}),"STATE").getAllValues():r.ctxStore.getAllValues()}function Bn(e){return Lo().find((t=>t.id?t.id===e:t.filePath.startsWith(e)))}function Ln(){return Uo()}function Un(e,t){return Nn.apply(this,arguments)}function Nn(){return(Nn=(0,o.Z)((function*(e,t){var r,{appId:n,updateStoryboardType:a,collectUsedContracts:o}=t,i=Fo(n);if("route"===a)r={routes:[e]};else if("template"===a)r={meta:{customTemplates:[e]}};else if("snippet"===a){var s,l=Rn(e.snippetId);r={routes:[null==i||null===(s=i.routes)||void 0===s?void 0:s.find((e=>e.path===l))]}}var c=[];return r&&o&&(yield o(r)).forEach((e=>{var t,[r,n,a]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===n&&e.name===a))||c.push(e)})),c}))).apply(this,arguments)}var Fn=[];function jn(e){On=e;var t=xn({tplStateStoreId:e.tplStateStoreId});Dn({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function $n(e){Fn.push(e)}function Dn(e){setTimeout((()=>{for(var t of Fn)try{t(e)}catch(t){console.error("RealTimeDataInspectHook failed (".concat(e.changeType,"):"),t)}}))}var Kn=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Vn{constructor(e,t,r,n){(0,s.Z)(this,"type",void 0),(0,s.Z)(this,"data",new Map),(0,s.Z)(this,"changeEventType",void 0),(0,s.Z)(this,"pendingStack",[]),(0,s.Z)(this,"hostBrick",void 0),(0,s.Z)(this,"stateStoreId",void 0),(0,s.Z)(this,"batchUpdate",!1),(0,s.Z)(this,"batchUpdateContextsNames",[]),(0,s.Z)(this,"rendererContext",void 0),(0,s.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,this.stateStoreId=n}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{var[t,{value:r}]=e;return[t,r]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(On){var{tplStateStoreId:r}=On;(r?"STATE"===this.type&&this.stateStoreId===r:"CTX"===this.type)&&Dn({changeType:"update",tplStateStoreId:r,detail:{name:e,value:t}})}}getAffectListByContext(e){var t=[e];return this.data.forEach(((e,r)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(r)&&t.push(...this.getAffectListByContext(r))})),t.shift(),[...new Set(t)]}updateValues(e,t,r){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");var n={},a={},o=[];e.forEach((e=>{var{name:a,value:i}=r([e]),s=this.data.get(a);o.push(...this.getAffectListByContext(a)),s&&(n[a]=s),this.updateValue(a,i,t)})),o.filter((e=>!n[e])).forEach((e=>{var t=this.data.get(e);t&&(a[e]=t)}));var i=e=>{for(var t in e){var r,n=e[t];null===(r=n.eventTarget)||void 0===r||r.dispatchEvent(new CustomEvent(this.changeEventType,{detail:n.value}))}};i(n),i(a),this.batchUpdate=!1}updateValue(e,t,r,n,o){var i=this.data.get(e);if(!i)throw new Error("".concat(this.type," '").concat(e,"' is not defined"));if("refresh"!==r&&"load"!==r)"replace"===r?i.value=t:(0,v.isObject)(i.value)?Object.assign(i.value,t):(console.warn('Non-object current value of "'.concat(this.type,".").concat(e,'" for "context.assign", try "context.replace" instead.')),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error("You can not ".concat(r,' "').concat(this.type,".").concat(e,'" which is not using resolve'));var s;"load"===r&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));var l=e=>{var t,r;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(r=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&r!==Uo()};if(s||(s=i.loading=i.load((0,a.Z)({cache:"load"===r?"default":"reload"},t))).then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||l(e)||null!=n&&n.error||fr(e)})),n){var c=Nr(n,o);s.then((e=>{c("success")({value:e}),c("finally")()}),(e=>{!l(e)&&n.error&&c("error")(e),c("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,r,n){if(Array.isArray(e)&&e.length>0){var a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX",n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",r=new Map;for(var n of e){var a=(0,_.collectMemberUsage)([n.if,n.value,n.resolve],t);r.set(n,a)}return r}(e,r),a=new Map;for(var i of Array.from(n.keys()).map((e=>e.name))){var s;a.set(i,(null!==(s=a.get(i))&&void 0!==s?s:0)+1)}var l=Array.from(n.values()).some((e=>e.hasNonStaticUsage)),c=new WeakSet,u=new Map,d=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,r)=>{u.set(e,{resolve:t,reject:r})}))]))),p=function(){var e=(0,o.Z)((function*(e){var r;c.add(e);var o=yield t(e);n.delete(e);var i=null!==(r=a.get(e.name))&&void 0!==r?r:0;if(o){if(u.get(e.name).resolve(),a.delete(e.name),0===i)throw new Error("Duplicated context defined: ".concat(e.name))}else 1===i?(u.get(e.name).resolve(),a.delete(e.name)):a.set(e.name,i-1);yield v()}));return function(t){return e.apply(this,arguments)}}(),f=l;function v(){return h.apply(this,arguments)}function h(){return h=(0,o.Z)((function*(){var e=Array.from(n.entries()).filter(function(e,t){return(r,n)=>t?0===n:![...r[1].usedProperties].some((t=>e.has(t)))}(a,f)).map((e=>e[0])).filter((e=>!c.has(e)));yield Promise.all(e.map(p))})),h.apply(this,arguments)}return{pendingResult:v().then((0,o.Z)((function*(){for(var e of(n.size>0&&(function(e,t){var r=new Map(e),n=new Set(Array.from(r.keys()).map((e=>e.name))),a=()=>{var e=!1;for(var[t,o]of r.entries())[...o.usedProperties].some((e=>n.has(e)))||(r.delete(t),n.delete(t.name),e=!0);e&&a()};if(a(),r.size>0)throw new ReferenceError("Circular ".concat(t," detected: ").concat(Array.from(r.keys()).map((e=>e.name)).join(", ")))}(n,r),f=!0,yield v()),u.values()))e.resolve()}))).catch((e=>{for(var t of u.values())t.reject(e);throw e})),pendingContexts:d}}(e,(e=>this.resolve(e,t,r,n)),this.type);this.pendingStack.push(a)}}onChange(e,t){var r;null===(r=this.data.get(e))||void 0===r||r.eventTarget.addEventListener(this.changeEventType,t)}waitFor(e){var t=this;return(0,o.Z)((function*(){var r=function*(t){yield Promise.all([...e].map((e=>t.get(e))))};for(var{pendingContexts:n}of t.pendingStack)yield*r(n)}))()}waitForAll(){var e=this;return(0,o.Z)((function*(){for(var{pendingContexts:t}of e.pendingStack)for(var r of t.values())r.catch((()=>{}));for(var{pendingResult:n}of e.pendingStack)yield n}))()}mountAsyncData(e){this.data.forEach((t=>{var r;if(t.async&&(!e||null!==(r=this.routeMap.get(e))&&void 0!==r&&r.has(t.name))){if(t.asyncMounted)return void console.error('Async data "'.concat(t.name,'" already mounted. This is a bug of Brick Next, please report it.'));t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}resolve(e,t,r,n){var i=this;return(0,o.Z)((function*(){if(!(yield Ct(e,t)))return!1;var s,l,c,u,d,p;if(r&&("STATE"===i.type?e.expose:"FORM_STATE"===i.type)&&(s=yield Mt(r,e.name)),void 0===s){if(e.resolve){var f=(0,v.hasOwnProperty)(e,"value");d=e.track&&f&&(0,v.hasOwnProperty)(e.resolve,"if")&&(0,_.strictCollectMemberUsage)(e.resolve.if,i.type).size>0;var h=(0,a.Z)({transform:"value"},e.resolve);if(((u=yield Ct(e.resolve,t))||d)&&(l=function(){var e=(0,o.Z)((function*(e){var r;return(yield ot(h,t,(0,a.Z)((0,a.Z)({},e),{},{renderId:null===(r=i.rendererContext)||void 0===r?void 0:r.renderId}))).value}));return function(t){return e.apply(this,arguments)}}()),u)"eager"==(p=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager")?s=yield l():"async"===p&&(c=l());else if(!f)return!1}u&&"eager"===p||void 0===e.value||(s=yield St(e.value,t))}if(i.data.has(e.name))throw new Error("".concat(i.type," '").concat(e.name,"' has already been declared"));var m={name:e.name,value:s,eventTarget:new Se,useResolve:u,load:l,loaded:"eager"===p,loading:c,async:"async"===p,deps:[]};if("lazy"===p){var g,{trigger:y}=e.resolve;y&&Kn.includes(y)&&(null===(g=i.rendererContext)||void 0===g||g.registerArbitraryLifeCycle(y,(()=>{i.updateValue(e.name,void 0,"load")})))}if(e.onChange&&m.eventTarget.addEventListener(i.changeEventType,wr(e.onChange,t)),e.track){var b=(0,_.strictCollectMemberUsage)(d?[e.resolve,e.value]:l?e.resolve:e.value,i.type);for(var w of(!l&&(m.deps=[...b]),b))i.onChange(w,i.batchAddListener((()=>{m.useResolve=d?Rt(e.resolve,t):!!l,m.useResolve?i.updateValue(e.name,{cache:"default"},"refresh"):i.updateValue(e.name,kt(e.value,t),"replace")}),e))}if(m.eventTarget.addEventListener(i.changeEventType,(t=>{i.notifyRealTimeDataChange(e.name,t.detail)})),i.data.set(e.name,m),Array.isArray(n))for(var S of n){var E=i.routeMap.get(S);E?E.add(e.name):i.routeMap.set(S,new Set([e.name]))}return!0}))()}disposeDataInRoutes(e){for(var t of e){var r=this.routeMap.get(t);if(void 0!==r)for(var n of r)this.data.delete(n)}}batchAddListener(e,t){return r=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(r)}}}function Wn(e,t,r){var n,a,{reversedProxies:o,asyncHostPropertyEntries:i,externalSlots:s,tplStateStoreId:l,hostBrick:c}=e;if(t&&o){var u=o.properties.get(t);u&&(a=i,n=u.map((e=>{var{from:t,to:r}=e,n=a.filter((e=>e[0]===t));if(n.length>0&&r.refProperty)return[r.refProperty,Mt(n,t),!0]})).filter(Boolean));var d=o.slots.get(t);if(d&&s){var p=new Map;for(var{from:f,to:h}of d){var m,g,y,w,S=null!==(m=null===(g=s[f])||void 0===g?void 0:g.bricks)&&void 0!==m?m:[];if(S.length){var E=null!==(y=h.refSlot)&&void 0!==y?y:f,k=p.get(E);if(!k){k=[];for(var I=(0,v.hasOwnProperty)(r,E)?r[E].bricks.length+1:1,Z=0;Z<I;Z+=1)k.push([]);p.set(E,k)}var C=null!==(w=h.refPosition)&&void 0!==w?w:-1;k[(0,b.clamp)(C<0?k.length+C:C,0,k.length-1)].push(...(0,v.hasOwnProperty)(c.runtimeContext,"forEachItem")?Hn(S,c.runtimeContext.forEachItem,c.runtimeContext.forEachIndex):S)}}var A=function(){(0,v.hasOwnProperty)(r,R)||(r[R]={type:"bricks",bricks:[]});var e=r[R];e.bricks=T.flatMap(((t,r)=>r<e.bricks.length?t.concat(e.bricks[r]):t)),0===e.bricks.length&&delete r[R]};for(var[R,T]of p.entries())A()}}return{[Jt]:n,[Yt]:l}}function Hn(e,t,r){return e.map((e=>{var n;return(0,a.Z)((0,a.Z)({},e),{},{[Qt]:t,[Xt]:r,slots:Object.fromEntries(Object.entries(null!==(n=e.slots)&&void 0!==n?n:{}).map((e=>{var n,[a,o]=e;return[a,"routes"===o.type?{type:"routes",routes:zn(o.routes,t,r)}:{type:"bricks",bricks:Hn(null!==(n=o.bricks)&&void 0!==n?n:[],t,r)}]})))})}))}function zn(e,t,r){return e.map((e=>e.type&&"bricks"!==e.type?e:(0,a.Z)((0,a.Z)({},e),{},{bricks:Hn(e.bricks,t,r)})))}var qn=["properties","slots","children"];function Gn(e,t){function r(e){return(0,v.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map((e=>{var[t,a]=e;return(0,v.isObject)(a)&&"useBrick"===t?Array.isArray(a)?[t,a.map(n)]:[t,n(a)]:[t,r(a)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function n(e){var{properties:o,slots:i,children:s}=e,l=(0,y.Z)(e,qn),c=ka(s,i),u=Object.fromEntries(Object.entries(null!=c?c:{}).map((e=>{var t,[r,a]=e;return[r,{type:"bricks",bricks:(null!==(t=a.bricks)&&void 0!==t?t:[]).map(n)}]})));return(0,a.Z)((0,a.Z)({},l),{},{properties:r(o),slots:u},Wn(t,l.ref,u))}return r(e)}var Jn=["slots","children"],Yn=["properties","slots","children"];function Qn(e,t,r,n,o){var i,s=(0,b.uniqueId)("tpl-state-"),l=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{tplStateStoreId:s});delete l.forEachItem,delete l.forEachIndex,delete l.formStateStoreId;var c=new Vn("STATE",r,o,s);l.tplStateStoreMap.set(s,c),l.tplStateStoreScope&&l.tplStateStoreScope.push(c);var{bricks:u,proxy:d,state:p,contracts:f}=xe.get(e);null==wo||null===(i=wo.flowApi)||void 0===i||i.collectWidgetContract(f),c.define(p,l,n);var{slots:v,children:h}=t,m=(0,y.Z)(t,Jn),g=(0,a.Z)((0,a.Z)({},m),{},{brick:e});r.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:d};var w={properties:new Map,slots:new Map};if(null!=d&&d.properties)for(var[S,E]of Object.entries(d.properties)){var k=w.properties.get(E.ref);k||(k=[],w.properties.set(E.ref,k)),k.push({from:S,to:E})}if(null!=d&&d.slots)for(var[I,Z]of Object.entries(d.slots)){var C=w.slots.get(Z.ref);C||(C=[],w.slots.set(Z.ref,C)),C.push({from:I,to:Z})}var A={reversedProxies:w,asyncHostPropertyEntries:n,externalSlots:ka(h,v),tplStateStoreId:s,hostBrick:r};return g.slots={"":{type:"bricks",bricks:u.map((e=>Xn(e,A)))}},g}function Xn(e,t){null===e.if&&delete e.if;var{properties:r,slots:n,children:o}=e,i=(0,y.Z)(e,Yn),s=ka(o,n),l=Object.fromEntries(Object.entries(null!=s?s:{}).map((e=>{var r,[n,a]=e;return[n,{type:"bricks",bricks:(null!==(r=a.bricks)&&void 0!==r?r:[]).map((e=>Xn(e,t)))}]})));return(0,a.Z)((0,a.Z)({},i),{},{properties:Gn(r,t),slots:l},Wn(t,i.ref,l))}var ea="form-renderer.form-renderer",ta=Symbol.for("form.stateStoreId"),ra=["forms.general-form","form.general-form","eo-form"];function na(e,t,r){var{id:n,bricks:o,events:i,context:s,mountPoint:l,instanceId:c}=e,{brick:u,properties:d}=e,p=t.find((e=>e.fieldId===n));if(p){var f=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}(p);u||(u=f.brick),d=(0,a.Z)((0,a.Z)({},f.properties),d)}var h={brick:u,properties:d,iid:c,slot:l,events:i,context:s,children:aa(o,t,r),[ta]:r};return(0,v.hasOwnProperty)(e,"if")&&(h.if=e.if),h}function aa(e,t,r){if(Array.isArray(e))return e.map((e=>na(e,t,r)))}var oa,ia,sa=["blockingList","node","menuRequests","hasTrackingControls"],la=["if","permissionsPreCheck"],ca=["formData"],ua=["src"],da=["href"];function pa(e,t,r,n,a,o,i){return fa.apply(this,arguments)}function fa(){return fa=(0,o.Z)((function*(e,t,r,n,o,i,s){var l=yield function(e,t){return zt.apply(this,arguments)}(t,r),c={blockingList:[],menuRequests:[]};switch(l){case"missed":break;case"unauthenticated":c.unauthenticated=!0;break;default:var u,d=c.route=l.route;c.path=l.match.path;var p=(0,a.Z)((0,a.Z)({},r),{},{match:l.match});s&&p.ctxStore.disposeDataInRoutes(t);var v=o.concat(d);p.ctxStore.define(d.context,p,void 0,v),p.pendingPermissionsPreCheck.push(null==wo||null===(u=wo.checkPermissions)||void 0===u?void 0:u.preCheckPermissionsForBrickOrRoute(d,(e=>St(e,p))));var{preLoadBricks:h}=d;if(Array.isArray(h)&&c.blockingList.push((0,f.loadBricksImperatively)(h,Lo())),"redirect"===d.type){var m;if("string"!=typeof(m="string"==typeof d.redirect?yield St(d.redirect,p):(yield ot((0,a.Z)({transform:"redirect"},d.redirect),p)).redirect))throw console.error("Unexpected redirect result:",m),new Error("Unexpected type of redirect result: ".concat(typeof m));c.redirect={path:m}}else{var g=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return St(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(d.menu,p);g&&c.menuRequests.push(g),"routes"===d.type?Ea(c,yield pa(e,d.routes,p,n,v,i)):Ea(c,yield va(e,d.bricks,p,n,v,i)),e.tag===Dr.BRICK&&n.memoizeMenuRequests(d,c.menuRequests)}}return c})),fa.apply(this,arguments)}function va(e,t,r,n,a,o,i,s){return ha.apply(this,arguments)}function ha(){return(ha=(0,o.Z)((function*(e,t,r,n,a,o,i,s){var l={blockingList:[],menuRequests:[]},c=null!=s?s:[];return(yield Promise.all(t.map(((t,s)=>ma(e,t,r,n,a,o,c.concat(s),i&&new Map(i)))))).forEach(((t,r)=>{t.hasTrackingControls&&n.memoize(o,c.concat(r),t.node,e),Ea(l,t)})),l}))).apply(this,arguments)}function ma(e,t,r,n,a,o){return ga.apply(this,arguments)}function ga(){return ga=(0,o.Z)((function*(e,t,r,n,i,s){var l,c,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:new Map,p={blockingList:[],menuRequests:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),p;var{if:h,permissionsPreCheck:m}=t,g=(0,y.Z)(t,la);if(function(e){return"string"==typeof e?(0,P.isTrackAll)(e):dt(e)&&(0,P.isTrackAll)(pt(e))}(h))return ma(e,(0,a.Z)({brick:":if",dataSource:h,permissionsPreCheck:m,slots:{"":{type:"bricks",bricks:[g]}}},Object.getOwnPropertySymbols(t).reduce(((e,r)=>(0,a.Z)((0,a.Z)({},e),{},{[r]:t[r]})),{})),r,n,i,s,u,d);var w=t[Yt],E=t[ta],k=(0,a.Z)((0,a.Z)({},r),{},{tplStateStoreId:w,formStateStoreId:E});(0,v.hasOwnProperty)(t,Qt)&&(k.forEachItem=t[Qt],k.forEachIndex=t[Xt]);var{context:I}=t;if(Array.isArray(I)&&I.length>0){var Z=Oe(k);Pe(Z,"Defining context on bricks","check your brick:",t),Z||k.ctxStore.define(I,k)}if(k.pendingPermissionsPreCheck.push(null==wo||null===(l=wo.checkPermissions)||void 0===l?void 0:l.preCheckPermissionsForBrickOrRoute(t,(e=>St(e,k)))),!(yield function(e,t){return Ot.apply(this,arguments)}(t,k)))return p;var C=t.brick;if(C.startsWith(":")){var A;!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error('Unknown storyboard control node: "'.concat(e,'"'))}(C);var{dataSource:R}=t,T=function(){var r=(0,o.Z)((function*(r){var a,o=yield St(R,r),l=":forEach"===C?"":":switch"===C?String(o):o?"":"else",c=ka(t.children,t.slots),p=c&&(0,v.hasOwnProperty)(c,l)&&(null===(a=c[l])||void 0===a?void 0:a.bricks);if(!Array.isArray(p))return{blockingList:[],menuRequests:[]};switch(C){case":forEach":return Array.isArray(o)?function(e,t,r,n,a,o,i,s,l){return ya.apply(this,arguments)}(e,o,p,r,n,i,s,d,u):{blockingList:[],menuRequests:[]};case":if":case":switch":return va(e,p,r,n,i,s,d,u)}}));return function(e){return r.apply(this,arguments)}}(),O=function(){var t=(0,o.Z)((function*(t){var r,n=yield T(t);return null!==(r=n.node)&&void 0!==r||(n.node={tag:Dr.PLACEHOLDER,return:e}),n}));return function(e){return t.apply(this,arguments)}}(),M=yield O(k),{onMount:x,onUnmount:B}=null!==(A=t.lifeCycle)&&void 0!==A?A:{},{contextNames:L,stateNames:U}=_t(R);if(L||U){M.hasTrackingControls=!0;var N=0,F=function(){var t=(0,o.Z)((function*(){var t=++N,[r,a,o]=Sa(k),i=yield O(r),l=[...a,...o];if(yield wa(i,r,l),N===t)for(var c of(B&&wr(B,k)(new CustomEvent("unmount",{detail:{rerender:!0}})),n.reRender(s,u,i.node,e),x&&wr(x,r)(new CustomEvent("mount",{detail:{rerender:!0}})),l))c.mountAsyncData()}));return function(){return t.apply(this,arguments)}}(),j=(0,b.debounce)(F);if(L)for(var $ of L)k.ctxStore.onChange($,j);if(U)for(var D of U)Be(k,"STATE",': "'.concat(R,'"')).onChange(D,j)}return x&&n.registerArbitraryLifeCycle("onMount",(()=>{wr(x,k)(new CustomEvent("mount",{detail:{rerender:!1}}))})),B&&n.registerArbitraryLifeCycle("onUnmount",(()=>{wr(B,k)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),M}/\.tpl-/.test(C)&&!xe.get(C)&&(yield Ia((0,f.loadBricksImperatively)([C],Lo()),"brick",C,n.unknownBricks));var K,V,W=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}(C,null===(c=k.app)||void 0===c?void 0:c.id);if(W){var H,z=null!==(H=d.get(W))&&void 0!==H?H:0;if(z>=10)throw new Error('Maximum custom template stack overflowed: "'.concat(W,'"'));d.set(W,z+1)}else C.includes("-")&&!customElements.get(C)&&(C===ea?customElements.define(ea,class extends HTMLElement{get $$typeof(){return"form-renderer"}}):p.blockingList.push(Ia((0,f.enqueueStableLoadBricks)([C],Lo()),"brick",C,n.unknownBricks)));if(C===ea){var q,G=null!==(q=t.properties)&&void 0!==q?q:{};({formData:K}=G),V=(0,y.Z)(G,ca)}else V=t.properties;var J=[],Y=function(e,t,r){return(0,v.isObject)(e)?Object.entries(e).map((e=>{var[n,a]=e,{contextNames:o,stateNames:i,formStateNames:s}=_t(a);return(o||i||s)&&r.push({contextNames:o,stateNames:i,formStateNames:s,propName:n,propValue:a}),[n,St(a,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?yt.USE_BRICK:yt.INITIAL})]})):[]}(V,k,J),Q=t[Jt];Q&&Y.push(...Q);var X="script"===C;if(X||"link"===C){var ee=yield Bt(Y);if(X?ee.src:"stylesheet"===ee.rel&&ee.href){var te,re=null!==(te=window.PUBLIC_ROOT)&&void 0!==te?te:"";if(X){var{src:ne}=ee,ae=(0,y.Z)(ee,ua);yield Ia((0,f.loadScript)(ne,re,ae),"script",ne,"silent")}else{var{href:oe}=ee;ae=(0,y.Z)(ee,da),yield Ia((0,f.loadStyle)(oe,re,ae),"stylesheet",oe,"silent")}return p}}var ie={tag:Dr.BRICK,type:W||C,return:e,slotId:s,events:t.events,runtimeContext:k,portal:t.portal,iid:t.iid,ref:t.ref};p.node=ie;var se=(0,_.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);se.size>0&&p.blockingList.push(Ia((0,f.loadProcessorsImperatively)(se,Lo()),"processors",[...se].join(", "),n.unknownBricks));var le=[],ce=function(){var e=(0,o.Z)((function*(){ie.properties=yield Bt(Y),function(e,t){var r=function(t){var r=()=>{e.element&&Nt(e.element,{[t.propName]:t.propValue},e.runtimeContext)};if(t.contextNames)for(var n of t.contextNames)e.runtimeContext.ctxStore.onChange(n,r);if(t.stateNames){var a=Be(e.runtimeContext,"STATE",': "'.concat(t.propValue,'"'));for(var o of t.stateNames)a.onChange(o,r)}if(t.formStateNames){var i=Ye(e.runtimeContext,"FORM_STATE",': "'.concat(t.propValue,'"'));for(var s of t.formStateNames)i.onChange(s,r)}};for(var n of t)r(n)}(ie,J)}));return function(){return e.apply(this,arguments)}}();le.push(ce()),n.registerBrickLifeCycle(ie,t.lifeCycle);var ue,de=t;W?de=Qn(W,t,ie,Y,n):C===ea&&(de=function(e,t,r,n,o){var i,s,l="string"==typeof e?JSON.parse(e):e,c=(0,b.uniqueId)("form-state-"),u=(0,a.Z)((0,a.Z)({},r.runtimeContext),{},{formStateStoreId:c});delete u.forEachItem,delete u.forEachIndex,delete u.tplStateStoreId;var d=new Vn("FORM_STATE",void 0,o,c);u.formStateStoreMap.set(c,d),u.formStateStoreScope&&u.formStateStoreScope.push(d);var p=null!==(i=l.context)&&void 0!==i?i:[];p.some((e=>"params"===e.name))||p.push({name:"params"}),d.define(p,u,n);var f=na(l.formSchema,l.fields,c);return ra.includes(f.brick)&&t.events&&(f.events=function(e,t){var r=null!=e?e:{};for(var[n,a]of Object.entries(t))r[n]=(0,v.hasOwnProperty)(r,n)?[r[n],a].flat():a;return r}(f.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:[f]}]}):(0,a.Z)((0,a.Z)({},t),{},{slots:void 0,children:[f]})}(K,t,ie,Y,n)),de.portal&&(ie.slotId=void 0),W?(delete(ue=(0,a.Z)({},k)).forEachItem,delete ue.forEachIndex):ue=k;var pe=function(){var e=(0,o.Z)((function*(){var e=ka(de.children,de.slots);if(e){var t=new Set,r=yield Promise.all(Object.entries(e).map(((e,r)=>{var[s,l]=e;if("routes"!==l.type)return va(ie,l.bricks,ue,n,i,s,d);var c=i[i.length-1];return null!=c&&c.incrementalSubRoutes&&(t.add(r),n.performIncrementalRender(function(){var e=(0,o.Z)((function*(e){var t,{homepage:r}=ue.app,{pathname:o}=e,u=null===(t=ue.match)||void 0===t?void 0:t.params;if(!S(r,o)||!i.every((e=>{var t=qt(e,r,o);return t&&(e!==c||(0,b.isEqual)(u,t.params))})))return!1;var d,[p,f,v]=Sa((0,a.Z)((0,a.Z)({},ue),{},{location:e,query:new URLSearchParams(e.search)})),h=!1,m=[];try{if(d=yield pa(ie,l.routes,p,n,i,s,!0),n.reBailout(d))return!0;m=[...f,...v],yield wa(d,p,[p.ctxStore,...m]),yield n.reMergeMenuRequests(l.routes,d.route,d.menuRequests)}catch(e){console.error("Incremental sub-router failed:",e);var g=n.reCatch(e,ie);if(!g)return!0;({failed:h,output:d}=g),yield n.reMergeMenuRequests(l.routes,d.route,d.menuRequests)}if(n.reRender(s,[],d.node,ie),!h)for(var y of(p.ctxStore.mountAsyncData(d.route),m))y.mountAsyncData();return!0}));return function(t){return e.apply(this,arguments)}}())),pa(ie,l.routes,ue,n,i,s)}))),l=(0,a.Z)((0,a.Z)({},p),{},{node:void 0,blockingList:[],menuRequests:[]});r.forEach(((e,r)=>{t.has(r)&&n.memoize(s,[],e.node,ie),Ea(l,e)})),l.node&&(ie.child=l.node),Ea(p,(0,a.Z)((0,a.Z)({},l),{},{node:void 0}))}}));return function(){return e.apply(this,arguments)}}();return le.push(pe()),yield Promise.all(le),p})),ga.apply(this,arguments)}function ya(){return(ya=(0,o.Z)((function*(e,t,r,n,o,i,s,l,c){var u={blockingList:[],menuRequests:[]},d=t.length;return(yield Promise.all(t.map(((t,u)=>Promise.all(r.map(((r,p)=>ma(e,r,(0,a.Z)((0,a.Z)({},n),{},{forEachItem:t,forEachIndex:u}),o,i,s,c.concat(u*d+p),l&&new Map(l))))))))).flat().forEach(((t,r)=>{t.hasTrackingControls&&o.memoize(s,c.concat(r),t.node,e),Ea(u,t)})),u}))).apply(this,arguments)}function ba(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function wa(e,t,r){return(0,f.flushStableLoadBricks)(),Promise.all([...e.blockingList,...r.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Sa(e){var t=[],r=[];return[(0,a.Z)((0,a.Z)({},e),{},{tplStateStoreScope:t,formStateStoreScope:r}),t,r]}function Ea(e,t){var{blockingList:r,node:n,menuRequests:a,hasTrackingControls:o}=t,i=(0,y.Z)(t,sa);if(e.blockingList.push(...r),e.menuRequests.push(...a),n)if(e.node){for(var s=e.node;s.sibling;)s=s.sibling;s.sibling=n}else e.node=n;Object.assign(e,i)}function ka(e,t){var r=t;if(Array.isArray(e)&&!r)for(var n of(r={},e)){var a,o=null!==(a=n.slot)&&void 0!==a?a:"";(0,v.hasOwnProperty)(r,o)||(r[o]={type:"bricks",bricks:[]}),r[o].bricks.push(n)}return r}function Ia(e,t,r,n){return"silent"===n?e.catch((e=>{console.error('Load %s "%s" failed:',t,r,e)})):e}function Za(){if(!oa){if(oa={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){oa.isInIframe=!0;try{if(window.origin===window.parent.origin){oa.isInIframeOfSameSite=!0;var e="/next/"===g(),t=window.parent.location.pathname,r=t.startsWith("/next/");oa.isInIframeOfNext=0==(Number(e)^Number(r)),oa.isInIframeOfVisualBuilder=t.startsWith("".concat(r?"/next":"","/visual-builder/")),oa.isInIframeOfLegacyConsole=e&&!r}}catch(e){}}Object.freeze(oa)}return oa}function Ca(e){var t;if(!e.$$registerCustomTemplateProcessed){e.$$registerCustomTemplateProcessed=!0;var r=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(r))for(var n of r){var a=n.name.includes(".")?n.name:"".concat(e.app.id,".").concat(n.name);xe.define(a,n)}}}function Aa(){return Aa=(0,o.Z)((function*(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=function(e){return Ra.apply(this,arguments)}(e)),e.$$fulfilling})),Aa.apply(this,arguments)}function Ra(){return(Ra=(0,o.Z)((function*(e){var t;yield null==wo||null===(t=wo.fulfilStoryboard)||void 0===t?void 0:t.call(wo,e),U(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}))).apply(this,arguments)}function Ta(e){var t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}var Oa=new WeakMap,Pa=new WeakMap,_a=new WeakMap,Ma=new WeakMap,xa=new WeakMap,Ba=new WeakMap,La=new WeakMap,Ua=new WeakMap,Na=new WeakMap,Fa=new WeakMap,ja=new WeakMap,$a=new WeakMap,Da=new WeakSet,Ka=new WeakSet,Va=new WeakSet,Wa=new WeakSet;class Ha{constructor(e){(0,i.Z)(this,Wa),(0,i.Z)(this,Va),(0,i.Z)(this,Ka),(0,i.Z)(this,Da),(0,l.Z)(this,Oa,{writable:!0,value:void 0}),(0,l.Z)(this,Pa,{writable:!0,value:!1}),(0,l.Z)(this,_a,{writable:!0,value:void 0}),(0,l.Z)(this,Ma,{writable:!0,value:void 0}),(0,l.Z)(this,xa,{writable:!0,value:void 0}),(0,l.Z)(this,Ba,{writable:!0,value:void 0}),(0,l.Z)(this,La,{writable:!0,value:new Set}),(0,l.Z)(this,Ua,{writable:!0,value:0}),(0,l.Z)(this,Na,{writable:!0,value:void 0}),(0,l.Z)(this,Fa,{writable:!0,value:void 0}),(0,l.Z)(this,ja,{writable:!0,value:void 0}),(0,l.Z)(this,$a,{writable:!0,value:void 0}),(0,u.Z)(this,Oa,e);var t=T();window.addEventListener("beforeunload",(e=>{(0,c.Z)(this,Da,za).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,c.Z)(this,Da,za).call(this,{location:e,action:t})))}getRenderId(){return(0,d.Z)(this,Na)}getRuntimeContext(){return(0,d.Z)(this,xa)}getRecentApps(){return{currentApp:(0,d.Z)(this,Fa),previousApp:(0,d.Z)(this,ja)}}getNavConfig(){return(0,d.Z)(this,$a)}bootstrap(){var e=this;window.AbortController&&(ia=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:ia.signal})})})));var t=T();(0,u.Z)(this,_a,t.location);var r=0;return t.listen(function(){var t=(0,o.Z)((function*(t,n){var o,i,s,l,p,f,v=++r,h={hash:void 0,state:void 0};if(void 0!==t.key&&("POP"!==n||void 0!==(0,d.Z)(e,_a).key&&!1!==(null===(o=(0,d.Z)(e,_a).state)||void 0===o?void 0:o.notify))||(h.key=void 0),((0,m.locationsAreEqual)((0,a.Z)((0,a.Z)({},(0,d.Z)(e,_a)),h),(0,a.Z)((0,a.Z)({},t),h))||"POP"!==n&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(p=!0),p||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(p=yield null===(f=(0,d.Z)(e,Ba))||void 0===f?void 0:f.didPerformIncrementalRender(t)),r===v)if(p)(0,u.Z)(e,_a,t);else{if(ia&&(ia.abort(),ia=new AbortController),(0,u.Z)(e,_a,t),null===(l=(0,d.Z)(e,Ba))||void 0===l||l.dispatchPageLeave(),"POP"===n&&E(w((0,d.Z)(e,Oa),t.pathname)))return void window.location.reload();(0,d.Z)(e,Pa)?(0,u.Z)(e,Ma,t):(H("locationChange"),(0,c.Z)(e,Va,Ga).call(e,t).catch(fr))}}));return function(e,r){return t.apply(this,arguments)}}()),(0,c.Z)(this,Va,Ga).call(this,t.location)}}function za(e){var t,r=T(),n=r.getBlockMessage();null===(t=(0,d.Z)(this,Ba))||void 0===t||t.dispatchBeforePageLeave(e);var a=r.getBlockMessage();return!n&&a&&r.unblock(),a}function qa(e,t,r){var n,a;if((0,u.Z)(this,Ua,(n=(0,d.Z)(this,Ua),a=n++,n)),a>10){var o='Infinite redirect detected: from "'.concat(r.pathname).concat(r.search).concat(r.hash,'" to "').concat(e,'"');throw new Error(o)}T().replace(e,t)}function Ga(e){return Ja.apply(this,arguments)}function Ja(){return(Ja=(0,o.Z)((function*(e){(0,u.Z)(this,Pa,!0);try{yield(0,c.Z)(this,Wa,Ya).call(this,e)}finally{if((0,u.Z)(this,Pa,!1),(0,d.Z)(this,Ma)){var t=(0,d.Z)(this,Ma);(0,u.Z)(this,Ma,void 0),yield(0,c.Z)(this,Va,Ga).call(this,t)}}}))).apply(this,arguments)}function Ya(e){return Qa.apply(this,arguments)}function Qa(){return Qa=(0,o.Z)((function*(e){var t,r,n,i,s=this,l=(0,u.Z)(this,Na,(0,b.uniqueId)("render-id-"));tt=new WeakSet,at.clear(),null==wo||null===(t=wo.flowApi)||void 0===t||t.clearCollectWidgetContract(),T().unblock();var p=null==wo||null===(r=wo.pageView)||void 0===r?void 0:r.create(),f=w((0,d.Z)(this,Oa),e.pathname),v=null===(n=(0,d.Z)(this,xa))||void 0===n?void 0:n.app,h=null==f||null===(i=f.app)||void 0===i?void 0:i.id;window.BOOTSTRAP_UNION_FILE&&h&&h!==(null==v?void 0:v.id)&&function(e){var{appId:t,version:r}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",r))}({appId:h,version:f.app.currentVersion}),null!=f&&f.app&&(yield function(e){return Aa.apply(this,arguments)}(f));var m,g=(0,u.Z)(this,Fa,null==f?void 0:f.app),y=v&&g?v.id!==g.id:v!==g,S=Oo().getFeatureFlags(),E=(0,d.Z)(this,Ba),k=(t,r)=>{null==p||p({status:"redirected"}),(0,d.Z)(this,La).add(E),(0,c.Z)(this,Ka,qa).call(this,t,r,e)},I=()=>{var t=S["sso-enabled"]?"/sso-auth/login":"/auth/login";sr(e),k(t,{from:e})},Z=document.querySelector("#main-mount-point"),C=document.querySelector("#portal-mount-point"),A={tag:Dr.ROOT,container:Z,createPortal:C},R=()=>{var e;for(var t of(Kr(Z),Kr(C),(0,d.Z)(this,La).add(E),(0,d.Z)(this,La)))t&&(t.dispatchOnUnmount(),t.dispose());(0,d.Z)(this,La).clear(),null==wo||null===(e=wo.messageDispatcher)||void 0===e||e.reset(),y&&((0,u.Z)(this,ja,v),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:v,currentApp:g}})))};if(te(g&&(ie()[g.id]||g.theme)||"light"),le("default"),g){var P,_,M,x,B,L;null==wo||null===(P=wo.checkInstalledApps)||void 0===P||P.preCheckInstalledApps(f,(e=>!!jo(e)));var U={bailout:e=>e.unauthenticated?(I(),!0):e.redirect?(k(e.redirect.path,e.redirect.state),!0):void(0,u.Z)(this,Ua,0),mergeMenus:(m=(0,o.Z)((function*(e){var t=yield Promise.all(e);(0,u.Z)(s,$a,function(e){var t={breadcrumb:[]};for(var r of e){var{breadcrumb:n}=r;n&&(n.overwrite?t.breadcrumb=n.items:t.breadcrumb.push(...n.items))}return t}(t))})),function(e){return m.apply(this,arguments)}),catch:(t,r)=>{if(!cr(t)||window.NO_AUTH_GUARD){if(!(t instanceof O.HttpAbortError)){var n=Oo().getMiscSettings().noAuthGuardLoginPath;return cr(t)&&n?void k(n,{from:e}):{failed:!0,output:{node:{tag:Dr.BRICK,type:"div",properties:{textContent:lr(t)},runtimeContext:null,return:r},blockingList:[],menuRequests:[]}}}(0,d.Z)(this,La).add(E)}else I()}},N=(0,u.Z)(this,Ba,new sn("page",{routeHelper:U,renderId:l})),F=(0,u.Z)(this,xa,{app:g,location:e,query:new URLSearchParams(e.search),flags:S,sys:(0,a.Z)((0,a.Z)((0,a.Z)({},null==wo||null===(_=wo.auth)||void 0===_?void 0:_.getAuth()),Za()),{},{settings:{brand:Oo().getBrandSettings()}}),ctxStore:new Vn("CTX",void 0,N),pendingPermissionsPreCheck:[null==wo||null===(M=wo.checkPermissions)||void 0===M?void 0:M.preCheckPermissions(f)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,u.Z)(this,$a,void 0),Ca(f),ye(null===(x=f.meta)||void 0===x?void 0:x.functions,g),null==wo||null===(B=wo.flowApi)||void 0===B||B.collectContract(null===(L=f.meta)||void 0===L?void 0:L.contracts);var j,$=!1,D=[];try{if(j=yield pa(A,function(e){if(window.parent===window)return e;var t=e,r=(0,b.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)];var n=(0,b.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)]}(f.routes),F,N,[]),U.bailout(j))return;D=ba(F),yield wa(j,F,D),yield U.mergeMenus(j.menuRequests),N.setInitialMenuRequests(j.menuRequests)}catch(e){console.error("Router failed:",e);var K=U.catch(e,A);if(!K)return;({failed:$,output:j}=K)}if(A.child=j.node,R(),j.route&&"routes"!==j.route.type||$){if($||N.dispatchBeforePageLoad(),ae(),ue(),window.DISABLE_REACT_FLUSH_SYNC=!1,Ta(null==g?void 0:g.uiVersion),Vr(A),setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0})),window.scrollTo(0,0),$)null==p||p({status:"failed"});else{for(var V of(N.dispatchPageLoad(),N.dispatchAnchorLoad(),N.dispatchOnMount(),N.initializeScrollIntoView(),N.initializeMediaChange(),N.initializeMessageDispatcher(),D))V.mountAsyncData();null==p||p({status:"ok",path:j.path,pageTitle:document.title})}return void H("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=wo&&wo.auth&&!wo.auth.isLoggedIn())return void I();R()}ae(),ue();var W={tag:Dr.BRICK,type:"div",properties:{textContent:"Page not found"},runtimeContext:null,return:A};A.child=W,Vr(A),window.scrollTo(0,0),null==p||p({status:"not-found"}),H("rendered")})),Qa.apply(this,arguments)}var Xa="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null,eo=r(3997),to=r(4633),ro=2,no=.16,ao=.05,oo=.05,io=.15,so=5,lo=4,co=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function uo(e){var t=e.r,r=e.g,n=e.b,a=(0,eo.py)(t,r,n);return{h:360*a.h,s:a.s,v:a.v}}function po(e){var t=e.r,r=e.g,n=e.b;return"#".concat((0,eo.vq)(t,r,n,!1))}function fo(e,t,r){var n;return(n=Math.round(e.h)>=60&&Math.round(e.h)<=240?r?Math.round(e.h)-ro*t:Math.round(e.h)+ro*t:r?Math.round(e.h)+ro*t:Math.round(e.h)-ro*t)<0?n+=360:n>=360&&(n-=360),n}function vo(e,t,r){return 0===e.h&&0===e.s?e.s:((n=r?e.s-no*t:t===lo?e.s+no:e.s+ao*t)>1&&(n=1),r&&t===so&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function ho(e,t,r){var n;return(n=r?e.v+oo*t:e.v-io*t)>1&&(n=1),Number(n.toFixed(2))}function mo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=(0,to.uA)(e),a=so;a>0;a-=1){var o=uo(n),i=po((0,to.uA)({h:fo(o,a,!0),s:vo(o,a,!0),v:ho(o,a,!0)}));r.push(i)}r.push(po(n));for(var s=1;s<=lo;s+=1){var l=uo(n),c=po((0,to.uA)({h:fo(l,s),s:vo(l,s),v:ho(l,s)}));r.push(c)}return"dark"===t.theme?co.map((function(e){var n,a,o,i=e.index,s=e.opacity;return po((n=(0,to.uA)(t.backgroundColor||"#141414"),o=100*s/100,{r:((a=(0,to.uA)(r[i])).r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b}))})):r}var go,yo,bo,wo,So={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Eo={},ko={};function Io(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Zo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Co(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Ao(e,t,r){return"dark"===t?mo(e,{theme:t,backgroundColor:r})[5]:e}function Ro(e){var t=[];if(["light","dark"].forEach((r=>{if(e[r])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Zo:Io)("string"==typeof(r=t)?" --color-brand: ".concat(r,";\n"):[" --color-brand: ".concat(r.default,";")," --color-brand-hover: ".concat(r.hover,";")," --color-brand-active: ".concat(r.active,";"),""].join("\n"));var r}(r,e[r]));break;case"baseColors":t.push(function(e,t,r){return("dark"===e?Zo:Io)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[r,n]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(r),n.map(((e,n)=>[" --palette-".concat(r,"-").concat(n+1,"-channel: ").concat(Co(e),";")].concat("dark"===t?[]:" --palette-".concat(r,"-").concat(n+1,": rgb(var(--palette-").concat(r,"-").concat(n+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,r){return Object.fromEntries(Object.entries(e).map((e=>{var[n,a]=e;return[n,mo(a,"dark"===t?{theme:t,backgroundColor:r}:void 0)]})))}(t,e,r),e),"\n").concat(function(e,t,r){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((n=>{var[a,o]=n;return[" --theme-".concat(a,"-color-rgb-channel: ").concat(Co(Ao(t[o],e,r)),";"),..."dark"===e?[]:[" --theme-".concat(a,"-color: var(--palette-").concat(o,"-6);")," --theme-".concat(a,"-border-color: var(--palette-").concat(o,"-3);")]," --theme-".concat(a,"-background: var(--palette-").concat(o,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,r)))}(r,e[r],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Zo:Io)(function(e){return Object.entries(e).map((e=>{var[t,r]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(r,";")})).concat("").join("\n")}(t))}(r,e[r]))}})),t.length>0){var r=document.createElement("style");return r.textContent=t.join("\n\n"),document.head.appendChild(r),()=>{r.remove()}}}function To(e){if(go)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{var{data:t}=e;if((null==t?void 0:t.source)===D){var r=t.payload;switch(null==r?void 0:r.type){case K:W=r.active;break;case V:j=r.panel}}})),wo=null==e?void 0:e.hooks,(0,p.initializeI18n)(ar,or),h.locale(p.i18n.language),p.i18n.on("languageChanged",(()=>{h.locale(p.i18n.language)})),R(),go=new xo}Object.keys(So).forEach((function(e){Eo[e]=mo(So[e]),Eo[e].primary=Eo[e][5],ko[e]=mo(So[e],{theme:"dark",backgroundColor:"#141414"}),ko[e].primary=ko[e][5]})),Eo.red,Eo.volcano,Eo.gold,Eo.orange,Eo.yellow,Eo.lime,Eo.green,Eo.cyan,Eo.blue,Eo.geekblue,Eo.purple,Eo.magenta,Eo.grey;var Oo=function(){var e=A();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return go},Po=new WeakMap,_o=new WeakMap,Mo=new WeakSet;class xo{constructor(){(0,i.Z)(this,Mo),(0,l.Z)(this,Po,{writable:!0,value:!1}),(0,l.Z)(this,_o,{writable:!0,value:!1}),(0,s.Z)(this,"version",3)}initialize(e){var t;if((0,d.Z)(this,Po))throw new Error("The runtime cannot be initialized more than once");(0,u.Z)(this,Po,!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;p.i18n.addResourceBundle(r,e,n)})),r.localeName=p.i18n.getFixedT(null,e)("name",r.name),Object.keys(r.locales).forEach((t=>{p.i18n.removeResourceBundle(t,e)}))}else r.localeName=r.name};for(var{app:r}of e.storyboards)t()}(0,v.isObject)(e.settings)&&(0,v.deepFreeze)(e.settings),e.brickPackages&&(0,v.deepFreeze)(e.brickPackages)}(e),yo=e;var r,{notification:n,dialog:o}=(0,c.Z)(this,Mo,Bo).call(this);!1!==n&&(r=null!=n?n:"basic.show-notification",(0,this.loadBricks)([r]).then((()=>{dr=document.createElement(r)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==o&&function(e,t){t([e]).then((()=>{Gt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(null!=o?o:"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?Ro((0,a.Z)({type:"brandColor"},e.brandColor)):e.baseColors?Ro((0,a.Z)({type:"baseColors"},e.baseColors)):e.variables&&Ro((0,a.Z)({type:"variables"},e.variables)))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}bootstrap(e){var t=this;return(0,o.Z)((function*(){if(e&&t.initialize(e),(0,d.Z)(t,_o))throw new Error("The runtime cannot be bootstrapped more than once");(0,u.Z)(t,_o,!0),bo=new Ha(yo.storyboards),yield bo.bootstrap()}))()}getRecentApps(){var e,t;return null!==(e=null===(t=bo)||void 0===t?void 0:t.getRecentApps())&&void 0!==e?e:{}}getCurrentApp(){var e;return null===(e=bo)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return Je(e,t)}getFeatureFlags(){var e,t;return(0,a.Z)((0,a.Z)((0,a.Z)({},null===(e=yo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags),null===(t=bo)||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=yo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc),null===(t=bo)||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=yo)||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=yo)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad)}getDesktops(){var e,t;return null!==(e=null===(t=yo)||void 0===t?void 0:t.desktops)&&void 0!==e?e:[]}getLaunchpadSiteMap(){var e,t;return null!==(e=null===(t=yo)||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=bo)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,f.loadBricksImperatively)(e,Lo())}}function Bo(){var e,t;return null!==(e=null===(t=yo)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.presetBricks)&&void 0!==e?e:{}}function Lo(){var e,t,r,n;return null!==(e=null!==(t=null!==(r=null===(n=yo)||void 0===n?void 0:n.brickPackages)&&void 0!==r?r:Xa)&&void 0!==t?t:window.STANDALONE_BRICK_PACKAGES)&&void 0!==e?e:[]}function Uo(){var e;return null===(e=bo)||void 0===e?void 0:e.getRenderId()}function No(){var e;return null===(e=bo)||void 0===e?void 0:e.getRuntimeContext()}function Fo(e){var t;return null===(t=yo)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function jo(e){var t;return null===(t=Fo(e))||void 0===t?void 0:t.app}function $o(){for(var e,t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];null==wo||null===(e=wo.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...n)}function Do(){var e;return null==wo||null===(e=wo.auth)||void 0===e?void 0:e.getAuth()}function Ko(){var e,t;return null==wo||null===(e=wo.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Vo(){var e;return null==wo||null===(e=wo.auth)||void 0===e?void 0:e.isLoggedIn()}function Wo(e,t,r){return Ho.apply(this,arguments)}function Ho(){return(Ho=(0,o.Z)((function*(e,t,r){return st(yield Xe(e),e,"resolve",t,r)}))).apply(this,arguments)}function zo(e){var t,{portal:r,scope:n="fragment",unknownBricks:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r;t=r||(()=>((i=document.createElement("div")).style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));var s,l,c=!1;return{render(r){var u=arguments;return(0,o.Z)((function*(){var{theme:o,uiVersion:d,context:p,functions:f,templates:h,i18n:m}=u.length>1&&void 0!==u[1]?u[1]:{};if(c)throw new Error("The root is unmounted and cannot be rendered any more");var g=[].concat(r),y=s,w=(0,b.uniqueId)("render-id-");s=new sn(n,{unknownBricks:a,renderId:w});var S={ctxStore:new Vn("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map},E={tag:Dr.ROOT,container:e,createPortal:t};if("page"===n){var k;!function(e,t){function r(e){if((0,v.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(var[t,a]of Object.entries(e))(0,v.isObject)(a)&&"useBrick"===t?Array.isArray(a)?a.forEach((e=>n(e,!0))):n(a,!0):r(a)}function n(e,a){a&&(e[yn]=t);var{properties:o,slots:i,children:s}=e,l=ka(s,i);for(var c of(r(o),Object.values(null!=l?l:{})))for(var u of null!==(d=c.bricks)&&void 0!==d?d:[]){var d;n(u,a)}}for(var a of e)n(a)}(g,S),te(null!=o?o:"light"),le("default"),Ta(d);var I={id:"demo",homepage:"/demo"};S.app=I;var Z={app:I,meta:{i18n:m,customTemplates:h}};null===(k=l)||void 0===k||k(),l=U(Z),Ca(Z),ye(f,I)}S.ctxStore.define(p,S);var C,A=!1,R=[];try{C=yield va(E,g,S,s,[]),R=ba(S),yield wa(C,S,R)}catch(e){A=!0,C={node:{tag:Dr.BRICK,type:"div",properties:{textContent:lr(e)},return:E,runtimeContext:null},blockingList:[],menuRequests:[]}}if(E.child=C.node,null==y||y.dispatchOnUnmount(),null==y||y.dispose(),Kr(e),i&&Kr(i),"page"===n&&(A||s.dispatchBeforePageLoad(),ae(),ue()),Vr(E),"page"===n&&window.scrollTo(0,0),!A){for(var T of R)T.mountAsyncData();"page"===n&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}}))()},unmount(){c||(c=!0,Kr(e),i&&(Kr(i),r||i.remove()))}}}}}]);
2
+ //# sourceMappingURL=3948.577db0fb.js.map