@next-bricks/diagram 0.32.0 → 0.32.3

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