@next-bricks/visual-builder 1.36.14 → 1.36.15

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 (152) hide show
  1. package/dist/bricks.json +6 -4
  2. package/dist/chunks/1122.8d825637.js +2 -0
  3. package/dist/chunks/1122.8d825637.js.map +1 -0
  4. package/dist/chunks/114.cf000627.js +2 -0
  5. package/dist/chunks/{114.8467ea5c.js.map → 114.cf000627.js.map} +1 -1
  6. package/dist/chunks/1940.956f7191.js +2 -0
  7. package/dist/chunks/1940.956f7191.js.map +1 -0
  8. package/dist/chunks/{2277.ff3d70d1.js → 2277.d3148cce.js} +2 -2
  9. package/dist/chunks/{2277.ff3d70d1.js.map → 2277.d3148cce.js.map} +1 -1
  10. package/dist/chunks/{2980.4ec4e488.js → 2980.47e98446.js} +2 -2
  11. package/dist/chunks/{2980.4ec4e488.js.map → 2980.47e98446.js.map} +1 -1
  12. package/dist/chunks/{3171.f66d7cb8.js → 3171.ef7f3653.js} +2 -2
  13. package/dist/chunks/{3171.f66d7cb8.js.map → 3171.ef7f3653.js.map} +1 -1
  14. package/dist/chunks/3933.ff6ffa69.js +2 -0
  15. package/dist/chunks/{6314.1364814f.js.map → 3933.ff6ffa69.js.map} +1 -1
  16. package/dist/chunks/4291.da2890c6.js +2 -0
  17. package/dist/chunks/4291.da2890c6.js.map +1 -0
  18. package/dist/chunks/{4658.bab96d6a.js → 4658.fee7130c.js} +2 -2
  19. package/dist/chunks/{4658.bab96d6a.js.map → 4658.fee7130c.js.map} +1 -1
  20. package/dist/chunks/{4837.c2472ae5.js → 4837.4ccac7cb.js} +2 -2
  21. package/dist/chunks/{4837.c2472ae5.js.map → 4837.4ccac7cb.js.map} +1 -1
  22. package/dist/chunks/5399.aeb5c01e.js +2 -0
  23. package/dist/chunks/5399.aeb5c01e.js.map +1 -0
  24. package/dist/chunks/{5552.61a7adc0.js → 5552.76a22ed9.js} +2 -2
  25. package/dist/chunks/{5552.61a7adc0.js.map → 5552.76a22ed9.js.map} +1 -1
  26. package/dist/chunks/{5814.b148acfc.js → 5814.71e5fb63.js} +3 -3
  27. package/dist/chunks/{5814.b148acfc.js.map → 5814.71e5fb63.js.map} +1 -1
  28. package/dist/chunks/5832.e8dd59e8.js +3 -0
  29. package/dist/chunks/{5832.375e36b5.js.map → 5832.e8dd59e8.js.map} +1 -1
  30. package/dist/chunks/6314.94a4d844.js +2 -0
  31. package/dist/chunks/{3933.227b6f32.js.map → 6314.94a4d844.js.map} +1 -1
  32. package/dist/chunks/6519.94d78769.js +2 -0
  33. package/dist/chunks/{6519.ddef7177.js.map → 6519.94d78769.js.map} +1 -1
  34. package/dist/chunks/718.e6c3ab34.js +3 -0
  35. package/dist/chunks/718.e6c3ab34.js.map +1 -0
  36. package/dist/chunks/{7218.84a3b93e.js → 7218.5217d68a.js} +2 -2
  37. package/dist/chunks/{7218.84a3b93e.js.map → 7218.5217d68a.js.map} +1 -1
  38. package/dist/chunks/7733.4f17e0d0.js +2 -0
  39. package/dist/chunks/{7733.25a56515.js.map → 7733.4f17e0d0.js.map} +1 -1
  40. package/dist/chunks/{790.eb4333db.js → 790.ff8d7aa6.js} +2 -2
  41. package/dist/chunks/{790.eb4333db.js.map → 790.ff8d7aa6.js.map} +1 -1
  42. package/dist/chunks/{9080.32c73c01.js → 9080.ea7347c9.js} +2 -2
  43. package/dist/chunks/{9080.32c73c01.js.map → 9080.ea7347c9.js.map} +1 -1
  44. package/dist/chunks/9559.95f5357b.js +2 -0
  45. package/dist/chunks/9559.95f5357b.js.map +1 -0
  46. package/dist/chunks/{batch-update-raw-data-generated-view.d3da84b6.js → batch-update-raw-data-generated-view.88b14330.js} +3 -3
  47. package/dist/chunks/{batch-update-raw-data-generated-view.d3da84b6.js.map → batch-update-raw-data-generated-view.88b14330.js.map} +1 -1
  48. package/dist/chunks/chat-conversation.f9dbc32c.js +3 -0
  49. package/dist/chunks/{chat-conversation.4850d7a0.js.map → chat-conversation.f9dbc32c.js.map} +1 -1
  50. package/dist/chunks/chat-preview.8f3da2b9.js +3 -0
  51. package/dist/chunks/{chat-preview.ef20464a.js.map → chat-preview.8f3da2b9.js.map} +1 -1
  52. package/dist/chunks/{check-editor-by-name.1bd05f99.js → check-editor-by-name.da64b777.js} +2 -2
  53. package/dist/chunks/{check-editor-by-name.1bd05f99.js.map → check-editor-by-name.da64b777.js.map} +1 -1
  54. package/dist/chunks/{contract-select.2a22d13c.js → contract-select.d1e33da7.js} +3 -3
  55. package/dist/chunks/{contract-select.2a22d13c.js.map → contract-select.d1e33da7.js.map} +1 -1
  56. package/dist/chunks/generate-snippets-context-menu.063daa61.js +2 -0
  57. package/dist/chunks/{generate-snippets-context-menu.311c1d21.js.map → generate-snippets-context-menu.063daa61.js.map} +1 -1
  58. package/dist/chunks/{get-data-deps.0f2657ad.js → get-data-deps.ac92d5ff.js} +2 -2
  59. package/dist/chunks/{get-data-deps.0f2657ad.js.map → get-data-deps.ac92d5ff.js.map} +1 -1
  60. package/dist/chunks/{get-dependency-tree.e224c55a.js → get-dependency-tree.ec1555ff.js} +2 -2
  61. package/dist/chunks/{get-dependency-tree.e224c55a.js.map → get-dependency-tree.ec1555ff.js.map} +1 -1
  62. package/dist/chunks/{get-raw-data-system-prompts.1ea9b35b.js → get-raw-data-system-prompts.2e436c6b.js} +2 -2
  63. package/dist/chunks/{get-raw-data-system-prompts.1ea9b35b.js.map → get-raw-data-system-prompts.2e436c6b.js.map} +1 -1
  64. package/dist/chunks/{inject-chat-preview-agent.a3f83b10.js → inject-chat-preview-agent.461db2ab.js} +2 -2
  65. package/dist/chunks/{inject-chat-preview-agent.a3f83b10.js.map → inject-chat-preview-agent.461db2ab.js.map} +1 -1
  66. package/dist/chunks/main.139ddf9c.js +2 -0
  67. package/dist/chunks/main.139ddf9c.js.map +1 -0
  68. package/dist/chunks/page-arch-node.eadf238c.js +3 -0
  69. package/dist/chunks/{page-arch-node.631dcdb9.js.map → page-arch-node.eadf238c.js.map} +1 -1
  70. package/dist/chunks/parse-path.a96c1dbd.js +2 -0
  71. package/dist/chunks/parse-path.a96c1dbd.js.map +1 -0
  72. package/dist/chunks/{pre-generated-container.b611638b.js → pre-generated-container.72c5e67c.js} +2 -2
  73. package/dist/chunks/{pre-generated-container.b611638b.js.map → pre-generated-container.72c5e67c.js.map} +1 -1
  74. package/dist/chunks/pre-generated-preview.890a7f44.js +3 -0
  75. package/dist/chunks/{pre-generated-preview.03dd751b.js.map → pre-generated-preview.890a7f44.js.map} +1 -1
  76. package/dist/chunks/pre-generated-table-view.c777ecd8.js +2 -0
  77. package/dist/chunks/{pre-generated-table-view.c9bb5b19.js.map → pre-generated-table-view.c777ecd8.js.map} +1 -1
  78. package/dist/chunks/{property-editor.aab83b02.js → property-editor.29944380.js} +2 -2
  79. package/dist/chunks/{property-editor.aab83b02.js.map → property-editor.29944380.js.map} +1 -1
  80. package/dist/chunks/raw-data-preview.84d2529d.js +3 -0
  81. package/dist/chunks/{raw-data-preview.29c2c561.js.map → raw-data-preview.84d2529d.js.map} +1 -1
  82. package/dist/chunks/workbench-action-list.a97943c2.js +2 -0
  83. package/dist/chunks/workbench-action-list.a97943c2.js.map +1 -0
  84. package/dist/chunks/{workbench-action.01553a81.js → workbench-action.6d901765.js} +3 -3
  85. package/dist/chunks/workbench-action.6d901765.js.map +1 -0
  86. package/dist/chunks/workbench-history-action.2f9693f3.js +3 -0
  87. package/dist/chunks/{workbench-history-action.84e24cf6.js.map → workbench-history-action.2f9693f3.js.map} +1 -1
  88. package/dist/chunks/workbench-pane.7680aac3.js +3 -0
  89. package/dist/chunks/{workbench-pane.b320bd8b.js.map → workbench-pane.7680aac3.js.map} +1 -1
  90. package/dist/chunks/workbench-sidebar.54dbf128.js +2 -0
  91. package/dist/chunks/{workbench-sidebar.f89da3df.js.map → workbench-sidebar.54dbf128.js.map} +1 -1
  92. package/dist/chunks/workbench-tree.bbcc6f86.js +3 -0
  93. package/dist/chunks/{workbench-tree.0dd36701.js.map → workbench-tree.bbcc6f86.js.map} +1 -1
  94. package/dist/index.b0f825c6.js +2 -0
  95. package/dist/index.b0f825c6.js.map +1 -0
  96. package/dist/manifest.json +4 -0
  97. package/dist/types.json +233 -226
  98. package/dist-types/property-editor/index.d.ts +45 -45
  99. package/dist-types/workbench-action/index.d.ts +2 -0
  100. package/package.json +4 -4
  101. package/dist/chunks/1122.7c509964.js +0 -2
  102. package/dist/chunks/1122.7c509964.js.map +0 -1
  103. package/dist/chunks/114.8467ea5c.js +0 -2
  104. package/dist/chunks/1940.0a5131bc.js +0 -2
  105. package/dist/chunks/1940.0a5131bc.js.map +0 -1
  106. package/dist/chunks/3680.a3dc1198.js +0 -2
  107. package/dist/chunks/3680.a3dc1198.js.map +0 -1
  108. package/dist/chunks/3933.227b6f32.js +0 -2
  109. package/dist/chunks/5399.be09f124.js +0 -2
  110. package/dist/chunks/5399.be09f124.js.map +0 -1
  111. package/dist/chunks/5832.375e36b5.js +0 -3
  112. package/dist/chunks/6314.1364814f.js +0 -2
  113. package/dist/chunks/6519.ddef7177.js +0 -2
  114. package/dist/chunks/718.3f0afc76.js +0 -3
  115. package/dist/chunks/718.3f0afc76.js.map +0 -1
  116. package/dist/chunks/7733.25a56515.js +0 -2
  117. package/dist/chunks/9559.ffb58a44.js +0 -2
  118. package/dist/chunks/9559.ffb58a44.js.map +0 -1
  119. package/dist/chunks/chat-conversation.4850d7a0.js +0 -3
  120. package/dist/chunks/chat-preview.ef20464a.js +0 -3
  121. package/dist/chunks/generate-snippets-context-menu.311c1d21.js +0 -2
  122. package/dist/chunks/main.3e56e51a.js +0 -2
  123. package/dist/chunks/main.3e56e51a.js.map +0 -1
  124. package/dist/chunks/page-arch-node.631dcdb9.js +0 -3
  125. package/dist/chunks/parse-path.d6310065.js +0 -2
  126. package/dist/chunks/parse-path.d6310065.js.map +0 -1
  127. package/dist/chunks/pre-generated-preview.03dd751b.js +0 -3
  128. package/dist/chunks/pre-generated-table-view.c9bb5b19.js +0 -2
  129. package/dist/chunks/raw-data-preview.29c2c561.js +0 -3
  130. package/dist/chunks/workbench-action-list.25ddaea6.js +0 -2
  131. package/dist/chunks/workbench-action-list.25ddaea6.js.map +0 -1
  132. package/dist/chunks/workbench-action.01553a81.js.map +0 -1
  133. package/dist/chunks/workbench-history-action.84e24cf6.js +0 -3
  134. package/dist/chunks/workbench-pane.b320bd8b.js +0 -3
  135. package/dist/chunks/workbench-sidebar.f89da3df.js +0 -2
  136. package/dist/chunks/workbench-tree.0dd36701.js +0 -3
  137. package/dist/index.92474b53.js +0 -2
  138. package/dist/index.92474b53.js.map +0 -1
  139. /package/dist/chunks/{5814.b148acfc.js.LICENSE.txt → 5814.71e5fb63.js.LICENSE.txt} +0 -0
  140. /package/dist/chunks/{5832.375e36b5.js.LICENSE.txt → 5832.e8dd59e8.js.LICENSE.txt} +0 -0
  141. /package/dist/chunks/{718.3f0afc76.js.LICENSE.txt → 718.e6c3ab34.js.LICENSE.txt} +0 -0
  142. /package/dist/chunks/{batch-update-raw-data-generated-view.d3da84b6.js.LICENSE.txt → batch-update-raw-data-generated-view.88b14330.js.LICENSE.txt} +0 -0
  143. /package/dist/chunks/{chat-conversation.4850d7a0.js.LICENSE.txt → chat-conversation.f9dbc32c.js.LICENSE.txt} +0 -0
  144. /package/dist/chunks/{chat-preview.ef20464a.js.LICENSE.txt → chat-preview.8f3da2b9.js.LICENSE.txt} +0 -0
  145. /package/dist/chunks/{contract-select.2a22d13c.js.LICENSE.txt → contract-select.d1e33da7.js.LICENSE.txt} +0 -0
  146. /package/dist/chunks/{page-arch-node.631dcdb9.js.LICENSE.txt → page-arch-node.eadf238c.js.LICENSE.txt} +0 -0
  147. /package/dist/chunks/{pre-generated-preview.03dd751b.js.LICENSE.txt → pre-generated-preview.890a7f44.js.LICENSE.txt} +0 -0
  148. /package/dist/chunks/{raw-data-preview.29c2c561.js.LICENSE.txt → raw-data-preview.84d2529d.js.LICENSE.txt} +0 -0
  149. /package/dist/chunks/{workbench-action.01553a81.js.LICENSE.txt → workbench-action.6d901765.js.LICENSE.txt} +0 -0
  150. /package/dist/chunks/{workbench-history-action.84e24cf6.js.LICENSE.txt → workbench-history-action.2f9693f3.js.LICENSE.txt} +0 -0
  151. /package/dist/chunks/{workbench-pane.b320bd8b.js.LICENSE.txt → workbench-pane.7680aac3.js.LICENSE.txt} +0 -0
  152. /package/dist/chunks/{workbench-tree.0dd36701.js.LICENSE.txt → workbench-tree.bbcc6f86.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 718.3f0afc76.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[718],{264:(e,t,n)=>{function r(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function o(e){return e&&e.sensitive?"":"i"}function i(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var i=n.strict,s=void 0!==i&&i,a=n.start,c=void 0===a||a,l=n.end,u=void 0===l||l,d=n.encode,p=void 0===d?function(e){return e}:d,f=n.delimiter,h=void 0===f?"/#?":f,m=n.endsWith,g="[".concat(r(void 0===m?"":m),"]|$"),v="[".concat(r(h),"]"),y=c?"^":"",w=0,b=e;w<b.length;w++){var E=b[w];if("string"==typeof E)y+=r(p(E));else{var S=r(p(E.prefix)),A=r(p(E.suffix));if(E.pattern)if(t&&t.push(E),S||A)if("+"===E.modifier||"*"===E.modifier){var k="*"===E.modifier?"?":"";y+="(?:".concat(S,"((?:").concat(E.pattern,")(?:").concat(A).concat(S,"(?:").concat(E.pattern,"))*)").concat(A,")").concat(k)}else y+="(?:".concat(S,"(").concat(E.pattern,")").concat(A,")").concat(E.modifier);else"+"===E.modifier||"*"===E.modifier?y+="((?:".concat(E.pattern,")").concat(E.modifier,")"):y+="(".concat(E.pattern,")").concat(E.modifier);else y+="(?:".concat(S).concat(A,")").concat(E.modifier)}}if(u)s||(y+="".concat(v,"?")),y+=n.endsWith?"(?=".concat(g,")"):"$";else{var I=e[e.length-1],C="string"==typeof I?v.indexOf(I[I.length-1])>-1:void 0===I;s||(y+="(?:".concat(v,"(?=").concat(g,"))?")),C||(y+="(?=".concat(v,"|").concat(g,")"))}return new RegExp(y,o(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var c=e.charCodeAt(a);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=t.prefixes,i=void 0===o?"./":o,s="[^".concat(r(t.delimiter||"/#?"),"]+?"),a=[],c=0,l=0,u="",d=function(e){if(l<n.length&&n[l].type===e)return n[l++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var r=n[l],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t};l<n.length;){var h=d("CHAR"),m=d("NAME"),g=d("PATTERN");if(m||g){var v=h||"";-1===i.indexOf(v)&&(u+=v,v=""),u&&(a.push(u),u=""),a.push({name:m||c++,prefix:v,suffix:"",pattern:g||s,modifier:d("MODIFIER")||""})}else{var y=h||d("ESCAPED_CHAR");if(y)u+=y;else if(u&&(a.push(u),u=""),d("OPEN")){v=f();var w=d("NAME")||"",b=d("PATTERN")||"",E=f();p("CLOSE"),a.push({name:w||(b?c++:""),pattern:w&&!b?s:b,prefix:v,suffix:E,modifier:d("MODIFIER")||""})}else p("END")}}return a}(e,n),t,n)}function s(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return s(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),o(n))}(e,t,n):i(e,t,n)}n.d(t,{MM:()=>s})},718:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Gt,Notification:()=>en,StoryboardFunctionRegistryFactory:()=>fe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>mi,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>St,checkIfOfComputed:()=>Et,createHistory:()=>A,createRuntime:()=>oi,customEditors:()=>bi,customProcessors:()=>x,customTemplates:()=>Pe,fetchByProvider:()=>Ei,getAuth:()=>gi,getBasePath:()=>f,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>io,getRealValue:()=>Ai,getRuntime:()=>ii,getV2RuntimeFromDll:()=>S,handleHttpError:()=>Zt,httpErrorToString:()=>qt,isLoggedIn:()=>yi,isUnauthenticatedError:()=>Yt,logout:()=>vi,matchPath:()=>Mt,registerWidgetFunctions:()=>$e,registerWidgetI18n:()=>N,setUIVersion:()=>ao,unstable_createRoot:()=>Si});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Cr,debugDataValue:()=>Er,getAddedContracts:()=>br,getAllContextValues:()=>mr,getBrickPackagesById:()=>gr,getContextValue:()=>hr,getLegalRuntimeValue:()=>Sr,getRenderId:()=>wr,legacyDoTransform:()=>ir,loadBricks:()=>vr,loadEditors:()=>yr,mountUseBrick:()=>rr,renderUseBrick:()=>nr,setRealTimeDataInspectRoot:()=>Ir,symbolForRootRuntimeContext:()=>tr,unmountUseBrick:()=>or,updateSnippetPreviewSettings:()=>pr,updateStoryboard:()=>sr,updateStoryboardByRoute:()=>ar,updateStoryboardBySnippet:()=>dr,updateStoryboardByTemplate:()=>cr,updateTemplatePreviewSettings:()=>lr});var o=n(4586),i=n(918),s=n(6121),a=n(829),c=n(3241),l=n(5096),u=n(4218),d=n(155),p=(n(597),n(2890));function f(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(1030);function m(e,t){const n=(0,h.orderBy)(e,(e=>{var t;return(null===(t=e.app.homepage)||void 0===t?void 0:t.length)??0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&g(n,t))return e}}function g(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function v(e){var t;return!e||(null===(t=ii().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let y,w=!1;function b(e,t){w=!confirm(e),t(!w)}function E(e){const{push:t,replace:n}=e;function r(r){return function(o,i,s){let a;const c="string"==typeof o;return a=c?(0,p.parsePath)(o).pathname:o.pathname,"string"==typeof a&&a.startsWith("/")&&v(function(e){var t;return m((null===(t=ei)||void 0===t?void 0:t.storyboards)??[],e)}(a))?location["push"===r?"assign":"replace"](c?f()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,i,s)}}return{push:r("push"),replace:r("replace")}}function S(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function A(){if(!y){const e=(0,p.createBrowserHistory)({basename:f().replace(/\/$/,""),getUserConfirmation:b});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){w=!1,t(e,n),null==r||r(w)}function o(e,t,r){w=!1,n(e,t),null==r||r(w)}function i(t){return function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;const{extraQuery:a,clear:c,keepHash:l,...u}=i,d=new URLSearchParams(c?"":e.location.search),p={};Object.assign(p,n,a);for(const[e,t]of Object.entries(p))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?r:o)(`?${d.toString()}${l?e.location.hash:""}`,u,s)}}let s;return{pushQuery:i("push"),replaceQuery:i("replace"),pushAnchor:function(t,n,o){r({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,o)},reload:function(t){o({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){s=e},getBlockMessage:function(){return s},unblock:function(){s=void 0},...E({...e,push:r,replace:o})}}(e)),y=e}return y}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return y};var I=n(4635),C=n(2559),R=n(8255),O=n(3136),T=n(4130),_=n(9080),P=n(8502),M=new WeakMap;const x=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,i.A)(this,M,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,a.A)(M,this).get(n);if(o||(o=new Map,(0,a.A)(M,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,a.A)(M,this).get(e)}};function L(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=B("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;c.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)c.i18n.removeResourceBundle(t,e)}}}function B(e,t){return`${e}/${t}`}function $(e){return c.i18n.getFixedT(null,B("widget",e))}const N=function(){const e=S();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=B("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;c.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",D="devtools-panel-change";let j,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||j&&"Evaluations"!==j))return;const r=()=>{var r;null===(r=n.emit)||void 0===r||r.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):setTimeout(r,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const H=()=>{throw new Error("Can't modify read-only proxy object")},G={set:H,defineProperty:H,deleteProperty:H,setPrototypeOf:H};function z(e){return new Proxy(e,G)}function q(e){let{get:t,ownKeys:n}=e;return W()?z(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const X=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);Y=e}function Z(){return Y}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){X.setItem(J,{...re(),...e})}function re(){let e;try{e=X.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return e??{}}let oe="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function se(){return document.documentElement.dataset.mode}function ae(e){e?ie(e):e=oe,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){const n={};for(const r of e){const e=ue(r,t);void 0!==e&&(n[r]=e)}return n}function ue(e,t){var n,r,o;let{collectCoverage:i,widgetId:s,widgetVersion:a,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return i?"/next":f().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>`mock/images/${e}`}:s?null==ri||null===(n=ri.images)||void 0===n?void 0:n.widgetImagesFactory(s,a):null==ri||null===(r=ri.images)||void 0===r?void 0:r.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return i?h.identity:s?$(s):c.i18n.getFixedT(null,[u,B("app",l.id)].filter(Boolean));case"I18N_TEXT":return i?de:c.i18nText;case"PERMISSIONS":return z({check:i?pe:null==ri||null===(o=ri.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return z({getTheme:i?()=>"light":Z});case"console":return p?z(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function pe(){return!0}function fe(){let{widgetId:e,widgetVersion:t,collectCoverage:n,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=new Map,i=null==r?void 0:r({precookFunction:O.precookFunction,cook:O.cook,supply:P.supply}),s=new Proxy(Object.freeze({}),{get:(c,l)=>function(c){const l=o.get(c);if(!l)return;if(l.processed)return l.cooked;let u;n&&(u=n.createCollector(c));const d=(0,O.precookFunction)(l.source,{typescript:l.typescript,hooks:u&&{beforeVisit:u.beforeVisit},cacheKey:l}),p=(0,P.supply)(d.attemptToVisitGlobals,le(d.attemptToVisitGlobals,{collectCoverage:n,widgetId:e,widgetVersion:t,app:a,storyboardFunctions:s,isStoryboardFunction:!0}),!!n);return l.cooked=(0,O.cook)(d.function,l.source,{rules:{noVar:!0},globalVariables:i?{...p,...null!=i&&i.LodashWithStaticFields&&d.attemptToVisitGlobals.has("_")?{_:{...p._,...i.LodashWithStaticFields}}:null,...null!=i&&i.ArrayConstructor&&d.attemptToVisitGlobals.has("Array")?{Array:i.ArrayConstructor}:null,...null!=i&&i.ObjectWithStaticFields&&d.attemptToVisitGlobals.has("Object")?{Object:{...p.Object,...i.ObjectWithStaticFields}}:null}:p,ArrayConstructor:null==i?void 0:i.ArrayConstructor,hooks:u&&{beforeEvaluate:u.beforeEvaluate,beforeCall:u.beforeCall,beforeBranch:u.beforeBranch},debug:!!r}),l.processed=!0,l.cooked}(l)});let a;return{storyboardFunctions:s,registerStoryboardFunctions:function(e,t){if(t&&(a=t),o.clear(),Array.isArray(e))for(const t of e){let e=t.deps;null==e&&(e=(0,T.collectMemberUsageInFunction)(t,"FN",!!n),e.delete(t.name));const r=t.perm??(0,T.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,deps:e,hasPermissionsCheck:r})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,T.collectMemberUsageInFunction)(n,"FN",!0),i=(0,T.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,deps:r,hasPermissionsCheck:i})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const r=o.get(e);return!!r&&(r.hasPermissionsCheck||[...r.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,O.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,O.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=fe();var ve={};try{ve.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=i.prototype;function i(){t.set(this,n(null))}function s(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function a(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}s(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),i=o[e]||(o[e]=[]),s=0,a=i.length;s<a;s++)if(i[s].listener===n)return;i.push({target:this,listener:n,options:r})})),s(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(s(e,"target",this),s(e,"currentTarget",this),n.slice(0).some(a,e),delete e.currentTarget,delete e.target),!0})),s(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===n)return void o.splice(i,1)})),ve.EventTarget=i}(Object,new WeakMap)}const ye=ve.EventTarget;let we=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const be=new Map([[we.xLarge,"1920px"],[we.large,"1600px"],[we.medium,"1280px"],[we.small,"1024px"],[we.xSmall,0]]),Ee=new ye,Se={},Ae={};function ke(e,t){let n=!1;Se[t]=e.matches;for(const[e]of be)if(Se[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&Ee.dispatchEvent(new CustomEvent("change",{detail:Ae}))}be.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);ke(n,t),n.addEventListener?n.addEventListener("change",(e=>{ke(e,t)})):n.addListener((e=>{ke(e,t)}))}));const Ie=()=>Ae;function Ce(e){return function(t){const n="local"===e?localStorage:sessionStorage;return JSON.parse(n.getItem(t)??"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=ii())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];const i=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${i}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${i}`,...r)}const Te=new Set(["prefix"]);var _e=new WeakMap;const Pe=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,i.A)(this,_e,new Map)}define(e,t){var n,r;let o=(0,a.A)(_e,this).has(e);o?console.warn(`Custom template of "${e}" already registered.`):(o=!!customElements.get(e),o&&console.warn(`Custom template of "${e}" already defined by customElements.`));const i=Re(),s=(null===(n=t.proxy)||void 0===n?void 0:n.properties)??{},c=[],l=[];for(const[t,n]of Object.entries(s))n.asVariable?(Oe(i,"Template `asVariable`",e,t),i||l.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&c.push([t,n]);const u={...t,proxy:{...t.proxy,properties:Object.fromEntries(c)},state:(t.state?i?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(l.map((e=>({name:e,expose:!0}))))};(0,a.A)(_e,this).set(e,{...u,name:e});const d=(p=u.state,(0,h.uniq)((null==p?void 0:p.filter((e=>e.expose)).map((e=>e.name)))??[]));var p;const f=Object.entries((null===(r=u.proxy)||void 0===r?void 0:r.methods)??{}),m=d.concat(c.map((e=>e[0]))),g=f.map((e=>e[0])),v=m.concat(g).filter((e=>e in HTMLElement.prototype&&!Te.has(e)));if(v.length>0&&(Oe(i,"Using native HTMLElement properties as template properties or methods",e,...v),i))throw new Error(`In custom template "${e}", ${v.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!o){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return m}static get _dev_only_definedMethods(){return g}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const r=document.createElement("slot");t.appendChild(n),t.appendChild(r),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of d)c.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of c)Object.defineProperty(t.prototype,e,{get(){return this.$$getElementByRef(n.ref)[n.refProperty??e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);o&&(o[n.refProperty??e]=t)},enumerable:!0});for(const[e,n]of f)Object.defineProperty(t.prototype,e,{value(){return this.$$getElementByRef(n.ref)[n.refMethod??e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,a.A)(_e,this).get(e)}};function Me(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${n??""}`);const i=o.get(r);if(!i)throw new Error(`Template state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return i}function xe(e,t,n){const r=Me(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return r}const Le=new Map,Be=new Proxy(Object.freeze({}),{get:(e,t)=>Le.get(t)}),$e=function(){const e=S();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Le.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=fe({widgetId:e,widgetVersion:n});Le.set(e,r),o(t)},Ne=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ue=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Ne);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Fe=e=>"*"===e||"x"===e||"X"===e,De=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},je=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(De(e),De(t));return n>r?1:n<r?-1:0},Ke=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=je(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{Ge(n);const r=((e,t)=>{const n=Ue(e),r=Ue(t),o=n.pop(),i=r.pop(),s=Ke(n,r);return 0!==s?s:o&&i?Ke(o.split("."),i.split(".")):o||i?o?-1:1:0})(e,t);return We[n].includes(r)},We={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},He=Object.keys(We),Ge=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===He.indexOf(e))throw new Error(`Invalid operator, expected one of ${He.join("|")}`)};function ze(e,t){let n=hi(e);if(!n&&null!=ri&&ri.checkInstalledApps&&(n=ri.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const r=t.match(/^([><]=?|=)(.*)$/);try{if(!r)throw new TypeError(`Invalid match version: ${t}`);return Ve(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function qe(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${n??""}`);const i=o.get(r);if(!i)throw new Error(`Form state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return i}const Ye=new Map;async function Xe(e){var t;const n=null==ri||null===(t=ri.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=ri.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)ri.flowApi.registerFlowApiProvider();else if(await(0,l.loadBricksImperatively)([e],li()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Ye.set(e,r),r}let Je=new WeakSet;function Qe(e){if((0,u.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Qe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Qe)}}function Ze(e){return Je.has(e)}const et=new Map;async function tt(e,t,n){const{useProvider:r,method:o="resolve",args:i=[],onReject:s}=e,{provider:a,field:c}=e;if(a&&!r)throw new Error(`You're using "provider: ${a}" which is dropped in v3, please use "useProvider" instead`);const l=null!=c;if(l){const e=Re();if(Oe(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Xe(r),mt(i,t)]),p=null==n?void 0:n.renderId,f=nt(u,r,o,d,n,i,!!p&&p!==di());let m,{transform:g}=e;try{const e=await f;m=l?(0,h.get)(e,c):e,Qe(m)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,m=e}return g?"string"==typeof g?{[g]:m}:mt(g,{...t,data:m}):m}async function nt(e,t,n,r,o,i,s){let a,c;try{a=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!i)throw e;a=JSON.stringify({useProvider:t,method:n,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(c=et.get(a)),c||(c=(async o=>{const i=null!=ri&&null!==(o=ri.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await ri.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...i)})(),s||et.set(a,c)),c}const rt=Symbol.for("pre.evaluated.raw"),ot=Symbol.for("pre.evaluated.context");function it(e){return!(null==e||!e[rt])}function st(e){return e[rt]}function at(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[rt])}const ct=new WeakSet([SyntaxError,TypeError,ReferenceError]);function lt(e){return ct.has(e.constructor)?e.constructor:TypeError}function ut(e,t,n){const{run:r}=dt(e,t,n,!1);return r()}function dt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const o=[];if("string"!=typeof e){const n=(0,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ot],...n},e=e[rt]}const i={usedArgs:new Set},s={usedArgs:new Set};let a;try{a=(0,O.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(i,e,t),(0,T.collectInstalledAppsHasUsage)(s,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(s.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:d}=a;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let p,f,m,g;const v=Re(t);let y,w;(d.has("STATE")||!v&&d.has("TPL"))&&(g=Me(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(w=qe(t,"FORM_STATE",`: "${e}"`));const b=W();if(r||b){if(d.has("CTX")&&(p=(0,T.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(p))),g){if(m=(0,T.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,T.strictCollectMemberUsage)(e,"TPL");for(const e of t)m.add(e)}r&&o.push(g.waitFor(m))}w&&(y=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(w.waitFor(y))),d.has("PROCESSORS")&&(f=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,l.loadProcessorsImperatively)(f,li())))}if(r){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,T.strictCollectMemberUsage)(e,"FN")];n=ge(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=ri&&ri.menu){const e=[...i.usedArgs];o.push(Promise.all(e.map((e=>ri.menu.fetchMenuById(e,t,{getStoryboardByAppId:fi,resolveData:tt,asyncComputeRealValue:mt})))))}var E;s.usedArgs.size>0&&o.push(null==ri||null===(E=ri.checkInstalledApps)||void 0===E?void 0:E.waitForCheckingApps([...s.usedArgs]))}return{blockingList:o,run(){var n,r;const{app:o,location:i,query:s,match:l,flags:b,sys:E,ctxStore:S,data:A,event:k}=t,I=t.overrideApp??o;for(const o of d)switch(o){case"ANCHOR":c[o]=i.hash?i.hash.substring(1):null;break;case"APP":if(null==I)throw new ReferenceError(`APP is not defined, in "${e}"`);c[o]={...(0,h.cloneDeep)(I),getMenu:null==ri||null===(n=ri.menu)||void 0===n?void 0:n.getMenuById};break;case"CTX":c[o]=q({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(p)});break;case"DATA":c[o]=A;break;case"EVENT":c[o]=k;break;case"FLAGS":c[o]=z(b);break;case"FORM_STATE":c[o]=q({get:(e,t)=>w.getValue(t),ownKeys:()=>Array.from(y)});break;case"HASH":c[o]=i.hash;break;case"INSTALLED_APPS":c[o]=z({has:ze});break;case"ITEM":case"INDEX":case"SIZE":{const n="ITEM"===o?"forEachItem":"INDEX"===o?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,n)?c[o]=t[n]:console.error(`Using \`${o}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[o]=z({getItem:Ce("local")});break;case"MEDIA":c[o]=z(Ie());break;case"MISC":c[o]=ii().getMiscSettings();break;case"PARAMS":if(null==s)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[o]=new URLSearchParams(s);break;case"PATH":c[o]=z((null==l?void 0:l.params)??{});break;case"PATH_NAME":c[o]=i.pathname;break;case"PROCESSORS":c[o]=q({get(e,t){const n=x.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return q({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of f){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==s)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.get(e)])));break;case"QUERY_ARRAY":if(null==s)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.getAll(e)])));break;case"SESSION_STORAGE":c[o]=z({getItem:Ce("session")});break;case"TPL":if(Oe(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[o]=q({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(m)});break;case"SYS":c[o]=z(E??{});break;case"__WIDGET_FN__":c[o]=Be;break;case"__WIDGET_IMG__":c[o]=null==ri||null===(r=ri.images)||void 0===r?void 0:r.widgetImagesFactory;break;case"__WIDGET_I18N__":c[o]=$}Object.assign(c,le(a.attemptToVisitGlobals,{storyboardFunctions:he,app:I,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,O.cook)(a.expression,a.source,{globalVariables:(0,P.supply)(a.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}}}}let pt=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 ft(e){switch(e){case pt.USE_BRICK_PROPERTIES:case pt.USE_BRICK_TRANSFORM:case pt.USE_BRICK_EVENTS:case pt.USE_BRICK_IF:case pt.USE_BRICK_LIFECYCLE:case pt.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(ft(e))return e;if(t)switch(e){case pt.USE_BRICK:return pt.USE_BRICK_ITEM;case pt.USE_BRICK_SLOTS_ITEM_BRICKS:return pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case pt.INITIAL:if("useBrick"===n)return pt.USE_BRICK;break;case pt.USE_BRICK:case pt.USE_BRICK_ITEM:case pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return pt.USE_BRICK_PROPERTIES;case"transform":return pt.USE_BRICK_TRANSFORM;case"dataSource":return pt.USE_BRICK_DATA_SOURCE;case"events":return pt.USE_BRICK_EVENTS;case"slots":return pt.USE_BRICK_SLOTS;case"children":return pt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return pt.USE_BRICK_IF;case"lifeCycle":return pt.USE_BRICK_LIFECYCLE}break;case pt.USE_BRICK_SLOTS:return pt.USE_BRICK_SLOTS_ITEM;case pt.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return pt.USE_BRICK_SLOTS_ITEM_BRICKS}return pt.INITIAL}async function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=await async function(e,t,n){const{blockingList:r,run:o}=dt(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?yt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return Promise.all(e.map((e=>mt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([mt(r,t),mt(o,t,vt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=ut(e,t),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?yt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return e.map((e=>gt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[gt(r,t),gt(o,t,vt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function vt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function yt(e){return e}async function wt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?await mt(e.if,t):e.if)}function bt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?gt(e.if,t):e.if)}function Et(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const St=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return bt(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,O.isEvaluable)(e):it(e)){const o="string"==typeof e?e:st(e);if((0,O.isTrackAll)(o)){const e=(0,T.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,T.track)(o,"track context","CTX"),n=(0,T.track)(o,"track state","STATE"),r=(0,T.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function kt(e,t){for(const[n,r,o]of e)if(n===t){const e=await r;if(void 0!==e||!o)return e}}async function It(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function Ct(e,t){if(t)for(const[n,r]of Object.entries(t))switch(n){case"style":case"dataset":for(const[t,o]of Object.entries(r))e[n][t]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${n}\` is prohibited`);default:e[n]=r}}function Rt(e,t,n){const r=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=gt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?pt.USE_BRICK:pt.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}var Ot=n(264);const Tt=new Map,_t=1e4;let Pt=0;function Mt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:i=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:s,keys:a}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=Tt.get(n);r||Tt.set(n,r=new Map);const o=r.get(e);if(o)return o;const i=[],s={regexp:(0,Ot.MM)(e,i,t),keys:i};return Pt<_t&&(r.set(e,s),Pt++),s}(n,{end:r,strict:o,sensitive:i}),c=s.exec(e);if(!c)return null;const[l,...u]=c,d=e===l;return r&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function xt(e,t,n){return Mt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Lt=Symbol.for("tpl.asyncComputedPropsFromHost"),Bt=Symbol.for("tpl.stateStoreId"),$t=Symbol.for("tpl.externalForEachItem"),Nt=Symbol.for("tpl.externalForEachIndex"),Ut=Symbol.for("tpl.externalForEachSize"),Ft=new Set;let Dt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e.LICENSE_EXPIRED="LICENSE_EXPIRED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e}({});const jt={[Dt.REQUEST_FAILED]:"Request Failed",[Dt.SOMETHING_WENT_WRONG]:"Something went wrong!",[Dt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Dt.NETWORK_ERROR]:"Network error, please check your network.",[Dt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[Dt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[Dt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[Dt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[Dt.UNKNOWN_ERROR]:"Oops! Something went wrong",[Dt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[Dt.GO_BACK_HOME]:"Go back to home page"},Kt={[Dt.REQUEST_FAILED]:"请求失败",[Dt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Dt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Dt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[Dt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[Dt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[Dt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[Dt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[Dt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[Dt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[Dt.GO_BACK_HOME]:"回到首页"},Vt="core/runtime",Wt={en:jt,zh:Kt};let Ht;const Gt=Object.freeze({show:function(e){if(Ht)return Ht.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function zt(e){const{search:t,pathname:n}=e,r=n?window.btoa(encodeURIComponent(n)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${r}; path=/`,document.cookie=`SALOGINQUERY=${o}; path=/`}function qt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t(`${Vt}:${Dt.NETWORK_ERROR}`);if(e instanceof R.HttpResponseError&&e.responseJson){if("string"==typeof e.responseJson.error)return e.responseJson.error;if("string"==typeof e.responseJson.msg)return e.responseJson.msg}return null==e?"Unknown error":e.toString()}function Yt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let Xt,Jt,Qt=!1;function Zt(e){if(e instanceof R.HttpAbortError)return;if(Yt(e)&&!window.NO_AUTH_GUARD){if(Qt)return;return Qt=!0,void Gt.show({type:"confirm",content:c.i18n.t(`${Vt}:${Dt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=ii().getFeatureFlags()["sso-enabled"],t=k();zt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),Qt=!1}),(()=>{Qt=!1}))}console.error(e);const t=qt(e);t!==Xt&&(Xt=t,Gt.show({type:"error",title:c.i18n.t(`${Vt}:${Dt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Xt=void 0})))}const en=Object.freeze({show:function(e){Jt?Jt.resolve(e):alert(e.message)}});function tn(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const i=an(o,n,{element:e});e.addEventListener(r,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,i]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function nn(e){return"string"==typeof e.action}function rn(e){return"string"==typeof e.useProvider}function on(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function sn(e){return!!e.then}function an(e,t,n){return function(r){for(const o of[].concat(e))if(bt(o,{...t,event:r}))if(sn(o))an(o.then,t,n)(r);else if(nn(o)){const[e,i]=o.action.split(".");switch(o.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":dn(r,i,o.args,o.callback,t);break;case"window.open":pn(r,o.args,t);break;case"window.postMessage":fn(r,o.args,t);break;case"location.reload":case"location.assign":yn(r,i,o.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":wn(r,e,i,o.args,t);break;case"event.preventDefault":r.preventDefault();break;case"event.stopPropagation":r.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":bn(r,i,o.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":En(r,i,o.args,t);break;case"handleHttpError":Zt(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":mn(r,i,o.args,o.batch??!0,o.callback,t);break;case"state.update":case"state.refresh":case"state.load":gn(r,i,o.args,o.batch??!0,o.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=kn(o.args,t,r);xe(t,o.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":vn(r,o.args,o.callback,t);break;case"message.subscribe":case"message.unsubscribe":Sn(r,i,o.args,t,n,o.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===o.action?"dark":"light");break;case"theme.setTheme":{const[e]=kn(o.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ae("mode.setDashboardMode"===o.action?"dashboard":"default");break;default:console.error("unknown event listener action:",o.action)}}else rn(o)?cn(r,o,t,n):on(o)?ln(r,o,t,n):console.error("unknown event handler:",o);else o.else&&an(o.else,t,n)(r)}}function cn(e,t,n,r){const o="saveAs"!==t.method?"resolve":"saveAs";un(e,t.useProvider,t,o,n,r)}function ln(e,t,n,r){let o=[];const i=t.target,s=t.targetRef;let a=i;if(("string"==typeof i?(0,O.isEvaluable)(i):it(i))&&(a=gt(i,{...n,event:e})),"string"==typeof a)if("_self"===a)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(a));else{const e=document.querySelector(a);null!==e&&o.push(e)}else if(a)a instanceof HTMLElement?o.push(a):console.error("unexpected target:",a);else if(s){let t=s;("string"==typeof s?(0,O.isEvaluable)(s):it(s))&&(t=gt(s,{...n,event:e}));const r=[].concat(t),i=xe(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=i.$$getElementByRef)||void 0===t?void 0:t.call(i,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{un(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(o,t.properties,{...n,event:e}):console.error("target not found:",i||s)}async function un(e,t,n,r,o,i,s){const a=rn(n),c=async()=>{var i;const c=a?await Xe(t):t;if("function"!=typeof c[r])throw new Error(`target <${c.tagName.toLowerCase()}> has no method: ${r}`);let l=kn(n.args,o,e,s);var u;return rn(n)&&null!=ri&&null!==(i=ri.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)&&(l=await ri.flowApi.getArgsOfFlowApi(n.useProvider,l,r,null===(u=n.sse)||void 0===u?void 0:u.stream)),c[r](...l)};if(!n.callback)return void c();const l=An(n.callback,o,i),u={progress:l("progress"),success:l("success"),error:l("error"),finally:l("finally")};if(a){var d,p;const t={...o,event:e};if(gt(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:i}=t;const s=di();try{const t=await e();for await(const e of t){if(s!==di())return;null==n||n(e)}if(s!==di())return;null==r||r()}catch(e){if(s!==di())return;null==o||o(e)}finally{null==i||i()}}(c,u);if(gt(null===(p=n.poll)||void 0===p?void 0:p.enabled,t))return void function(e,t,n,r){let{progress:o,success:i,error:s,finally:a}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:p,delegateLoadingBar:f}=gt((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),m=di();let g;async function v(){let t;Ft.delete(g);try{var n;if(t=null===(n=gt(c,r))||void 0===n?void 0:n(),t)null==a||a();else{var d;const n=await e(),s=null===(d=gt(c,r))||void 0===d?void 0:d();var h;t=s||m!==di(),t?s&&(null==a||a()):(null==o||o(n),null!==(h=gt(l,r))&&void 0!==h&&h(n)?(f&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==a||a()):y(u??3e3))}}catch(e){var v;const n=null===(v=gt(c,r))||void 0===v?void 0:v();t=n||m!==di(),t?n&&(null==a||a()):(null==s||s(e),p?y(u??3e3):null==a||a())}finally{f&&t&&window.dispatchEvent(new Event("request.end"))}}function y(e){g=setTimeout(v,e),Ft.add(g)}y(d??0),f&&window.dispatchEvent(new Event("request.start"))}(c,u,n.poll,t)}try{const e=await c();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function dn(e,t,n,r,o){let i=0,s=!1,a=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,s=!0;break;case"reload":s=!0;break;case"block":i=1,a="setBlockMessage"}let c=[];if(i>0&&(c=kn(n,o,e,{useEventDetailAsDefault:!0}),c.length=i),s&&r){const e=An(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[a](...c)}function pn(e,t,n){const[r,o,i]=kn(t,n,e);window.open(r,o||"_self",i)}function fn(e,t,n){const r=kn(t,n,e);1===r.length&&r.push(location.origin),window.postMessage(...r)}function hn(e,t,n,r,o,i){t?r.updateValues(e,n,(e=>kn(e,o,i)[0])):e.forEach((e=>{const{name:t,value:s}=kn([e],o,i)[0];r.updateValue(t,s,n)}))}function mn(e,t,n,r,o,i){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[r,s]=kn(n,i,e);i.ctxStore.updateValue(r,s,t,o,i)}else hn(n,r,t,i.ctxStore,i,e)}function gn(e,t,n,r,o,i){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)hn(n,r,"replace",Me(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[r,s]=kn(n,i,e);Me(i,`state.${t}`,`: ${r}`).updateValue(r,s,"update"===t?"replace":t,o,i)}}function vn(e,t,n,r){const[o,i]=kn(t,r,e);qe(r,"formstate.update",`: ${o}`).updateValue(o,i,"replace",n,r)}function yn(e,t,n,r){if("assign"===t){const[t]=kn(n,r,e);location.assign(t)}else location[t]()}function wn(e,t,n,r,o){const i="localStorage"===t?localStorage:sessionStorage,[s,a]=kn(r,o,e);"setItem"===n?void 0!==a&&i.setItem(s,JSON.stringify(a)):i.removeItem(s)}function bn(e,t,n,r){console[t](...kn(n,r,e,{useEventAsDefault:!0}))}function En(e,t,n,r){const o=kn(n,r,e,{useEventAsDefault:!0});en.show({type:t,message:o[0]})}async function Sn(e,t,n,r,o,i){const s=()=>{var o;const i=kn(n,r,e);return null==ri||null===(o=ri.messageDispatcher)||void 0===o?void 0:o[t](...i)};if(!i)return void s();const a=An(i,r,o);try{const e=await s();a("success")(e)}catch(e){a("error")(e)}finally{a("finally")()}}function An(e,t,n){return function(r){return function(o){const i=null==e?void 0:e[r];if(i)try{const e=new CustomEvent(`callback.${r}`,{detail:o});an(i,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function kn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?gt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function In(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:i}=Me(r,"bindTemplateProxy"),s=i.tplHostMetadata;s.internalBricksByRef.set(n,e);const a=null===(t=s.proxy)||void 0===t?void 0:t.events;if(a)for(const[e,t]of Object.entries(a))if(t.ref===n){var c;const n=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=t.refEvent??e;o.addEventListener(r,n),(c=o).$$proxyListeners??(c.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function Cn(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=Me(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of r.$$proxyListeners??[])r.removeEventListener(e,t);delete r.$$proxyListeners}let Rn=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function On(e){e.replaceChildren()}function Tn(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===Rn.BRICK){var o;const i=n.type;i.includes("-")&&!customElements.get(i)&&console.error(`Undefined custom element: ${i}`),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const s=t&&n===e.child?t:document.createElement(i);n.element=s,n.slotId&&s.setAttribute("slot",n.slotId),n.iid&&(s.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(s.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Ct(s,n.properties),tn(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=Me({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),In(n),n.portal?r.push(s):n.return&&(n.return.childElements||(n.return.childElements=[]),n.return.childElements.push(s))}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var i;let e=n.return;for(;e;){var s;if(e.childElements)e.tag===Rn.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===Rn.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(i=e)||void 0===i?void 0:i.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const _n=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Pn=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Mn=new WeakMap,xn=new WeakMap,Ln=new WeakMap,Bn=new WeakMap,$n=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Dn=new WeakMap,jn=new WeakSet;class Kn{constructor(e,t){(0,I.A)(this,jn),(0,o.A)(this,"scope",void 0),(0,o.A)(this,"unknownBricks",void 0),(0,o.A)(this,"renderId",void 0),(0,i.A)(this,Mn,void 0),(0,i.A)(this,xn,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,i.A)(this,Ln,new Map),(0,i.A)(this,Bn,void 0),(0,i.A)(this,$n,new Map),(0,i.A)(this,Nn,void 0),(0,i.A)(this,Un,void 0),(0,i.A)(this,Fn,new WeakMap),(0,i.A)(this,Dn,new Map),this.scope=e,this.unknownBricks=(null==t?void 0:t.unknownBricks)??"throw",(0,s.A)(Mn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,s.A)(Un,this,e)}memoizeMenuRequestNode(e,t){(0,a.A)(Fn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,a.A)(Un,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(0,a.A)(Fn,this).get(t);(0,a.A)(Fn,this).set(t,n);let o,i=e.child;for(;i&&i!==r;)o=i,i=i.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,a.A)(Mn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,a.A)(Mn,this).bailout(e)}reCatch(e,t){return(0,a.A)(Mn,this).catch(e,t)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:i}of[...(0,a.A)(Dn,this).values()].reverse()){const s=o[o.length-1];if(r.includes(s))continue;const a=await i(e,t);a&&r.push(...o.slice(0,-1)),!1!==a&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,a.A)(Dn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[..._n,..."page"===this.scope?Pn:[]];for(const r of n){const n=t[r];n&&(0,a.A)(xn,this)[r].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,a.A)($n,this).get(e);n?n.add(t):(0,a.A)($n,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,a.A)(Nn,this)||(0,s.A)(Nn,this,new WeakMap);const o=[e??"",...t].join(".");let i=(0,a.A)(Nn,this).get(r);i||(i=new Map,(0,a.A)(Nn,this).set(r,i)),i.set(o,{node:n,last:zn(n),lastNormal:qn(n),lastPortal:Xn(n)})}reRender(e,t,n,r){const o=[e??"",...t].join("."),i=(0,a.A)(Nn,this).get(r).get(o),{node:s,last:c,lastNormal:l,lastPortal:u}=i;let d;const p=[];if((null==s?void 0:s.tag)===Rn.PLACEHOLDER){var f,h;d=(null===(f=function(e){return Yn(e,!0)}(s))||void 0===f?void 0:f.element)??null;const e=null===(h=function(e){return Jn(e,!0)}(s))||void 0===h?void 0:h.element;e&&p.push(e)}else{var m,g;d=(null==l||null===(m=l.element)||void 0===m?void 0:m.nextSibling)??null;let e=null==u||null===(g=u.element)||void 0===g?void 0:g.nextSibling;for(;e&&(p.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const v=zn(n);let y;i.node=n,i.last=v,i.lastNormal=qn(n),i.lastPortal=Xn(n);let w=r.child;for(;w&&w!==c;){if(w.sibling===s){y=w;break}w=w.sibling}const b=document.createDocumentFragment(),E=document.createDocumentFragment(),S={tag:Rn.ROOT,container:b,createPortal:E,child:n};for(w=n;w;)w.return=S,w=w.sibling;const A=Qn(s,c);for((0,C.A)(jn,this,Vn).call(this,A),Tn(S),y?y.sibling=n:r.child=n,v&&(v.sibling=null==c?void 0:c.sibling),w=n;w;)w.return=r,w=w.sibling;var k,I;if(r.tag===Rn.ROOT?null===(k=r.container)||void 0===k||k.insertBefore(b,d):null===(I=r.element)||void 0===I||I.insertBefore(b,d),E.childNodes.length>0){var R;let e=n;for(;e&&e.return;)e=e.return;if((null===(R=e)||void 0===R?void 0:R.tag)!==Rn.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const t="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of p)if(t.contains(e)){r=e;break}t.insertBefore(E,r)}const O=Qn(n,v);(0,C.A)(jn,this,Wn).call(this,O)}dispose(){for(const e of Object.values((0,a.A)(xn,this)))e.length=0;for(const e of(0,a.A)(Ln,this).values()){for(const t of e)t.disconnect();e.length=0}(0,a.A)(Ln,this).clear(),(0,a.A)(Bn,this)&&(Ee.removeEventListener("change",(0,a.A)(Bn,this)),(0,s.A)(Bn,this,void 0)),(0,s.A)(Nn,this,void 0),(0,a.A)($n,this).clear(),(0,a.A)(Dn,this).clear(),(0,s.A)(Fn,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(jn,this,Hn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(jn,this,Hn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(jn,this,Hn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(jn,this,Hn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(jn,this,Hn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(jn,this,Hn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,a.A)(xn,this).onScrollIntoView)(0,C.A)(jn,this,Gn).call(this,e,t)}initializeMediaChange(){(0,s.A)(Bn,this,(e=>{(0,C.A)(jn,this,Hn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:z(e.detail)}))})),Ee.addEventListener("change",(0,a.A)(Bn,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,a.A)(xn,this).onMessage)for(const r of[].concat(n)){var t;null==ri||null===(t=ri.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{an(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==ri||null===(e=ri.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(jn,this,Hn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(jn,this,Hn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(jn,this,Hn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Vn(e){const t=[..._n,..."page"===this.scope?Pn:[]],n=[];for(const r of t){const t=(0,h.remove)((0,a.A)(xn,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o;const e=(0,a.A)(Ln,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,a.A)(Ln,this).delete(t)}Cn(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove()}const i=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)an(t,e.runtimeContext,e)(i)}function Wn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,a.A)(xn,this).onMount)e.has(n)&&an(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,a.A)(xn,this).onScrollIntoView)e.has(t)&&(0,C.A)(jn,this,Gn).call(this,t,n)}function Hn(e,t){for(const{brick:n,handlers:r}of(0,a.A)(xn,this)[e])an(r,n.runtimeContext,n)(t);const n=(0,a.A)($n,this).get(e);if(n)for(const e of n)e()}function Gn(e,t){const n=t.threshold??.1,r=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(an(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});r.observe(e.element);let o=(0,a.A)(Ln,this).get(e);o||(o=[],(0,a.A)(Ln,this).set(e,o)),o.push(r)}function zn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function qn(e){return Yn(e,!1)}function Yn(e,t){let n,r=e;for(;r;){if(r.tag===Rn.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function Xn(e){return Jn(e,!1)}function Jn(e,t){let n,r=e;for(;r;){if(r.tag===Rn.BRICK&&r.portal){if(t)return r;n=r}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&!e.sibling;)e=e.return;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}function Qn(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===Rn.BRICK&&n.add(r),r.child)r=r.child;else{if(r===t)break;if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&e!==t&&!e.sibling;)e=e.return;if(e===t)break;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}const Zn=new Map;function er(e){return Zn.get(e)}const tr=Symbol.for("root.runtimeContext");async function nr(e,t,n){var r,o;const[i,s,a]=Jr({...e[tr]??pi(),data:t,pendingPermissionsPreCheck:[]});i.tplStateStoreMap??(i.tplStateStoreMap=new Map),i.formStateStoreMap??(i.formStateStoreMap=new Map);const c=new Kn("fragment"),l={tag:Rn.ROOT,createPortal:null},u=e.transform,d=Re();u&&Oe(d,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);const p=await qr(l,d&&!n?e:{errorBoundary:n,...e,properties:{...e.properties,...u}},i,c,[],{}),f=[...s,...a];if(await Xr(p,i,f),(null===(r=p.node)||void 0===r?void 0:r.tag)===Rn.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(o=p.node)&&void 0!==o&&o.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return l.child=p.node,{tagName:p.node?p.node.type:null,renderRoot:l,rendererContext:c,scopedStores:f}}function rr(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:i}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Tn(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function or(e,t){let{rendererContext:n}=e;t.portal&&(On(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function ir(e,t,n){if(n)throw new Error("Legacy doTransform does not support options in v3");return gt(t,{...pi(),data:e},{noInject:!0})}function sr(e,t){const n=fi(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),L(n)}function ar(e,t){const n=fi(e);let r=!1;function o(e){e.forEach(((n,s)=>{"routes"===n.type?o(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(r=!0,e[s]=t):Array.isArray(n.bricks)&&i(n.bricks)}))}function i(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?o(t.routes):i(t.bricks)}))}o(n.routes),r||n.routes.unshift(t)}function cr(e,t,n){const r=`${e}.${t.name}`;Pe.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),lr(e,t.name,n)}function lr(e,t,n){fr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function ur(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function dr(e,t){var n;fr(e,ur(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const pr=dr;function fr(e,t,n,r){const{routes:o}=fi(e),i=o.findIndex((e=>e.path===t)),s={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===i?o.unshift(s):o.splice(i,1,s)}function hr(e,t){let{tplStateStoreId:n}=t;const r=pi();return n?Me({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function mr(e){let{tplStateStoreId:t}=e;const n=pi();return t?Me({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function gr(e){return li().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function vr(e){return(0,l.loadBricksImperatively)(e,li())}function yr(e,t){return(0,l.loadEditorsImperatively)(e,t??li())}function wr(){return di()}async function br(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const i=fi(n);let s;if("route"===r)s={routes:[e]};else if("template"===r)s={meta:{customTemplates:[e]}};else if("snippet"===r){var a;const t=ur(e.snippetId);s={routes:[null==i||null===(a=i.routes)||void 0===a?void 0:a.find((e=>e.path===t))]}}const c=[];return s&&o&&(await o(s)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===r&&e.name===o))||c.push(e)})),c}async function Er(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...pi(),tplStateStoreId:n,match:er(r)};return e.resolve?tt(e.resolve,o,{cache:"reload"}):mt(e.value,o)}function Sr(e){const t=pi();return{app:(null==t?void 0:t.overrideApp)??(null==t?void 0:t.app),location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(t,["query","sys"]),match:er(null==e?void 0:e.routeId)}}let Ar;const kr=[];function Ir(e){Ar=e;const t=mr({tplStateStoreId:e.tplStateStoreId});Rr({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Cr(e){kr.push(e)}function Rr(e){setTimeout((()=>{for(const t of kr)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const Or=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Tr{constructor(e,t,n,r){(0,o.A)(this,"type",void 0),(0,o.A)(this,"data",new Map),(0,o.A)(this,"changeEventType",void 0),(0,o.A)(this,"pendingStack",[]),(0,o.A)(this,"hostBrick",void 0),(0,o.A)(this,"stateStoreId",void 0),(0,o.A)(this,"batchUpdate",!1),(0,o.A)(this,"batchUpdateContextsNames",[]),(0,o.A)(this,"rendererContext",void 0),(0,o.A)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Ar){const{tplStateStoreId:n}=Ar;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&Rr({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const r={},o={},i=[];e.forEach((e=>{const{name:o,value:s}=n([e]),a=this.data.get(o);i.push(...this.getAffectListByContext(o)),a&&(r[o]=a),this.updateValue(o,s,t)})),i.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const s=e=>{for(const n in e){var t;const r=e[n];null===(t=r.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:r.value}))}};s(r),s(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const i=this.data.get(e);if(!i)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?i.value=t:(0,u.isObject)(i.value)?Object.assign(i.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let s;"load"===n&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));const a=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==di()};if(s||(s=i.loading=i.load({cache:"load"===n?"default":"reload",...t}),s.then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||a(e)||null!=r&&r.error||Zt(e)}))),r){const e=An(r,o);s.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!a(t)&&r.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,r){if(Array.isArray(e)&&e.length>0){const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const r=new Map;for(const o of e){const e=[o.if,o.value,o.resolve],i=(0,T.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,T.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)i.usedProperties.add(e);t.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}r.set(o,i)}return r}(e,n,arguments.length>3?arguments[3]:void 0),o=new Map;for(const e of Array.from(r.keys()).map((e=>e.name)))o.set(e,(o.get(e)??0)+1);const i=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,a=new Map,c=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,n)=>{a.set(e,{resolve:t,reject:n})}))]))),l=async e=>{s.add(e);const n=await t(e);r.delete(e);const i=o.get(e.name)??0;if(n){if(a.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===i?(a.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);await d()};let u=i;async function d(){const e=Array.from(r.entries()).filter(function(e,t){return(n,r)=>t?0===r:![...n[1].usedProperties].some((t=>e.has(t)))}(o,u)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(l))}return{pendingResult:d().then((async()=>{r.size>0&&(function(e,t){const n=new Map(e),r=new Set(Array.from(n.keys()).map((e=>e.name))),o=()=>{let e=!1;for(const[t,o]of n.entries())[...o.usedProperties].some((e=>r.has(e)))||(n.delete(t),r.delete(t.name),e=!0);e&&o()};if(o(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(r,n),u=!0,await d());for(const e of a.values())e.resolve()})).catch((e=>{for(const t of a.values())t.reject(e);throw e})),pendingContexts:c}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));this.pendingStack.push(o)}}onChange(e,t){var n;null===(n=this.data.get(e))||void 0===n||n.eventTarget.addEventListener(this.changeEventType,t)}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingContexts:e}of this.pendingStack)for(const t of e.values())t.catch((()=>{}));for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,r){if(!await wt(e,t))return!1;let o,i,s,a,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await kt(n,e.name)),void 0===o){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");c=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,T.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(a=await wt(e.resolve,t),(a||c)&&(i=async e=>{var n;return(await tt(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),a)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await i():"async"===l&&(s=i());else if(!n)return!1}a&&"eager"===l||void 0===e.value||(o=await mt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:o,eventTarget:new ye,useResolve:a,load:i,loaded:"eager"===l,loading:s,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var p;t&&Or.includes(t)&&(null===(p=this.rendererContext)||void 0===p||p.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,an(e.onChange,t)),e.track){const n=(0,T.strictCollectMemberUsage)(c?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(d.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{d.useResolve=c?bt(e.resolve,t):!!i,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,gt(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),Array.isArray(r))for(const t of r){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e)for(const t of e)this.data.delete(t)}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function _r(e,t,n){const{reversedProxies:r,asyncHostPropertyEntries:o,externalSlots:i,tplStateStoreId:s,hostBrick:a}=e;let c;if(t&&r){const e=r.properties.get(t);e&&(d=o,c=e.map((e=>{let{from:t,to:n}=e;const r=d.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const s=r.slots.get(t);if(s&&i){const e=new Map;for(const{from:t,to:r}of s){var l;const o=(null===(l=i[t])||void 0===l?void 0:l.bricks)??[];if(!o.length)continue;const s=r.refSlot??t;let c=e.get(s);if(!c){c=[];const t=(0,u.hasOwnProperty)(n,s)?n[s].bricks.length+1:1;for(let e=0;e<t;e+=1)c.push([]);e.set(s,c)}const d=r.refPosition??-1,p=(0,u.hasOwnProperty)(a.runtimeContext,"forEachItem");c[(0,h.clamp)(d<0?c.length+d:d,0,c.length-1)].push(...p?Pr(o,a.runtimeContext.forEachItem,a.runtimeContext.forEachIndex,a.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=r.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var d;return{[Lt]:c,[Bt]:s}}function Pr(e,t,n,r){return e.map((e=>{let{children:o,slots:i,...s}=e;return{...s,[$t]:t,[Nt]:n,[Ut]:r,slots:":forEach"===s.brick?eo(o,i):Object.fromEntries(Object.entries(eo(o,i)??{}).map((e=>{let[o,i]=e;return[o,"routes"===i.type?{type:"routes",routes:Mr(i.routes,t,n,r)}:{type:"bricks",bricks:Pr(i.bricks,t,n,r)}]})))}}))}function Mr(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:Mr(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Pr(e.bricks,t,n,r)}))}function xr(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(r)]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e){const{properties:o,slots:i,children:s,...a}=e,c=eo(s,i),l=Object.fromEntries(Object.entries(c??{}).map((e=>{let[t,n]=e;return[t,{type:"bricks",bricks:(n.bricks??[]).map(r)}]})));return{...a,properties:n(o),slots:l,..._r(t,a.ref,l)}}return n(e)}function Lr(e,t,n,r,o){var i;const s=(0,h.uniqueId)("tpl-state-"),a={...n.runtimeContext,tplStateStoreId:s};delete a.forEachItem,delete a.forEachIndex,delete a.forEachSize,delete a.formStateStoreId;const c=new Tr("STATE",n,o,s);a.tplStateStoreMap.set(s,c),a.tplStateStoreScope&&a.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:p}=Pe.get(e);null==ri||null===(i=ri.flowApi)||void 0===i||i.collectWidgetContract(p),c.define(d,a,r);const{slots:f,children:m,...g}=t,v={...g,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const y={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=y.properties.get(t.ref);n||(n=[],y.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=y.slots.get(t.ref);n||(n=[],y.slots.set(t.ref,n)),n.push({from:e,to:t})}const w={reversedProxies:y,asyncHostPropertyEntries:r,externalSlots:eo(m,f),tplStateStoreId:s,hostBrick:n};return v.slots={"":{type:"bricks",bricks:l.map((e=>Br(e,w)))}},v}function Br(e,t){null===e.if&&delete e.if;const{properties:n,slots:r,children:o,...i}=e,s=eo(o,r),a=Object.fromEntries(Object.entries(s??{}).map((e=>{let[n,r]=e;return[n,{type:"bricks",bricks:(r.bricks??[]).map((e=>Br(e,t)))}]})));return{...i,properties:xr(n,t),slots:a,..._r(t,i.ref,a)}}const $r="form-renderer.form-renderer",Nr=Symbol.for("form.stateStoreId"),Ur=["forms.general-form","form.general-form","eo-form"];function Fr(e,t,n){const{id:r,bricks:o,events:i,context:s,mountPoint:a,instanceId:c}=e;let{brick:l,properties:d}=e;const p=t.find((e=>e.fieldId===r));if(p){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},r=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...r()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...r(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...r(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...r(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...r()}};break;default:t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description}}}return t}(p);l||(l=e.brick),d={...e.properties,...d}}const f={brick:l,properties:d,iid:c,slot:a,events:i,context:s,children:Dr(o,t,n),[Nr]:n};return(0,u.hasOwnProperty)(e,"if")&&(f.if=e.if),f}function Dr(e,t,n){if(Array.isArray(e))return e.map((e=>Fr(e,t,n)))}var jr=new WeakSet;class Kr extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,jr),(0,o.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(jr,this,Vr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(jr,this,Vr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(jr,this,Vr).call(this,"resetFields",t)}}function Vr(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,i=null==o||null===(n=o.tagName)||void 0===n?void 0:n.toLowerCase();Ur.includes(i)?o[e](...r):console.error(`no ${e} method in the container element`,{container:i})}class Wr extends Error{constructor(e){super(e),this.name="PageNotFoundError",Error.captureStackTrace&&Error.captureStackTrace(this,l.BrickLoadError)}}async function Hr(e,t,n){const{title:r,variant:o,showLink:i,showDescription:s}=function(e){var t,n;return e instanceof Wr?"app not found"===e.message?{showLink:"home",title:c.i18n.t(`${Vt}:${Dt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:c.i18n.t(`${Vt}:${Dt.PAGE_NOT_FOUND}`)}:e instanceof l.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name?{showDescription:!0,title:c.i18n.t(`${Vt}:${Dt.NETWORK_ERROR}`),variant:"internet-disconnected"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Vt}:${Dt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:c.i18n.t(`${Vt}:${Dt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Vt}:${Dt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){const n=ui().error??"illustrations.error-message";if(!1!==n){const a="eo-link",u=i?[n,a]:[n];try{await Promise.race([(0,l.loadBricksImperatively)(u,li()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const d={tag:Rn.BRICK,type:n,properties:{errorTitle:r,description:s?qt(e):void 0,variant:o,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return i&&(d.child={tag:Rn.BRICK,type:a,properties:{textContent:"home"===i?c.i18n.t(`${Vt}:${Dt.GO_BACK_HOME}`):c.i18n.t(`${Vt}:${Dt.GO_BACK_TO_PREVIOUS_PAGE}`),url:"home"===i?"/":void 0},events:"home"===i?void 0:{click:{action:"history.goBack"}},runtimeContext:null,return:d}),d}catch(e){console.error("Failed to load brick:",u.join(", "),e)}}}return{tag:Rn.BRICK,type:"div",properties:{textContent:s?`${r}: ${qt(e)}`:r,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t}}async function Gr(e,t,n,r,o,i,s,a){const c=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=xt(n,t.app.homepage,t.location.pathname);if(e&&await wt(n,t))return t.app.noAuthGuard||n.public||null==ri||!ri.auth||ri.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),u={blockingList:[]},d=u.menuRequestNode={return:i};switch(c){case"missed":break;case"unauthenticated":u.unauthenticated=!0;break;default:{var p;const i=u.route=c.route;u.path=c.match.path;const m={...n,match:c.match};i.iid&&(f=i.iid,h=c.match,Zn.set(f,h)),a&&m.ctxStore.disposeDataInRoutes(t);const g=o.concat(i);m.ctxStore.define(i.context,m,void 0,g),m.pendingPermissionsPreCheck.push(null==ri||null===(p=ri.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(i,(e=>mt(e,m))));const{preLoadBricks:v}=i;if(Array.isArray(v)&&u.blockingList.push((0,l.loadBricksImperatively)(v,li())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await mt(i.redirect,m):(await tt({transform:"redirect",...i.redirect},m)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);u.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return mt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,m);let o;n&&(d.request=n),a||r.memoizeMenuRequestNode(t,d),o="routes"===i.type?await Gr(e,i.routes,m,r,g,d,s):await zr(e,i.bricks,m,r,g,d,s),Qr(u,o),Zr(d,o.menuRequestNode)}}}var f,h;return u}async function zr(e,t,n,r,o,i,s,a,c){!function(e,t,n){function r(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(const[t,n]of Object.entries(e))(0,u.isObject)(n)&&"useBrick"===t?Array.isArray(n)?n.forEach((e=>o(e,!0))):o(n,!0,!0):r(n)}function o(e,i,s){if(i&&(e[tr]=t),r(e.properties),n&&!s)return;const a=eo(e.children,e.slots);for(const e of Object.values(a??{}))for(const t of e.bricks??[])o(t,i)}for(const t of e)o(t)}(t,n,!0);const l={blockingList:[]},d=c??[];return(await Promise.all(t.map(((t,c)=>qr(e,t,n,r,o,i,s,d.concat(c),a&&new Map(a)))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(s,d.concat(n),t.node,e),Qr(l,t)})),l}async function qr(e,t,n,r,o,i,s){let a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new Map;try{return await async function(e,t,n,r,o,i,s,a,c){var d,p;const f={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;const{if:m,permissionsPreCheck:v,...y}=t;if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):it(e)&&(0,O.isTrackAll)(st(e))}(m))return qr(e,{brick:":if",dataSource:m,permissionsPreCheck:v,slots:{"":{type:"bricks",bricks:[y]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,i,s,a,c);const w=t[Bt],b=t[Nr],E={...n,tplStateStoreId:w,formStateStoreId:b};(0,u.hasOwnProperty)(t,$t)&&(E.forEachItem=t[$t],E.forEachIndex=t[Nt],E.forEachSize=t[Ut]);const{context:S}=t;if(Array.isArray(S)&&S.length>0){const e=Re(E);Oe(e,"Defining context on bricks","check your brick:",t),e||E.ctxStore.define(S,E)}if(E.pendingPermissionsPreCheck.push(null==ri||null===(d=ri.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(t,(e=>mt(e,E)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!it(e.if)?Et(await tt(e.if,t)):wt(e,t)}(t,E))return f;const A=t.brick;if(A.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(A);const{dataSource:n}=t,l=async l=>{var d;const p=await mt(n,l),f=":forEach"===A?"":":switch"===A?String(p):p?"":"else",h=eo(t.children,t.slots),m=h&&(0,u.hasOwnProperty)(h,f)&&(null===(d=h[f])||void 0===d?void 0:d.bricks);if(!Array.isArray(m))return{blockingList:[]};switch(A){case":forEach":return Array.isArray(p)?async function(e,t,n,r,o,i,s,a,c,l){const u={blockingList:[]},d=t.length,p=await Promise.all(t.map(((t,u)=>Promise.all(n.map(((n,p)=>qr(e,n,{...r,forEachItem:t,forEachIndex:u,forEachSize:d},o,i,s,a,l.concat(u*d+p),c&&new Map(c))))))));return p.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(a,l.concat(n),t.node,e),Qr(u,t)})),u}(e,p,m,l,r,o,i,s,c,a):{blockingList:[]};case":if":case":switch":return zr(e,m,l,r,o,i,s,c,a)}},d=async t=>{const n=await l(t);return n.node??(n.node={tag:Rn.PLACEHOLDER,return:e}),n},p=await d(E),{onMount:f,onUnmount:m}=t.lifeCycle??{},{contextNames:g,stateNames:v}=At(n);if(g||v){p.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,i,c]=Jr(E),l=await d(o),u=[...i,...c];if(await Xr(l,o,u),t===n){m&&an(m,E)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(s,a,l.node,e),f&&an(f,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of u)e.mountAsyncData()}},i=(0,h.debounce)(o,0,{leading:!0,trailing:!0});if(g)for(const e of g)E.ctxStore.onChange(e,i);if(v)for(const e of v)Me(E,"STATE",`: "${n}"`).onChange(e,i)}return f&&r.registerArbitraryLifeCycle("onMount",(()=>{an(f,E)(new CustomEvent("mount",{detail:{rerender:!1}}))})),m&&r.registerArbitraryLifeCycle("onUnmount",(()=>{an(m,E)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),p}/\.tpl-/.test(A)&&!Pe.get(A)&&await to((0,l.loadBricksImperatively)([A],li()),"brick",A,r.unknownBricks);const k=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Pe.get(n))return n}return!!Pe.get(e)&&e}(A,null===(p=E.app)||void 0===p?void 0:p.id);if(k){const e=c.get(k)??0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${k}"`);c.set(k,e+1)}else A.includes("-")&&!customElements.get(A)&&(A===$r?customElements.get($r)||customElements.define($r,Kr):f.blockingList.push(to((0,l.enqueueStableLoadBricks)([A],li()),"brick",A,r.unknownBricks)));let I,C;var R;A===$r?(({formData:I,...C}=t.properties??{}),null!==(R=t.properties)&&void 0!==R&&R.compute&&(I=await mt(I,E))):C=t.properties;const _=[],P=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:i,stateNames:s,formStateNames:a}=At(o);return(i||s||a)&&n.push({contextNames:i,stateNames:s,formStateNames:a,propName:r,propValue:o}),[r,mt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?pt.USE_BRICK:pt.INITIAL})]})):[]}(C,E,_),M=t[Lt];M&&P.push(...M);const x="script"===A;if(x||"link"===A){const e=await It(P);if(x?e.src:"stylesheet"===e.rel&&e.href){const t=window.PUBLIC_ROOT??"";if(x){const{src:n,...r}=e;await to((0,l.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await to((0,l.loadStyle)(n,t,r),"stylesheet",n,"silent")}return f}}const L={tag:Rn.BRICK,type:k||A,return:e,slotId:s,events:t.events,runtimeContext:E,portal:t.portal,iid:t.iid,ref:t.ref};f.node=L;const B=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);B.size>0&&f.blockingList.push(to((0,l.loadProcessorsImperatively)(B,li()),"processors",[...B].join(", "),r.unknownBricks));const $=[];$.push((async()=>{L.properties=await It(P),function(e,t){for(const n of t){const t=()=>{e.element&&Rt(e.element,{[n.propName]:n.propValue},e.runtimeContext)};if(n.contextNames)for(const r of n.contextNames)e.runtimeContext.ctxStore.onChange(r,t);if(n.stateNames){const r=Me(e.runtimeContext,"STATE",`: "${n.propValue}"`);for(const e of n.stateNames)r.onChange(e,t)}if(n.formStateNames){const r=qe(e.runtimeContext,"FORM_STATE",`: "${n.propValue}"`);for(const e of n.formStateNames)r.onChange(e,t)}}}(L,_)})()),r.registerBrickLifeCycle(L,t.lifeCycle);let N,U=t;k?U=Lr(k,t,L,P,r):A===$r&&(U=function(e,t,n,r,o){var i;const s="string"==typeof e?JSON.parse(e):e,a=(0,h.uniqueId)("form-state-"),c={...n.runtimeContext,formStateStoreId:a};delete c.forEachItem,delete c.forEachIndex,delete c.forEachSize,delete c.tplStateStoreId;const l=new Tr("FORM_STATE",void 0,o,a);c.formStateStoreMap.set(a,l),c.formStateStoreScope&&c.formStateStoreScope.push(l);const d=s.context??[];d.some((e=>"params"===e.name))||d.push({name:"params"}),l.define(d,c,r);const p=Fr(s.formSchema,s.fields,a);return Ur.includes(p.brick)&&t.events&&(p.events=function(e,t){const n=e??{};for(const[e,r]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(p.events,t.events)),"boolean"!=typeof(null===(i=t.properties)||void 0===i?void 0:i.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[p]}]}:{...t,slots:void 0,children:[p]}}(I,t,L,P,r)),U.portal&&(L.slotId=void 0),k?(N={...E},delete N.forEachItem,delete N.forEachIndex,delete N.forEachSize):N=E;return $.push((async()=>{const e=eo(U.children,U.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map(((e,n)=>{let[s,a]=e;if("routes"!==a.type)return zr(L,a.bricks,N,r,o,i,s,c);const l=o[o.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(n,s),r.performIncrementalRender(a,o,(async(e,t)=>{const{homepage:n}=N.app,{pathname:c}=e;if(!g(n,c)||!o.every((e=>{let r,o;return(r=xt(e,n,t.pathname))&&(o=xt(e,n,c))&&(e!==l||(0,h.isEqual)(r.params,o.params))})))return!1;const[u,d,p]=Jr({...N,location:e,query:new URLSearchParams(e.search)});let f,m=!1,v=[];try{if(f=await Gr(L,a.routes,u,r,o,i,s,!0),f.route){if(r.reBailout(f))return!0;v=[...d,...p],await Xr(f,u,[u.ctxStore,...v])}await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=await r.reCatch(e,L);if(!t)return!0;({failed:m,output:f}=t),await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}if(r.reRender(s,[],f.node,L),!m){u.ctxStore.mountAsyncData(f.route);for(const e of v)e.mountAsyncData()}return!!f.route||null}))),Gr(L,a.routes,N,r,o,i,s)}))),s={...f,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,L),Qr(s,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(s,e)})),s.node&&(L.child=s.node),Qr(f,{...s,node:void 0}),Zr(i,f.menuRequestNode=s.menuRequestNode)})()),await Promise.all($),f}(e,t,n,r,o,i,s,a,c)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await Hr(n,e),blockingList:[]};throw n}}function Yr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function Xr(e,t,n){return(0,l.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function Jr(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function Qr(e,t){const{blockingList:n,node:r,menuRequestNode:o,hasTrackingControls:i,...s}=t;if(e.blockingList.push(...n),r)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=r}else e.node=r;Object.assign(e,s)}function Zr(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function eo(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const t of e){const e=t.slot??"";(0,u.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(t)}}return n}function to(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let no,ro,oo;function io(){if(!no){if(no={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){no.isInIframe=!0;try{if(window.origin===window.parent.origin){no.isInIframeOfSameSite=!0;const e="/next/"===f(),t=window.parent.location.pathname,n=t.startsWith("/next/");no.isInIframeOfNext=0==(Number(e)^Number(n));const r=n?"/next":"";no.isInIframeOfVisualBuilder=t.startsWith(`${r}/visual-builder/`)||t.startsWith(`${r}/visual-builder-`),no.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(no)}return no}function so(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Pe.define(n,t)}}function ao(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const co="basic.show-watermark";var lo=new WeakMap,uo=new WeakMap,po=new WeakMap,fo=new WeakMap,ho=new WeakMap,mo=new WeakMap,go=new WeakMap,vo=new WeakMap,yo=new WeakMap,wo=new WeakMap,bo=new WeakMap,Eo=new WeakSet;class So{constructor(e){(0,I.A)(this,Eo),(0,i.A)(this,lo,void 0),(0,i.A)(this,uo,!1),(0,i.A)(this,po,void 0),(0,i.A)(this,fo,void 0),(0,i.A)(this,ho,void 0),(0,i.A)(this,mo,new Set),(0,i.A)(this,go,0),(0,i.A)(this,vo,void 0),(0,i.A)(this,yo,void 0),(0,i.A)(this,wo,void 0),(0,i.A)(this,bo,void 0),(0,s.A)(lo,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(Eo,this,Ao).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(Eo,this,Ao).call(this,{location:e,action:t})))}getRenderId(){return(0,a.A)(vo,this)}getRuntimeContext(){return(0,a.A)(fo,this)}getRecentApps(){return{currentApp:(0,a.A)(yo,this),previousApp:(0,a.A)(wo,this)}}getNavConfig(){return(0,a.A)(bo,this)}bootstrap(){window.AbortController&&(ro=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{...e.options,signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:ro.signal}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const r=t;t=e,(0,a.A)(uo,this)?(0,s.A)(po,this,{location:e,prevLocation:r,action:n}):(0,C.A)(Eo,this,Io).call(this,{location:e,prevLocation:r,action:n}).catch(Zt)})),(0,C.A)(Eo,this,Io).call(this,{location:e.location})}}function Ao(e){var t;const n=k(),r=n.getBlockMessage();null===(t=(0,a.A)(ho,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function ko(e,t,n){var r,o;if((0,s.A)(go,this,(r=(0,a.A)(go,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function Io(e){(0,s.A)(uo,this,!0);try{await(0,C.A)(Eo,this,Co).call(this,e)}finally{if((0,s.A)(uo,this,!1),(0,a.A)(po,this)){const e=(0,a.A)(po,this);(0,s.A)(po,this,void 0),await(0,C.A)(Eo,this,Io).call(this,e)}}}async function Co(e){let{location:t,prevLocation:n,action:r}=e;if(n){var o,i,s,c;let e;const u={hash:void 0,state:void 0};var l;if(void 0!==t.key&&("POP"!==r||void 0!==n.key&&!1!==(null===(o=n.state)||void 0===o?void 0:o.notify))||(u.key=void 0),((0,p.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==r&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(e=!0),e||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(e=await(null===(l=(0,a.A)(ho,this))||void 0===l?void 0:l.didPerformIncrementalRender(t,n))),e)return;if(ro&&(ro.abort(),ro=new AbortController),null===(c=(0,a.A)(ho,this))||void 0===c||c.dispatchPageLeave(),"POP"===r&&v(m((0,a.A)(lo,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(Eo,this,Ro).call(this,t)}async function Ro(e){var t,n,r,o;const i=(0,s.A)(vo,this,(0,h.uniqueId)("render-id-"));Je=new WeakSet,et.clear(),null==ri||null===(t=ri.flowApi)||void 0===t||t.clearCollectWidgetContract(),k().unblock();const c=null==ri||null===(n=ri.pageView)||void 0===n?void 0:n.create(),u=m((0,a.A)(lo,this),e.pathname),d=null===(r=(0,a.A)(fo,this))||void 0===r?void 0:r.app,p=null==u||null===(o=u.app)||void 0===o?void 0:o.id;window.BOOTSTRAP_UNION_FILE&&p&&p!==(null==d?void 0:d.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:p,version:u.app.currentVersion}),null!=u&&u.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==ri||null===(t=ri.fulfilStoryboard)||void 0===t?void 0:t.call(ri,e)),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(u);const f=(0,s.A)(yo,this,null==u?void 0:u.app);!function(){var e,t,n,r,o;const i=ii().getFeatureFlags(),s=ii().getMiscSettings();if(!i["show-watermark"])return;const a="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),c=(null==ri||null===(n=ri.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)??"",u=s.watermarkConfig??{flags:{}},d=[..."string"==typeof u.content?[u.content]:u.content??[],null!==(r=u.flags)&&void 0!==r&&r["show-development"]&&a?"Development":"",null!==(o=u.flags)&&void 0!==o&&o["show-user"]?c:""].filter(Boolean);if(0===d.length)return;const p={content:d,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(u,["content","flags"])};oo?oo.resolve(p):(0,l.loadBricksImperatively)([co],li()).then((()=>{oo=document.createElement(co),oo.resolve(p)}),(e=>{console.error("Load watermark service failed:",e)}))}();const g=d&&f?d.id!==f.id:d!==f;(0,O.clearExpressionASTCache)(),g&&(0,O.clearFunctionASTCache)();const v=ii().getFeatureFlags(),y=(0,a.A)(ho,this),w=(t,n)=>{null==c||c({status:"redirected"}),(0,a.A)(mo,this).add(y),(0,C.A)(Eo,this,ko).call(this,t,n,e)},b=()=>{const t=v["sso-enabled"]?"/sso-auth/login":"/auth/login";zt(e),w(t,{from:e})},E=document.querySelector("#main-mount-point"),S=document.querySelector("#portal-mount-point"),A={tag:Rn.ROOT,container:E,createPortal:S},I=()=>{var e;On(E),On(S),(0,a.A)(mo,this).add(y);for(const e of(0,a.A)(mo,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,a.A)(mo,this).clear(),null==ri||null===(e=ri.messageDispatcher)||void 0===e||e.reset(),g&&((0,s.A)(wo,this,d),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:d,currentApp:f}})))};if(Q(f&&(re()[f.id]||f.theme)||"light"),ie("default"),f){var T,_,P,M,x,B;null==ri||null===(T=ri.checkInstalledApps)||void 0===T||T.preCheckInstalledApps(u,(e=>!!hi(e)));const t={bailout:e=>e.unauthenticated?(b(),!0):e.redirect?(w(e.redirect.path,e.redirect.state),!0):void(0,s.A)(go,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,s.A)(bo,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,a.A)(bo,this)}))},catch:async(t,n)=>{if(!Yt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const r=ii().getMiscSettings().noAuthGuardLoginPath;return Yt(t)&&r?void w(r,{from:e}):{failed:!0,output:{node:await Hr(t,n,!0),blockingList:[]}}}(0,a.A)(mo,this).add(y)}else b()}},n=(0,s.A)(ho,this,new Kn("page",{routeHelper:t,renderId:i})),r=(0,s.A)(fo,this,{app:f,location:e,query:new URLSearchParams(e.search),flags:v,sys:{...null==ri||null===(_=ri.auth)||void 0===_?void 0:_.getAuth(),...io(),settings:{brand:ii().getBrandSettings()}},ctxStore:new Tr("CTX",void 0,n),pendingPermissionsPreCheck:[null==ri||null===(P=ri.checkPermissions)||void 0===P?void 0:P.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.A)(bo,this,void 0),so(u),me(null===(M=u.meta)||void 0===M?void 0:M.functions,f),null==ri||null===(x=ri.flowApi)||void 0===x||x.collectContract(null===(B=u.meta)||void 0===B?void 0:B.contracts);let o,l=!1,d=[];try{Zn.clear();const e={};if(o=await Gr(A,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const r=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)],t}(u.routes),r,n,[],e),t.bailout(o))return;d=Yr(r),await Xr(o,r,d),e.child=o.menuRequestNode,n.setInitialMenuRequestNode(e),await t.mergeMenus(n.getMenuRequests())}catch(e){console.error("Router failed:",e);const n=await t.catch(e,A);if(!n)return;({failed:l,output:o}=n)}if(A.child=o.node,I(),o.route&&"routes"!==o.route.type||l){if(l||n.dispatchBeforePageLoad(),te(),ae(),ao(null==f?void 0:f.uiVersion),Tn(A),window.scrollTo(0,0),l)null==c||c({status:"failed"});else{n.dispatchPageLoad(),n.dispatchAnchorLoad(),n.dispatchOnMount(),n.initializeScrollIntoView(),n.initializeMediaChange(),n.initializeMessageDispatcher();for(const e of d)e.mountAsyncData();null==c||c({status:"ok",path:o.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=ri&&ri.auth&&!ri.auth.isLoggedIn())return void b();I()}te(),ae();const $=await Hr(new Wr(f?"page not found":"app not found"),A,!0);A.child=$,Tn(A),window.scrollTo(0,0),null==c||c({status:"not-found"}),V("rendered")}const Oo="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;var To=n(4579),_o=n(4501),Po=2,Mo=.16,xo=.05,Lo=.05,Bo=.15,$o=5,No=4,Uo=[{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 Fo(e){var t=e.r,n=e.g,r=e.b,o=(0,To.wE)(t,n,r);return{h:360*o.h,s:o.s,v:o.v}}function Do(e){var t=e.r,n=e.g,r=e.b;return"#".concat((0,To.Ob)(t,n,r,!1))}function jo(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Po*t:Math.round(e.h)+Po*t:n?Math.round(e.h)+Po*t:Math.round(e.h)-Po*t)<0?r+=360:r>=360&&(r-=360),r}function Ko(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-Mo*t:t===No?e.s+Mo:e.s+xo*t)>1&&(r=1),n&&t===$o&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Vo(e,t,n){var r;return(r=n?e.v+Lo*t:e.v-Bo*t)>1&&(r=1),Number(r.toFixed(2))}function Wo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,_o.RO)(e),o=$o;o>0;o-=1){var i=Fo(r),s=Do((0,_o.RO)({h:jo(i,o,!0),s:Ko(i,o,!0),v:Vo(i,o,!0)}));n.push(s)}n.push(Do(r));for(var a=1;a<=No;a+=1){var c=Fo(r),l=Do((0,_o.RO)({h:jo(c,a),s:Ko(c,a),v:Vo(c,a)}));n.push(l)}return"dark"===t.theme?Uo.map((function(e){var r,o,i,s=e.index,a=e.opacity;return Do((r=(0,_o.RO)(t.backgroundColor||"#141414"),i=100*a/100,{r:((o=(0,_o.RO)(n[s])).r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b}))})):n}var Ho={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"},Go={},zo={};function qo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Yo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Xo(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function Jo(e,t,n){return"dark"===t?Wo(e,{theme:t,backgroundColor:n})[5]:e}function Qo(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Yo:qo)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?Yo:qo)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,r]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),r.map(((e,r)=>[" --palette-".concat(n,"-").concat(r+1,"-channel: ").concat(Xo(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(r+1,": rgb(var(--palette-").concat(n,"-").concat(r+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[r,o]=e;return[r,Wo(o,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((r=>{var[o,i]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(Xo(Jo(t[i],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(i,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(i,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(i,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Yo:qo)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let Zo,ei,ti,ni,ri;function oi(e){if(Zo)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case D:j=n.panel}})),ri=null==e?void 0:e.hooks,(0,c.initializeI18n)(Vt,Wt),d.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{d.locale(c.i18n.language)})),A(),Zo=new ci,Zo}Object.keys(Ho).forEach((function(e){Go[e]=Wo(Ho[e]),Go[e].primary=Go[e][5],zo[e]=Wo(Ho[e],{theme:"dark",backgroundColor:"#141414"}),zo[e].primary=zo[e][5]})),Go.red,Go.volcano,Go.gold,Go.orange,Go.yellow,Go.lime,Go.green,Go.cyan,Go.blue,Go.geekblue,Go.purple,Go.magenta,Go.grey;const ii=function(){const e=S();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return Zo};var si=new WeakMap,ai=new WeakMap;class ci{constructor(){(0,i.A)(this,si,!1),(0,i.A)(this,ai,!1),(0,o.A)(this,"version",3)}initialize(e){var t;if((0,a.A)(si,this))throw new Error("The runtime cannot be initialized more than once");(0,s.A)(si,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),ei=e;const{notification:n,dialog:r}=ui();var o;!1!==n&&(o=n??"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{Jt=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{Ht=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(r??"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?Qo({type:"brandColor",...e.brandColor}):e.baseColors?Qo({type:"baseColors",...e.baseColors}):e.variables&&Qo({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,a.A)(ai,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.A)(ai,this,!0),ti=new So(ei.storyboards),await ti.bootstrap()}getRecentApps(){var e;return(null===(e=ti)||void 0===e?void 0:e.getRecentApps())??{}}getCurrentApp(){var e;return null===(e=ti)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return ze(e,t)}getFeatureFlags(){var e,t;return{...null===(e=ei)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=ti)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=ei)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=ti)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=ei)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=ei)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e;return(null===(e=ei)||void 0===e?void 0:e.desktops)??[]}getLaunchpadSiteMap(){var e;return(null===(e=ei)||void 0===e?void 0:e.siteSort)??[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=ti)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=ti)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,l.loadBricksImperatively)(e,li())}}function li(){var e;return ni??(ni=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}((null===(e=ei)||void 0===e?void 0:e.brickPackages)??Oo??window.STANDALONE_BRICK_PACKAGES??[],window.PUBLIC_DEPS))}function ui(){var e;return(null===(e=ei)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.presetBricks)??{}}function di(){var e;return null===(e=ti)||void 0===e?void 0:e.getRenderId()}function pi(){var e;return null===(e=ti)||void 0===e?void 0:e.getRuntimeContext()}function fi(e){var t;return null===(t=ei)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function hi(e){var t;return null===(t=fi(e))||void 0===t?void 0:t.app}function mi(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==ri||null===(e=ri.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function gi(){var e;return null==ri||null===(e=ri.auth)||void 0===e?void 0:e.getAuth()}function vi(){var e,t;return null==ri||null===(e=ri.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function yi(){var e;return null==ri||null===(e=ri.auth)||void 0===e?void 0:e.isLoggedIn()}var wi=new WeakMap;const bi=new class{constructor(){(0,i.A)(this,wi,new Map)}define(e,t){(0,a.A)(wi,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,a.A)(wi,this).set(e,t)}get(e){return(0,a.A)(wi,this).get(e)}};async function Ei(e,t,n){return nt(await Xe(e),e,"resolve",t,n)}function Si(e){let t,{portal:n,scope:r="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n;t=n||(()=>(i=document.createElement("div"),i.style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));let s,a,l=!1;return{async render(n){let{theme:u,uiVersion:d,language:p,context:f,functions:m,templates:g,i18n:v,url:y,app:w}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");const b=[].concat(n),E=s,S=(0,h.uniqueId)("render-id-");s=new Kn(r,{unknownBricks:o,renderId:S});const A={ctxStore:new Tr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(y){const e=new URL(y);A.query=e.searchParams,A.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const k={tag:Rn.ROOT,container:e,createPortal:t};if("page"===r){var I;Q(u??"light"),ie("default"),ao(d),p&&await c.i18n.changeLanguage(p),w??(w={id:"demo",homepage:"/demo"}),A.app=w;const e={app:w,meta:{i18n:v,customTemplates:g}};null===(I=a)||void 0===I||I(),a=L(e),so(e),me(m,w)}A.ctxStore.define(f,A);let C,R=!1,O=[];try{C=await zr(k,b,A,s,[],{}),O=Yr(A),await Xr(C,A,O)}catch(e){R=!0,C={node:await Hr(e,k,"page"===r),blockingList:[]}}if(k.child=C.node,null==E||E.dispatchOnUnmount(),null==E||E.dispose(),On(e),i&&On(i),"page"===r&&(R||s.dispatchBeforePageLoad(),te(),ae()),Tn(k),"page"===r&&window.scrollTo(0,0),!R){for(const e of O)e.mountAsyncData();"page"===r&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}},unmount(){l||(l=!0,On(e),i&&(On(i),n||i.remove()))}}}function Ai(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...pi()};t&&(n.query=new URLSearchParams(k().location.search));const r=t=>{if("string"==typeof t){if((0,O.isEvaluable)(t)){const e=ut(t,n);return Qe(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||Ze(e)?t:Array.isArray(t)?t.map((e=>r(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[r(t),r(n)]})))};return r(e)}}}]);
3
- //# sourceMappingURL=718.3f0afc76.js.map