@next-bricks/diagram 0.42.11 → 0.42.12

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 (75) hide show
  1. package/dist/bricks.json +3 -3
  2. package/dist/chunks/{1122.97ee7474.js → 1122.dea87200.js} +2 -2
  3. package/dist/chunks/{1122.97ee7474.js.map → 1122.dea87200.js.map} +1 -1
  4. package/dist/chunks/{114.9d0b78d2.js → 114.d27688d7.js} +2 -2
  5. package/dist/chunks/{114.9d0b78d2.js.map → 114.d27688d7.js.map} +1 -1
  6. package/dist/chunks/1371.226b7bfe.js +2 -0
  7. package/dist/chunks/{1371.4d56b3dc.js.map → 1371.226b7bfe.js.map} +1 -1
  8. package/dist/chunks/{1940.3fa9b819.js → 1940.e1fdb1c6.js} +2 -2
  9. package/dist/chunks/{1940.3fa9b819.js.map → 1940.e1fdb1c6.js.map} +1 -1
  10. package/dist/chunks/{2277.642aada3.js → 2277.0b3548af.js} +2 -2
  11. package/dist/chunks/{4658.ff7efb11.js.map → 2277.0b3548af.js.map} +1 -1
  12. package/dist/chunks/2416.f25f772b.js +2 -0
  13. package/dist/chunks/{2416.1dd136d0.js.map → 2416.f25f772b.js.map} +1 -1
  14. package/dist/chunks/{3171.9a74d0e1.js → 3171.633b30e8.js} +2 -2
  15. package/dist/chunks/{3171.9a74d0e1.js.map → 3171.633b30e8.js.map} +1 -1
  16. package/dist/chunks/3489.c2223b1c.js +3 -0
  17. package/dist/chunks/{3489.e0ce6106.js.map → 3489.c2223b1c.js.map} +1 -1
  18. package/dist/chunks/3933.fca8ae82.js +2 -0
  19. package/dist/chunks/{6314.d82ad8ed.js.map → 3933.fca8ae82.js.map} +1 -1
  20. package/dist/chunks/4017.c7b74992.js +3 -0
  21. package/dist/chunks/{4017.2680d65a.js.map → 4017.c7b74992.js.map} +1 -1
  22. package/dist/chunks/{4658.ff7efb11.js → 4658.d4d0115b.js} +2 -2
  23. package/dist/chunks/{2277.642aada3.js.map → 4658.d4d0115b.js.map} +1 -1
  24. package/dist/chunks/4837.44f22425.js +2 -0
  25. package/dist/chunks/{7218.3cc8b20d.js.map → 4837.44f22425.js.map} +1 -1
  26. package/dist/chunks/{5552.69fe3835.js → 5552.ad11237e.js} +2 -2
  27. package/dist/chunks/{5552.69fe3835.js.map → 5552.ad11237e.js.map} +1 -1
  28. package/dist/chunks/6314.f35cc928.js +2 -0
  29. package/dist/chunks/{3933.e4f7efe6.js.map → 6314.f35cc928.js.map} +1 -1
  30. package/dist/chunks/7218.6822e904.js +2 -0
  31. package/dist/chunks/{4837.ac3853bb.js.map → 7218.6822e904.js.map} +1 -1
  32. package/dist/chunks/{7733.a27200f8.js → 7733.e752ca8f.js} +2 -2
  33. package/dist/chunks/{7733.a27200f8.js.map → 7733.e752ca8f.js.map} +1 -1
  34. package/dist/chunks/799.5e6749ba.js +3 -0
  35. package/dist/chunks/799.5e6749ba.js.map +1 -0
  36. package/dist/chunks/{9559.436645e2.js → 9559.1cd5e0b2.js} +2 -2
  37. package/dist/chunks/{9559.436645e2.js.map → 9559.1cd5e0b2.js.map} +1 -1
  38. package/dist/chunks/{editable-label.a3d1d983.js → editable-label.e65ba20e.js} +3 -3
  39. package/dist/chunks/{editable-label.a3d1d983.js.map → editable-label.e65ba20e.js.map} +1 -1
  40. package/dist/chunks/{eo-diagram.261eb2d9.js → eo-diagram.e353ce7a.js} +2 -2
  41. package/dist/chunks/{eo-diagram.261eb2d9.js.map → eo-diagram.e353ce7a.js.map} +1 -1
  42. package/dist/chunks/eo-display-canvas.ccd2cce0.js +2 -0
  43. package/dist/chunks/{eo-display-canvas.e43ca2e5.js.map → eo-display-canvas.ccd2cce0.js.map} +1 -1
  44. package/dist/chunks/eo-draw-canvas.5d50938b.js +2 -0
  45. package/dist/chunks/{eo-draw-canvas.91b46e0d.js.map → eo-draw-canvas.5d50938b.js.map} +1 -1
  46. package/dist/chunks/{experimental-node.c9bb5135.js → experimental-node.ff43315f.js} +2 -2
  47. package/dist/chunks/{experimental-node.c9bb5135.js.map → experimental-node.ff43315f.js.map} +1 -1
  48. package/dist/chunks/main.5cfa7eee.js +2 -0
  49. package/dist/chunks/main.5cfa7eee.js.map +1 -0
  50. package/dist/examples.json +5 -5
  51. package/dist/index.820bfcb6.js +2 -0
  52. package/dist/index.820bfcb6.js.map +1 -0
  53. package/dist/manifest.json +181 -181
  54. package/dist/types.json +3222 -3222
  55. package/package.json +4 -4
  56. package/dist/chunks/1371.4d56b3dc.js +0 -2
  57. package/dist/chunks/2416.1dd136d0.js +0 -2
  58. package/dist/chunks/3489.e0ce6106.js +0 -3
  59. package/dist/chunks/3933.e4f7efe6.js +0 -2
  60. package/dist/chunks/4017.2680d65a.js +0 -3
  61. package/dist/chunks/4837.ac3853bb.js +0 -2
  62. package/dist/chunks/6314.d82ad8ed.js +0 -2
  63. package/dist/chunks/7218.3cc8b20d.js +0 -2
  64. package/dist/chunks/799.0d07ef57.js +0 -3
  65. package/dist/chunks/799.0d07ef57.js.map +0 -1
  66. package/dist/chunks/eo-display-canvas.e43ca2e5.js +0 -2
  67. package/dist/chunks/eo-draw-canvas.91b46e0d.js +0 -2
  68. package/dist/chunks/main.4e79d4df.js +0 -2
  69. package/dist/chunks/main.4e79d4df.js.map +0 -1
  70. package/dist/index.4a8ba3c2.js +0 -2
  71. package/dist/index.4a8ba3c2.js.map +0 -1
  72. /package/dist/chunks/{3489.e0ce6106.js.LICENSE.txt → 3489.c2223b1c.js.LICENSE.txt} +0 -0
  73. /package/dist/chunks/{4017.2680d65a.js.LICENSE.txt → 4017.c7b74992.js.LICENSE.txt} +0 -0
  74. /package/dist/chunks/{799.0d07ef57.js.LICENSE.txt → 799.5e6749ba.js.LICENSE.txt} +0 -0
  75. /package/dist/chunks/{editable-label.a3d1d983.js.LICENSE.txt → editable-label.e65ba20e.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 4017.2680d65a.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[4017,8939],{9711:(e,t,n)=>{n.r(t);var a,i=n(4635),s=n(918),l=n(6902),o=n(5536),r=n(6121),h=n(829),c=n(2740),d=n(8769),u=n.n(d),p=n(4782),g=n(1389),A=(n(6477),n(7566)),f=n(9047),y=n(3373),v=n.n(y),b=n(1030),m=n(9126),k=n(8892),w=n(5157),_=n(8308),x=n(9576),M=n(9137),C=n(2547),E=n(1803),N=n(3739),W=n(9191),T=n(6671),R=n(8060),S=n(2448),z=n(8657),$=n(8069),L=n(1324),B=n(821),D=n(9741),P=n(2673),O=n(5987);let H,I,K,U,Y,V,j,X,q,F,Z,J,G,Q,ee,te,ne,ae,ie,se,le,oe,re,he,ce,de,ue,pe,ge,Ae,fe,ye,ve,be,me,ke,we,_e,xe,Me,Ce,Ee,Ne,We,Te,Re,Se,ze,$e,Le,Be,De,Pe,Oe;const{defineElement:He,property:Ie,event:Ke,method:Ue}=(0,p.createDecorators)(),Ye=(0,d.forwardRef)(wt);let Ve;var je=new WeakMap,Xe=new WeakMap,qe=new WeakMap,Fe=new WeakMap,Ze=new WeakMap,Je=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,at=new WeakMap,it=new WeakMap,st=new WeakMap,lt=new WeakMap,ot=new WeakSet,rt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,At=new WeakMap,ft=new WeakMap,yt=new WeakMap,vt=new WeakMap,bt=new WeakMap,mt=new WeakMap;class kt extends g.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,ot),(0,s.A)(this,je,(H(this),K(this))),(0,s.A)(this,Xe,(U(this),Y(this))),(0,s.A)(this,qe,(V(this),j(this))),(0,s.A)(this,Fe,(X(this),q(this))),(0,s.A)(this,Ze,(F(this),Z(this))),(0,s.A)(this,Je,(J(this),G(this))),(0,s.A)(this,Ge,(Q(this),ee(this))),(0,s.A)(this,Qe,(te(this),ne(this))),(0,s.A)(this,et,(ae(this),ie(this))),(0,s.A)(this,tt,(se(this),le(this))),(0,s.A)(this,nt,(oe(this),re(this,!0))),(0,s.A)(this,at,(he(this),ce(this,!0))),(0,s.A)(this,it,(de(this),ue(this,!0))),(0,s.A)(this,st,(pe(this),ge(this))),(0,s.A)(this,lt,(Ae(this),fe(this))),(0,s.A)(this,rt,(be(this),e=>{(0,o.A)(ot,this,ye).emit(e)})),(0,s.A)(this,ht,me(this)),(0,s.A)(this,ct,(_e(this),e=>{(0,o.A)(ot,this,ke).emit(e)})),(0,s.A)(this,dt,xe(this)),(0,s.A)(this,ut,(Ee(this),e=>{(0,o.A)(ot,this,Me).emit(e)})),(0,s.A)(this,pt,Ne(this)),(0,s.A)(this,gt,(Re(this),e=>{(0,o.A)(ot,this,We).emit(e)})),(0,s.A)(this,At,Se(this)),(0,s.A)(this,ft,(Le(this),e=>{(0,o.A)(ot,this,ze).emit(e)})),(0,s.A)(this,yt,Be(this)),(0,s.A)(this,vt,(Oe(this),e=>{(0,o.A)(ot,this,De).emit(e)})),(0,s.A)(this,bt,(e=>{(0,P.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,mt,(0,d.createRef)())}get layout(){return(0,h.A)(je,this)}set layout(e){(0,r.A)(je,this,e)}get nodes(){return(0,h.A)(Xe,this)}set nodes(e){(0,r.A)(Xe,this,e)}get edges(){return(0,h.A)(qe,this)}set edges(e){(0,r.A)(qe,this,e)}get nodeBricks(){return(0,h.A)(Fe,this)}set nodeBricks(e){(0,r.A)(Fe,this,e)}get lines(){return(0,h.A)(Ze,this)}set lines(e){(0,r.A)(Ze,this,e)}get layoutOptions(){return(0,h.A)(Je,this)}set layoutOptions(e){(0,r.A)(Je,this,e)}get activeTarget(){return(0,h.A)(Ge,this)}set activeTarget(e){(0,r.A)(Ge,this,e)}get disableKeyboardAction(){return(0,h.A)(Qe,this)}set disableKeyboardAction(e){(0,r.A)(Qe,this,e)}get connectNodes(){return(0,h.A)(et,this)}set connectNodes(e){(0,r.A)(et,this,e)}get dragNodes(){return(0,h.A)(tt,this)}set dragNodes(e){(0,r.A)(tt,this,e)}get zoomable(){return(0,h.A)(nt,this)}set zoomable(e){(0,r.A)(nt,this,e)}get scrollable(){return(0,h.A)(at,this)}set scrollable(e){(0,r.A)(at,this,e)}get pannable(){return(0,h.A)(it,this)}set pannable(e){(0,r.A)(it,this,e)}get scaleRange(){return(0,h.A)(st,this)}set scaleRange(e){(0,r.A)(st,this,e)}callOnLineLabel(e,t){for(var n,a=arguments.length,i=new Array(a>2?a-2:0),s=2;s<a;s++)i[s-2]=arguments[s];null===(n=(0,h.A)(mt,this).current)||void 0===n||n.callOnLineLabel(e,t,...i)}render(){return u().createElement(Ye,{ref:(0,h.A)(mt,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(rt,this),onSwitchActiveTarget:(0,h.A)(bt,this),onNodeDelete:(0,h.A)(ct,this),onEdgeDelete:(0,h.A)(ut,this),onLineClick:(0,h.A)(gt,this),onLineDoubleClick:(0,h.A)(ft,this),onNodesConnect:(0,h.A)(vt,this)})}}function wt(e,t){let{layout:n,nodes:a,edges:i,nodeBricks:s,lines:l,layoutOptions:o,connectNodes:r,dragNodes:h,activeTarget:c,disableKeyboardAction:p,zoomable:g,scrollable:y,pannable:B,scaleRange:H,onActiveTargetChange:I,onSwitchActiveTarget:K,onNodeDelete:U,onEdgeDelete:Y,onLineClick:V,onLineDoubleClick:j,onNodesConnect:X}=e;const[q,F]=(0,d.useState)(!1),[Z,J]=(0,d.useState)(0),[G,Q]=(0,d.useState)(null),[ee,te]=(0,d.useState)(!1),[ne,ae]=(0,d.useState)(0),[ie,se]=(0,d.useState)(null),[le,oe]=(0,d.useState)([]),[re,he]=(0,d.useState)(!1),[ce,de]=(0,d.useState)({k:1,x:0,y:0}),ue=(0,d.useRef)(new Map),pe=(0,d.useRef)(null),ge=(0,d.useRef)(null),[Ae,fe]=(0,d.useState)(!1),{userViewReady:ye,userViewNodesMap:ve,saveUserView:be}=(0,D._)(null==h?void 0:h.save),[me,ke]=(0,d.useState)([0,0]),[we,_e]=(0,d.useState)(null),[xe,Me]=(0,d.useState)("initial"),[Ce,Ee]=(0,d.useState)(null);(0,d.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,a=arguments.length,i=new Array(a>2?a-2:0),s=2;s<a;s++)i[s-2]=arguments[s];null==ie||null===(n=ie.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...i)}}))),(0,d.useEffect)((()=>{const e=e=>{(0,S.P)(e,{nodes:a,nodesRefRepository:G,connectNodes:r,dragNodes:h,scale:ce.k,setConnectLineState:_e,setConnectLineTo:ke,setManualLayoutStatus:Me,setNodeMovement:Ee,onSwitchActiveTarget:K,onNodesConnect:X})},t=ge.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[a,r,h,ce.k,G,X,K]);const{normalizedLines:Ne,normalizedLinesMap:We,markers:Te}=(0,d.useMemo)((()=>(0,M.t)(i,l)),[i,l]),Re=(0,d.useMemo)((()=>Ne.flatMap((e=>{let t,n,{line:{text:a,label:i,$id:s},edge:l}=e;return a||i?(i?(t="label",n=[].concat(i)):(t="text",n=[].concat(a)),n.map((e=>({[t]:e,id:`${s}-${e.placement??"center"}`,edge:l})))):[]}))),[Ne]),{nodes:Se,edges:ze}=(0,$.o)({layout:n,nodes:a,edges:i,manualLayoutStatus:xe,userViewReady:ye,userViewNodesMap:ve,nodeMovement:Ce,nodesRefRepository:G,lineLabelsRefRepository:ie,normalizedLinesMap:We,layoutOptions:o,nodesRenderId:Z,lineLabelsRenderId:ne});(0,d.useEffect)((()=>{"finished"===xe&&be(Se.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[xe]);const $e=(0,d.useMemo)((()=>(0,x.R)(ze,Se,Ne)),[Ne,Se,ze]),Le=c??null,[Be,De]=(0,d.useState)(Le);(0,d.useEffect)((()=>{De((e=>(0,P.c)(e,Le)?e:Le))}),[Le]);const Pe=(0,d.useRef)(!1);(0,d.useEffect)((()=>{Pe.current?null==I||I(Be):Pe.current=!0}),[Be,I]),(0,d.useEffect)((()=>{const e=pe.current;if(!e||p)return;const t=e=>{const t=(0,w.a)(e,{renderedNodes:Se,activeTarget:Be});"delete-node"===(null==t?void 0:t.action)?null==U||U(t.node):"delete-edge"===(null==t?void 0:t.action)?null==Y||Y(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==K||K({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Be,Se,p,K,U,Y]);const Oe=(0,d.useCallback)((e=>{e&&(J((e=>e+1)),Q(e)),F((t=>t||!!e))}),[]),He=(0,d.useCallback)((e=>{e&&(ae((e=>e+1)),se(e)),te((t=>t||!!e))}),[]),Ie=(0,d.useMemo)((()=>H??[z.sS,z.Yt]),[H]),Ke=(0,d.useMemo)((()=>(0,f.s_)()),[]);(0,d.useEffect)((()=>{let e=!1;Ke.scaleExtent(g?Ie:[1,1]).on("start",(()=>{e=!1,he(!0)})).on("zoom",(t=>{e=!0,de(t.transform)})).on("end",(()=>{he(!1),e||null==K||K(null)}))}),[K,Ie,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(!e)return;const t=(0,A.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(g||y||B)return(g||y)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),y&&(e.preventDefault(),Ke.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ke).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),B||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}),[B,y,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(0===Se.length||!e||Ae)return;const{k:t,x:n,y:a}=(0,_.r)(Se,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:g?Ie:void 0});Ke.transform((0,A.A)(e),new f.uV(t,n,a)),fe(!0)}),[Ae,Se,Ie,g,Ke]);const Ue=(0,d.useMemo)((()=>`${(0,b.uniqueId)("diagram-")}-`),[]),Ye=`${Ue}line-arrow-`,Ve=`${Ue}mask-`,je=`${Ue}active-line-`;(0,d.useEffect)((()=>{oe((e=>(0,R.z)(e,$e,ue.current)))}),[$e]);const[Xe,qe]=u().useState(new Map);return(0,d.useEffect)((()=>{if(!ie)return;(0,L.F)(le,ie);const e=new m.A((()=>{qe((0,O.G)(le,ie))}));for(const t of ie.values())e.observe(t);return()=>{e.disconnect()}}),[ne,ie,le]),"dagre"!==n&&"force"!==n?u().createElement("div",null,`Diagram layout not supported: "${n}"`):u().createElement("div",{className:v()("diagram",{ready:q&&Ae,grabbing:re,pannable:B}),tabIndex:-1,ref:pe},u().createElement("svg",{width:"100%",height:"100%",className:"lines"},u().createElement("defs",null,Te.map(((e,t)=>{let{type:n,strokeColor:a}=e;return u().createElement(N.c,{key:t,id:`${Ye}${t}`,type:n,strokeColor:a})})),[...Xe].map((e=>{let[t,n]=e;return u().createElement(W.y,{key:t,lineId:t,rects:n,maskPrefix:Ve,renderedLineLabels:le})})),u().createElement("marker",{id:`${je}start`,viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),u().createElement("marker",{id:`${je}end`,viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),u().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),u().createElement("g",{transform:`translate(${ce.x} ${ce.y}) scale(${ce.k})`},$e.map((e=>u().createElement(E.m,{key:e.line.$id,line:e,linePaths:ue.current,lineMaskRects:Xe,maskPrefix:Ve,markerPrefix:Ye,activeLineMarkerPrefix:je,active:"edge"===(null==Be?void 0:Be.type)&&Be.edge.source===e.edge.source&&Be.edge.target===e.edge.target,activeRelated:"node"===(null==Be?void 0:Be.type)&&(e.edge.source===Be.nodeId||e.edge.target===Be.nodeId),onLineClick:V,onLineDoubleClick:j}))))),u().createElement("div",{className:v()("line-labels",{ready:ee}),style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(C.d2,{labels:Re,onRendered:He})),u().createElement("div",{className:"nodes",ref:ge,style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(k.p,{nodes:a,nodeBricks:s,onRendered:Oe})),u().createElement(T.w,{connectLineState:we,connectLineTo:me,markerPrefix:Ye}))}a=kt,({e:[K,U,Y,V,j,X,q,F,Z,J,G,Q,ee,te,ne,ae,ie,se,le,oe,re,he,ce,de,ue,pe,ge,Ae,fe,ye,ve,be,me,ke,we,_e,xe,Me,Ce,Ee,Ne,We,Te,Re,Se,ze,$e,Le,Be,De,Pe,Oe,H],c:[Ve,I]}=(0,c.A)(a,[He("eo-diagram",{styleTexts:[B.A]})],[[Ie({type:String}),1,"layout"],[Ie({attribute:!1}),1,"nodes"],[Ie({attribute:!1}),1,"edges"],[Ie({attribute:!1}),1,"nodeBricks"],[Ie({attribute:!1}),1,"lines"],[Ie({attribute:!1}),1,"layoutOptions"],[Ie({attribute:!1}),1,"activeTarget"],[Ie({type:Boolean}),1,"disableKeyboardAction"],[Ie({attribute:!1}),1,"connectNodes"],[Ie({attribute:!1}),1,"dragNodes"],[Ie({type:Boolean}),1,"zoomable"],[Ie({type:Boolean}),1,"scrollable"],[Ie({type:Boolean}),1,"pannable"],[Ie({attribute:!1}),1,"scaleRange"],[Ke({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(lt,e),(e,t)=>(0,r.A)(lt,e,t)],[Ke({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)(ht,e),(e,t)=>(0,r.A)(ht,e,t)],[Ke({type:"edge.delete"}),1,"edgeDelete",e=>(0,h.A)(dt,e),(e,t)=>(0,r.A)(dt,e,t)],[Ke({type:"line.click"}),1,"lineClick",e=>(0,h.A)(pt,e),(e,t)=>(0,r.A)(pt,e,t)],[Ke({type:"line.dblclick"}),1,"lineDoubleClick",e=>(0,h.A)(At,e),(e,t)=>(0,r.A)(At,e,t)],[Ke({type:"nodes.connect"}),1,"connectNodes",e=>(0,h.A)(yt,e),(e,t)=>(0,r.A)(yt,e,t)],[Ue(),2,"callOnLineLabel"]],0,(e=>mt.has((0,l.A)(e))),g.ReactNextElement)),I();var _t,xt=n(3971);let Mt,Ct,Et,Nt,Wt,Tt,Rt,St,zt,$t,Lt,Bt,Dt,Pt;const{defineElement:Ot,property:Ht,event:It,method:Kt}=(0,p.createDecorators)(),Ut=(0,d.forwardRef)(en);let Yt;var Vt=new WeakMap,jt=new WeakMap,Xt=new WeakMap,qt=new WeakSet,Ft=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,Gt=new WeakMap;class Qt extends g.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,qt),(0,s.A)(this,Vt,(Mt(this),Et(this))),(0,s.A)(this,jt,(Nt(this),Wt(this))),(0,s.A)(this,Xt,(Tt(this),Rt(this))),(0,s.A)(this,Ft,($t(this),e=>{(0,o.A)(qt,this,St).emit(e)})),(0,s.A)(this,Zt,Lt(this)),(0,s.A)(this,Jt,(Pt(this),e=>{(0,o.A)(qt,this,Bt).emit(e)})),(0,s.A)(this,Gt,(0,d.createRef)())}get label(){return(0,h.A)(Vt,this)}set label(e){(0,r.A)(Vt,this,e)}get type(){return(0,h.A)(jt,this)}set type(e){(0,r.A)(jt,this,e)}enableEditing(){var e;null===(e=(0,h.A)(Gt,this).current)||void 0===e||e.enableEditing()}render(){return u().createElement(Ut,{ref:(0,h.A)(Gt,this),label:this.label,onLabelEditingChange:(0,h.A)(Ft,this),onLabelChange:(0,h.A)(Jt,this)})}}function en(e,t){let{label:n,onLabelChange:a,onLabelEditingChange:i}=e;const s=n??"",[l,o]=(0,d.useState)(s),[r,h]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[p,g]=(0,d.useState)(!1),A=(0,d.useRef)(null);(0,d.useImperativeHandle)(t,(()=>({enableEditing(){h(!0)}}))),(0,d.useEffect)((()=>{o(s)}),[s]);const f=(0,d.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),h(!0)}),[]);(0,d.useEffect)((()=>{var e,t;r&&(null===(e=A.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=A.current)||void 0===t||t.select())}),[r]),(0,d.useEffect)((()=>{c.current?null==i||i(r):c.current=!0}),[r,i]);const y=(0,d.useCallback)((e=>{o(e.target.value)}),[]),b=(0,d.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=A.current)||void 0===n||n.blur()}),[]),m=(0,d.useCallback)((()=>{h(!1),g(!0)}),[]);(0,d.useEffect)((()=>{p&&(null==a||a(l),g(!1))}),[l,a,p]);const k=(0,d.useCallback)((e=>{e.stopPropagation()}),[]);return u().createElement("div",{className:v()("label",{editing:r,empty:!l}),onDoubleClick:k,onMouseDown:k},u().createElement("input",{className:"label-input",value:l,ref:A,onChange:y,onKeyDown:b,onBlur:m}),u().createElement("div",{className:"label-text",onDoubleClick:f},l))}_t=Qt,({e:[Et,Nt,Wt,Tt,Rt,St,zt,$t,Lt,Bt,Dt,Pt,Mt],c:[Yt,Ct]}=(0,c.A)(_t,[Ot("diagram.editable-label",{styleTexts:[xt.A]})],[[Ht(),1,"label"],[Ht({render:!1}),1,"type"],[It({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,h.A)(Xt,e),(e,t)=>(0,r.A)(Xt,e,t)],[It({type:"label.change"}),1,"labelChange",e=>(0,h.A)(Zt,e),(e,t)=>(0,r.A)(Zt,e,t)],[Kt(),2,"enableEditing"]],0,(e=>Gt.has((0,l.A)(e))),g.ReactNextElement)),Ct(),n(9068);var tn,nn=n(497);let an,sn,ln,on,rn,hn,cn,dn,un,pn,gn,An,fn,yn,vn,bn,mn,kn,wn;const{defineElement:_n,property:xn,event:Mn}=(0,p.createDecorators)();let Cn;var En=new WeakMap,Nn=new WeakMap,Wn=new WeakMap,Tn=new WeakMap,Rn=new WeakSet,Sn=new WeakMap,zn=new WeakMap,$n=new WeakMap,Ln=new WeakMap,Bn=new WeakMap;class Dn extends g.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Rn),(0,s.A)(this,En,sn(this)),(0,s.A)(this,Nn,(ln(this),on(this))),(0,s.A)(this,Wn,(rn(this),hn(this))),(0,s.A)(this,Tn,(cn(this),dn(this))),(0,s.A)(this,Sn,(gn(this),e=>{(0,o.A)(Rn,this,un).emit(e)})),(0,s.A)(this,zn,An(this)),(0,s.A)(this,$n,(vn(this),e=>{(0,o.A)(Rn,this,fn).emit(e)})),(0,s.A)(this,Ln,bn(this)),(0,s.A)(this,Bn,(wn(this),e=>{(0,o.A)(Rn,this,mn).emit(e)}))}get usage(){return(0,h.A)(En,this)}set usage(e){(0,r.A)(En,this,e)}get status(){return(0,h.A)(Nn,this)}set status(e){(0,r.A)(Nn,this,e)}get decorator(){return(0,h.A)(Wn,this)}set decorator(e){(0,r.A)(Wn,this,e)}render(){return u().createElement(Pn,{usage:this.usage,onDragStart:(0,h.A)(Sn,this),onDragMove:(0,h.A)($n,this),onDragEnd:(0,h.A)(Bn,this)})}}function Pn(e){let{usage:t,onDragStart:n,onDragMove:a,onDragEnd:i}=e;const s=(0,d.useCallback)((e=>{if("library"!==t)return;e.stopPropagation(),e.preventDefault();const s=[e.clientX,e.clientY];let l=!1;const o=e=>{l||(l=(e.clientX-s[0])**2+(e.clientY-s[1])**2>=9,l&&(null==n||n([e.clientX,e.clientY]))),l&&(null==a||a([e.clientX,e.clientY]))},r=e=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),l&&(null==i||i([e.clientX,e.clientY]))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}),[i,a,n,t]);return u().createElement("div",{onMouseDown:s},u().createElement("slot",null))}tn=Dn,({e:[sn,ln,on,rn,hn,cn,dn,un,pn,gn,An,fn,yn,vn,bn,mn,kn,wn],c:[Cn,an]}=(0,c.A)(tn,[_n("diagram.experimental-node",{styleTexts:[nn.A]})],[[xn(),1,"usage"],[xn({type:String,render:!1}),1,"status"],[xn({type:String}),1,"decorator"],[Mn({type:"drag.start"}),1,"dragStartEvent",e=>(0,h.A)(Tn,e),(e,t)=>(0,r.A)(Tn,e,t)],[Mn({type:"drag.move"}),1,"dragMoveEvent",e=>(0,h.A)(zn,e),(e,t)=>(0,r.A)(zn,e,t)],[Mn({type:"drag.end"}),1,"dragEndEvent",e=>(0,h.A)(Ln,e),(e,t)=>(0,r.A)(Ln,e,t)]],0,(e=>Bn.has((0,l.A)(e))),g.ReactNextElement)),an();var On,Hn=n(8185),In=n(2140),Kn=n(3783),Un=n(3033),Yn=n(8091),Vn=n(1819),jn=n(5748),Xn=n(227),qn=n(531),Fn=n(7099),Zn=n(1484),Jn=n(8197),Gn=n(7531),Qn=n(2098),ea=n(3012),ta=n(6237);let na,aa,ia,sa,la,oa,ra,ha,ca,da,ua,pa,ga,Aa,fa,ya,va,ba,ma,ka,wa,_a,xa,Ma,Ca,Ea,Na,Wa,Ta,Ra,Sa,za,$a,La,Ba,Da,Pa,Oa,Ha,Ia,Ka;const{defineElement:Ua,property:Ya,event:Va}=(0,p.createDecorators)();let ja;var Xa=new WeakMap,qa=new WeakMap,Fa=new WeakMap,Za=new WeakMap,Ja=new WeakMap,Ga=new WeakMap,Qa=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ai=new WeakMap,ii=new WeakMap,si=new WeakMap,li=new WeakMap,oi=new WeakMap,ri=new WeakSet,hi=new WeakMap,ci=new WeakMap,di=new WeakMap,ui=new WeakMap,pi=new WeakMap,gi=new WeakMap;class Ai extends g.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,ri),(0,s.A)(this,Xa,aa(this)),(0,s.A)(this,qa,(ia(this),sa(this))),(0,s.A)(this,Fa,(la(this),oa(this))),(0,s.A)(this,Za,(ra(this),ha(this,[Un.HP,Un.HP]))),(0,s.A)(this,Ja,(ca(this),da(this))),(0,s.A)(this,Ga,(ua(this),pa(this))),(0,s.A)(this,Qa,(ga(this),Aa(this))),(0,s.A)(this,ei,(fa(this),ya(this))),(0,s.A)(this,ti,(va(this),ba(this))),(0,s.A)(this,ni,(ma(this),ka(this))),(0,s.A)(this,ai,(wa(this),_a(this,!0))),(0,s.A)(this,ii,(xa(this),Ma(this,!0))),(0,s.A)(this,si,(Ca(this),Ea(this,!0))),(0,s.A)(this,li,(Na(this),Wa(this))),(0,s.A)(this,oi,(Ta(this),Ra(this))),(0,s.A)(this,hi,($a(this),e=>{(0,o.A)(ri,this,Sa).emit(e)})),(0,s.A)(this,ci,(e=>{(0,Hn.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,di,La(this)),(0,s.A)(this,ui,(Pa(this),e=>{(0,o.A)(ri,this,Ba).emit(e)})),(0,s.A)(this,pi,Oa(this)),(0,s.A)(this,gi,(Ka(this),e=>{(0,o.A)(ri,this,Ha).emit(e)}))}get cells(){return(0,h.A)(Xa,this)}set cells(e){(0,r.A)(Xa,this,e)}get layout(){return(0,h.A)(qa,this)}set layout(e){(0,r.A)(qa,this,e)}get layoutOptions(){return(0,h.A)(Fa,this)}set layoutOptions(e){(0,r.A)(Fa,this,e)}get defaultNodeSize(){return(0,h.A)(Za,this)}set defaultNodeSize(e){(0,r.A)(Za,this,e)}get defaultNodeBricks(){return(0,h.A)(Ja,this)}set defaultNodeBricks(e){(0,r.A)(Ja,this,e)}get degradedThreshold(){return(0,h.A)(Ga,this)}set degradedThreshold(e){(0,r.A)(Ga,this,e)}get degradedNodeLabel(){return(0,h.A)(Qa,this)}set degradedNodeLabel(e){(0,r.A)(Qa,this,e)}get defaultEdgeLines(){return(0,h.A)(ei,this)}set defaultEdgeLines(e){(0,r.A)(ei,this,e)}get activeTarget(){return(0,h.A)(ti,this)}set activeTarget(e){(0,r.A)(ti,this,e)}get fadeUnrelatedCells(){return(0,h.A)(ni,this)}set fadeUnrelatedCells(e){(0,r.A)(ni,this,e)}get zoomable(){return(0,h.A)(ai,this)}set zoomable(e){(0,r.A)(ai,this,e)}get scrollable(){return(0,h.A)(ii,this)}set scrollable(e){(0,r.A)(ii,this,e)}get pannable(){return(0,h.A)(si,this)}set pannable(e){(0,r.A)(si,this,e)}get scaleRange(){return(0,h.A)(li,this)}set scaleRange(e){(0,r.A)(li,this,e)}render(){return u().createElement(fi,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(hi,this),onSwitchActiveTarget:(0,h.A)(ci,this),onCellContextMenu:(0,h.A)(ui,this),onCellClick:(0,h.A)(gi,this)})}}function fi(e){let{shadowRoot:t,cells:n,layout:a,layoutOptions:i,defaultNodeSize:s,defaultNodeBricks:l,defaultEdgeLines:o,degradedThreshold:r,degradedNodeLabel:h,activeTarget:c,fadeUnrelatedCells:p,zoomable:g,scrollable:f,pannable:y,scaleRange:m,onActiveTargetChange:k,onSwitchActiveTarget:w,onCellContextMenu:_,onCellClick:x}=e;const[{cells:M,layoutKey:C},E]=(0,d.useReducer)(jn.d,n,(e=>({cells:(0,Kn.C)(e,{defaultNodeSize:s}),layoutKey:1}))),W=(0,d.useMemo)((()=>M.filter(qn.N).length>=(r??Un.pC)),[M,r]),T=(0,d.useRef)(null),R=(0,d.useRef)(null),{grabbing:S,transform:z,zoomer:$,scaleRange:L}=(0,Yn.f)({rootRef:T,zoomable:g,scrollable:f,pannable:y,draggable:!0,scaleRange:m,onSwitchActiveTarget:w}),{centered:B,setCentered:D,getNextLayoutKey:P}=(0,Zn.g)({layout:a,layoutOptions:i,rootRef:T,cells:M,zoomable:g,zoomer:$,scaleRange:L,layoutKey:C,dispatch:E}),O=(0,d.useCallback)((()=>{D(!1)}),[D]),H=(0,d.useRef)(n);(0,d.useEffect)((()=>{if(n!==H.current){H.current=n;const e=(0,Qn.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:s,layout:a,previousCells:M,cells:n,scaleRange:L,transform:z});E({type:"update-cells",payload:e.cells})}}),[M,s,n,a,L,t,z]);const I=(0,Vn.J)({cellsRef:R,activeTarget:c,onActiveTargetChange:k}),K=`${(0,d.useMemo)((()=>`${(0,b.uniqueId)("diagram-")}-`),[])}line-arrow-`,U=(0,d.useCallback)(((e,t)=>{E({type:"update-node-size",payload:{id:e,size:t},layoutKey:P()})}),[P]),[Y,V]=(0,d.useState)(null),j=(0,d.useCallback)((e=>{V(e)}),[]),X=(0,d.useCallback)((e=>{V((t=>t===e?null:t))}),[]),[q,F]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=p?(0,Xn.Y)(M,null,Y):[];F((t=>0===t.length&&0===e.length?t:e))}),[M,p,Y]);const Z=(0,d.useCallback)((e=>{$.scaleTo((0,A.A)(T.current),e/100)}),[$]),[J,G]=(0,Gn.d)({cells:M,defaultEdgeLines:o,markerPrefix:K}),Q=(0,Jn.H)({cells:M,layout:a,centered:B});return u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:T,className:v()("root",{grabbing:S,pannable:y,ready:Q}),tabIndex:-1},u().createElement("defs",null,G.map(((e,t)=>u().createElement(N.c,{key:t,id:`${K}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${z.x} ${z.y}) scale(${z.k})`},u().createElement("g",{className:"cells",ref:R},M.map((e=>u().createElement(In.m,{key:`${e.type}:${(0,qn.WW)(e)?`${e.source}~${e.target}`:e.id}`,layout:a,cell:e,cells:M,degraded:W,degradedNodeLabel:h,defaultNodeBricks:l,lineConfMap:J,transform:z,activeTarget:I,readOnly:!0,unrelatedCells:q,onSwitchActiveTarget:w,onCellContextMenu:_,onCellClick:x,onNodeBrickResize:U,onCellMouseEnter:p&&(0,qn.N)(e)?j:void 0,onCellMouseLeave:p&&(0,qn.N)(e)?X:void 0})))))),u().createElement(Fn.Y,{shadowRoot:t,scale:z.k,scaleRange:L,onZoomChange:Z,onReCenter:O}))}On=Ai,({e:[aa,ia,sa,la,oa,ra,ha,ca,da,ua,pa,ga,Aa,fa,ya,va,ba,ma,ka,wa,_a,xa,Ma,Ca,Ea,Na,Wa,Ta,Ra,Sa,za,$a,La,Ba,Da,Pa,Oa,Ha,Ia,Ka],c:[ja,na]}=(0,c.A)(On,[Ua("eo-display-canvas",{styleTexts:[ea.A,ta.A]})],[[Ya({attribute:!1}),1,"cells"],[Ya({type:String}),1,"layout"],[Ya({attribute:!1}),1,"layoutOptions"],[Ya({attribute:!1}),1,"defaultNodeSize"],[Ya({attribute:!1}),1,"defaultNodeBricks"],[Ya({type:Number}),1,"degradedThreshold"],[Ya({attribute:!1}),1,"degradedNodeLabel"],[Ya({attribute:!1}),1,"defaultEdgeLines"],[Ya({attribute:!1}),1,"activeTarget"],[Ya({type:Boolean}),1,"fadeUnrelatedCells"],[Ya({type:Boolean}),1,"zoomable"],[Ya({type:Boolean}),1,"scrollable"],[Ya({type:Boolean}),1,"pannable"],[Ya({attribute:!1}),1,"scaleRange"],[Va({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(oi,e),(e,t)=>(0,r.A)(oi,e,t)],[Va({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(di,e),(e,t)=>(0,r.A)(di,e,t)],[Va({type:"cell.click"}),1,"cellClick",e=>(0,h.A)(pi,e),(e,t)=>(0,r.A)(pi,e,t)]],0,(e=>gi.has((0,l.A)(e))),g.ReactNextElement)),na()},9068:(e,t,n)=>{n.d(t,{uuidV4:()=>kn});var a,i=n(4635),s=n(918),l=n(6902),o=n(2559),r=n(5536),h=n(6121),c=n(829),d=n(2740),u=n(8769),p=n.n(u),g=n(4782),A=n(1389),f=n(279),y=(n(6477),n(1030)),v=n(3373),b=n.n(v),m=n(7566),k=n(5748),w=n(3739),_=n(531),x=n(8185),M=n(5114),C=n(2140),E=n(3639),N=n(3783),W=n(2098),T=n(227),R=n(3033),S=n(8091),z=n(1819),$=n(7099),L=n(1484),B=n(8197),D=n(7531),P=n(2219),O=n(3012),H=n(6237),I=n(9386),K=n(1991);let U,Y,V,j,X,q,F,Z,J,G,Q,ee,te,ne,ae,ie,se,le,oe,re,he,ce,de,ue,pe,ge,Ae,fe,ye,ve,be,me,ke,we,_e,xe,Me,Ce,Ee,Ne,We,Te,Re,Se,ze,$e,Le,Be,De,Pe,Oe,He,Ie,Ke,Ue,Ye,Ve,je,Xe,qe,Fe,Ze,Je,Ge,Qe,et,tt,nt,at,it,st,lt,ot,rt,ht,ct,dt,ut,pt,gt,At,ft,yt,vt,bt,mt;const kt=(0,f.unwrapProvider)("basic.lock-body-scroll"),{defineElement:wt,property:_t,method:xt,event:Mt}=(0,g.createDecorators)(),Ct=p().forwardRef(mn);let Et;var Nt=new WeakMap,Wt=new WeakMap,Tt=new WeakMap,Rt=new WeakMap,St=new WeakMap,zt=new WeakMap,$t=new WeakMap,Lt=new WeakMap,Bt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,It=new WeakMap,Kt=new WeakMap,Ut=new WeakMap,Yt=new WeakMap,Vt=new WeakMap,jt=new WeakMap,Xt=new WeakSet,qt=new WeakMap,Ft=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,Gt=new WeakMap,Qt=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,an=new WeakMap,sn=new WeakMap,ln=new WeakMap,on=new WeakMap,rn=new WeakMap,hn=new WeakMap,cn=new WeakMap,dn=new WeakMap,un=new WeakMap,pn=new WeakMap,gn=new WeakMap,An=new WeakMap,fn=new WeakMap,yn=new WeakMap;class vn extends A.ReactNextElement{constructor(){super(...arguments),(0,i.A)(this,Xt),(0,s.A)(this,Nt,(U(this),V(this))),(0,s.A)(this,Wt,(j(this),X(this))),(0,s.A)(this,Tt,(q(this),F(this))),(0,s.A)(this,Rt,(Z(this),J(this,[R.HP,R.HP]))),(0,s.A)(this,St,(G(this),Q(this))),(0,s.A)(this,zt,(ee(this),te(this))),(0,s.A)(this,$t,(ne(this),ae(this))),(0,s.A)(this,Lt,(ie(this),se(this))),(0,s.A)(this,Bt,(le(this),oe(this))),(0,s.A)(this,Dt,(re(this),he(this))),(0,s.A)(this,Pt,(ce(this),de(this,!0))),(0,s.A)(this,Ot,(ue(this),pe(this,!0))),(0,s.A)(this,Ht,(ge(this),Ae(this,!0))),(0,s.A)(this,It,(fe(this),ye(this,!0))),(0,s.A)(this,Kt,(ve(this),be(this,!1))),(0,s.A)(this,Ut,(me(this),ke(this))),(0,s.A)(this,Yt,(we(this),_e(this))),(0,s.A)(this,Vt,(xe(this),Me(this))),(0,s.A)(this,jt,(Ce(this),Ee(this))),(0,s.A)(this,qt,(Te(this),e=>{(0,r.A)(Xt,this,Ne).emit(e)})),(0,s.A)(this,Ft,(e=>{(0,x.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Zt,Re(this)),(0,s.A)(this,Jt,($e(this),Le(this))),(0,s.A)(this,Gt,(Pe(this),e=>{(0,r.A)(Xt,this,Be).emit(e),"node"===e.type&&(0,r.A)(Xt,this,Se).emit(e)})),(0,s.A)(this,Qt,Oe(this)),(0,s.A)(this,en,(Ke(this),e=>{(0,r.A)(Xt,this,He).emit(e)})),(0,s.A)(this,tn,Ue(this)),(0,s.A)(this,nn,(je(this),e=>{(0,r.A)(Xt,this,Ye).emit(e)})),(0,s.A)(this,an,Xe(this)),(0,s.A)(this,sn,(Ze(this),Je(this))),(0,s.A)(this,ln,(et(this),e=>{(0,r.A)(Xt,this,Ge).emit(e),"node"===e.type&&(0,r.A)(Xt,this,qe).emit(e)})),(0,s.A)(this,on,tt(this)),(0,s.A)(this,rn,(it(this),e=>{(0,r.A)(Xt,this,nt).emit(e)})),(0,s.A)(this,hn,st(this)),(0,s.A)(this,cn,(rt(this),e=>{(0,r.A)(Xt,this,lt).emit(e)})),(0,s.A)(this,dn,ht(this)),(0,s.A)(this,un,(ut(this),e=>{(0,r.A)(Xt,this,ct).emit(e)})),(0,s.A)(this,pn,pt(this)),(0,s.A)(this,gn,(ft(this),e=>{(0,r.A)(Xt,this,gt).emit(e)})),(0,s.A)(this,An,yt(this)),(0,s.A)(this,fn,(mt(this),e=>{(0,r.A)(Xt,this,vt).emit(e)})),(0,s.A)(this,yn,(0,u.createRef)())}get cells(){return(0,c.A)(Nt,this)}set cells(e){(0,h.A)(Nt,this,e)}get layout(){return(0,c.A)(Wt,this)}set layout(e){(0,h.A)(Wt,this,e)}get layoutOptions(){return(0,c.A)(Tt,this)}set layoutOptions(e){(0,h.A)(Tt,this,e)}get defaultNodeSize(){return(0,c.A)(Rt,this)}set defaultNodeSize(e){(0,h.A)(Rt,this,e)}get defaultNodeBricks(){return(0,c.A)(St,this)}set defaultNodeBricks(e){(0,h.A)(St,this,e)}get degradedThreshold(){return(0,c.A)(zt,this)}set degradedThreshold(e){(0,h.A)(zt,this,e)}get degradedNodeLabel(){return(0,c.A)($t,this)}set degradedNodeLabel(e){(0,h.A)($t,this,e)}get defaultEdgeLines(){return(0,c.A)(Lt,this)}set defaultEdgeLines(e){(0,h.A)(Lt,this,e)}get activeTarget(){return(0,c.A)(Bt,this)}set activeTarget(e){(0,h.A)(Bt,this,e)}get fadeUnrelatedCells(){return(0,c.A)(Dt,this)}set fadeUnrelatedCells(e){(0,h.A)(Dt,this,e)}get zoomable(){return(0,c.A)(Pt,this)}set zoomable(e){(0,h.A)(Pt,this,e)}get scrollable(){return(0,c.A)(Ot,this)}set scrollable(e){(0,h.A)(Ot,this,e)}get pannable(){return(0,c.A)(Ht,this)}set pannable(e){(0,h.A)(Ht,this,e)}get selectable(){return(0,c.A)(It,this)}set selectable(e){(0,h.A)(It,this,e)}get allowEdgeToArea(){return(0,c.A)(Kt,this)}set allowEdgeToArea(e){(0,h.A)(Kt,this,e)}get dragBehavior(){return(0,c.A)(Ut,this)}set dragBehavior(e){(0,h.A)(Ut,this,e)}get ctrlDragBehavior(){return(0,c.A)(Yt,this)}set ctrlDragBehavior(e){(0,h.A)(Yt,this,e)}get scaleRange(){return(0,c.A)(Vt,this)}set scaleRange(e){(0,h.A)(Vt,this,e)}async dropNode(e){var t,n;let{id:a,position:i,size:s,data:l,useBrick:o}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,i[0],i[1]))||void 0===t?void 0:t.includes(this)){var r;const e=this.getBoundingClientRect(),t=(0,c.A)(yn,this).current.getTransform(),n={type:"node",id:a,view:{..."force"===this.layout||"dagre"===this.layout?null:{x:(i[0]-e.left-t.x)/t.k,y:(i[1]-e.top-t.y)/t.k},width:(null==s?void 0:s[0])??this.defaultNodeSize[0],height:(null==s?void 0:s[1])??this.defaultNodeSize[0]},data:l,useBrick:o};return null===(r=(0,c.A)(yn,this).current)||void 0===r||r.dropNode(n),n}return null}async dropDecorator(e){var t,n;let{position:a,decorator:i,text:s,direction:l}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,a[0],a[1]))||void 0===t?void 0:t.includes(this)){var o;const e=this.getBoundingClientRect(),t=(0,c.A)(yn,this).current.getTransform(),n={type:"decorator",decorator:i,id:kn(),view:{x:(a[0]-e.left-t.x)/t.k,y:(a[1]-e.top-t.y)/t.k,width:R.N8,height:R.w1,text:s,direction:l}};return null===(o=(0,c.A)(yn,this).current)||void 0===o||o.dropDecorator(n),n}return null}async addNodes(e){if(0===e.length)return[];const t=e.map((e=>{let{size:t,useBrick:n,id:a,data:i}=e;return{type:"node",id:a,data:i,view:{width:(null==t?void 0:t[0])??this.defaultNodeSize[0],height:(null==t?void 0:t[1])??this.defaultNodeSize[0]},useBrick:n}}));return(0,c.A)(yn,this).current.addNodes(t,{defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight})}async addEdge(e){var t;let{source:n,target:a,data:i}=e;const s={type:"edge",source:n,target:a,data:i};return null===(t=(0,c.A)(yn,this).current)||void 0===t||t.addEdge(s),s}manuallyConnectNodes(e){return(0,c.A)(yn,this).current.manuallyConnectNodes(e)}async updateCells(e,t){await(0,o.A)(Xt,this,bn).call(this);const{updated:n}=(0,c.A)(yn,this).current.updateCells(e,{...t,defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight});return{updated:n}}disconnectedCallback(){super.disconnectedCallback(),kt(this,!1)}render(){return p().createElement(Ct,{host:this,ref:(0,c.A)(yn,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,dragBehavior:this.dragBehavior,ctrlDragBehavior:this.ctrlDragBehavior,scaleRange:this.scaleRange,allowEdgeToArea:this.allowEdgeToArea,onActiveTargetChange:(0,c.A)(qt,this),onSwitchActiveTarget:(0,c.A)(Ft,this),onCellMove:(0,c.A)(Gt,this),onCellsMove:(0,c.A)(en,this),onCellResize:(0,c.A)(nn,this),onCellDelete:(0,c.A)(ln,this),onCellsDelete:(0,c.A)(rn,this),onCellContextMenu:(0,c.A)(cn,this),onDecoratorTextChange:(0,c.A)(un,this),onContainerContainerChange:(0,c.A)(gn,this),onScaleChange:(0,c.A)(fn,this)})}}function bn(){return new Promise((e=>{const t=()=>{(0,c.A)(yn,this).current?e():setTimeout(t,10)};t()}))}function mn(e,t){let{host:n,layout:a,layoutOptions:i,cells:s,defaultNodeSize:l,defaultNodeBricks:o,defaultEdgeLines:r,degradedThreshold:h,degradedNodeLabel:c,activeTarget:d,fadeUnrelatedCells:g,zoomable:A,scrollable:f,pannable:v,dragBehavior:x,ctrlDragBehavior:O,scaleRange:H,allowEdgeToArea:U,onActiveTargetChange:Y,onSwitchActiveTarget:V,onCellMove:j,onCellResize:X,onCellDelete:q,onCellsMove:F,onCellsDelete:Z,onCellContextMenu:J,onDecoratorTextChange:G,onScaleChange:Q,onContainerContainerChange:ee}=e;const[{cells:te,layoutKey:ne},ae]=(0,u.useReducer)(k.d,s,(e=>({cells:(0,N.C)(e,{defaultNodeSize:l}),layoutKey:0}))),ie=(0,u.useMemo)((()=>te.filter(_.N).length>=(h??R.pC)),[te,h]),se=(0,u.useRef)(null),le=(0,u.useRef)(null),oe=(0,u.useRef)(null),[re,he]=(0,u.useState)([]),[ce,de]=(0,u.useState)([]),{grabbing:ue,transform:pe,zoomer:ge,scaleRange:Ae}=(0,S.f)({rootRef:se,zoomable:A,scrollable:f,pannable:v,draggable:"grab"===x,ctrlDraggable:"grab"===O,scaleRange:H,onSwitchActiveTarget:V});(0,u.useEffect)((()=>{Q(pe.k)}),[Q,pe.k]);const[fe,ye]=(0,u.useState)(null),[ve,be]=(0,u.useState)(null),{centered:me,setCentered:ke,getNextLayoutKey:we}=(0,L.g)({layout:a,layoutOptions:i,rootRef:se,cells:te,zoomable:A,zoomer:ge,scaleRange:Ae,layoutKey:ne,allowEdgeToArea:U,dispatch:ae});(0,u.useImperativeHandle)(t,(()=>({dropNode(e){"dagre"!==a&&"force"!==a&&ke(!0),ae({type:"drop-node",payload:e})},dropDecorator(e){"dagre"!==a&&"force"!==a&&ke(!0),ae({type:"drop-decorator",payload:e})},addNodes(e,t){let{defaultNodeSize:n,canvasWidth:i,canvasHeight:s}=t;const l=te.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,o=[...te.slice(0,l),...e,...te.slice(l)],{cells:r,updated:h,shouldReCenter:c}=(0,W.L)({cells:o,layout:a,previousCells:te,defaultNodeSize:n,canvasWidth:i,canvasHeight:s,scaleRange:Ae,transform:pe,allowEdgeToArea:U});return c&&ke(!1),ae({type:"update-cells",payload:r}),h.filter((t=>e.includes(t)))},addEdge(e){ae({type:"add-edge",payload:e})},updateCells(e,t){const{shouldReCenter:n,...i}=(0,W.L)({...t,layout:a,previousCells:te,cells:e,scaleRange:Ae,transform:pe,allowEdgeToArea:U});return n&&ke(!1),ae({type:"update-cells",payload:i.cells}),i},getTransform:()=>pe,manuallyConnectNodes(e){const t=te.find((t=>(U&&(0,_.o6)(t)||(0,_.N)(t))&&t.id===e));if(t){const e=se.current.getBoundingClientRect();return be({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[e.left,e.top]}),new Promise(((e,t)=>{oe.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[te,a,Ae,ke,pe,U]);const _e=(0,u.useCallback)(((e,t)=>{var n;for(let n=te.length-1;n>=0;n--){const i=te[n];if((U&&(0,_.o6)(i)||(0,_.N)(i))&&i.id!==e.source.id&&i.view.x<t[0]&&i.view.x+i.view.width>t[0]&&i.view.y<t[1]&&i.view.y+i.view.height>t[1]){var a;null===(a=oe.current)||void 0===a||a.resolve({source:e.source,target:i});break}}null===(n=oe.current)||void 0===n||n.reject(null),be(null)}),[te]);(0,u.useEffect)((()=>{kt(n,!(!ve&&!fe))}),[ve,n,fe]);const xe=(0,z.J)({cellsRef:le,activeTarget:d,onActiveTargetChange:Y}),[Me,Ce]=(0,u.useState)([]);(0,u.useEffect)((()=>{const e=g?(0,T.Y)(te,ve,xe,U):[];Ce((t=>0===t.length&&0===e.length?t:e))}),[xe,te,ve,g,U]),(0,u.useEffect)((()=>{const e=se.current;if(!e||re.length>0)return;const t=e=>{const t=(0,M.a)(e,{cells:te,activeTarget:xe});"delete-cells"===(null==t?void 0:t.action)&&(Z(t.cells),1===t.cells.length&&q(t.cells[0]))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[xe,te,re.length,q,Z]);const Ee=`${(0,u.useMemo)((()=>`${(0,y.uniqueId)("diagram-")}-`),[])}line-arrow-`,Ne=(0,u.useCallback)((e=>{ae({type:"move-cells",payload:e});const t=[];(0,K._)(e,te).forEach((e=>{var n,a;null!==(n=e.containerCell)&&void 0!==n&&n.id&&t.push(null===(a=e.containerCell)||void 0===a?void 0:a.id)})),de(t)}),[te]),We=(0,u.useCallback)((e=>{ae({type:"move-cells",payload:e}),F(e),1===e.length&&j(e[0]),(0,K._)(e,te,ee),de([])}),[j,F,te,ee]),Te=(0,u.useCallback)((e=>{ae({type:"resize-cell",payload:e})}),[]),Re=(0,u.useCallback)((e=>{ae({type:"resize-cell",payload:e}),X(e)}),[X]),Se=(0,u.useCallback)((e=>{let{id:t,editing:n}=e;he(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ze=(0,u.useCallback)(((e,t)=>{const n=we();ae({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[we]),$e=(0,u.useCallback)((e=>{ge.scaleTo((0,m.A)(se.current),e/100)}),[ge]),Le=(0,u.useCallback)((()=>{ke(!1)}),[ke]),[Be,De]=(0,D.d)({cells:te,defaultEdgeLines:r,markerPrefix:Ee}),Pe=(0,B.H)({cells:te,layout:a,centered:me});return(0,u.useEffect)((()=>{const e=se.current;if(!e||"lasso"!==x)return;const t=e.getBoundingClientRect(),n=e=>{(0,P.F)(e,{transform:pe,offset:[t.left,t.top],onLassoing(e){ye(e)},onLassoed(e){ye(null);const t=[];for(const n of te)if((0,_.t2)(n)||(0,_.o6)(n)||(0,_.Hs)(n)){const a=n.view.x,i=n.view.y;a>=e.x&&a+n.view.width<=e.x+e.width&&i>=e.y&&i+n.view.height<=e.y+e.height&&t.push(n)}null==V||V(t.length>1?{type:"multi",targets:t.map(I.P)}:1===t.length?(0,I.P)(t[0]):null)}})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}),[pe,te,x,V]),p().createElement(p().Fragment,null,p().createElement("svg",{width:"100%",height:"100%",ref:se,className:b()("root",{grabbing:ue,pannable:v,ready:Pe}),tabIndex:-1},p().createElement("defs",null,De.map(((e,t)=>p().createElement(w.c,{key:t,id:`${Ee}${t}`,type:"arrow",strokeColor:e.strokeColor})))),p().createElement("g",{transform:`translate(${pe.x} ${pe.y}) scale(${pe.k})`},p().createElement("g",{className:b()("cells",{allowEdgeToArea:U}),ref:le},te.map((e=>p().createElement(C.m,{key:`${e.type}:${(0,_.WW)(e)?`${e.source}~${e.target}`:e.id}`,dragNodeToContainerActive:!(0,_.WW)(e)&&ce.includes(e.id),layout:a,cell:e,cells:te,degraded:ie,degradedNodeLabel:c,defaultNodeBricks:o,transform:pe,lineConfMap:Be,activeTarget:xe,unrelatedCells:Me,onCellsMoving:Ne,onCellsMoved:We,onCellResizing:Te,onCellResized:Re,onSwitchActiveTarget:V,onCellContextMenu:J,onDecoratorTextChange:G,onDecoratorTextEditing:Se,onNodeBrickResize:ze})))),p().createElement(E.w,{connectLineState:ve,transform:pe,markerEnd:`${Ee}0`,onConnect:_e}),fe&&p().createElement("rect",{x:fe.x,y:fe.y,width:fe.width,height:fe.height,fill:"var(--palette-gray-5)",fillOpacity:.3,stroke:"var(--palette-gray-5)",strokeDasharray:2}))),p().createElement($.Y,{shadowRoot:n.shadowRoot,scale:pe.k,scaleRange:Ae,onZoomChange:$e,onReCenter:Le}))}function kn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}a=vn,({e:[V,j,X,q,F,Z,J,G,Q,ee,te,ne,ae,ie,se,le,oe,re,he,ce,de,ue,pe,ge,Ae,fe,ye,ve,be,me,ke,we,_e,xe,Me,Ce,Ee,Ne,We,Te,Re,Se,ze,$e,Le,Be,De,Pe,Oe,He,Ie,Ke,Ue,Ye,Ve,je,Xe,qe,Fe,Ze,Je,Ge,Qe,et,tt,nt,at,it,st,lt,ot,rt,ht,ct,dt,ut,pt,gt,At,ft,yt,vt,bt,mt,U],c:[Et,Y]}=(0,d.A)(a,[wt("eo-draw-canvas",{styleTexts:[O.A,H.A]})],[[_t({attribute:!1}),1,"cells"],[_t({type:String}),1,"layout"],[_t({attribute:!1}),1,"layoutOptions"],[_t({attribute:!1}),1,"defaultNodeSize"],[_t({attribute:!1}),1,"defaultNodeBricks"],[_t({type:Number}),1,"degradedThreshold"],[_t({attribute:!1}),1,"degradedNodeLabel"],[_t({attribute:!1}),1,"defaultEdgeLines"],[_t({attribute:!1}),1,"activeTarget"],[_t({type:Boolean}),1,"fadeUnrelatedCells"],[_t({type:Boolean}),1,"zoomable"],[_t({type:Boolean}),1,"scrollable"],[_t({type:Boolean}),1,"pannable"],[_t({type:Boolean}),1,"selectable"],[_t({type:Boolean}),1,"allowEdgeToArea"],[_t(),1,"dragBehavior"],[_t(),1,"ctrlDragBehavior"],[_t({attribute:!1}),1,"scaleRange"],[Mt({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(jt,e),(e,t)=>(0,h.A)(jt,e,t)],[Mt({type:"node.move"}),1,"nodeMoveEvent",e=>(0,c.A)(Zt,e),(e,t)=>(0,h.A)(Zt,e,t)],[Mt({type:"cell.move"}),1,"cellMoveEvent",e=>(0,c.A)(Jt,e),(e,t)=>(0,h.A)(Jt,e,t)],[Mt({type:"cells.move"}),1,"cellsMoveEvent",e=>(0,c.A)(Qt,e),(e,t)=>(0,h.A)(Qt,e,t)],[Mt({type:"cell.resize"}),1,"cellResizeEvent",e=>(0,c.A)(tn,e),(e,t)=>(0,h.A)(tn,e,t)],[Mt({type:"node.delete"}),1,"nodeDelete",e=>(0,c.A)(an,e),(e,t)=>(0,h.A)(an,e,t)],[Mt({type:"cell.delete"}),1,"cellDelete",e=>(0,c.A)(sn,e),(e,t)=>(0,h.A)(sn,e,t)],[Mt({type:"cells.delete"}),1,"cellsDelete",e=>(0,c.A)(on,e),(e,t)=>(0,h.A)(on,e,t)],[Mt({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,c.A)(hn,e),(e,t)=>(0,h.A)(hn,e,t)],[Mt({type:"decorator.text.change"}),1,"decoratorTextChange",e=>(0,c.A)(dn,e),(e,t)=>(0,h.A)(dn,e,t)],[Mt({type:"node.container.change"}),1,"containerContainerChange",e=>(0,c.A)(pn,e),(e,t)=>(0,h.A)(pn,e,t)],[Mt({type:"scale.change"}),1,"scaleChange",e=>(0,c.A)(An,e),(e,t)=>(0,h.A)(An,e,t)],[xt(),2,"dropNode"],[xt(),2,"dropDecorator"],[xt(),2,"addNodes"],[xt(),2,"addEdge"],[xt(),2,"manuallyConnectNodes"],[xt(),2,"updateCells"]],0,(e=>yn.has((0,l.A)(e))),A.ReactNextElement)),Y()},3971:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(6758),i=n.n(a),s=n(935),l=n.n(s)()(i());l.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const o=l.toString()},497:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(6758),i=n.n(a),s=n(935),l=n.n(s)()(i());l.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const o=l.toString()},780:(e,t,n)=>{n.d(t,{_:()=>s});var a=n(6330),i=n(3496),s=function(){var e=(0,a.A)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,a){return e.apply(this,arguments)}}()},8406:(e,t,n)=>{n.d(t,{y:()=>s});var a=n(6330),i=n(3496),s=function(){var e=(0,a.A)((function*(e,t,n){return(yield i.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,a){return e.apply(this,arguments)}}()},6841:(e,t,n)=>{n.d(t,{x:()=>s});var a=n(6330),i=n(3496),s=function(){var e=(0,a.A)((function*(e,t,n,a){return(yield i.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,a)).data}));return function(t,n,a,i){return e.apply(this,arguments)}}()},4993:(e,t,n)=>{function a(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function s(e){return new i(e)}n.d(t,{Ay:()=>s}),i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},4643:(e,t,n)=>{n.d(t,{dJ:()=>i,kl:()=>s});class a{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function i(e){return new a(e,!0)}function s(e){return new a(e,!1)}},482:(e,t,n)=>{function a(e){this._context=e}function i(e){return new a(e)}n.d(t,{A:()=>i}),a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}}},3488:(e,t,n)=>{function a(e){return e<0?-1:1}function i(e,t,n){var i=e._x1-e._x0,s=t-e._x1,l=(e._y1-e._y0)/(i||s<0&&-0),o=(n-e._y1)/(s||i<0&&-0),r=(l*s+o*i)/(i+s);return(a(l)+a(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(r))||0}function s(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function l(e,t,n){var a=e._x0,i=e._y0,s=e._x1,l=e._y1,o=(s-a)/3;e._context.bezierCurveTo(a+o,i+o*t,s-o,l-o*n,s,l)}function o(e){this._context=e}function r(e){this._context=new h(e)}function h(e){this._context=e}function c(e){return new o(e)}function d(e){return new r(e)}n.d(t,{G:()=>c,N:()=>d}),o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:l(this,this._t0,s(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,l(this,s(this,n=i(this,e,t)),n);break;default:l(this,this._t0,n=i(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(r.prototype=Object.create(o.prototype)).point=function(e,t){o.prototype.point.call(this,t,e)},h.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,a,i,s){this._context.bezierCurveTo(t,e,a,n,s,i)}}},6066:(e,t,n)=>{function a(e){this._context=e}function i(e){var t,n,a=e.length-1,i=new Array(a),s=new Array(a),l=new Array(a);for(i[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<a-1;++t)i[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[a-1]=2,s[a-1]=7,l[a-1]=8*e[a-1]+e[a],t=1;t<a;++t)n=i[t]/s[t-1],s[t]-=n,l[t]-=n*l[t-1];for(i[a-1]=l[a-1]/s[a-1],t=a-2;t>=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[a-1]=(e[a]+i[a-1])/2,t=0;t<a-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function s(e){return new a(e)}n.d(t,{A:()=>s}),a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var a=i(e),s=i(t),l=0,o=1;o<n;++l,++o)this._context.bezierCurveTo(a[0][l],s[0][l],a[1][l],s[1][l],e[o],t[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}}},3269:(e,t,n)=>{function a(e){return function(){return e}}n.d(t,{A:()=>p}),Array.prototype.slice;var i=n(482);const s=Math.PI,l=2*s,o=1e-6,r=l-o;function h(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class c{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?h:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return h;const n=10**t;return function(e){this._+=e[0];for(let t=1,a=e.length;t<a;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,a){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(e,t,n,a,i,s){this._append`C${+e},${+t},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(e,t,n,a,i){if(e=+e,t=+t,n=+n,a=+a,(i=+i)<0)throw new Error(`negative radius: ${i}`);let l=this._x1,r=this._y1,h=n-e,c=a-t,d=l-e,u=r-t,p=d*d+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(p>o)if(Math.abs(u*h-c*d)>o&&i){let g=n-l,A=a-r,f=h*h+c*c,y=g*g+A*A,v=Math.sqrt(f),b=Math.sqrt(p),m=i*Math.tan((s-Math.acos((f+p-y)/(2*v*b)))/2),k=m/b,w=m/v;Math.abs(k-1)>o&&this._append`L${e+k*d},${t+k*u}`,this._append`A${i},${i},0,0,${+(u*g>d*A)},${this._x1=e+w*h},${this._y1=t+w*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,a,i,h){if(e=+e,t=+t,h=!!h,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(a),d=n*Math.sin(a),u=e+c,p=t+d,g=1^h,A=h?a-i:i-a;null===this._x1?this._append`M${u},${p}`:(Math.abs(this._x1-u)>o||Math.abs(this._y1-p)>o)&&this._append`L${u},${p}`,n&&(A<0&&(A=A%l+l),A>r?this._append`A${n},${n},0,1,${g},${e-c},${t-d}A${n},${n},0,1,${g},${this._x1=u},${this._y1=p}`:A>o&&this._append`A${n},${n},0,${+(A>=s)},${g},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,a){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function u(e){return e[1]}function p(e,t){var n=a(!0),s=null,l=i.A,o=null,r=function(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new c(t)}(h);function h(a){var i,h,c,d=(a=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(a)).length,u=!1;for(null==s&&(o=l(c=r())),i=0;i<=d;++i)!(i<d&&n(h=a[i],i,a))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(h,i,a),+t(h,i,a));if(c)return o=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:a(e),t="function"==typeof t?t:void 0===t?u:a(t),h.x=function(t){return arguments.length?(e="function"==typeof t?t:a(+t),h):e},h.y=function(e){return arguments.length?(t="function"==typeof e?e:a(+e),h):t},h.defined=function(e){return arguments.length?(n="function"==typeof e?e:a(!!e),h):n},h.curve=function(e){return arguments.length?(l=e,null!=s&&(o=l(s)),h):l},h.context=function(e){return arguments.length?(null==e?s=o=null:o=l(s=e),h):s},h}c.prototype}}]);
3
- //# sourceMappingURL=4017.2680d65a.js.map
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[4837,7218],{4837:(e,r,t)=>{t.r(r),t.d(r,{ReactUseBrick:()=>c,ReactUseMultipleBricks:()=>u,asyncWrapBrick:()=>k,useCurrentApp:()=>l,useCurrentTheme:()=>o,useLazyWrapBrick:()=>w,useNavConfig:()=>h,useProvider:()=>m,useRecentApps:()=>i,useRouteRender:()=>d});var n=t(8769),s=t(184);let c=function(e){let{useBrick:r,data:t,errorBoundary:c,refCallback:u,ignoredCallback:a}=e;const[o,i]=(0,n.useState)(null),l=(0,n.useRef)(),[d,f]=(0,n.useState)(),p=(0,n.useRef)(0),g=(0,n.useMemo)((()=>{var e;return null===(e=s.__secret_internals.getRenderId)||void 0===e?void 0:e.call(s.__secret_internals)}),[]);(0,n.useEffect)((()=>{let e=!1;return async function(){try{const n=await s.__secret_internals.renderUseBrick(r,t,c);if(e)return;i(n),f(++p.current)}catch(n){!e&&function(e){var r;const t=null===(r=s.__secret_internals.getRenderId)||void 0===r?void 0:r.call(s.__secret_internals);return!e||!t||e===t}(g)&&(console.error("Render useBrick failed:",r,"with data:",t),(0,s.handleHttpError)(n))}}(),()=>{e=!0}}),[t,r,g,c]);const y=(0,n.useCallback)((e=>{e?l.current=s.__secret_internals.mountUseBrick(o,e):(s.__secret_internals.unmountUseBrick(o,l.current),l.current=void 0),null==u||u(e)}),[u,o]);if(!o)return null;const{tagName:m}=o;if(null===m)return null==a||a(),null;const v=m;return n.createElement(v,{key:d,ref:y})},u=function(e){let{useBrick:r,data:t,errorBoundary:s}=e;return Array.isArray(r)?n.createElement(n.Fragment,null,r.map(((e,r)=>n.createElement(c,{key:r,useBrick:e,data:t,errorBoundary:s})))):n.createElement(c,{useBrick:r,data:t,errorBoundary:s})};const a=(0,s.getV2RuntimeFromDll)();if(a){const{SingleBrickAsComponentFactory:e,BrickAsComponentFactory:r}=a;e&&r&&(c=e(n),u=r(n))}function o(){const[e,r]=(0,n.useState)(s.getCurrentTheme);return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("theme.change",e),()=>{window.removeEventListener("theme.change",e)}}),[]),e}function i(){const[e,r]=n.useState((()=>(0,s.getRuntime)().getRecentApps()));return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("app.change",e),()=>window.removeEventListener("app.change",e)}),[]),e}function l(){return i().currentApp}function d(){const[e,r]=n.useState(null);return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("route.render",e),()=>window.removeEventListener("route.render",e)}),[]),e}const f={provider:"",customOptions:{onError:()=>{},transform:(e,r)=>r,data:void 0,loading:!1,suspense:!1,cache:!0},dependencies:void 0},p=Object.entries(f).reduce(((e,r)=>{let[t,n]=r;return"[object Object]"===Object.prototype.toString.call(n)?{...e,...n}:{...e,[t]:n}}),{});var g=t(1030);const y=new Map;function m(){const{provider:e,customOptions:r,dependencies:t,requestInit:c}=function(e,r,t){const s=(0,n.useMemo)((()=>"string"==typeof e?e:f.provider),[e,r]),c=(0,n.useMemo)((()=>{let t={};return(0,g.isObject)(e)?t=e:(0,g.isObject)(r)&&(t=r),{...p,...t}}),[e,r]),u=(0,n.useMemo)((()=>{const e=[...Object.keys(f),...Object.keys(f.customOptions)],{args:r=null,...t}=Object.keys(c).reduce(((r,t)=>(e.includes(t)||(r[t]=c[t]),r)),{});return{options:{...t},args:r}}),[c]),a=(0,n.useMemo)((()=>Array.isArray(r)?r:Array.isArray(t)?t:p.dependencies),[r,t]),o=c.loading||Array.isArray(a);return{provider:s,customOptions:(0,n.useMemo)((()=>({...Object.keys(f.customOptions).reduce(((e,r)=>(e[r]=c[r],e)),{}),loading:o})),[c]),requestInit:u,dependencies:a}}(...arguments),{onError:u,transform:a,suspense:o,cache:i,...l}=r,[d,m]=(0,n.useState)(l.loading),v=(0,n.useRef)("pending"),k=(0,n.useRef)(),h=(0,n.useRef)(!1),w=(0,n.useRef)(),_=(0,n.useRef)(),b=(0,n.useRef)(l.data),B=(0,n.useReducer)((()=>({})),[])[1],E=(0,n.useCallback)((async(e,r)=>{try{w.current=void 0,o||m(!0);const t=await async function(e,r,t){let n;const c=function(e){const r=e=>Object.keys(e).sort().map((r=>({[r]:e[r]})));for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];try{const t="object"!=typeof(c=n)||null===c||Array.isArray(c)?n.map((e=>function(e){return"string"==typeof e}(e)?e:r(e))):r(n);return JSON.stringify({provider:e,args:t})}catch(r){return JSON.stringify({provider:e,args:n})}var c}(e,...t);return!r&&y.has(c)&&y.delete(c),y.has(c)?n=y.get(c):(n=(0,s.fetchByProvider)(e,t),r&&y.set(c,n)),n}(e,i,r);_.current=t,b.current=a(b.current,t)}catch(e){w.current=e,b.current=void 0}return o||m(!1),w.current&&u(w.current),b.current}),[e,r,t,c,o,a,l.data,u,i]),O=(0,n.useCallback)((async(r,t)=>{let n=e,s=[];return(0,g.isString)(r)&&(n=r),(0,g.isObject)(r)?s=r:(0,g.isObject)(t)&&(s=t),o?(async()=>(k.current=E(n,s).then((e=>(v.current="success",e)),(e=>(v.current="error",e.current=e,e))),B(),await k.current))():E(n,s)}),[E]),R=(0,n.useMemo)((()=>Object.defineProperties({query:O},{loading:{get:()=>d},data:{get:()=>b.current},error:{get:()=>w.current}})),[O]);if((0,n.useEffect)((()=>(h.current=!0,Array.isArray(t)&&e&&R.query(e,c.args),()=>h.current=!1)),t),o&&k.current)switch(v.current){case"pending":throw k.current;case"error":throw w.current}return Object.assign([R,_.current,d,w.current],{request:R,...R,response:_.current,data:b.current,loading:d,error:w.current})}var v=t(1389);async function k(e,r){return await s.__secret_internals.loadBricks([e]),(0,v.wrapBrick)(e,r)}function h(){const[e,r]=(0,n.useState)((()=>(0,s.getRuntime)().getNavConfig()));return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("navConfig.change",e),()=>window.removeEventListener("navConfig.change",e)}),[]),e}function w(e,r){return(0,n.useMemo)((()=>null!=e?(0,n.lazy)((async()=>({default:await k(e,r)}))):null),[e,r])}}}]);
2
- //# sourceMappingURL=4837.ac3853bb.js.map
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[6314,3933],{3933:(e,t,o)=>{function n(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(r,s){if("string"==typeof t?r.name===t:t.includes(r.name)){const t=[];for(let i=1;i<=o;i++){const o=s[s.length-i];if("MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key){const s=o.node;s.computed||"Identifier"!==s.property.type?s.computed&&"Literal"===s.property.type&&"string"==typeof s.property.value?t.push(n?`${r.name}.${s.property.value}`:s.property.value):e.hasNonStaticUsage=!0:t.push(n?`${r.name}.${s.property.name}`:s.property.name)}else e.hasNonStaticUsage=!0}t.length===o&&e.usedProperties.add(t.join("."))}}}function r(e,t){return function(o,n,r){if(n.name===e){const e=r[r.length-1],n=r[r.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==e?void 0:e.node.type)&&"object"===e.key&&(e.node.computed?"Literal"===e.node.property.type&&e.node.property.value===t:"Identifier"===e.node.property.type&&e.node.property.name===t)){const e=n.node.arguments;if(e.length>0){const t=e[0];"Literal"===t.type&&"string"==typeof t.value?o.usedArgs.add(t.value):o.hasNonStaticUsage=!0}}}}}o.r(t),o.d(t,{beforeVisitGlobalMember:()=>n,collectAppGetMenuUsage:()=>s,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>S,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>P,scanPermissionActionsInStoryboard:()=>v,strictCollectMemberUsage:()=>l,track:()=>f,trackAll:()=>y,traverseStoryboardExpressions:()=>u,traverseStoryboardFunction:()=>g,traverseStoryboardFunctions:()=>h,unwrapProvider:()=>c.unwrapProvider});const s=r("APP","getMenu"),i=r("INSTALLED_APPS","has");var a=o(8897),c=o(279);function u(e,t,o){const n=new WeakSet,{matchExpressionString:r,visitNotMatchedExpressionString:s,visitNonExpressionString:i,visitObject:u}="string"==typeof o?{matchExpressionString:e=>e.includes(o)}:o;!function e(o){if("string"==typeof o)if((0,a.isEvaluable)(o))if(r(o))try{(0,a.preevaluate)(o,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,n){t(e,n,o)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==s||s(o);else null==i||i(o);else if((0,c.isObject)(o)){if(n.has(o))return;n.add(o),null==u||u(o);for(const t of Array.isArray(o)?o:Object.values(o))e(t)}}(e)}function l(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const{hasNonStaticUsage:n,nonStaticUsage:r,usedProperties:s}=p(e,t,o);if(n)throw new Error(`Non-static usage of ${t} is prohibited, check your expression: "${r}"`);return s}function p(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r={usedProperties:new Set,hasNonStaticUsage:!1},s=n(r,t,o);return u(e,((e,t,o)=>{s(e,t),r.hasNonStaticUsage&&(r.nonStaticUsage=o)}),t),r}const d=["CTX","STATE","FORM_STATE"];function f(e,t,o){if(e.includes(t)){const r={usedProperties:new Set,hasNonStaticUsage:!1},{expression:s}=(0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:n(r,o)}});let i;if("SequenceExpression"===s.type&&(i=s.expressions[0])&&"Literal"===i.type&&i.value===t){if(r.usedProperties.size>0)return r.usedProperties;console.warn(`You are using "${t}" but no \`${o}\` usage found in your expression: ${JSON.stringify(e)}`)}}return!1}function y(e){if(d.some((t=>e.includes(t)))){const t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,a.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal:n(t,d,1,!0)}}),t.usedProperties.size>0){const e=[...t.usedProperties],o={context:!1,state:!1,formState:!1},n={CTX:"context",STATE:"state",FORM_STATE:"formState"};return e.forEach((e=>{const[t,r]=e.split(".");o[n[t]]||(o[n[t]]=[]),o[n[t]].push(r)})),o}console.warn(`You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: ${JSON.stringify(e)}`)}return!1}function h(e,t,o){if(Array.isArray(e))for(const n of e)null!=o&&o.matchSource&&!o.matchSource(n.source)||g(n,t)}function g(e,t,o){try{(0,a.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t},cacheKey:e})}catch(t){o||console.error(`Parse storyboard function "${e.name}" failed:`,t)}}function S(e,t,o){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const s={usedProperties:new Set,hasNonStaticUsage:!1};if(e.source.includes(t)&&g(e,n(s,t,r),o),s.hasNonStaticUsage&&!o)throw new Error(`Non-static usage of ${t} is prohibited, check your function: "${e.name}"`);return s.usedProperties.delete(e.name),s.usedProperties}const m="PERMISSIONS",b="check";function v(e){const t=new Set,o=k(t),{customTemplates:n,functions:r}=e.meta??{};return u([e.routes,n],o,m),h(r,o,{matchSource:e=>e.includes(m)}),Array.from(t)}function P(e){const t=new Set;return u(e,k(t),m),Array.from(t)}function k(e){return function(t,o){if(t.name===m){const t=o[o.length-1],n=o[o.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==t?void 0:t.node.type)&&"object"===t.key&&(t.node.computed?"Literal"===t.node.property.type&&t.node.property.value===b:"Identifier"===t.node.property.type&&t.node.property.name===b))for(const t of n.node.arguments)"Literal"===t.type&&"string"==typeof t.value&&e.add(t.value)}}}}}]);
2
- //# sourceMappingURL=6314.d82ad8ed.js.map
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[7218,4837],{4837:(e,r,t)=>{t.r(r),t.d(r,{ReactUseBrick:()=>c,ReactUseMultipleBricks:()=>u,asyncWrapBrick:()=>k,useCurrentApp:()=>l,useCurrentTheme:()=>o,useLazyWrapBrick:()=>w,useNavConfig:()=>h,useProvider:()=>m,useRecentApps:()=>i,useRouteRender:()=>d});var n=t(8769),s=t(184);let c=function(e){let{useBrick:r,data:t,errorBoundary:c,refCallback:u,ignoredCallback:a}=e;const[o,i]=(0,n.useState)(null),l=(0,n.useRef)(),[d,f]=(0,n.useState)(),p=(0,n.useRef)(0),g=(0,n.useMemo)((()=>{var e;return null===(e=s.__secret_internals.getRenderId)||void 0===e?void 0:e.call(s.__secret_internals)}),[]);(0,n.useEffect)((()=>{let e=!1;return async function(){try{const n=await s.__secret_internals.renderUseBrick(r,t,c);if(e)return;i(n),f(++p.current)}catch(n){!e&&function(e){var r;const t=null===(r=s.__secret_internals.getRenderId)||void 0===r?void 0:r.call(s.__secret_internals);return!e||!t||e===t}(g)&&(console.error("Render useBrick failed:",r,"with data:",t),(0,s.handleHttpError)(n))}}(),()=>{e=!0}}),[t,r,g,c]);const y=(0,n.useCallback)((e=>{e?l.current=s.__secret_internals.mountUseBrick(o,e):(s.__secret_internals.unmountUseBrick(o,l.current),l.current=void 0),null==u||u(e)}),[u,o]);if(!o)return null;const{tagName:m}=o;if(null===m)return null==a||a(),null;const v=m;return n.createElement(v,{key:d,ref:y})},u=function(e){let{useBrick:r,data:t,errorBoundary:s}=e;return Array.isArray(r)?n.createElement(n.Fragment,null,r.map(((e,r)=>n.createElement(c,{key:r,useBrick:e,data:t,errorBoundary:s})))):n.createElement(c,{useBrick:r,data:t,errorBoundary:s})};const a=(0,s.getV2RuntimeFromDll)();if(a){const{SingleBrickAsComponentFactory:e,BrickAsComponentFactory:r}=a;e&&r&&(c=e(n),u=r(n))}function o(){const[e,r]=(0,n.useState)(s.getCurrentTheme);return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("theme.change",e),()=>{window.removeEventListener("theme.change",e)}}),[]),e}function i(){const[e,r]=n.useState((()=>(0,s.getRuntime)().getRecentApps()));return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("app.change",e),()=>window.removeEventListener("app.change",e)}),[]),e}function l(){return i().currentApp}function d(){const[e,r]=n.useState(null);return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("route.render",e),()=>window.removeEventListener("route.render",e)}),[]),e}const f={provider:"",customOptions:{onError:()=>{},transform:(e,r)=>r,data:void 0,loading:!1,suspense:!1,cache:!0},dependencies:void 0},p=Object.entries(f).reduce(((e,r)=>{let[t,n]=r;return"[object Object]"===Object.prototype.toString.call(n)?{...e,...n}:{...e,[t]:n}}),{});var g=t(1030);const y=new Map;function m(){const{provider:e,customOptions:r,dependencies:t,requestInit:c}=function(e,r,t){const s=(0,n.useMemo)((()=>"string"==typeof e?e:f.provider),[e,r]),c=(0,n.useMemo)((()=>{let t={};return(0,g.isObject)(e)?t=e:(0,g.isObject)(r)&&(t=r),{...p,...t}}),[e,r]),u=(0,n.useMemo)((()=>{const e=[...Object.keys(f),...Object.keys(f.customOptions)],{args:r=null,...t}=Object.keys(c).reduce(((r,t)=>(e.includes(t)||(r[t]=c[t]),r)),{});return{options:{...t},args:r}}),[c]),a=(0,n.useMemo)((()=>Array.isArray(r)?r:Array.isArray(t)?t:p.dependencies),[r,t]),o=c.loading||Array.isArray(a);return{provider:s,customOptions:(0,n.useMemo)((()=>({...Object.keys(f.customOptions).reduce(((e,r)=>(e[r]=c[r],e)),{}),loading:o})),[c]),requestInit:u,dependencies:a}}(...arguments),{onError:u,transform:a,suspense:o,cache:i,...l}=r,[d,m]=(0,n.useState)(l.loading),v=(0,n.useRef)("pending"),k=(0,n.useRef)(),h=(0,n.useRef)(!1),w=(0,n.useRef)(),_=(0,n.useRef)(),b=(0,n.useRef)(l.data),B=(0,n.useReducer)((()=>({})),[])[1],E=(0,n.useCallback)((async(e,r)=>{try{w.current=void 0,o||m(!0);const t=await async function(e,r,t){let n;const c=function(e){const r=e=>Object.keys(e).sort().map((r=>({[r]:e[r]})));for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];try{const t="object"!=typeof(c=n)||null===c||Array.isArray(c)?n.map((e=>function(e){return"string"==typeof e}(e)?e:r(e))):r(n);return JSON.stringify({provider:e,args:t})}catch(r){return JSON.stringify({provider:e,args:n})}var c}(e,...t);return!r&&y.has(c)&&y.delete(c),y.has(c)?n=y.get(c):(n=(0,s.fetchByProvider)(e,t),r&&y.set(c,n)),n}(e,i,r);_.current=t,b.current=a(b.current,t)}catch(e){w.current=e,b.current=void 0}return o||m(!1),w.current&&u(w.current),b.current}),[e,r,t,c,o,a,l.data,u,i]),O=(0,n.useCallback)((async(r,t)=>{let n=e,s=[];return(0,g.isString)(r)&&(n=r),(0,g.isObject)(r)?s=r:(0,g.isObject)(t)&&(s=t),o?(async()=>(k.current=E(n,s).then((e=>(v.current="success",e)),(e=>(v.current="error",e.current=e,e))),B(),await k.current))():E(n,s)}),[E]),R=(0,n.useMemo)((()=>Object.defineProperties({query:O},{loading:{get:()=>d},data:{get:()=>b.current},error:{get:()=>w.current}})),[O]);if((0,n.useEffect)((()=>(h.current=!0,Array.isArray(t)&&e&&R.query(e,c.args),()=>h.current=!1)),t),o&&k.current)switch(v.current){case"pending":throw k.current;case"error":throw w.current}return Object.assign([R,_.current,d,w.current],{request:R,...R,response:_.current,data:b.current,loading:d,error:w.current})}var v=t(1389);async function k(e,r){return await s.__secret_internals.loadBricks([e]),(0,v.wrapBrick)(e,r)}function h(){const[e,r]=(0,n.useState)((()=>(0,s.getRuntime)().getNavConfig()));return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("navConfig.change",e),()=>window.removeEventListener("navConfig.change",e)}),[]),e}function w(e,r){return(0,n.useMemo)((()=>null!=e?(0,n.lazy)((async()=>({default:await k(e,r)}))):null),[e,r])}}}]);
2
- //# sourceMappingURL=7218.3cc8b20d.js.map
@@ -1,3 +0,0 @@
1
- /*! For license information please see 799.0d07ef57.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[799],{799:(e,t,n)=>{n.r(t),n.d(t,{Dialog:()=>Yt,Notification:()=>rn,StoryboardFunctionRegistryFactory:()=>fe,__secret_internals:()=>r,__test_only:()=>{},applyTheme:()=>te,authenticate:()=>yi,batchSetAppsLocalTheme:()=>ne,checkIfByTransform:()=>St,checkIfOfComputed:()=>Et,createHistory:()=>A,createRuntime:()=>ai,customEditors:()=>Ai,customProcessors:()=>x,customTemplates:()=>Pe,fetchByProvider:()=>ki,getAuth:()=>wi,getBasePath:()=>f,getCssPropertyValue:()=>ce,getCurrentMode:()=>se,getCurrentTheme:()=>ee,getHistory:()=>k,getPageInfo:()=>co,getRealValue:()=>Ci,getRuntime:()=>ci,getV2RuntimeFromDll:()=>S,handleHttpError:()=>nn,httpErrorToString:()=>Jt,isLoggedIn:()=>Ei,isUnauthenticatedError:()=>Qt,logout:()=>bi,matchPath:()=>Bt,registerWidgetFunctions:()=>$e,registerWidgetI18n:()=>N,setUIVersion:()=>uo,unstable_createRoot:()=>Ii});var r={};n.r(r),n.d(r,{addRealTimeDataInspectHook:()=>Tr,debugDataValue:()=>kr,getAddedContracts:()=>Ar,getAllContextValues:()=>yr,getBrickPackagesById:()=>wr,getContextValue:()=>vr,getLegalRuntimeValue:()=>Ir,getRenderId:()=>Sr,legacyDoTransform:()=>cr,loadBricks:()=>br,loadEditors:()=>Er,mountUseBrick:()=>sr,renderUseBrick:()=>ir,setRealTimeDataInspectRoot:()=>Or,symbolForRootRuntimeContext:()=>or,unmountUseBrick:()=>ar,updateSnippetPreviewSettings:()=>mr,updateStoryboard:()=>lr,updateStoryboardByRoute:()=>ur,updateStoryboardBySnippet:()=>hr,updateStoryboardByTemplate:()=>dr,updateTemplatePreviewSettings:()=>pr});var o=n(4586),i=n(918),s=n(6121),a=n(829),c=n(7318),l=n(9424),u=n(279),d=n(1302),p=(n(6036),n(2890));function f(){const e=document.querySelector("base");return e?e.getAttribute("href"):"/"}var h=n(1030);function m(e,t){const n=(0,h.orderBy)(e,(e=>{var t;return(null===(t=e.app.homepage)||void 0===t?void 0:t.length)??0}),"desc");for(const e of n){const n=e.app.homepage;if("string"==typeof n&&"/"===n[0]&&g(n,t))return e}}function g(e,t){return"/"===e?t===e:`${t.replace(/\/+$/,"")}/`.startsWith(`${e.replace(/\/+$/,"")}/`)}function v(e){var t;return!e||(null===(t=ci().getCurrentApp())||void 0===t?void 0:t.id)!==e.app.id&&!window.STANDALONE_MICRO_APPS&&e.app.standaloneMode}let y,w=!1;function b(e,t){w=!confirm(e),t(!w)}function E(e){const{push:t,replace:n}=e;function r(r){return function(o,i,s){let a;const c="string"==typeof o;return a=c?(0,p.parsePath)(o).pathname:o.pathname,"string"==typeof a&&a.startsWith("/")&&v(function(e){var t;return m((null===(t=ri)||void 0===t?void 0:t.storyboards)??[],e)}(a))?location["push"===r?"assign":"replace"](c?f()+o.substring(1):e.createHref(o)):("push"===r?t:n)(o,i,s)}}return{push:r("push"),replace:r("replace")}}function S(){var e;const{dll:t}=window;if(t&&null!==(e=window.BRICK_NEXT_VERSIONS)&&void 0!==e&&null!==(e=e["brick-container"])&&void 0!==e&&e.startsWith("2."))return t("tYg3")}function A(){if(!y){const e=(0,p.createBrowserHistory)({basename:f().replace(/\/$/,""),getUserConfirmation:b});Object.assign(e,function(e){const{push:t,replace:n}=e;function r(e,n,r){w=!1,t(e,n),null==r||r(w)}function o(e,t,r){w=!1,n(e,t),null==r||r(w)}function i(t){return function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;const{extraQuery:a,clear:c,keepHash:l,...u}=i,d=new URLSearchParams(c?"":e.location.search),p={};Object.assign(p,n,a);for(const[e,t]of Object.entries(p))if(Array.isArray(t)){d.delete(e);for(const n of t)d.append(e,n)}else null==t||""===t?d.delete(e):d.set(e,t);("push"===t?r:o)(`?${d.toString()}${l?e.location.hash:""}`,u,s)}}let s;return{pushQuery:i("push"),replaceQuery:i("replace"),pushAnchor:function(t,n,o){r({...e.location,key:void 0,hash:t,state:{notify:!1,...n}},void 0,o)},reload:function(t){o({...e.location,state:{...e.location.state,notify:!0,noIncremental:!0}},void 0,t)},setBlockMessage:function(e){s=e},getBlockMessage:function(){return s},unblock:function(){s=void 0},...E({...e,push:r,replace:o})}}(e)),y=e}return y}const k=function(){const e=S();if(e)return e.getHistory}()||function(){return y};var I=n(4635),C=n(2559),R=n(9422),O=n(8897),T=n(877),_=n(8965),P=n(1680),M=new WeakMap;const x=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomProcessor(t,n)})}()||new class{constructor(){(0,i.A)(this,M,new Map)}define(e,t){const[n,r]=e.split(".");let o=(0,a.A)(M,this).get(n);if(o||(o=new Map,(0,a.A)(M,this).set(n,o)),o.has(r))throw new Error(`Custom processor of "${e}" already registered`);o.set(r,t)}get(e){return(0,a.A)(M,this).get(e)}};function L(e){let{app:t,meta:n}=e;if(null!=n&&n.i18n){const e=B("app",t.id),r=[];return Object.entries(n.i18n).forEach((t=>{let[n,o]=t;c.i18n.addResourceBundle(n,e,o),r.push(n)})),()=>{for(const t of r)c.i18n.removeResourceBundle(t,e)}}}function B(e,t){return`${e}/${t}`}function $(e){return c.i18n.getFixedT(null,B("widget",e))}const N=function(){const e=S();if(e)return function(t,n){return e.getRuntime().registerWidgetI18n(t,n)}}()||function(e,t){const n=B("widget",e);Object.entries(t).forEach((e=>{let[t,r]=e;c.i18n.addResourceBundle(t,n,r)}))},U="brick-next-devtools-panel",F="devtools-frame-active-change",D="devtools-panel-change";let j,K=!0;function V(e,t){const n=W();if(!n||"evaluation"===e&&(!K||j&&"Evaluations"!==j))return;const r=()=>{var r;null===(r=n.emit)||void 0===r||r.call(n,{type:e,payload:t})};"function"==typeof window.requestIdleCallback?window.requestIdleCallback(r):setTimeout(r,0)}function W(){return window.__BRICK_NEXT_DEVTOOLS_HOOK__}const H=()=>{throw new Error("Can't modify read-only proxy object")},G={set:H,defineProperty:H,deleteProperty:H,setPrototypeOf:H};function z(e){return new Proxy(e,G)}function q(e){let{get:t,ownKeys:n}=e;return W()?z(Object.fromEntries(n(null).map((e=>[e,t(null,e,null)])))):new Proxy(Object.freeze({}),{get:t})}let Y="light";const X=new u.JsonStorage(localStorage),J="apps-theme";function Q(e){if("dark"!==e&&"light"!==e&&"dark-v2"!==e)throw new Error(`Unsupported theme: ${e}`);Y=e}function Z(){return Y}function ee(){return document.documentElement.dataset.theme}function te(e){e?Q(e):e=Z(),e!==ee()&&(document.documentElement.dataset.theme=e,window.dispatchEvent(new CustomEvent("theme.change",{detail:e})))}function ne(e){X.setItem(J,{...re(),...e})}function re(){let e;try{e=X.getItem(J)}catch{console.error("JSON parse error inside `getLocalAppsTheme()`")}return e??{}}let oe="default";function ie(e){if("dashboard"!==e&&"default"!==e)throw new Error(`Unsupported mode: ${e}`);oe=e}function se(){return document.documentElement.dataset.mode}function ae(e){e?ie(e):e=oe,e!==se()&&(document.documentElement.dataset.mode=e,window.dispatchEvent(new CustomEvent("mode.change",{detail:e})))}function ce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return n&&(null===(t=window.getComputedStyle(n))||void 0===t?void 0:t.getPropertyValue(e))||""}function le(e,t){const n={};for(const r of e){const e=ue(r,t);void 0!==e&&(n[r]=e)}return n}function ue(e,t){var n,r,o;let{collectCoverage:i,widgetId:s,widgetVersion:a,app:l,appendI18nNamespace:u,storyboardFunctions:d,isStoryboardFunction:p}=t;switch(e){case"BASE_URL":return i?"/next":f().replace(/\/$/,"");case"FN":return d;case"IMG":return i?{get:e=>`mock/images/${e}`}:s?null==si||null===(n=si.images)||void 0===n?void 0:n.widgetImagesFactory(s,a):null==si||null===(r=si.images)||void 0===r?void 0:r.imagesFactory(l.id,l.isBuildPush,l.currentVersion);case"I18N":return i?h.identity:s?$(s):c.i18n.getFixedT(null,[u,B("app",l.id)].filter(Boolean));case"I18N_TEXT":return i?de:c.i18nText;case"PERMISSIONS":return z({check:i?pe:null==si||null===(o=si.checkPermissions)||void 0===o?void 0:o.checkPermissions});case"THEME":return z({getTheme:i?()=>"light":Z});case"console":return p?z(console):void 0;case"location":return i?{href:"http://localhost:3000/functions/test",origin:"http://localhost:3000",host:"localhost:3000",hostname:"localhost"}:{href:location.href,origin:location.origin,host:location.host,hostname:location.hostname}}}function de(e){return null==e?void 0:e.en}function pe(){return!0}function fe(){let{widgetId:e,widgetVersion:t,collectCoverage:n,debuggerOverrides:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=new Map,i=null==r?void 0:r({precookFunction:O.precookFunction,cook:O.cook,supply:P.supply}),s=new Proxy(Object.freeze({}),{get:(c,l)=>function(c){const l=o.get(c);if(!l)return;if(l.processed)return l.cooked;let u;n&&(u=n.createCollector(c));const d=(0,O.precookFunction)(l.source,{typescript:l.typescript,hooks:u&&{beforeVisit:u.beforeVisit},cacheKey:l}),p=(0,P.supply)(d.attemptToVisitGlobals,le(d.attemptToVisitGlobals,{collectCoverage:n,widgetId:e,widgetVersion:t,app:a,storyboardFunctions:s,isStoryboardFunction:!0}),!!n);return l.cooked=(0,O.cook)(d.function,l.source,{rules:{noVar:!0},globalVariables:i?{...p,...null!=i&&i.LodashWithStaticFields&&d.attemptToVisitGlobals.has("_")?{_:{...p._,...i.LodashWithStaticFields}}:null,...null!=i&&i.ArrayConstructor&&d.attemptToVisitGlobals.has("Array")?{Array:i.ArrayConstructor}:null,...null!=i&&i.ObjectWithStaticFields&&d.attemptToVisitGlobals.has("Object")?{Object:{...p.Object,...i.ObjectWithStaticFields}}:null}:p,ArrayConstructor:null==i?void 0:i.ArrayConstructor,hooks:u&&{beforeEvaluate:u.beforeEvaluate,beforeCall:u.beforeCall,beforeBranch:u.beforeBranch},debug:!!r}),l.processed=!0,l.cooked}(l)});let a;return{storyboardFunctions:s,registerStoryboardFunctions:function(e,t){if(t&&(a=t),o.clear(),Array.isArray(e))for(const t of e){const e=(0,T.collectMemberUsageInFunction)(t,"FN",!!n),r=(0,T.collectMemberUsageInFunction)(t,"PERMISSIONS",!!n).has("check");o.set(t.name,{source:t.source,typescript:t.typescript,deps:e,hasPermissionsCheck:r})}},updateStoryboardFunction(e,t){const n={...t,name:e},r=(0,T.collectMemberUsageInFunction)(n,"FN",!0),i=(0,T.collectMemberUsageInFunction)(n,"PERMISSIONS",!0).has("check");o.set(e,{source:t.source,typescript:t.typescript,deps:r,hasPermissionsCheck:i})},checkPermissionsUsage(e){const t=new Set,n=e=>{if(!t.has(e)){t.add(e);const r=o.get(e);return!!r&&(r.hasPermissionsCheck||[...r.deps].some(n))}return!1};return e.some(n)},clearGlobalExecutionContextStack(){(0,O.__dev_only_clearGlobalExecutionContextStack)()},getGlobalExecutionContextStack:()=>(0,O.__dev_only_getGlobalExecutionContextStack)()}}const{storyboardFunctions:he,registerStoryboardFunctions:me,checkPermissionsUsage:ge}=fe();var ve={};try{ve.EventTarget=(new EventTarget).constructor}catch(e){!function(e,t){var n=e.create,r=e.defineProperty,o=i.prototype;function i(){t.set(this,n(null))}function s(e,t,n){r(e,t,{configurable:!0,writable:!0,value:n})}function a(e){var t=e.options;return t&&t.once&&e.target.removeEventListener(this.type,e.listener),"function"==typeof e.listener?e.listener.call(e.target,this):e.listener.handleEvent(this),this._stopImmediatePropagationFlag}s(o,"addEventListener",(function(e,n,r){for(var o=t.get(this),i=o[e]||(o[e]=[]),s=0,a=i.length;s<a;s++)if(i[s].listener===n)return;i.push({target:this,listener:n,options:r})})),s(o,"dispatchEvent",(function(e){var n=t.get(this)[e.type];return n&&(s(e,"target",this),s(e,"currentTarget",this),n.slice(0).some(a,e),delete e.currentTarget,delete e.target),!0})),s(o,"removeEventListener",(function(e,n){for(var r=t.get(this),o=r[e]||(r[e]=[]),i=0,s=o.length;i<s;i++)if(o[i].listener===n)return void o.splice(i,1)})),ve.EventTarget=i}(Object,new WeakMap)}const ye=ve.EventTarget;let we=function(e){return e.xLarge="xLarge",e.large="large",e.medium="medium",e.small="small",e.xSmall="xSmall",e}({});const be=new Map([[we.xLarge,"1920px"],[we.large,"1600px"],[we.medium,"1280px"],[we.small,"1024px"],[we.xSmall,0]]),Ee=new ye,Se={},Ae={};function ke(e,t){let n=!1;Se[t]=e.matches;for(const[e]of be)if(Se[e]&&Ae.breakpoint!==e){Ae.breakpoint=e,n=!0;break}n&&Ee.dispatchEvent(new CustomEvent("change",{detail:Ae}))}be.forEach(((e,t)=>{const n=window.matchMedia(`(min-width: ${e})`);ke(n,t),n.addEventListener?n.addEventListener("change",(e=>{ke(e,t)})):n.addListener((e=>{ke(e,t)}))}));const Ie=()=>Ae;function Ce(e){return function(t){const n="local"===e?localStorage:sessionStorage;return JSON.parse(n.getItem(t)??"null")}}function Re(e){var t,n;return!(null===(t=e?e.flags:null===(n=ci())||void 0===n?void 0:n.getFeatureFlags())||void 0===t||!t["brick-next-v3-strict-mode"])}function Oe(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];const i=0===r.length?"":",";e?console.error(`${t} is dropped in v3 strict mode${i}`,...r):console.warn(`${t} is deprecated in v3 and will be dropped in strict mode${i}`,...r)}const Te=new Set(["prefix"]);var _e=new WeakMap;const Pe=function(){const e=S();if(e)return Object.freeze({define:(t,n)=>e.getRuntime().registerCustomTemplate(t,n)})}()||new class{constructor(){(0,i.A)(this,_e,new Map)}define(e,t){var n,r;let o=(0,a.A)(_e,this).has(e);o?console.warn(`Custom template of "${e}" already registered.`):(o=!!customElements.get(e),o&&console.warn(`Custom template of "${e}" already defined by customElements.`));const i=Re(),s=(null===(n=t.proxy)||void 0===n?void 0:n.properties)??{},c=[],l=[];for(const[t,n]of Object.entries(s))n.asVariable?(Oe(i,"Template `asVariable`",e,t),i||l.push(t)):n.mergeProperty||n.refTransform?console.error("Template `mergeProperty` and `refTransform` are dropped in v3:",e,t):n.ref&&c.push([t,n]);const u={...t,proxy:{...t.proxy,properties:Object.fromEntries(c)},state:(t.state?i?t.state:t.state.map((e=>({expose:!0,...e}))):[]).concat(l.map((e=>({name:e,expose:!0}))))};(0,a.A)(_e,this).set(e,{...u,name:e});const d=(p=u.state,(0,h.uniq)((null==p?void 0:p.filter((e=>e.expose)).map((e=>e.name)))??[]));var p;const f=Object.entries((null===(r=u.proxy)||void 0===r?void 0:r.methods)??{}),m=d.concat(c.map((e=>e[0]))),g=f.map((e=>e[0])),v=m.concat(g).filter((e=>e in HTMLElement.prototype&&!Te.has(e)));if(v.length>0&&(Oe(i,"Using native HTMLElement properties as template properties or methods",e,...v),i))throw new Error(`In custom template "${e}", ${v.map((e=>`"${e}"`)).join(", ")} are native HTMLElement properties, and should be avoid to be used as brick properties or methods.`);if(!o){class t extends HTMLElement{get $$typeof(){return"custom-template"}static get _dev_only_definedProperties(){return m}static get _dev_only_definedMethods(){return g}$$getElementByRef(e){var t;return null===(t=this.$$tplStateStore)||void 0===t||null===(t=t.hostBrick)||void 0===t||null===(t=t.tplHostMetadata)||void 0===t||null===(t=t.internalBricksByRef.get(e))||void 0===t?void 0:t.element}connectedCallback(){let e=this.shadowRoot;e||(e=this.attachShadow({mode:"open"}));const t=document.createDocumentFragment(),n=document.createElement("style");n.textContent=":host{display:block}:host([hidden]){display:none}";const r=document.createElement("slot");t.appendChild(n),t.appendChild(r),e.appendChild(t)}disconnectedCallback(){this.shadowRoot&&(this.shadowRoot.textContent="")}}for(const n of d)c.some((e=>e[0]===n))?console.error(`Cannot define an exposed state that is also a proxy property: "${n}" in ${e}`):Object.defineProperty(t.prototype,n,{get(){return this.$$tplStateStore.getValue(n)},set(e){var t;null===(t=this.$$tplStateStore)||void 0===t||t.updateValue(n,e,"replace")},enumerable:!0});for(const[e,n]of c)Object.defineProperty(t.prototype,e,{get(){return this.$$getElementByRef(n.ref)[n.refProperty??e]},set(t){var r;const o=null===(r=this.$$getElementByRef)||void 0===r?void 0:r.call(this,n.ref);o&&(o[n.refProperty??e]=t)},enumerable:!0});for(const[e,n]of f)Object.defineProperty(t.prototype,e,{value(){return this.$$getElementByRef(n.ref)[n.refMethod??e](...arguments)},enumerable:!0});customElements.define(e,t)}}get(e){return(0,a.A)(_e,this).get(e)}};function Me(e,t,n){let{tplStateStoreId:r,tplStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of a custom template${n??""}`);const i=o.get(r);if(!i)throw new Error(`Template state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return i}function xe(e,t,n){const r=Me(e,t,n).hostBrick.element;if(!r)throw new Error(`Template host element is gone when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return r}const Le=new Map,Be=new Proxy(Object.freeze({}),{get:(e,t)=>Le.get(t)}),$e=function(){const e=S();if(e)return function(t,n,r){return e.getRuntime().registerWidgetFunctions(t,n,r)}}()||function(e,t,n){if(Le.has(e))throw new Error(`Widget functions of "${e}" already registered`);const{storyboardFunctions:r,registerStoryboardFunctions:o}=fe({widgetId:e,widgetVersion:n});Le.set(e,r),o(t)},Ne=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ue=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(Ne);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Fe=e=>"*"===e||"x"===e||"X"===e,De=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},je=(e,t)=>{if(Fe(e)||Fe(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(De(e),De(t));return n>r?1:n<r?-1:0},Ke=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=je(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0},Ve=(e,t,n)=>{Ge(n);const r=((e,t)=>{const n=Ue(e),r=Ue(t),o=n.pop(),i=r.pop(),s=Ke(n,r);return 0!==s?s:o&&i?Ke(o.split("."),i.split(".")):o||i?o?-1:1:0})(e,t);return We[n].includes(r)},We={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},He=Object.keys(We),Ge=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===He.indexOf(e))throw new Error(`Invalid operator, expected one of ${He.join("|")}`)};function ze(e,t){let n=vi(e);if(!n&&null!=si&&si.checkInstalledApps&&(n=si.checkInstalledApps.getCheckedApp(e)),!n||"running"===n.installStatus)return!1;if(!t||!n.currentVersion)return!0;const r=t.match(/^([><]=?|=)(.*)$/);try{if(!r)throw new TypeError(`Invalid match version: ${t}`);return Ve(n.currentVersion,r[2],r[1])}catch(e){console.error(e)}return!1}function qe(e,t,n){let{formStateStoreId:r,formStateStoreMap:o}=e;if(!r)throw new Error(`Using "${t}" outside of form renderer${n??""}`);const i=o.get(r);if(!i)throw new Error(`Form state store is not found when using "${t}"${n??""}.\nThis is a bug of Brick Next, please report it.`);return i}const Ye=new Map;async function Xe(e){var t;const n=null==si||null===(t=si.flowApi)||void 0===t?void 0:t.isFlowApiProvider(e);n&&(e=si.flowApi.FLOW_API_PROVIDER);let r=Ye.get(e);if(r)return r;if(e.includes("-")&&!customElements.get(e))if(n)si.flowApi.registerFlowApiProvider();else if(await(0,l.loadBricksImperatively)([e],pi()),!customElements.get(e))throw new Error(`Provider not defined: "${e}".`);return r=document.createElement(e),Ye.set(e,r),r}let Je=new WeakSet;function Qe(e){if((0,u.isObject)(e)&&!Ze(e))if(Je.add(e),Array.isArray(e))e.forEach(Qe);else{const t=Object.getPrototypeOf(e);t&&t.constructor!==Object||Object.values(e).forEach(Qe)}}function Ze(e){return Je.has(e)}const et=new Map;async function tt(e,t,n){const{useProvider:r,method:o="resolve",args:i=[],onReject:s}=e,{provider:a,field:c}=e;if(a&&!r)throw new Error(`You're using "provider: ${a}" which is dropped in v3, please use "useProvider" instead`);const l=null!=c;if(l){const e=Re();if(Oe(e,"`resolve.field`"),e)throw new Error("Using deprecated `resolve.field`")}const[u,d]=await Promise.all([Xe(r),mt(i,t)]),p=null==n?void 0:n.renderId,f=nt(u,r,o,d,n,i,!!p&&p!==hi());let m,{transform:g}=e;try{const e=await f;m=l?(0,h.get)(e,c):e,Qe(m)}catch(e){if(!function(e){return!(null==e||!e.transform)}(s))throw e;g=s.transform,m=e}return g?"string"==typeof g?{[g]:m}:mt(g,{...t,data:m}):m}async function nt(e,t,n,r,o,i,s){let a,c;try{a=JSON.stringify({useProvider:t,method:n,args:r})}catch(e){if(!i)throw e;a=JSON.stringify({useProvider:t,method:n,originalArgs:i})}return"reload"!==(null==o?void 0:o.cache)&&(c=et.get(a)),c||(c=(async o=>{const i=null!=si&&null!==(o=si.flowApi)&&void 0!==o&&o.isFlowApiProvider(t)?await si.flowApi.getArgsOfFlowApi(t,r,n):r;return e[n](...i)})(),s||et.set(a,c)),c}const rt=Symbol.for("pre.evaluated.raw"),ot=Symbol.for("pre.evaluated.context");function it(e){return!(null==e||!e[rt])}function st(e){return e[rt]}function at(e){return"string"==typeof e?(0,O.shouldAllowRecursiveEvaluations)(e):(0,O.shouldAllowRecursiveEvaluations)(e[rt])}const ct=new WeakSet([SyntaxError,TypeError,ReferenceError]);function lt(e){return ct.has(e.constructor)?e.constructor:TypeError}function ut(e,t,n){const{run:r}=dt(e,t,n,!1);return r()}function dt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const o=[];if("string"!=typeof e){const n=(0,h.omit)(t,["pendingPermissionsPreCheck","tplStateStoreMap","tplStateStoreScope","formStateStoreMap","formStateStoreScope"]);t={...e[ot],...n},e=e[rt]}const i={usedArgs:new Set},s={usedArgs:new Set};let a;try{a=(0,O.preevaluate)(e,{cache:!0,withParent:!0,hooks:{beforeVisitGlobal(e,t){(0,T.collectAppGetMenuUsage)(i,e,t),(0,T.collectInstalledAppsHasUsage)(s,e,t)}}})}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}if(i.hasNonStaticUsage)throw new Error(`Non-static usage of "APP.getMenu" is prohibited in v3, check your expression: "${e}"`);if(s.hasNonStaticUsage)throw new Error(`Non-static usage of "INSTALLED_APPS.has" is prohibited in v3, check your expression: "${e}"`);const c={},{attemptToVisitGlobals:d}=a;if(n.lazy||d.has("EVENT")&&!(0,u.hasOwnProperty)(t,"event")||d.has("DATA")&&!(0,u.hasOwnProperty)(t,"data"))return{blockingList:o,run:()=>Object.keys(t).length>0?{[rt]:e,[ot]:t}:e};let p,f,m,g;const v=Re(t);let y,w;(d.has("STATE")||!v&&d.has("TPL"))&&(g=Me(t,"STATE",`: "${e}"`)),d.has("FORM_STATE")&&(w=qe(t,"FORM_STATE",`: "${e}"`));const b=W();if(r||b){if(d.has("CTX")&&(p=(0,T.strictCollectMemberUsage)(e,"CTX"),r&&o.push(t.ctxStore.waitFor(p))),g){if(m=(0,T.strictCollectMemberUsage)(e,"STATE"),!v){const t=(0,T.strictCollectMemberUsage)(e,"TPL");for(const e of t)m.add(e)}r&&o.push(g.waitFor(m))}w&&(y=(0,T.strictCollectMemberUsage)(e,"FORM_STATE"),r&&o.push(w.waitFor(y))),d.has("PROCESSORS")&&(f=(0,T.strictCollectMemberUsage)(e,"PROCESSORS",2),r&&o.push((0,l.loadProcessorsImperatively)(f,pi())))}if(r){let n=d.has("PERMISSIONS");if(!n&&d.has("FN")){const t=[...(0,T.strictCollectMemberUsage)(e,"FN")];n=ge(t)}if(n&&o.push(...t.pendingPermissionsPreCheck),i.usedArgs.size>0&&null!=si&&si.menu){const e=[...i.usedArgs];o.push(Promise.all(e.map((e=>si.menu.fetchMenuById(e,t,{getStoryboardByAppId:gi,resolveData:tt,asyncComputeRealValue:mt})))))}var E;s.usedArgs.size>0&&o.push(null==si||null===(E=si.checkInstalledApps)||void 0===E?void 0:E.waitForCheckingApps([...s.usedArgs]))}return{blockingList:o,run(){var n,r;const{app:o,location:i,query:s,match:l,flags:b,sys:E,ctxStore:S,data:A,event:k}=t,I=t.overrideApp??o;for(const o of d)switch(o){case"ANCHOR":c[o]=i.hash?i.hash.substring(1):null;break;case"APP":if(null==I)throw new ReferenceError(`APP is not defined, in "${e}"`);c[o]={...(0,h.cloneDeep)(I),getMenu:null==si||null===(n=si.menu)||void 0===n?void 0:n.getMenuById};break;case"CTX":c[o]=q({get:(e,t)=>S.getValue(t),ownKeys:()=>Array.from(p)});break;case"DATA":c[o]=A;break;case"EVENT":c[o]=k;break;case"FLAGS":c[o]=z(b);break;case"FORM_STATE":c[o]=q({get:(e,t)=>w.getValue(t),ownKeys:()=>Array.from(y)});break;case"HASH":c[o]=i.hash;break;case"INSTALLED_APPS":c[o]=z({has:ze});break;case"ITEM":case"INDEX":case"SIZE":{const n="ITEM"===o?"forEachItem":"INDEX"===o?"forEachIndex":"forEachSize";(0,u.hasOwnProperty)(t,n)?c[o]=t[n]:console.error(`Using \`${o}\` but no \`:forEach\` is found, check your expression: "${e}"`);break}case"LOCAL_STORAGE":c[o]=z({getItem:Ce("local")});break;case"MEDIA":c[o]=z(Ie());break;case"MISC":c[o]=ci().getMiscSettings();break;case"PARAMS":if(null==s)throw new ReferenceError(`PARAMS is not defined, in "${e}"`);c[o]=new URLSearchParams(s);break;case"PATH":c[o]=z((null==l?void 0:l.params)??{});break;case"PATH_NAME":c[o]=i.pathname;break;case"PROCESSORS":c[o]=q({get(e,t){const n=x.get(t);if(!n)throw new Error(`'PROCESSORS.${t}' is not registered! Have you installed the relevant brick package?`);return q({get:(e,t)=>n.get(t),ownKeys:()=>Array.from(n.keys())})},ownKeys(){const e=new Set;for(const t of f){const n=t.split(".")[0];e.add(n)}return Array.from(e)}});break;case"QUERY":if(null==s)throw new ReferenceError(`QUERY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.get(e)])));break;case"QUERY_ARRAY":if(null==s)throw new ReferenceError(`QUERY_ARRAY is not defined, in "${e}"`);c[o]=Object.fromEntries(Array.from(s.keys()).map((e=>[e,s.getAll(e)])));break;case"SESSION_STORAGE":c[o]=z({getItem:Ce("session")});break;case"TPL":if(Oe(v,'Using "TPL" in expression',`check your expression: "${e}"`),v)break;case"STATE":c[o]=q({get:(e,t)=>g.getValue(t),ownKeys:()=>Array.from(m)});break;case"SYS":c[o]=z(E??{});break;case"__WIDGET_FN__":c[o]=Be;break;case"__WIDGET_IMG__":c[o]=null==si||null===(r=si.images)||void 0===r?void 0:r.widgetImagesFactory;break;case"__WIDGET_I18N__":c[o]=$}Object.assign(c,le(a.attemptToVisitGlobals,{storyboardFunctions:he,app:I,appendI18nNamespace:t.appendI18nNamespace}));try{const t=(0,O.cook)(a.expression,a.source,{globalVariables:(0,P.supply)(a.attemptToVisitGlobals,c)});return V("evaluation",{raw:e,context:c,result:t}),t}catch(t){const n=`${t.message}, in "${e}"`;throw new(lt(t))(n)}}}}let pt=function(e){return e[e.INITIAL=0]="INITIAL",e[e.USE_BRICK=1]="USE_BRICK",e[e.USE_BRICK_ITEM=2]="USE_BRICK_ITEM",e[e.USE_BRICK_PROPERTIES=3]="USE_BRICK_PROPERTIES",e[e.USE_BRICK_TRANSFORM=4]="USE_BRICK_TRANSFORM",e[e.USE_BRICK_EVENTS=5]="USE_BRICK_EVENTS",e[e.USE_BRICK_IF=6]="USE_BRICK_IF",e[e.USE_BRICK_SLOTS=7]="USE_BRICK_SLOTS",e[e.USE_BRICK_SLOTS_ITEM=8]="USE_BRICK_SLOTS_ITEM",e[e.USE_BRICK_SLOTS_ITEM_BRICKS=9]="USE_BRICK_SLOTS_ITEM_BRICKS",e[e.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM=10]="USE_BRICK_SLOTS_ITEM_BRICKS_ITEM",e[e.USE_BRICK_LIFECYCLE=11]="USE_BRICK_LIFECYCLE",e[e.USE_BRICK_DATA_SOURCE=12]="USE_BRICK_DATA_SOURCE",e}({});function ft(e){switch(e){case pt.USE_BRICK_PROPERTIES:case pt.USE_BRICK_TRANSFORM:case pt.USE_BRICK_EVENTS:case pt.USE_BRICK_IF:case pt.USE_BRICK_LIFECYCLE:case pt.USE_BRICK_DATA_SOURCE:return!0}return!1}function ht(e,t,n){if(ft(e))return e;if(t)switch(e){case pt.USE_BRICK:return pt.USE_BRICK_ITEM;case pt.USE_BRICK_SLOTS_ITEM_BRICKS:return pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM}else switch(e){case pt.INITIAL:if("useBrick"===n)return pt.USE_BRICK;break;case pt.USE_BRICK:case pt.USE_BRICK_ITEM:case pt.USE_BRICK_SLOTS_ITEM_BRICKS_ITEM:switch(n){case"properties":return pt.USE_BRICK_PROPERTIES;case"transform":return pt.USE_BRICK_TRANSFORM;case"dataSource":return pt.USE_BRICK_DATA_SOURCE;case"events":return pt.USE_BRICK_EVENTS;case"slots":return pt.USE_BRICK_SLOTS;case"children":return pt.USE_BRICK_SLOTS_ITEM_BRICKS;case"if":return pt.USE_BRICK_IF;case"lifeCycle":return pt.USE_BRICK_LIFECYCLE}break;case pt.USE_BRICK_SLOTS:return pt.USE_BRICK_SLOTS_ITEM;case pt.USE_BRICK_SLOTS_ITEM:if("bricks"===n)return pt.USE_BRICK_SLOTS_ITEM_BRICKS}return pt.INITIAL}async function mt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=await async function(e,t,n){const{blockingList:r,run:o}=dt(e,t,n,!0);return await Promise.all(r),o()}(e,t,{lazy:o}),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?yt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return Promise.all(e.map((e=>mt(e,t,r))))}return Object.fromEntries((await Promise.all(Object.entries(e).map((e=>{let[r,o]=e;return Promise.all([mt(r,t),mt(o,t,vt(n,!1,r))])})))).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function gt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=it(e);if(r||"string"==typeof e){const o=n.$$lazyForUseBrick&&ft(n.$$stateOfUseBrick);let i,s=o;return r||(0,O.isEvaluable)(e)?(i=ut(e,t),s=at(e)):i=o?e:((0,u.hasOwnProperty)(t,"data")?n.noInject?_.transform:_.transformAndInject:n.noInject?yt:_.inject)(e,t),s||Qe(i),i}if(!(0,u.isObject)(e)||Ze(e)||"function"==typeof e)return e;if(Array.isArray(e)){const r=vt(n,!0);return e.map((e=>gt(e,t,r)))}return Object.fromEntries(Object.entries(e).map((e=>{let[r,o]=e;return[gt(r,t),gt(o,t,vt(n,!1,r))]})).concat(n.ignoreSymbols?[]:Object.getOwnPropertySymbols(e).map((t=>[t,e[t]]))))}function vt(e,t,n){return e.$$lazyForUseBrick?{...e,$$stateOfUseBrick:ht(e.$$stateOfUseBrick,t,n)}:e}function yt(e){return e}async function wt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?await mt(e.if,t):e.if)}function bt(e,t){return!(0,u.hasOwnProperty)(e,"if")||!!("string"==typeof e.if||it(e.if)?gt(e.if,t):e.if)}function Et(e){return!(0,u.hasOwnProperty)(e,"if")||!!e.if}const St=function(){const e=S();if(e)return e.looseCheckIfByTransform}()||function(e,t){return bt(e,{data:t})};function At(e){let t=!1,n=!1,r=!1;if("string"==typeof e?(0,O.isEvaluable)(e):it(e)){const o="string"==typeof e?e:st(e);if((0,O.isTrackAll)(o)){const e=(0,T.trackAll)(o);e&&(t=e.context,n=e.state,r=e.formState)}else t=(0,T.track)(o,"track context","CTX"),n=(0,T.track)(o,"track state","STATE"),r=(0,T.track)(o,"track formstate","FORM_STATE")}return{contextNames:t,stateNames:n,formStateNames:r}}async function kt(e,t){for(const[n,r,o]of e)if(n===t){const e=await r;if(void 0!==e||!o)return e}}async function It(e){const t={};for(const[n,r,o]of e){const e=await r;void 0===e&&o||!("style"!==n&&"dataset"!==n||(0,u.isObject)(e))||(t[n]=e)}return t}function Ct(e,t){if(t)for(const[n,r]of Object.entries(t))switch(n){case"style":case"dataset":for(const[t,o]of Object.entries(r))e[n][t]=o;break;case"constructor":case"__proto__":case"innerHTML":throw new Error(`set \`${n}\` is prohibited`);default:e[n]=r}}function Rt(e,t,n){const r=function(e,t){return(0,u.isObject)(e)?Object.fromEntries(Object.entries(e).map((e=>{let[n,r]=e;const o=gt(r,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===n?pt.USE_BRICK:pt.INITIAL});if("style"!==n&&"dataset"!==n||(0,u.isObject)(o))return[n,o]})).filter(Boolean)):{}}(t,n);Array.isArray(e)||(e=[e]),e.forEach((e=>{Ct(e,r)}))}function Ot(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Tt(e){return e&&e.sensitive?"":"i"}function _t(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,i=n.start,s=void 0===i||i,a=n.end,c=void 0===a||a,l=n.encode,u=void 0===l?function(e){return e}:l,d=n.delimiter,p=void 0===d?"/#?":d,f=n.endsWith,h="[".concat(Ot(void 0===f?"":f),"]|$"),m="[".concat(Ot(p),"]"),g=s?"^":"",v=0,y=e;v<y.length;v++){var w=y[v];if("string"==typeof w)g+=Ot(u(w));else{var b=Ot(u(w.prefix)),E=Ot(u(w.suffix));if(w.pattern)if(t&&t.push(w),b||E)if("+"===w.modifier||"*"===w.modifier){var S="*"===w.modifier?"?":"";g+="(?:".concat(b,"((?:").concat(w.pattern,")(?:").concat(E).concat(b,"(?:").concat(w.pattern,"))*)").concat(E,")").concat(S)}else g+="(?:".concat(b,"(").concat(w.pattern,")").concat(E,")").concat(w.modifier);else"+"===w.modifier||"*"===w.modifier?g+="((?:".concat(w.pattern,")").concat(w.modifier,")"):g+="(".concat(w.pattern,")").concat(w.modifier);else g+="(?:".concat(b).concat(E,")").concat(w.modifier)}}if(c)o||(g+="".concat(m,"?")),g+=n.endsWith?"(?=".concat(h,")"):"$";else{var A=e[e.length-1],k="string"==typeof A?m.indexOf(A[A.length-1])>-1:void 0===A;o||(g+="(?:".concat(m,"(?=").concat(h,"))?")),k||(g+="(?=".concat(m,"|").concat(h,")"))}return new RegExp(g,Tt(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var c=e.charCodeAt(a);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i="[^".concat(Ot(t.delimiter||"/#?"),"]+?"),s=[],a=0,c=0,l="",u=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},d=function(e){var t=u(e);if(void 0!==t)return t;var r=n[c],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},p=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t};c<n.length;){var f=u("CHAR"),h=u("NAME"),m=u("PATTERN");if(h||m){var g=f||"";-1===o.indexOf(g)&&(l+=g,g=""),l&&(s.push(l),l=""),s.push({name:h||a++,prefix:g,suffix:"",pattern:m||i,modifier:u("MODIFIER")||""})}else{var v=f||u("ESCAPED_CHAR");if(v)l+=v;else if(l&&(s.push(l),l=""),u("OPEN")){g=p();var y=u("NAME")||"",w=u("PATTERN")||"",b=p();d("CLOSE"),s.push({name:y||(w?a++:""),pattern:y&&!w?i:w,prefix:g,suffix:b,modifier:u("MODIFIER")||""})}else d("END")}}return s}(e,n),t,n)}function Pt(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return Pt(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),Tt(n))}(e,t,n):_t(e,t,n)}const Mt=new Map,xt=1e4;let Lt=0;function Bt(e,t){const{path:n,exact:r=!1,strict:o=!1,sensitive:i=!0}=t;return(Array.isArray(n)?n:[n]).reduce(((t,n)=>{if(t)return t;const{regexp:s,keys:a}=function(e,t){const n=`${t.end}${t.strict}${t.sensitive}`;let r=Mt.get(n);r||Mt.set(n,r=new Map);const o=r.get(e);if(o)return o;const i=[],s={regexp:Pt(e,i,t),keys:i};return Lt<xt&&(r.set(e,s),Lt++),s}(n,{end:r,strict:o,sensitive:i}),c=s.exec(e);if(!c)return null;const[l,...u]=c,d=e===l;return r&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce(((e,t,n)=>(e[t.name]=u[n],e)),{})}}),null)}function $t(e,t,n){return Bt(n,{path:e.path.replace(/^\$\{APP.homepage\}/,t),exact:e.exact})}const Nt=Symbol.for("tpl.asyncComputedPropsFromHost"),Ut=Symbol.for("tpl.stateStoreId"),Ft=Symbol.for("tpl.externalForEachItem"),Dt=Symbol.for("tpl.externalForEachIndex"),jt=Symbol.for("tpl.externalForEachSize"),Kt=new Set;let Vt=function(e){return e.REQUEST_FAILED="REQUEST_FAILED",e.SOMETHING_WENT_WRONG="SOMETHING_WENT_WRONG",e.LOGIN_TIMEOUT_MESSAGE="LOGIN_TIMEOUT_MESSAGE",e.NETWORK_ERROR="NETWORK_ERROR",e.LICENSE_EXPIRED="LICENSE_EXPIRED",e.NO_PERMISSION="NO_PERMISSION",e.PAGE_NOT_FOUND="PAGE_NOT_FOUND",e.APP_NOT_FOUND="APP_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.GO_BACK_TO_PREVIOUS_PAGE="GO_BACK_TO_PREVIOUS_PAGE",e.GO_BACK_HOME="GO_BACK_HOME",e}({});const Wt={[Vt.REQUEST_FAILED]:"Request Failed",[Vt.SOMETHING_WENT_WRONG]:"Something went wrong!",[Vt.LOGIN_TIMEOUT_MESSAGE]:"You haven't logged in or your login session has expired. Login right now?",[Vt.NETWORK_ERROR]:"Network error, please check your network.",[Vt.LICENSE_EXPIRED]:"The license authorization has expired, please contact the platform administrator",[Vt.NO_PERMISSION]:"Unauthorized access, unable to retrieve the required resources for this page",[Vt.PAGE_NOT_FOUND]:"Page not found, please check the URL",[Vt.APP_NOT_FOUND]:"App not found, maybe the URL is wrong or you don't have permission to access",[Vt.UNKNOWN_ERROR]:"Oops! Something went wrong",[Vt.GO_BACK_TO_PREVIOUS_PAGE]:"Go back to previous page",[Vt.GO_BACK_HOME]:"Go back to home page"},Ht={[Vt.REQUEST_FAILED]:"请求失败",[Vt.SOMETHING_WENT_WRONG]:"出现了一些问题!",[Vt.LOGIN_TIMEOUT_MESSAGE]:"您还未登录或登录信息已过期,现在重新登录?",[Vt.NETWORK_ERROR]:"网络错误,请检查您的网络连接。",[Vt.LICENSE_EXPIRED]:"License 授权失效,请联系平台管理员",[Vt.NO_PERMISSION]:"没有权限,无法获取页面所需要的资源",[Vt.PAGE_NOT_FOUND]:"请求的页面未找到,请确认 URL 是否正确",[Vt.APP_NOT_FOUND]:"请求的微应用无法找到, 可能是 URL 错误或者无权限访问",[Vt.UNKNOWN_ERROR]:"糟糕!页面出现了一些问题",[Vt.GO_BACK_TO_PREVIOUS_PAGE]:"回到上一页",[Vt.GO_BACK_HOME]:"回到首页"},Gt="core/runtime",zt={en:Wt,zh:Ht};let qt;const Yt=Object.freeze({show:function(e){if(qt)return qt.resolve(e);if("confirm"===e.type){const t=confirm(e.content);return new Promise(((e,n)=>setTimeout((()=>{(t?e:n)()}),1)))}return alert(e.content),new Promise((e=>setTimeout((()=>{e()}),1)))}});function Xt(e){const{search:t,pathname:n}=e,r=n?window.btoa(encodeURIComponent(n)):"",o=t?window.btoa(encodeURIComponent(t)):"";document.cookie=`SALOGINPATH=${r}; path=/`,document.cookie=`SALOGINQUERY=${o}; path=/`}function Jt(e){if(e instanceof Event&&e.target instanceof HTMLScriptElement)return e.target.src;if(e instanceof R.HttpFetchError)return c.i18n.t(`${Gt}:${Vt.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 Qt(e){return e instanceof R.HttpResponseError&&401===e.response.status&&!!e.responseJson&&100003===e.responseJson.code}let Zt,en,tn=!1;function nn(e){if(e instanceof R.HttpAbortError)return;if(Qt(e)&&!window.NO_AUTH_GUARD){if(tn)return;return tn=!0,void Yt.show({type:"confirm",content:c.i18n.t(`${Gt}:${Vt.LOGIN_TIMEOUT_MESSAGE}`)}).then((()=>{!function(){const e=ci().getFeatureFlags()["sso-enabled"],t=k();Xt(t.location),t.push(e?"/sso-auth/login":"/auth/login",{from:{...t.location,state:void 0}})}(),tn=!1}),(()=>{tn=!1}))}console.error(e);const t=Jt(e);t!==Zt&&(Zt=t,Yt.show({type:"error",title:c.i18n.t(`${Gt}:${Vt.REQUEST_FAILED}`),content:t,contentStyle:{whiteSpace:"pre-wrap",wordBreak:"break-word"}}).then((()=>{Zt=void 0})))}const rn=Object.freeze({show:function(e){en?en.resolve(e):alert(e.message)}});function on(e,t,n){t&&Object.entries(t).forEach((t=>{let[r,o]=t;const i=un(o,n,{element:e});e.addEventListener(r,i),e.$$listeners||(e.$$listeners=[]),e.$$listeners.push([r,i]),e.$$eventListeners||(e.$$eventListeners=[]);for(const t of[].concat(o))e.$$eventListeners.push([r,null,t])}))}function sn(e){return"string"==typeof e.action}function an(e){return"string"==typeof e.useProvider}function cn(e){return!(!e.target&&!e.targetRef||!e.method&&!e.properties)}function ln(e){return!!e.then}function un(e,t,n){return function(r){for(const o of[].concat(e))if(bt(o,{...t,event:r}))if(ln(o))un(o.then,t,n)(r);else if(sn(o)){const[e,i]=o.action.split(".");switch(o.action){case"history.push":case"history.replace":case"history.pushQuery":case"history.replaceQuery":case"history.pushAnchor":case"history.block":case"history.goBack":case"history.goForward":case"history.reload":case"history.unblock":hn(r,i,o.args,o.callback,t);break;case"window.open":mn(r,o.args,t);break;case"window.postMessage":gn(r,o.args,t);break;case"location.reload":case"location.assign":En(r,i,o.args,t);break;case"localStorage.setItem":case"localStorage.removeItem":case"sessionStorage.setItem":case"sessionStorage.removeItem":Sn(r,e,i,o.args,t);break;case"event.preventDefault":r.preventDefault();break;case"event.stopPropagation":r.stopPropagation();break;case"console.log":case"console.error":case"console.warn":case"console.info":An(r,i,o.args,t);break;case"message.success":case"message.error":case"message.info":case"message.warn":kn(r,i,o.args,t);break;case"handleHttpError":nn(r.detail);break;case"context.assign":case"context.replace":case"context.refresh":case"context.load":yn(r,i,o.args,o.batch??!0,o.callback,t);break;case"state.update":case"state.refresh":case"state.load":wn(r,i,o.args,o.batch??!0,o.callback,t);break;case"tpl.dispatchEvent":{const[e,n]=Rn(o.args,t,r);xe(t,o.action,`: ${e}`).dispatchEvent(new CustomEvent(e,n));break}case"formstate.update":bn(r,o.args,o.callback,t);break;case"message.subscribe":case"message.unsubscribe":In(r,i,o.args,t,n,o.callback);break;case"theme.setDarkTheme":case"theme.setLightTheme":te("theme.setDarkTheme"===o.action?"dark":"light");break;case"theme.setTheme":{const[e]=Rn(o.args,t,r);te(e);break}case"mode.setDashboardMode":case"mode.setDefaultMode":ae("mode.setDashboardMode"===o.action?"dashboard":"default");break;default:console.error("unknown event listener action:",o.action)}}else an(o)?dn(r,o,t,n):cn(o)?pn(r,o,t,n):console.error("unknown event handler:",o);else o.else&&un(o.else,t,n)(r)}}function dn(e,t,n,r){const o="saveAs"!==t.method?"resolve":"saveAs";fn(e,t.useProvider,t,o,n,r)}function pn(e,t,n,r){let o=[];const i=t.target,s=t.targetRef;let a=i;if(("string"==typeof i?(0,O.isEvaluable)(i):it(i))&&(a=gt(i,{...n,event:e})),"string"==typeof a)if("_self"===a)o.push(r.element);else if(t.multiple)o=Array.from(document.querySelectorAll(a));else{const e=document.querySelector(a);null!==e&&o.push(e)}else if(a)a instanceof HTMLElement?o.push(a):console.error("unexpected target:",a);else if(s){let t=s;("string"==typeof s?(0,O.isEvaluable)(s):it(s))&&(t=gt(s,{...n,event:e}));const r=[].concat(t),i=xe(n,"targetRef",`: ${r.join(", ")}`);o.push(...r.map((e=>{var t;return null===(t=i.$$getElementByRef)||void 0===t?void 0:t.call(i,e)})).filter(Boolean))}0!==o.length?function(e){return!!e.method}(t)?o.forEach((o=>{fn(e,o,t,t.method,n,r,{useEventAsDefault:!0})})):function(e){return!!e.properties}(t)&&Rt(o,t.properties,{...n,event:e}):console.error("target not found:",i||s)}async function fn(e,t,n,r,o,i,s){const a=an(n),c=async()=>{var i;const c=a?await Xe(t):t;if("function"!=typeof c[r])throw new Error(`target <${c.tagName.toLowerCase()}> has no method: ${r}`);let l=Rn(n.args,o,e,s);var u;return an(n)&&null!=si&&null!==(i=si.flowApi)&&void 0!==i&&i.isFlowApiProvider(n.useProvider)&&(l=await si.flowApi.getArgsOfFlowApi(n.useProvider,l,r,null===(u=n.sse)||void 0===u?void 0:u.stream)),c[r](...l)};if(!n.callback)return void c();const l=Cn(n.callback,o,i),u={progress:l("progress"),success:l("success"),error:l("error"),finally:l("finally")};if(a){var d,p;const t={...o,event:e};if(gt(null===(d=n.sse)||void 0===d?void 0:d.stream,t))return void async function(e,t){let{progress:n,success:r,error:o,finally:i}=t;const s=hi();try{const t=await e();for await(const e of t){if(s!==hi())return;null==n||n(e)}if(s!==hi())return;null==r||r()}catch(e){if(s!==hi())return;null==o||o(e)}finally{null==i||i()}}(c,u);if(gt(null===(p=n.poll)||void 0===p?void 0:p.enabled,t))return void function(e,t,n,r){let{progress:o,success:i,error:s,finally:a}=t;const{expectPollStopImmediately:c,expectPollEnd:l}=n,{interval:u,leadingRequestDelay:d,continueOnError:p,delegateLoadingBar:f}=gt((0,h.pick)(n,["interval","leadingRequestDelay","continueOnError","delegateLoadingBar"]),r),m=hi();let g;async function v(){let t;Kt.delete(g);try{var n;if(t=null===(n=gt(c,r))||void 0===n?void 0:n(),t)null==a||a();else{var d;const n=await e(),s=null===(d=gt(c,r))||void 0===d?void 0:d();var h;t=s||m!==hi(),t?s&&(null==a||a()):(null==o||o(n),null!==(h=gt(l,r))&&void 0!==h&&h(n)?(f&&window.dispatchEvent(new Event("request.end")),null==i||i(n),null==a||a()):y(u??3e3))}}catch(e){var v;const n=null===(v=gt(c,r))||void 0===v?void 0:v();t=n||m!==hi(),t?n&&(null==a||a()):(null==s||s(e),p?y(u??3e3):null==a||a())}finally{f&&t&&window.dispatchEvent(new Event("request.end"))}}function y(e){g=setTimeout(v,e),Kt.add(g)}y(d??0),f&&window.dispatchEvent(new Event("request.start"))}(c,u,n.poll,t)}try{const e=await c();u.success(e)}catch(e){u.error(e)}finally{u.finally()}}function hn(e,t,n,r,o){let i=0,s=!1,a=t;switch(t){case"push":case"replace":case"pushQuery":case"replaceQuery":case"pushAnchor":i=2,s=!0;break;case"reload":s=!0;break;case"block":i=1,a="setBlockMessage"}let c=[];if(i>0&&(c=Rn(n,o,e,{useEventDetailAsDefault:!0}),c.length=i),s&&r){const e=Cn(r,o,void 0);c.push((t=>{e(t?"error":"success")({blocked:t}),e("finally")({blocked:t})}))}k()[a](...c)}function mn(e,t,n){const[r,o,i]=Rn(t,n,e);window.open(r,o||"_self",i)}function gn(e,t,n){const r=Rn(t,n,e);1===r.length&&r.push(location.origin),window.postMessage(...r)}function vn(e,t,n,r,o,i){t?r.updateValues(e,n,(e=>Rn(e,o,i)[0])):e.forEach((e=>{const{name:t,value:s}=Rn([e],o,i)[0];r.updateValue(t,s,n)}))}function yn(e,t,n,r,o,i){if(!Array.isArray(n)||!n.every(u.isObject)||"assign"!==t&&"replace"!==t){const[r,s]=Rn(n,i,e);i.ctxStore.updateValue(r,s,t,o,i)}else vn(n,r,t,i.ctxStore,i,e)}function wn(e,t,n,r,o,i){if(Array.isArray(n)&&n.every(u.isObject)&&"update"===t)vn(n,r,"replace",Me(i,`state.${t}`,`: ${JSON.stringify(n)}`),i,e);else{const[r,s]=Rn(n,i,e);Me(i,`state.${t}`,`: ${r}`).updateValue(r,s,"update"===t?"replace":t,o,i)}}function bn(e,t,n,r){const[o,i]=Rn(t,r,e);qe(r,"formstate.update",`: ${o}`).updateValue(o,i,"replace",n,r)}function En(e,t,n,r){if("assign"===t){const[t]=Rn(n,r,e);location.assign(t)}else location[t]()}function Sn(e,t,n,r,o){const i="localStorage"===t?localStorage:sessionStorage,[s,a]=Rn(r,o,e);"setItem"===n?void 0!==a&&i.setItem(s,JSON.stringify(a)):i.removeItem(s)}function An(e,t,n,r){console[t](...Rn(n,r,e,{useEventAsDefault:!0}))}function kn(e,t,n,r){const o=Rn(n,r,e,{useEventAsDefault:!0});rn.show({type:t,message:o[0]})}async function In(e,t,n,r,o,i){const s=()=>{var o;const i=Rn(n,r,e);return null==si||null===(o=si.messageDispatcher)||void 0===o?void 0:o[t](...i)};if(!i)return void s();const a=Cn(i,r,o);try{const e=await s();a("success")(e)}catch(e){a("error")(e)}finally{a("finally")()}}function Cn(e,t,n){return function(r){return function(o){const i=null==e?void 0:e[r];if(i)try{const e=new CustomEvent(`callback.${r}`,{detail:o});un(i,t,n)(e)}catch(e){console.error(e)}else"error"===r&&console.error("Unhandled callback error:",o)}}}function Rn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Array.isArray(e)?gt(e,{...t,event:n}):r.useEventAsDefault?[n]:r.useEventDetailAsDefault?[n.detail]:[]}function On(e){var t;const{ref:n,runtimeContext:r,element:o}=e;if(!n||!r.tplStateStoreId)return;const{hostBrick:i}=Me(r,"bindTemplateProxy"),s=i.tplHostMetadata;s.internalBricksByRef.set(n,e);const a=null===(t=s.proxy)||void 0===t?void 0:t.events;if(a)for(const[e,t]of Object.entries(a))if(t.ref===n){var c;const n=t=>{t.bubbles&&t.stopPropagation(),i.element.dispatchEvent(new CustomEvent(e,{detail:t.detail,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed}))},r=t.refEvent??e;o.addEventListener(r,n),(c=o).$$proxyListeners??(c.$$proxyListeners=[]),o.$$proxyListeners.push([r,n])}}function Tn(e){const{ref:t,runtimeContext:n,element:r}=e;if(null==n||!n.tplStateStoreId||!t)return;const{hostBrick:o}=Me(n,"unbindTemplateProxy");o.tplHostMetadata.internalBricksByRef.delete(t);for(const[e,t]of r.$$proxyListeners??[])r.removeEventListener(e,t);delete r.$$proxyListeners}let _n=function(e){return e[e.ROOT=1]="ROOT",e[e.BRICK=2]="BRICK",e[e.PLACEHOLDER=3]="PLACEHOLDER",e}({});function Pn(e){e.replaceChildren()}function Mn(e,t){window.DISABLE_REACT_FLUSH_SYNC=!1;let n=e.child;const r=[];for(;n;){if(n.tag===_n.BRICK){var o;const i=n.type;i.includes("-")&&!customElements.get(i)&&console.error(`Undefined custom element: ${i}`),"basic-bricks.script-brick"===i&&console.warn("`basic-bricks.script-brick` is deprecated, please take caution when using it");const s=t&&n===e.child?t:document.createElement(i);n.element=s,n.slotId&&s.setAttribute("slot",n.slotId),n.iid&&(s.dataset.iid=n.iid),null!==(o=n.tplHostMetadata)&&void 0!==o&&o.tplStateStoreId&&(s.dataset.tplStateStoreId=n.tplHostMetadata.tplStateStoreId),Ct(s,n.properties),on(s,n.events,n.runtimeContext),n.tplHostMetadata&&(s.$$tplStateStore=Me({tplStateStoreId:n.tplHostMetadata.tplStateStoreId,tplStateStoreMap:n.runtimeContext.tplStateStoreMap},"mount")),On(n),n.portal?r.push(s):n.return&&(n.return.childElements||(n.return.childElements=[]),n.return.childElements.push(s))}if(n.child)n=n.child;else if(n.sibling)n=n.sibling;else{var i;let e=n.return;for(;e;){var s;if(e.childElements)e.tag===_n.ROOT?null===(s=e.container)||void 0===s||s.append(...e.childElements):e.element.append(...e.childElements),e.childElements=void 0;if(e.tag===_n.ROOT&&r.length>0&&("function"==typeof e.createPortal?e.createPortal():e.createPortal).append(...r),e.sibling)break;e=e.return}n=null===(i=e)||void 0===i?void 0:i.sibling}}setTimeout((()=>{window.DISABLE_REACT_FLUSH_SYNC=!0}))}const xn=["onMount","onUnmount","onMediaChange","onScrollIntoView","onMessage","onMessageClose"],Ln=["onBeforePageLoad","onPageLoad","onPageLeave","onBeforePageLeave","onAnchorLoad","onAnchorUnload"];var Bn=new WeakMap,$n=new WeakMap,Nn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,Dn=new WeakMap,jn=new WeakMap,Kn=new WeakMap,Vn=new WeakMap,Wn=new WeakSet;class Hn{constructor(e,t){(0,I.A)(this,Wn),(0,o.A)(this,"scope",void 0),(0,o.A)(this,"unknownBricks",void 0),(0,o.A)(this,"renderId",void 0),(0,i.A)(this,Bn,void 0),(0,i.A)(this,$n,{onBeforePageLoad:[],onPageLoad:[],onPageLeave:[],onBeforePageLeave:[],onAnchorLoad:[],onAnchorUnload:[],onMediaChange:[],onScrollIntoView:[],onMount:[],onUnmount:[],onMessage:[],onMessageClose:[]}),(0,i.A)(this,Nn,new Map),(0,i.A)(this,Un,void 0),(0,i.A)(this,Fn,new Map),(0,i.A)(this,Dn,void 0),(0,i.A)(this,jn,void 0),(0,i.A)(this,Kn,new WeakMap),(0,i.A)(this,Vn,new Map),this.scope=e,this.unknownBricks=(null==t?void 0:t.unknownBricks)??"throw",(0,s.A)(Bn,this,null==t?void 0:t.routeHelper),this.renderId=null==t?void 0:t.renderId}setInitialMenuRequestNode(e){(0,s.A)(jn,this,e)}memoizeMenuRequestNode(e,t){(0,a.A)(Kn,this).set(e,t)}getMenuRequests(){const e=[];let t=(0,a.A)(jn,this);for(;t;)if(t.request&&e.push(t.request),t.child)t=t.child;else{for(var n;t&&!t.sibling;)t=t.return;t=null===(n=t)||void 0===n?void 0:n.sibling}return e}async reMergeMenuRequestNodes(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(0,a.A)(Kn,this).get(t);(0,a.A)(Kn,this).set(t,n);let o,i=e.child;for(;i&&i!==r;)o=i,i=i.sibling;o?(o.sibling=n,n.sibling=null==r?void 0:r.sibling):e.child=n,await(0,a.A)(Bn,this).mergeMenus(this.getMenuRequests())}reBailout(e){return(0,a.A)(Bn,this).bailout(e)}reCatch(e,t){return(0,a.A)(Bn,this).catch(e,t)}async didPerformIncrementalRender(e,t){let n=!1;const r=[];for(const{parentRoutes:o,callback:i}of[...(0,a.A)(Vn,this).values()].reverse()){const s=o[o.length-1];if(r.includes(s))continue;const a=await i(e,t);a&&r.push(...o.slice(0,-1)),!1!==a&&(n=!0)}return n}performIncrementalRender(e,t,n){(0,a.A)(Vn,this).set(e,{parentRoutes:t,callback:n})}registerBrickLifeCycle(e,t){if(!t)return;const n=[...xn,..."page"===this.scope?Ln:[]];for(const r of n){const n=t[r];n&&(0,a.A)($n,this)[r].push({brick:e,handlers:n})}(0,h.isEmpty)(t.useResolves)||console.error("`lifeCycle.useResolves` is dropped in v3:",t)}registerArbitraryLifeCycle(e,t){const n=(0,a.A)(Fn,this).get(e);n?n.add(t):(0,a.A)(Fn,this).set(e,new Set([t]))}memoize(e,t,n,r){(0,a.A)(Dn,this)||(0,s.A)(Dn,this,new WeakMap);const o=[e??"",...t].join(".");let i=(0,a.A)(Dn,this).get(r);i||(i=new Map,(0,a.A)(Dn,this).set(r,i)),i.set(o,{node:n,last:Xn(n),lastNormal:Jn(n),lastPortal:Zn(n)})}reRender(e,t,n,r){const o=[e??"",...t].join("."),i=(0,a.A)(Dn,this).get(r).get(o),{node:s,last:c,lastNormal:l,lastPortal:u}=i;let d;const p=[];if((null==s?void 0:s.tag)===_n.PLACEHOLDER){var f,h;d=(null===(f=function(e){return Qn(e,!0)}(s))||void 0===f?void 0:f.element)??null;const e=null===(h=function(e){return er(e,!0)}(s))||void 0===h?void 0:h.element;e&&p.push(e)}else{var m,g;d=(null==l||null===(m=l.element)||void 0===m?void 0:m.nextSibling)??null;let e=null==u||null===(g=u.element)||void 0===g?void 0:g.nextSibling;for(;e&&(p.push(e),e instanceof HTMLElement&&"DIV"===e.tagName);)e=e.nextSibling}const v=Xn(n);let y;i.node=n,i.last=v,i.lastNormal=Jn(n),i.lastPortal=Zn(n);let w=r.child;for(;w&&w!==c;){if(w.sibling===s){y=w;break}w=w.sibling}const b=document.createDocumentFragment(),E=document.createDocumentFragment(),S={tag:_n.ROOT,container:b,createPortal:E,child:n};for(w=n;w;)w.return=S,w=w.sibling;const A=tr(s,c);for((0,C.A)(Wn,this,Gn).call(this,A),Mn(S),y?y.sibling=n:r.child=n,v&&(v.sibling=null==c?void 0:c.sibling),w=n;w;)w.return=r,w=w.sibling;var k,I;if(r.tag===_n.ROOT?null===(k=r.container)||void 0===k||k.insertBefore(b,d):null===(I=r.element)||void 0===I||I.insertBefore(b,d),E.childNodes.length>0){var R;let e=n;for(;e&&e.return;)e=e.return;if((null===(R=e)||void 0===R?void 0:R.tag)!==_n.ROOT)throw new Error("Cannot find render root node. This is a bug of Brick Next, please report it.");const t="function"==typeof e.createPortal?e.createPortal():e.createPortal;let r=null;for(const e of p)if(t.contains(e)){r=e;break}t.insertBefore(E,r)}const O=tr(n,v);(0,C.A)(Wn,this,zn).call(this,O)}dispose(){for(const e of Object.values((0,a.A)($n,this)))e.length=0;for(const e of(0,a.A)(Nn,this).values()){for(const t of e)t.disconnect();e.length=0}(0,a.A)(Nn,this).clear(),(0,a.A)(Un,this)&&(Ee.removeEventListener("change",(0,a.A)(Un,this)),(0,s.A)(Un,this,void 0)),(0,s.A)(Dn,this,void 0),(0,a.A)(Fn,this).clear(),(0,a.A)(Vn,this).clear(),(0,s.A)(Kn,this,void 0)}dispatchBeforePageLoad(){(0,C.A)(Wn,this,qn).call(this,"onBeforePageLoad",new CustomEvent("page.beforeLoad"))}dispatchPageLoad(){const e=new CustomEvent("page.load");(0,C.A)(Wn,this,qn).call(this,"onPageLoad",e),window.dispatchEvent(e)}dispatchBeforePageLeave(e){(0,C.A)(Wn,this,qn).call(this,"onBeforePageLeave",new CustomEvent("page.beforeLeave",{detail:e}))}dispatchPageLeave(){(0,C.A)(Wn,this,qn).call(this,"onPageLeave",new CustomEvent("page.leave"))}dispatchAnchorLoad(){const{hash:e}=k().location;e&&"#"!==e?(0,C.A)(Wn,this,qn).call(this,"onAnchorLoad",new CustomEvent("anchor.load",{detail:{hash:e,anchor:e.substring(1)}})):(0,C.A)(Wn,this,qn).call(this,"onAnchorUnload",new CustomEvent("anchor.unload"))}initializeScrollIntoView(){for(const{brick:e,handlers:t}of(0,a.A)($n,this).onScrollIntoView)(0,C.A)(Wn,this,Yn).call(this,e,t)}initializeMediaChange(){(0,s.A)(Un,this,(e=>{(0,C.A)(Wn,this,qn).call(this,"onMediaChange",new CustomEvent("media.change",{detail:z(e.detail)}))})),Ee.addEventListener("change",(0,a.A)(Un,this))}initializeMessageDispatcher(){var e;for(const{brick:e,handlers:n}of(0,a.A)($n,this).onMessage)for(const r of[].concat(n)){var t;null==si||null===(t=si.messageDispatcher)||void 0===t||t.onMessage(r.channel,(t=>{un(r.handlers,e.runtimeContext,e)(new CustomEvent("message.push",{detail:t}))}))}null==si||null===(e=si.messageDispatcher)||void 0===e||e.onClose((()=>{(0,C.A)(Wn,this,qn).call(this,"onMessageClose",new CustomEvent("message.close"))}))}dispatchOnMount(){(0,C.A)(Wn,this,qn).call(this,"onMount",new CustomEvent("mount"))}dispatchOnUnmount(){(0,C.A)(Wn,this,qn).call(this,"onUnmount",new CustomEvent("unmount"))}}function Gn(e){const t=[...xn,..."page"===this.scope?Ln:[]],n=[];for(const r of t){const t=(0,h.remove)((0,a.A)($n,this)[r],(t=>e.has(t.brick)));"onUnmount"===r&&n.push(...t)}for(const t of e){var r,o;const e=(0,a.A)(Nn,this).get(t);if(null!=e&&e.length){for(const t of e)t.disconnect();e.length=0,(0,a.A)(Nn,this).delete(t)}Tn(t),null===(r=t.element)||void 0===r||delete r.$$tplStateStore,null===(o=t.element)||void 0===o||o.remove()}const i=new CustomEvent("unmount");for(const{brick:e,handlers:t}of n)un(t,e.runtimeContext,e)(i)}function zn(e){const t=new CustomEvent("mount");for(const{brick:n,handlers:r}of(0,a.A)($n,this).onMount)e.has(n)&&un(r,n.runtimeContext,n)(t);for(const{brick:t,handlers:n}of(0,a.A)($n,this).onScrollIntoView)e.has(t)&&(0,C.A)(Wn,this,Yn).call(this,t,n)}function qn(e,t){for(const{brick:n,handlers:r}of(0,a.A)($n,this)[e])un(r,n.runtimeContext,n)(t);const n=(0,a.A)(Fn,this).get(e);if(n)for(const e of n)e()}function Yn(e,t){const n=t.threshold??.1,r=new IntersectionObserver(((r,o)=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=n&&(un(t.handlers,e.runtimeContext,e)(new CustomEvent("scroll.into.view")),o.disconnect())}))}),{threshold:n});r.observe(e.element);let o=(0,a.A)(Nn,this).get(e);o||(o=[],(0,a.A)(Nn,this).set(e,o)),o.push(r)}function Xn(e){let t=e;for(;null!==(n=t)&&void 0!==n&&n.sibling;){var n;t=t.sibling}return t}function Jn(e){return Qn(e,!1)}function Qn(e,t){let n,r=e;for(;r;){if(r.tag===_n.BRICK&&!r.portal){if(t)return r;n=r}r=r.sibling}return n}function Zn(e){return er(e,!1)}function er(e,t){let n,r=e;for(;r;){if(r.tag===_n.BRICK&&r.portal){if(t)return r;n=r}if(r.child)r=r.child;else if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&!e.sibling;)e=e.return;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}function tr(e,t){const n=new Set;let r=e;for(;r;)if(r.tag===_n.BRICK&&n.add(r),r.child)r=r.child;else{if(r===t)break;if(r.sibling)r=r.sibling;else{var o;let e=r.return;for(;e&&e!==t&&!e.sibling;)e=e.return;if(e===t)break;r=null===(o=e)||void 0===o?void 0:o.sibling}}return n}const nr=new Map;function rr(e){return nr.get(e)}const or=Symbol.for("root.runtimeContext");async function ir(e,t,n){var r,o;const[i,s,a]=eo({...e[or]??mi(),data:t,pendingPermissionsPreCheck:[]});i.tplStateStoreMap??(i.tplStateStoreMap=new Map),i.formStateStoreMap??(i.formStateStoreMap=new Map);const c=new Hn("fragment"),l={tag:_n.ROOT,createPortal:null},u=e.transform,d=Re();u&&Oe(d,"`useBrick.transform`",'please use "properties" instead, check your useBrick:',e);const p=await Jr(l,d&&!n?e:{errorBoundary:n,...e,properties:{...e.properties,...u}},i,c,[],{}),f=[...s,...a];if(await Zr(p,i,f),(null===(r=p.node)||void 0===r?void 0:r.tag)===_n.PLACEHOLDER)throw new Error("The root brick of useBrick cannot be an ignored control node");if(null!==(o=p.node)&&void 0!==o&&o.portal)throw new Error("The root brick of useBrick cannot be a portal brick");return l.child=p.node,{tagName:p.node?p.node.type:null,renderRoot:l,rendererContext:c,scopedStores:f}}function sr(e,t){let n,{renderRoot:r,rendererContext:o,scopedStores:i}=e;r.createPortal=()=>{const e=document.querySelector("#portal-mount-point");return n=document.createElement("div"),e.appendChild(n),n},Mn(r,t),o.dispatchOnMount(),o.initializeScrollIntoView(),o.initializeMediaChange(),o.initializeMessageDispatcher();for(const e of i)e.mountAsyncData();return{portal:n}}function ar(e,t){let{rendererContext:n}=e;t.portal&&(Pn(t.portal),t.portal.remove()),n.dispatchOnUnmount(),n.dispose()}function cr(e,t,n){if(n)throw new Error("Legacy doTransform does not support options in v3");return gt(t,{...mi(),data:e},{noInject:!0})}function lr(e,t){const n=gi(e);Object.assign(n,{...t,meta:{...n.meta,...t.meta},$$fulfilling:null,$$fulfilled:!0,$$registerCustomTemplateProcessed:!1}),L(n)}function ur(e,t){const n=gi(e);let r=!1;function o(e){e.forEach(((n,s)=>{"routes"===n.type?o(n.routes):function(e){return e.path===t.path&&!e.exact==!t.exact}(n)?(r=!0,e[s]=t):Array.isArray(n.bricks)&&i(n.bricks)}))}function i(e){e.forEach((e=>{if(e.slots)for(const t of Object.values(e.slots))"routes"===t.type?o(t.routes):i(t.bricks)}))}o(n.routes),r||n.routes.unshift(t)}function dr(e,t,n){const r=`${e}.${t.name}`;Pe.define(r,{bricks:t.bricks,proxy:t.proxy,state:t.state}),pr(e,t.name,n)}function pr(e,t,n){gr(e,`\${APP.homepage}/_dev_only_/template-preview/${t}`,[{brick:t,...(0,h.pick)(n,"properties","events","lifeCycle","context","slots","children")}])}function fr(e){return`\${APP.homepage}/_dev_only_/snippet-preview/${e}`}function hr(e,t){var n;gr(e,fr(t.snippetId),null!==(n=t.bricks)&&void 0!==n&&n.length?t.bricks:[{brick:"span"}],t.context)}const mr=hr;function gr(e,t,n,r){const{routes:o}=gi(e),i=o.findIndex((e=>e.path===t)),s={path:t,bricks:n,context:r,menu:!1,exact:!0};-1===i?o.unshift(s):o.splice(i,1,s)}function vr(e,t){let{tplStateStoreId:n}=t;const r=mi();return n?Me({...r,tplStateStoreId:n},"STATE").getValue(e):r.ctxStore.getValue(e)}function yr(e){let{tplStateStoreId:t}=e;const n=mi();return t?Me({...n,tplStateStoreId:t},"STATE").getAllValues():n.ctxStore.getAllValues()}function wr(e){return pi().find((t=>t.id?t.id===e:t.filePath.startsWith(`${e}/`)))}function br(e){return(0,l.loadBricksImperatively)(e,pi())}function Er(e,t){return(0,l.loadEditorsImperatively)(e,t??pi())}function Sr(){return hi()}async function Ar(e,t){let{appId:n,updateStoryboardType:r,collectUsedContracts:o}=t;const i=gi(n);let s;if("route"===r)s={routes:[e]};else if("template"===r)s={meta:{customTemplates:[e]}};else if("snippet"===r){var a;const t=fr(e.snippetId);s={routes:[null==i||null===(a=i.routes)||void 0===a?void 0:a.find((e=>e.path===t))]}}const c=[];return s&&o&&(await o(s)).forEach((e=>{var t;const[n,r,o]=e.match(/(.*)@(.*):\d\.\d\.\d/);null!=i&&null!==(t=i.meta)&&void 0!==t&&null!==(t=t.contracts)&&void 0!==t&&t.some((e=>e.namespaceId===r&&e.name===o))||c.push(e)})),c}async function kr(e,t){let{tplStateStoreId:n,routeId:r}=t;const o={...mi(),tplStateStoreId:n,match:rr(r)};return e.resolve?tt(e.resolve,o,{cache:"reload"}):mt(e.value,o)}function Ir(e){const t=mi();return{app:(null==t?void 0:t.overrideApp)??(null==t?void 0:t.app),location:(0,h.pick)(location,["href","origin","hostname","host"]),...(0,h.pick)(t,["query","sys"]),match:rr(null==e?void 0:e.routeId)}}let Cr;const Rr=[];function Or(e){Cr=e;const t=yr({tplStateStoreId:e.tplStateStoreId});_r({changeType:"initialize",tplStateStoreId:e.tplStateStoreId,detail:{data:t}})}function Tr(e){Rr.push(e)}function _r(e){setTimeout((()=>{for(const t of Rr)try{t(e)}catch(t){console.error(`RealTimeDataInspectHook failed (${e.changeType}):`,t)}}))}const Pr=["onBeforePageLoad","onPageLoad","onBeforePageLeave","onPageLeave","onAnchorLoad","onAnchorUnload"];class Mr{constructor(e,t,n,r){(0,o.A)(this,"type",void 0),(0,o.A)(this,"data",new Map),(0,o.A)(this,"changeEventType",void 0),(0,o.A)(this,"pendingStack",[]),(0,o.A)(this,"hostBrick",void 0),(0,o.A)(this,"stateStoreId",void 0),(0,o.A)(this,"batchUpdate",!1),(0,o.A)(this,"batchUpdateContextsNames",[]),(0,o.A)(this,"rendererContext",void 0),(0,o.A)(this,"routeMap",new WeakMap),this.type=e,this.changeEventType="FORM_STATE"===this.type?"formstate.change":"STATE"===this.type?"state.change":"context.change",this.hostBrick=t,this.rendererContext=n,this.stateStoreId=r}getAllValues(){return Object.fromEntries([...this.data.entries()].map((e=>{let[t,{value:n}]=e;return[t,n]})))}getValue(e){var t;return null===(t=this.data.get(e))||void 0===t?void 0:t.value}notifyRealTimeDataChange(e,t){if(Cr){const{tplStateStoreId:n}=Cr;(n?"STATE"===this.type&&this.stateStoreId===n:"CTX"===this.type)&&_r({changeType:"update",tplStateStoreId:n,detail:{name:e,value:t}})}}getAffectListByContext(e){const t=[e];return this.data.forEach(((e,n)=>{e.deps&&e.deps.some((e=>t.includes(e)))&&t.push(n)&&t.push(...this.getAffectListByContext(n))})),t.shift(),[...new Set(t)]}updateValues(e,t,n){if(this.batchUpdate=!0,this.batchUpdateContextsNames=e.map((e=>e.name)),[...new Set(this.batchUpdateContextsNames)].length!==this.batchUpdateContextsNames.length)throw new Error("Batch update not allow to update same item");const r={},o={},i=[];e.forEach((e=>{const{name:o,value:s}=n([e]),a=this.data.get(o);i.push(...this.getAffectListByContext(o)),a&&(r[o]=a),this.updateValue(o,s,t)})),i.filter((e=>!r[e])).forEach((e=>{const t=this.data.get(e);t&&(o[e]=t)}));const s=e=>{for(const n in e){var t;const r=e[n];null===(t=r.eventTarget)||void 0===t||t.dispatchEvent(new CustomEvent(this.changeEventType,{detail:r.value}))}};s(r),s(o),this.batchUpdate=!1}updateValue(e,t,n,r,o){const i=this.data.get(e);if(!i)throw new Error(`${this.type} '${e}' is not defined`);if("refresh"!==n&&"load"!==n)"replace"===n?i.value=t:(0,u.isObject)(i.value)?Object.assign(i.value,t):(console.warn(`Non-object current value of "${this.type}.${e}" for "context.assign", try "context.replace" instead.`),i.value=t),this.batchUpdate||i.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:i.value}));else{if(!i.useResolve)throw new Error(`You can not ${n} "${this.type}.${e}" which is not using resolve`);let s;"load"===n&&(i.loaded?s=Promise.resolve(i.value):i.loading&&(s=i.loading));const a=e=>{var t;let n;return"FlowApiNotFoundError"===(null==e?void 0:e.name)&&!!(n=null===(t=this.rendererContext)||void 0===t?void 0:t.renderId)&&n!==hi()};if(s||(s=i.loading=i.load({cache:"load"===n?"default":"reload",...t}),s.then((e=>{this.finishLoad(i,e)}),(e=>{!i.useResolve||a(e)||null!=r&&r.error||nn(e)}))),r){const e=Cn(r,o);s.then((t=>{e("success")({value:t}),e("finally")()}),(t=>{!a(t)&&r.error&&e("error")(t),e("finally")()}))}}}finishLoad(e,t){e.useResolve&&(e.loaded=!0,e.value=t,e.eventTarget.dispatchEvent(new CustomEvent(this.changeEventType,{detail:t})))}define(e,t,n,r){if(Array.isArray(e)&&e.length>0){const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"CTX";const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CTX",n=arguments.length>2?arguments[2]:void 0;const r=new Map;for(const o of e){const e=[o.if,o.value,o.resolve],i=(0,T.collectMemberUsage)(e,t);if(!n&&"STATE"===t){const t=(0,T.collectMemberUsage)(e,"TPL");for(const e of t.usedProperties)i.usedProperties.add(e);t.hasNonStaticUsage&&(i.hasNonStaticUsage=!0)}r.set(o,i)}return r}(e,n,arguments.length>3?arguments[3]:void 0),o=new Map;for(const e of Array.from(r.keys()).map((e=>e.name)))o.set(e,(o.get(e)??0)+1);const i=Array.from(r.values()).some((e=>e.hasNonStaticUsage)),s=new WeakSet,a=new Map,c=new Map([...new Set(e.map((e=>e.name)))].map((e=>[e,new Promise(((t,n)=>{a.set(e,{resolve:t,reject:n})}))]))),l=async e=>{s.add(e);const n=await t(e);r.delete(e);const i=o.get(e.name)??0;if(n){if(a.get(e.name).resolve(),o.delete(e.name),0===i)throw new Error(`Duplicated context defined: ${e.name}`)}else 1===i?(a.get(e.name).resolve(),o.delete(e.name)):o.set(e.name,i-1);await d()};let u=i;async function d(){const e=Array.from(r.entries()).filter(function(e,t){return(n,r)=>t?0===r:![...n[1].usedProperties].some((t=>e.has(t)))}(o,u)).map((e=>e[0])).filter((e=>!s.has(e)));await Promise.all(e.map(l))}return{pendingResult:d().then((async()=>{r.size>0&&(function(e,t){const n=new Map(e),r=new Set(Array.from(n.keys()).map((e=>e.name))),o=()=>{let e=!1;for(const[t,o]of n.entries())[...o.usedProperties].some((e=>r.has(e)))||(n.delete(t),r.delete(t.name),e=!0);e&&o()};if(o(),n.size>0)throw new ReferenceError(`Circular ${t} detected: ${Array.from(n.keys()).map((e=>e.name)).join(", ")}`)}(r,n),u=!0,await d());for(const e of a.values())e.resolve()})).catch((e=>{for(const t of a.values())t.reject(e);throw e})),pendingContexts:c}}(e,(e=>this.resolve(e,t,n,r)),this.type,Re(t));this.pendingStack.push(o)}}onChange(e,t){var n;null===(n=this.data.get(e))||void 0===n||n.eventTarget.addEventListener(this.changeEventType,t)}async waitFor(e){for(const{pendingContexts:t}of this.pendingStack)await Promise.all([...e].map((e=>t.get(e))))}async waitForAll(){for(const{pendingContexts:e}of this.pendingStack)for(const t of e.values())t.catch((()=>{}));for(const{pendingResult:e}of this.pendingStack)await e}mountAsyncData(e){this.data.forEach((t=>{var n;if(t.async&&(!e||null!==(n=this.routeMap.get(e))&&void 0!==n&&n.has(t.name))){if(t.asyncMounted)return void console.error(`Async data "${t.name}" already mounted. This is a bug of Brick Next, please report it.`);t.asyncMounted=!0,t.loading.then((e=>{this.finishLoad(t,e)}))}}))}async resolve(e,t,n,r){if(!await wt(e,t))return!1;let o,i,s,a,c,l;if(n&&("STATE"===this.type?e.expose:"FORM_STATE"===this.type)&&(o=await kt(n,e.name)),void 0===o){if(e.resolve){const n=(0,u.hasOwnProperty)(e,"value");c=e.track&&n&&(0,u.hasOwnProperty)(e.resolve,"if")&&(0,T.strictCollectMemberUsage)(e.resolve.if,this.type).size>0;const r={transform:"value",...e.resolve};if(a=await wt(e.resolve,t),(a||c)&&(i=async e=>{var n;return(await tt(r,t,{...e,renderId:null===(n=this.rendererContext)||void 0===n?void 0:n.renderId})).value}),a)l=e.resolve.async?"async":e.resolve.lazy?"lazy":"eager","eager"===l?o=await i():"async"===l&&(s=i());else if(!n)return!1}a&&"eager"===l||void 0===e.value||(o=await mt(e.value,t))}if(this.data.has(e.name))throw new Error(`${this.type} '${e.name}' has already been declared`);const d={name:e.name,value:o,eventTarget:new ye,useResolve:a,load:i,loaded:"eager"===l,loading:s,async:"async"===l,deps:[]};if("lazy"===l){const{trigger:t}=e.resolve;var p;t&&Pr.includes(t)&&(null===(p=this.rendererContext)||void 0===p||p.registerArbitraryLifeCycle(t,(()=>{this.updateValue(e.name,void 0,"load")})))}if(e.onChange&&d.eventTarget.addEventListener(this.changeEventType,un(e.onChange,t)),e.track){const n=(0,T.strictCollectMemberUsage)(c?[e.resolve,e.value]:i?e.resolve:e.value,this.type);!i&&(d.deps=[...n]);for(const r of n)this.onChange(r,this.batchAddListener((()=>{d.useResolve=c?bt(e.resolve,t):!!i,d.useResolve?this.updateValue(e.name,{cache:"default"},"refresh"):this.updateValue(e.name,gt(e.value,t),"replace")}),e))}if(d.eventTarget.addEventListener(this.changeEventType,(t=>{this.notifyRealTimeDataChange(e.name,t.detail)})),this.data.set(e.name,d),Array.isArray(r))for(const t of r){const n=this.routeMap.get(t);n?n.add(e.name):this.routeMap.set(t,new Set([e.name]))}return!0}disposeDataInRoutes(e){for(const t of e){const e=this.routeMap.get(t);if(void 0!==e)for(const t of e)this.data.delete(t)}}batchAddListener(e,t){return n=>{this.batchUpdate&&this.batchUpdateContextsNames.includes(t.name)||e(n)}}}function xr(e,t,n){const{reversedProxies:r,asyncHostPropertyEntries:o,externalSlots:i,tplStateStoreId:s,hostBrick:a}=e;let c;if(t&&r){const e=r.properties.get(t);e&&(d=o,c=e.map((e=>{let{from:t,to:n}=e;const r=d.filter((e=>e[0]===t));if(r.length>0&&n.refProperty)return[n.refProperty,kt(r,t),!0]})).filter(Boolean));const s=r.slots.get(t);if(s&&i){const e=new Map;for(const{from:t,to:r}of s){var l;const o=(null===(l=i[t])||void 0===l?void 0:l.bricks)??[];if(!o.length)continue;const s=r.refSlot??t;let c=e.get(s);if(!c){c=[];const t=(0,u.hasOwnProperty)(n,s)?n[s].bricks.length+1:1;for(let e=0;e<t;e+=1)c.push([]);e.set(s,c)}const d=r.refPosition??-1,p=(0,u.hasOwnProperty)(a.runtimeContext,"forEachItem");c[(0,h.clamp)(d<0?c.length+d:d,0,c.length-1)].push(...p?Lr(o,a.runtimeContext.forEachItem,a.runtimeContext.forEachIndex,a.runtimeContext.forEachSize):o)}for(const[t,r]of e.entries()){(0,u.hasOwnProperty)(n,t)||(n[t]={type:"bricks",bricks:[]});const e=n[t];e.bricks=r.flatMap(((t,n)=>n<e.bricks.length?t.concat(e.bricks[n]):t)),0===e.bricks.length&&delete n[t]}}}var d;return{[Nt]:c,[Ut]:s}}function Lr(e,t,n,r){return e.map((e=>{let{children:o,slots:i,...s}=e;return{...s,[Ft]:t,[Dt]:n,[jt]:r,slots:":forEach"===s.brick?ro(o,i):Object.fromEntries(Object.entries(ro(o,i)??{}).map((e=>{let[o,i]=e;return[o,"routes"===i.type?{type:"routes",routes:Br(i.routes,t,n,r)}:{type:"bricks",bricks:Lr(i.bricks,t,n,r)}]})))}}))}function Br(e,t,n,r){return e.map((e=>"routes"===e.type?{...e,routes:Br(e.routes,t,n,r)}:"redirect"===e.type?e:{...e,bricks:Lr(e.bricks,t,n,r)}))}function $r(e,t){function n(e){return(0,u.isObject)(e)&&"function"!=typeof e?Array.isArray(e)?e.map(n):Object.fromEntries(Object.entries(e).map((e=>{let[t,o]=e;return(0,u.isObject)(o)&&"useBrick"===t?Array.isArray(o)?[t,o.map(r)]:[t,r(o)]:[t,n(o)]})).concat(Object.getOwnPropertySymbols(e).map((t=>[t,e[t]])))):e}function r(e){const{properties:o,slots:i,children:s,...a}=e,c=ro(s,i),l=Object.fromEntries(Object.entries(c??{}).map((e=>{let[t,n]=e;return[t,{type:"bricks",bricks:(n.bricks??[]).map(r)}]})));return{...a,properties:n(o),slots:l,...xr(t,a.ref,l)}}return n(e)}function Nr(e,t,n,r,o){var i;const s=(0,h.uniqueId)("tpl-state-"),a={...n.runtimeContext,tplStateStoreId:s};delete a.forEachItem,delete a.forEachIndex,delete a.forEachSize,delete a.formStateStoreId;const c=new Mr("STATE",n,o,s);a.tplStateStoreMap.set(s,c),a.tplStateStoreScope&&a.tplStateStoreScope.push(c);const{bricks:l,proxy:u,state:d,contracts:p}=Pe.get(e);null==si||null===(i=si.flowApi)||void 0===i||i.collectWidgetContract(p),c.define(d,a,r);const{slots:f,children:m,...g}=t,v={...g,brick:e};n.tplHostMetadata={internalBricksByRef:new Map,tplStateStoreId:s,proxy:u};const y={properties:new Map,slots:new Map};if(null!=u&&u.properties)for(const[e,t]of Object.entries(u.properties)){let n=y.properties.get(t.ref);n||(n=[],y.properties.set(t.ref,n)),n.push({from:e,to:t})}if(null!=u&&u.slots)for(const[e,t]of Object.entries(u.slots)){let n=y.slots.get(t.ref);n||(n=[],y.slots.set(t.ref,n)),n.push({from:e,to:t})}const w={reversedProxies:y,asyncHostPropertyEntries:r,externalSlots:ro(m,f),tplStateStoreId:s,hostBrick:n};return v.slots={"":{type:"bricks",bricks:l.map((e=>Ur(e,w)))}},v}function Ur(e,t){null===e.if&&delete e.if;const{properties:n,slots:r,children:o,...i}=e,s=ro(o,r),a=Object.fromEntries(Object.entries(s??{}).map((e=>{let[n,r]=e;return[n,{type:"bricks",bricks:(r.bricks??[]).map((e=>Ur(e,t)))}]})));return{...i,properties:$r(n,t),slots:a,...xr(t,i.ref,a)}}const Fr="form-renderer.form-renderer",Dr=Symbol.for("form.stateStoreId"),jr=["forms.general-form","form.general-form","eo-form"];function Kr(e,t,n){const{id:r,bricks:o,events:i,context:s,mountPoint:a,instanceId:c}=e;let{brick:l,properties:d}=e;const p=t.find((e=>e.fieldId===r));if(p){const e=function(e){let t;const n={id:e.fieldId,name:e.fieldId,label:e.name,dataset:{testid:e.fieldId}},r=()=>{var t,n;return{readOnly:null===(t=e.limit)||void 0===t?void 0:t.includes("READONLY"),required:null===(n=e.limit)||void 0===n?void 0:n.includes("REQUIRED")}};switch(e.fieldType){case"INT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,precision:0,inputBoxStyle:{width:"100%"}}};break;case"BOOLEAN":t={brick:"forms.general-switch",properties:{...n,...r()}};break;case"FLOAT":t={brick:"forms.general-input-number",properties:{...n,...r(),placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUM":t={brick:"forms.general-select",properties:{...n,...r(),options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"ENUMS":t={brick:"forms.general-select",properties:{...n,...r(),mode:"multiple",options:[{label:"选项一",value:1},{label:"选项二",value:2}],placeholder:e.description,inputBoxStyle:{width:"100%"}}};break;case"DATE":case"TIME":t={brick:"forms.general-date-picker",properties:{...n,...r(),placeholder:e.description}};break;case"IP":t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description,pattern:"((^s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))s*$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*$))",message:{pattern:"输入字符不匹配IP格式"}}};break;case"JSON":t={brick:"forms.general-textarea",properties:{...n}};break;case"ARRAY":t={brick:"forms.general-select",properties:{...n}};break;case"STRUCTURE":case"STRUCTURE_ARRAY":t={brick:"forms.cmdb-instance-select-panel",properties:{...n,...r()}};break;default:t={brick:"forms.general-input",properties:{...n,...r(),placeholder:e.description}}}return t}(p);l||(l=e.brick),d={...e.properties,...d}}const f={brick:l,properties:d,iid:c,slot:a,events:i,context:s,children:Vr(o,t,n),[Dr]:n};return(0,u.hasOwnProperty)(e,"if")&&(f.if=e.if),f}function Vr(e,t,n){if(Array.isArray(e))return e.map((e=>Kr(e,t,n)))}var Wr=new WeakSet;class Hr extends HTMLElement{constructor(){super(...arguments),(0,I.A)(this,Wr),(0,o.A)(this,"renderRoot",void 0)}get $$typeof(){return"formRenderer"}validate(){(0,C.A)(Wr,this,Gr).call(this,"validate")}setInitValue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Wr,this,Gr).call(this,"setInitValue",t)}resetFields(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];(0,C.A)(Wr,this,Gr).call(this,"resetFields",t)}}function Gr(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=!1!==this.renderRoot?null===(t=this.firstElementChild)||void 0===t?void 0:t.firstElementChild:this.firstElementChild,i=null==o||null===(n=o.tagName)||void 0===n?void 0:n.toLowerCase();jr.includes(i)?o[e](...r):console.error(`no ${e} method in the container element`,{container:i})}class zr extends Error{constructor(e){super(e),this.name="PageNotFoundError",Error.captureStackTrace&&Error.captureStackTrace(this,l.BrickLoadError)}}async function qr(e,t,n){const{title:r,variant:o,showLink:i,showDescription:s}=function(e){var t,n;return e instanceof zr?"app not found"===e.message?{showLink:"home",title:c.i18n.t(`${Gt}:${Vt.APP_NOT_FOUND}`),variant:"no-permission"}:{showLink:"home",variant:"not-found",title:c.i18n.t(`${Gt}:${Vt.PAGE_NOT_FOUND}`)}:e instanceof l.BrickLoadError||e instanceof Error&&"ChunkLoadError"===e.name?{showDescription:!0,title:c.i18n.t(`${Gt}:${Vt.NETWORK_ERROR}`),variant:"internet-disconnected"}:e instanceof R.HttpResponseError&&403===(null===(t=e.response)||void 0===t?void 0:t.status)?{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Gt}:${Vt.NO_PERMISSION}`),variant:"no-permission"}:e instanceof R.HttpResponseError&&"200000"===(null===(n=e.responseJson)||void 0===n?void 0:n.code)?{showDescription:!0,title:c.i18n.t(`${Gt}:${Vt.LICENSE_EXPIRED}`),variant:"license-expired"}:{showLink:"previous",showDescription:!0,title:c.i18n.t(`${Gt}:${Vt.UNKNOWN_ERROR}`),variant:"unknown-error"}}(e);if(n){const n=fi().error??"illustrations.error-message";if(!1!==n){const a="eo-link",u=i?[n,a]:[n];try{await Promise.race([(0,l.loadBricksImperatively)(u,pi()),new Promise(((e,t)=>setTimeout((()=>{t(new Error("timeout"))}),3e3)))]);const d={tag:_n.BRICK,type:n,properties:{errorTitle:r,description:s?Jt(e):void 0,variant:o,dataset:{errorBoundary:""}},runtimeContext:null,return:t};return i&&(d.child={tag:_n.BRICK,type:a,properties:{textContent:"home"===i?c.i18n.t(`${Gt}:${Vt.GO_BACK_HOME}`):c.i18n.t(`${Gt}:${Vt.GO_BACK_TO_PREVIOUS_PAGE}`),url:"home"===i?"/":void 0},events:"home"===i?void 0:{click:{action:"history.goBack"}},runtimeContext:null,return:d}),d}catch(e){console.error("Failed to load brick:",u.join(", "),e)}}}return{tag:_n.BRICK,type:"div",properties:{textContent:s?`${r}: ${Jt(e)}`:r,dataset:{errorBoundary:""},style:{color:"var(--color-error)"}},runtimeContext:null,return:t}}async function Yr(e,t,n,r,o,i,s,a){const c=await async function(e,t){for(const n of e){if("string"!=typeof n.path)throw console.error("Invalid route with invalid path:",n),new Error("Invalid route with invalid type of path: "+typeof n.path);const e=$t(n,t.app.homepage,t.location.pathname);if(e&&await wt(n,t))return t.app.noAuthGuard||n.public||null==si||!si.auth||si.auth.isLoggedIn()?{match:e,route:n}:"unauthenticated"}return"missed"}(t,n),u={blockingList:[]},d=u.menuRequestNode={return:i};switch(c){case"missed":break;case"unauthenticated":u.unauthenticated=!0;break;default:{var p;const i=u.route=c.route;u.path=c.match.path;const m={...n,match:c.match};i.iid&&(f=i.iid,h=c.match,nr.set(f,h)),a&&m.ctxStore.disposeDataInRoutes(t);const g=o.concat(i);m.ctxStore.define(i.context,m,void 0,g),m.pendingPermissionsPreCheck.push(null==si||null===(p=si.checkPermissions)||void 0===p?void 0:p.preCheckPermissionsForBrickOrRoute(i,(e=>mt(e,m))));const{preLoadBricks:v}=i;if(Array.isArray(v)&&u.blockingList.push((0,l.loadBricksImperatively)(v,pi())),"redirect"===i.type){let e;if(e="string"==typeof i.redirect?await mt(i.redirect,m):(await tt({transform:"redirect",...i.redirect},m)).redirect,"string"!=typeof e)throw console.error("Unexpected redirect result:",e),new Error("Unexpected type of redirect result: "+typeof e);u.redirect={path:e}}else{const n=function(e,t){if(e){if("brick"===e.type)throw console.error("Set menu with brick is dropped in v3:",e),new Error("Set menu with brick is dropped in v3");if("resolve"!==e.type)return mt(e,t);console.warn("Set menu with resolve is not supported in v3 yet:",e)}}(i.menu,m);let o;n&&(d.request=n),a||r.memoizeMenuRequestNode(t,d),o="routes"===i.type?await Yr(e,i.routes,m,r,g,d,s):await Xr(e,i.bricks,m,r,g,d,s),to(u,o),no(d,o.menuRequestNode)}}}var f,h;return u}async function Xr(e,t,n,r,o,i,s,a,c){!function(e,t,n){function r(e){if((0,u.isObject)(e)&&"function"!=typeof e)if(Array.isArray(e))e.map(r);else for(const[t,n]of Object.entries(e))(0,u.isObject)(n)&&"useBrick"===t?Array.isArray(n)?n.forEach((e=>o(e,!0))):o(n,!0,!0):r(n)}function o(e,i,s){if(i&&(e[or]=t),r(e.properties),n&&!s)return;const a=ro(e.children,e.slots);for(const e of Object.values(a??{}))for(const t of e.bricks??[])o(t,i)}for(const t of e)o(t)}(t,n,!0);const l={blockingList:[]},d=c??[];return(await Promise.all(t.map(((t,c)=>Jr(e,t,n,r,o,i,s,d.concat(c),a&&new Map(a)))))).forEach(((t,n)=>{t.hasTrackingControls&&r.memoize(s,d.concat(n),t.node,e),to(l,t)})),l}async function Jr(e,t,n,r,o,i,s){let a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:new Map;try{return await async function(e,t,n,r,o,i,s,a,c){var d,p;const f={blockingList:[]};if(!t.brick)return t.template?console.error("Legacy templates are dropped in v3:",t):console.error("Invalid brick:",t),f;const{if:m,permissionsPreCheck:v,...y}=t;if(function(e){return"string"==typeof e?(0,O.isTrackAll)(e):it(e)&&(0,O.isTrackAll)(st(e))}(m))return Jr(e,{brick:":if",dataSource:m,permissionsPreCheck:v,slots:{"":{type:"bricks",bricks:[y]}},...Object.getOwnPropertySymbols(t).reduce(((e,n)=>({...e,[n]:t[n]})),{})},n,r,o,i,s,a,c);const w=t[Ut],b=t[Dr],E={...n,tplStateStoreId:w,formStateStoreId:b};(0,u.hasOwnProperty)(t,Ft)&&(E.forEachItem=t[Ft],E.forEachIndex=t[Dt],E.forEachSize=t[jt]);const{context:S}=t;if(Array.isArray(S)&&S.length>0){const e=Re(E);Oe(e,"Defining context on bricks","check your brick:",t),e||E.ctxStore.define(S,E)}if(E.pendingPermissionsPreCheck.push(null==si||null===(d=si.checkPermissions)||void 0===d?void 0:d.preCheckPermissionsForBrickOrRoute(t,(e=>mt(e,E)))),!await async function(e,t){return(0,u.isObject)(e.if)&&!it(e.if)?Et(await tt(e.if,t)):wt(e,t)}(t,E))return f;const A=t.brick;if(A.startsWith(":")){!function(e){if(":forEach"!==e&&":if"!==e&&":switch"!==e)throw new Error(`Unknown storyboard control node: "${e}"`)}(A);const{dataSource:n}=t,l=async l=>{var d;const p=await mt(n,l),f=":forEach"===A?"":":switch"===A?String(p):p?"":"else",h=ro(t.children,t.slots),m=h&&(0,u.hasOwnProperty)(h,f)&&(null===(d=h[f])||void 0===d?void 0:d.bricks);if(!Array.isArray(m))return{blockingList:[]};switch(A){case":forEach":return Array.isArray(p)?async function(e,t,n,r,o,i,s,a,c,l){const u={blockingList:[]},d=t.length,p=await Promise.all(t.map(((t,u)=>Promise.all(n.map(((n,p)=>Jr(e,n,{...r,forEachItem:t,forEachIndex:u,forEachSize:d},o,i,s,a,l.concat(u*d+p),c&&new Map(c))))))));return p.flat().forEach(((t,n)=>{t.hasTrackingControls&&o.memoize(a,l.concat(n),t.node,e),to(u,t)})),u}(e,p,m,l,r,o,i,s,c,a):{blockingList:[]};case":if":case":switch":return Xr(e,m,l,r,o,i,s,c,a)}},d=async t=>{const n=await l(t);return n.node??(n.node={tag:_n.PLACEHOLDER,return:e}),n},p=await d(E),{onMount:f,onUnmount:m}=t.lifeCycle??{},{contextNames:g,stateNames:v}=At(n);if(g||v){p.hasTrackingControls=!0;let t=0;const o=async()=>{const n=++t,[o,i,c]=eo(E),l=await d(o),u=[...i,...c];if(await Zr(l,o,u),t===n){m&&un(m,E)(new CustomEvent("unmount",{detail:{rerender:!0}})),r.reRender(s,a,l.node,e),f&&un(f,o)(new CustomEvent("mount",{detail:{rerender:!0}}));for(const e of u)e.mountAsyncData()}},i=(0,h.debounce)(o);if(g)for(const e of g)E.ctxStore.onChange(e,i);if(v)for(const e of v)Me(E,"STATE",`: "${n}"`).onChange(e,i)}return f&&r.registerArbitraryLifeCycle("onMount",(()=>{un(f,E)(new CustomEvent("mount",{detail:{rerender:!1}}))})),m&&r.registerArbitraryLifeCycle("onUnmount",(()=>{un(m,E)(new CustomEvent("unmount",{detail:{rerender:!1}}))})),p}/\.tpl-/.test(A)&&!Pe.get(A)&&await oo((0,l.loadBricksImperatively)([A],pi()),"brick",A,r.unknownBricks);const k=function(e,t){if(!e.includes(".")&&e.startsWith("tpl-")&&t){const n=`${t}.${e}`;if(Pe.get(n))return n}return!!Pe.get(e)&&e}(A,null===(p=E.app)||void 0===p?void 0:p.id);if(k){const e=c.get(k)??0;if(e>=10)throw new Error(`Maximum custom template stack overflowed: "${k}"`);c.set(k,e+1)}else A.includes("-")&&!customElements.get(A)&&(A===Fr?customElements.get(Fr)||customElements.define(Fr,Hr):f.blockingList.push(oo((0,l.enqueueStableLoadBricks)([A],pi()),"brick",A,r.unknownBricks)));let I,C;var R;A===Fr?(({formData:I,...C}=t.properties??{}),null!==(R=t.properties)&&void 0!==R&&R.compute&&(I=await mt(I,E))):C=t.properties;const _=[],P=function(e,t,n){return(0,u.isObject)(e)?Object.entries(e).map((e=>{let[r,o]=e;const{contextNames:i,stateNames:s,formStateNames:a}=At(o);return(i||s||a)&&n.push({contextNames:i,stateNames:s,formStateNames:a,propName:r,propValue:o}),[r,mt(o,t,{$$lazyForUseBrick:!0,$$stateOfUseBrick:"useBrick"===r?pt.USE_BRICK:pt.INITIAL})]})):[]}(C,E,_),M=t[Nt];M&&P.push(...M);const x="script"===A;if(x||"link"===A){const e=await It(P);if(x?e.src:"stylesheet"===e.rel&&e.href){const t=window.PUBLIC_ROOT??"";if(x){const{src:n,...r}=e;await oo((0,l.loadScript)(n,t,r),"script",n,"silent")}else{const{href:n,...r}=e;await oo((0,l.loadStyle)(n,t,r),"stylesheet",n,"silent")}return f}}const L={tag:_n.BRICK,type:k||A,return:e,slotId:s,events:t.events,runtimeContext:E,portal:t.portal,iid:t.iid,ref:t.ref};f.node=L;const B=(0,T.strictCollectMemberUsage)([t.events,t.lifeCycle],"PROCESSORS",2);B.size>0&&f.blockingList.push(oo((0,l.loadProcessorsImperatively)(B,pi()),"processors",[...B].join(", "),r.unknownBricks));const $=[];$.push((async()=>{L.properties=await It(P),function(e,t){for(const n of t){const t=()=>{e.element&&Rt(e.element,{[n.propName]:n.propValue},e.runtimeContext)};if(n.contextNames)for(const r of n.contextNames)e.runtimeContext.ctxStore.onChange(r,t);if(n.stateNames){const r=Me(e.runtimeContext,"STATE",`: "${n.propValue}"`);for(const e of n.stateNames)r.onChange(e,t)}if(n.formStateNames){const r=qe(e.runtimeContext,"FORM_STATE",`: "${n.propValue}"`);for(const e of n.formStateNames)r.onChange(e,t)}}}(L,_)})()),r.registerBrickLifeCycle(L,t.lifeCycle);let N,U=t;k?U=Nr(k,t,L,P,r):A===Fr&&(U=function(e,t,n,r,o){var i;const s="string"==typeof e?JSON.parse(e):e,a=(0,h.uniqueId)("form-state-"),c={...n.runtimeContext,formStateStoreId:a};delete c.forEachItem,delete c.forEachIndex,delete c.forEachSize,delete c.tplStateStoreId;const l=new Mr("FORM_STATE",void 0,o,a);c.formStateStoreMap.set(a,l),c.formStateStoreScope&&c.formStateStoreScope.push(l);const d=s.context??[];d.some((e=>"params"===e.name))||d.push({name:"params"}),l.define(d,c,r);const p=Kr(s.formSchema,s.fields,a);return jr.includes(p.brick)&&t.events&&(p.events=function(e,t){const n=e??{};for(const[e,r]of Object.entries(t))n[e]=(0,u.hasOwnProperty)(n,e)?[n[e],r].flat():r;return n}(p.events,t.events)),"boolean"!=typeof(null===(i=t.properties)||void 0===i?void 0:i.renderRoot)||t.properties.renderRoot?{...t,slots:void 0,children:[{brick:"eo-micro-view",properties:{style:{padding:"12px"}},children:[p]}]}:{...t,slots:void 0,children:[p]}}(I,t,L,P,r)),U.portal&&(L.slotId=void 0),k?(N={...E},delete N.forEachItem,delete N.forEachIndex,delete N.forEachSize):N=E;return $.push((async()=>{const e=ro(U.children,U.slots);if(!e)return;const t=new Map,n=await Promise.all(Object.entries(e).map(((e,n)=>{let[s,a]=e;if("routes"!==a.type)return Xr(L,a.bricks,N,r,o,i,s,c);const l=o[o.length-1];return null!=l&&l.incrementalSubRoutes&&(t.set(n,s),r.performIncrementalRender(a,o,(async(e,t)=>{const{homepage:n}=N.app,{pathname:c}=e;if(!g(n,c)||!o.every((e=>{let r,o;return(r=$t(e,n,t.pathname))&&(o=$t(e,n,c))&&(e!==l||(0,h.isEqual)(r.params,o.params))})))return!1;const[u,d,p]=eo({...N,location:e,query:new URLSearchParams(e.search)});let f,m=!1,v=[];try{if(f=await Yr(L,a.routes,u,r,o,i,s,!0),f.route){if(r.reBailout(f))return!0;v=[...d,...p],await Zr(f,u,[u.ctxStore,...v])}await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}catch(e){console.error("Incremental sub-router failed:",e);const t=await r.reCatch(e,L);if(!t)return!0;({failed:m,output:f}=t),await r.reMergeMenuRequestNodes(i,a.routes,f.menuRequestNode)}if(r.reRender(s,[],f.node,L),!m){u.ctxStore.mountAsyncData(f.route);for(const e of v)e.mountAsyncData()}return!!f.route||null}))),Yr(L,a.routes,N,r,o,i,s)}))),s={...f,node:void 0,blockingList:[],menuRequestNode:void 0};n.forEach(((e,n)=>{t.has(n)&&r.memoize(t.get(n),[],e.node,L),to(s,e),function(e,t){const n=t.menuRequestNode;if(n)if(e.menuRequestNode){let t=e.menuRequestNode;for(;t.sibling;)t=t.sibling;t.sibling=n}else e.menuRequestNode=n}(s,e)})),s.node&&(L.child=s.node),to(f,{...s,node:void 0}),no(i,f.menuRequestNode=s.menuRequestNode)})()),await Promise.all($),f}(e,t,n,r,o,i,s,a,c)}catch(n){if(t.errorBoundary)return console.error("Error caught by error boundary:",n),{node:await qr(n,e),blockingList:[]};throw n}}function Qr(e){return[e.ctxStore,...e.tplStateStoreMap.values(),...e.formStateStoreMap.values()]}function Zr(e,t,n){return(0,l.flushStableLoadBricks)(),Promise.all([...e.blockingList,...n.map((e=>e.waitForAll())),...t.pendingPermissionsPreCheck])}function eo(e){const t=[],n=[];return[{...e,tplStateStoreScope:t,formStateStoreScope:n},t,n]}function to(e,t){const{blockingList:n,node:r,menuRequestNode:o,hasTrackingControls:i,...s}=t;if(e.blockingList.push(...n),r)if(e.node){let t=e.node;for(;t.sibling;)t=t.sibling;t.sibling=r}else e.node=r;Object.assign(e,s)}function no(e,t){if(t)if(e.child){let n=e.child;for(;n.sibling;)n=n.sibling;n.sibling=t}else e.child=t}function ro(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const t of e){const e=t.slot??"";(0,u.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(t)}}return n}function oo(e,t,n,r){return"silent"===r?e.catch((e=>{console.error('Load %s "%s" failed:',t,n,e)})):e}let io,so,ao;function co(){if(!io){if(io={isInIframe:!1,isInIframeOfSameSite:!1,isInIframeOfNext:!1,isInIframeOfVisualBuilder:!1,isInIframeOfLegacyConsole:!1},window!==window.parent){io.isInIframe=!0;try{if(window.origin===window.parent.origin){io.isInIframeOfSameSite=!0;const e="/next/"===f(),t=window.parent.location.pathname,n=t.startsWith("/next/");io.isInIframeOfNext=0==(Number(e)^Number(n));const r=n?"/next":"";io.isInIframeOfVisualBuilder=t.startsWith(`${r}/visual-builder/`)||t.startsWith(`${r}/visual-builder-`),io.isInIframeOfLegacyConsole=e&&!n}}catch{}}Object.freeze(io)}return io}function lo(e){var t;if(e.$$registerCustomTemplateProcessed)return;e.$$registerCustomTemplateProcessed=!0;const n=null===(t=e.meta)||void 0===t?void 0:t.customTemplates;if(Array.isArray(n))for(const t of n){const n=t.name.includes(".")?t.name:`${e.app.id}.${t.name}`;Pe.define(n,t)}}function uo(e){let t;t="8.2"===e?"v8-2":"v8",document.documentElement.dataset.ui=t}const po="basic.show-watermark";var fo=new WeakMap,ho=new WeakMap,mo=new WeakMap,go=new WeakMap,vo=new WeakMap,yo=new WeakMap,wo=new WeakMap,bo=new WeakMap,Eo=new WeakMap,So=new WeakMap,Ao=new WeakMap,ko=new WeakSet;class Io{constructor(e){(0,I.A)(this,ko),(0,i.A)(this,fo,void 0),(0,i.A)(this,ho,!1),(0,i.A)(this,mo,void 0),(0,i.A)(this,go,void 0),(0,i.A)(this,vo,void 0),(0,i.A)(this,yo,new Set),(0,i.A)(this,wo,0),(0,i.A)(this,bo,void 0),(0,i.A)(this,Eo,void 0),(0,i.A)(this,So,void 0),(0,i.A)(this,Ao,void 0),(0,s.A)(fo,this,e);const t=k();window.addEventListener("beforeunload",(e=>{(0,C.A)(ko,this,Co).call(this,{})?(e.preventDefault(),e.returnValue=""):delete e.returnValue})),t.block(((e,t)=>(0,C.A)(ko,this,Co).call(this,{location:e,action:t})))}getRenderId(){return(0,a.A)(bo,this)}getRuntimeContext(){return(0,a.A)(go,this)}getRecentApps(){return{currentApp:(0,a.A)(Eo,this),previousApp:(0,a.A)(So,this)}}getNavConfig(){return(0,a.A)(Ao,this)}bootstrap(){window.AbortController&&(so=new AbortController,R.http.interceptors.request.use((e=>{var t;return{...e,options:{...e.options,signal:null!==(t=e.options)&&void 0!==t&&t.noAbortOnRouteChange?null:so.signal}}})));const e=k();let t=e.location;return e.listen(((e,n)=>{const r=t;t=e,(0,a.A)(ho,this)?(0,s.A)(mo,this,{location:e,prevLocation:r,action:n}):(0,C.A)(ko,this,Oo).call(this,{location:e,prevLocation:r,action:n}).catch(nn)})),(0,C.A)(ko,this,Oo).call(this,{location:e.location})}}function Co(e){var t;const n=k(),r=n.getBlockMessage();null===(t=(0,a.A)(vo,this))||void 0===t||t.dispatchBeforePageLeave(e);const o=n.getBlockMessage();return!r&&o&&n.unblock(),o}function Ro(e,t,n){var r,o;if((0,s.A)(wo,this,(r=(0,a.A)(wo,this),o=r++,r)),o>10){const t=`Infinite redirect detected: from "${n.pathname}${n.search}${n.hash}" to "${e}"`;throw new Error(t)}k().replace(e,t)}async function Oo(e){(0,s.A)(ho,this,!0);try{await(0,C.A)(ko,this,To).call(this,e)}finally{if((0,s.A)(ho,this,!1),(0,a.A)(mo,this)){const e=(0,a.A)(mo,this);(0,s.A)(mo,this,void 0),await(0,C.A)(ko,this,Oo).call(this,e)}}}async function To(e){let{location:t,prevLocation:n,action:r}=e;if(n){var o,i,s,c;let e;const u={hash:void 0,state:void 0};var l;if(void 0!==t.key&&("POP"!==r||void 0!==n.key&&!1!==(null===(o=n.state)||void 0===o?void 0:o.notify))||(u.key=void 0),((0,p.locationsAreEqual)({...n,...u},{...t,...u})||"POP"!==r&&!1===(null===(i=t.state)||void 0===i?void 0:i.notify))&&(e=!0),e||null!==(s=t.state)&&void 0!==s&&s.noIncremental||(e=await(null===(l=(0,a.A)(vo,this))||void 0===l?void 0:l.didPerformIncrementalRender(t,n))),e)return;if(so&&(so.abort(),so=new AbortController),null===(c=(0,a.A)(vo,this))||void 0===c||c.dispatchPageLeave(),"POP"===r&&v(m((0,a.A)(fo,this),t.pathname)))return void window.location.reload();V("locationChange")}return(0,C.A)(ko,this,_o).call(this,t)}async function _o(e){var t,n,r,o;const i=(0,s.A)(bo,this,(0,h.uniqueId)("render-id-"));Je=new WeakSet,et.clear(),null==si||null===(t=si.flowApi)||void 0===t||t.clearCollectWidgetContract(),k().unblock();const c=null==si||null===(n=si.pageView)||void 0===n?void 0:n.create(),u=m((0,a.A)(fo,this),e.pathname),d=null===(r=(0,a.A)(go,this))||void 0===r?void 0:r.app,p=null==u||null===(o=u.app)||void 0===o?void 0:o.id;window.BOOTSTRAP_UNION_FILE&&p&&p!==(null==d?void 0:d.id)&&function(e){const{appId:t,version:n}=e;window.APP_ROOT_TPL&&(window.APP_ID=t,window.APP_ROOT=window.APP_ROOT_TPL.replace("{id}",t).replace("{version}",n))}({appId:p,version:u.app.currentVersion}),null!=u&&u.app&&await async function(e){if(!e.$$fulfilled)return e.$$fulfilling||(e.$$fulfilling=async function(e){var t;await(null==si||null===(t=si.fulfilStoryboard)||void 0===t?void 0:t.call(si,e)),L(e),Object.assign(e,{$$fulfilled:!0,$$fulfilling:null})}(e)),e.$$fulfilling}(u);const f=(0,s.A)(Eo,this,null==u?void 0:u.app);!function(){var e,t,n,r,o;const i=ci().getFeatureFlags(),s=ci().getMiscSettings();if(!i["show-watermark"])return;const a="0.0.0"===(null===(e=window.APP_ROOT)||void 0===e||null===(e=e.match(/versions\/([^/]+)\//))||void 0===e?void 0:e[1])||"0.0.0"===(null===(t=window.APP_ROOT)||void 0===t||null===(t=t.match(/micro-apps\/(?:v2|v3)\/[^/]+\/([^/]+)/))||void 0===t?void 0:t[1]),c=(null==si||null===(n=si.auth)||void 0===n||null===(n=n.getAuth())||void 0===n?void 0:n.username)??"",u=s.watermarkConfig??{flags:{}},d=[..."string"==typeof u.content?[u.content]:u.content??[],null!==(r=u.flags)&&void 0!==r&&r["show-development"]&&a?"Development":"",null!==(o=u.flags)&&void 0!==o&&o["show-user"]?c:""].filter(Boolean);if(0===d.length)return;const p={content:d,zIndex:1001,width:200,font:{fontSize:28},gap:[190,190],...(0,h.omit)(u,["content","flags"])};ao?ao.resolve(p):(0,l.loadBricksImperatively)([po],pi()).then((()=>{ao=document.createElement(po),ao.resolve(p)}),(e=>{console.error("Load watermark service failed:",e)}))}();const g=d&&f?d.id!==f.id:d!==f;(0,O.clearExpressionASTCache)(),g&&(0,O.clearFunctionASTCache)();const v=ci().getFeatureFlags(),y=(0,a.A)(vo,this),w=(t,n)=>{null==c||c({status:"redirected"}),(0,a.A)(yo,this).add(y),(0,C.A)(ko,this,Ro).call(this,t,n,e)},b=()=>{const t=v["sso-enabled"]?"/sso-auth/login":"/auth/login";Xt(e),w(t,{from:e})},E=document.querySelector("#main-mount-point"),S=document.querySelector("#portal-mount-point"),A={tag:_n.ROOT,container:E,createPortal:S},I=()=>{var e;Pn(E),Pn(S),(0,a.A)(yo,this).add(y);for(const e of(0,a.A)(yo,this))e&&(e.dispatchOnUnmount(),e.dispose());(0,a.A)(yo,this).clear(),null==si||null===(e=si.messageDispatcher)||void 0===e||e.reset(),g&&((0,s.A)(So,this,d),window.dispatchEvent(new CustomEvent("app.change",{detail:{previousApp:d,currentApp:f}})))};if(Q(f&&(re()[f.id]||f.theme)||"light"),ie("default"),f){var T,_,P,M,x,B;null==si||null===(T=si.checkInstalledApps)||void 0===T||T.preCheckInstalledApps(u,(e=>!!vi(e)));const t={bailout:e=>e.unauthenticated?(b(),!0):e.redirect?(w(e.redirect.path,e.redirect.state),!0):void(0,s.A)(wo,this,0),mergeMenus:async e=>{const t=await Promise.all(e);(0,s.A)(Ao,this,function(e){const t={breadcrumb:[]};for(const n of e){const{breadcrumb:e}=n;e&&(e.overwrite?t.breadcrumb=e.items:t.breadcrumb.push(...e.items))}return t}(t)),window.dispatchEvent(new CustomEvent("navConfig.change",{detail:(0,a.A)(Ao,this)}))},catch:async(t,n)=>{if(!Qt(t)||window.NO_AUTH_GUARD){if(!(t instanceof R.HttpAbortError)){const r=ci().getMiscSettings().noAuthGuardLoginPath;return Qt(t)&&r?void w(r,{from:e}):{failed:!0,output:{node:await qr(t,n,!0),blockingList:[]}}}(0,a.A)(yo,this).add(y)}else b()}},n=(0,s.A)(vo,this,new Hn("page",{routeHelper:t,renderId:i})),r=(0,s.A)(go,this,{app:f,location:e,query:new URLSearchParams(e.search),flags:v,sys:{...null==si||null===(_=si.auth)||void 0===_?void 0:_.getAuth(),...co(),settings:{brand:ci().getBrandSettings()}},ctxStore:new Mr("CTX",void 0,n),pendingPermissionsPreCheck:[null==si||null===(P=si.checkPermissions)||void 0===P?void 0:P.preCheckPermissions(u)],tplStateStoreMap:new Map,formStateStoreMap:new Map});(0,s.A)(Ao,this,void 0),lo(u),me(null===(M=u.meta)||void 0===M?void 0:M.functions,f),null==si||null===(x=si.flowApi)||void 0===x||x.collectContract(null===(B=u.meta)||void 0===B?void 0:B.contracts);let o,l=!1,d=[];try{nr.clear();const e={};if(o=await Yr(A,function(e){if(window.parent===window)return e;let t=e;const n=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/template-preview/")));t=[...t.slice(0,n+1),{path:"${APP.homepage}/_dev_only_/template-preview/:templateId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(n+1)];const r=(0,h.findLastIndex)(t,(e=>e.path.startsWith("${APP.homepage}/_dev_only_/snippet-preview/")));return t=[...t.slice(0,r+1),{path:"${APP.homepage}/_dev_only_/snippet-preview/:snippetId",bricks:[{brick:"span"}],menu:!1,exact:!0},...t.slice(r+1)],t}(u.routes),r,n,[],e),t.bailout(o))return;d=Qr(r),await Zr(o,r,d),e.child=o.menuRequestNode,n.setInitialMenuRequestNode(e),await t.mergeMenus(n.getMenuRequests())}catch(e){console.error("Router failed:",e);const n=await t.catch(e,A);if(!n)return;({failed:l,output:o}=n)}if(A.child=o.node,I(),o.route&&"routes"!==o.route.type||l){if(l||n.dispatchBeforePageLoad(),te(),ae(),uo(null==f?void 0:f.uiVersion),Mn(A),window.scrollTo(0,0),l)null==c||c({status:"failed"});else{n.dispatchPageLoad(),n.dispatchAnchorLoad(),n.dispatchOnMount(),n.initializeScrollIntoView(),n.initializeMediaChange(),n.initializeMessageDispatcher();for(const e of d)e.mountAsyncData();null==c||c({status:"ok",path:o.path,pageTitle:document.title})}return void V("rendered")}}else{if(!window.NO_AUTH_GUARD&&null!=si&&si.auth&&!si.auth.isLoggedIn())return void b();I()}te(),ae();const $=await qr(new zr(f?"page not found":"app not found"),A,!0);A.child=$,Mn(A),window.scrollTo(0,0),null==c||c({status:"not-found"}),V("rendered")}const Po="undefined"!=typeof BRICK_PACKAGES?BRICK_PACKAGES:null;var Mo=n(4579),xo=n(4501),Lo=2,Bo=.16,$o=.05,No=.05,Uo=.15,Fo=5,Do=4,jo=[{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 Ko(e){var t=e.r,n=e.g,r=e.b,o=(0,Mo.wE)(t,n,r);return{h:360*o.h,s:o.s,v:o.v}}function Vo(e){var t=e.r,n=e.g,r=e.b;return"#".concat((0,Mo.Ob)(t,n,r,!1))}function Wo(e,t,n){var r;return(r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Lo*t:Math.round(e.h)+Lo*t:n?Math.round(e.h)+Lo*t:Math.round(e.h)-Lo*t)<0?r+=360:r>=360&&(r-=360),r}function Ho(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-Bo*t:t===Do?e.s+Bo:e.s+$o*t)>1&&(r=1),n&&t===Fo&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Go(e,t,n){var r;return(r=n?e.v+No*t:e.v-Uo*t)>1&&(r=1),Number(r.toFixed(2))}function zo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=(0,xo.RO)(e),o=Fo;o>0;o-=1){var i=Ko(r),s=Vo((0,xo.RO)({h:Wo(i,o,!0),s:Ho(i,o,!0),v:Go(i,o,!0)}));n.push(s)}n.push(Vo(r));for(var a=1;a<=Do;a+=1){var c=Ko(r),l=Vo((0,xo.RO)({h:Wo(c,a),s:Ho(c,a),v:Go(c,a)}));n.push(l)}return"dark"===t.theme?jo.map((function(e){var r,o,i,s=e.index,a=e.opacity;return Vo((r=(0,xo.RO)(t.backgroundColor||"#141414"),i=100*a/100,{r:((o=(0,xo.RO)(n[s])).r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b}))})):n}var qo={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"},Yo={},Xo={};function Jo(e){return':root,\n[data-override-theme="light"] {\n'.concat(e,"}")}function Qo(e){return'html[data-theme="dark-v2"],\n[data-override-theme="dark-v2"] {\n'.concat(e,"}")}function Zo(e){return e.match(/[0-9a-fA-F]{2}/g).map((e=>parseInt(e,16))).join(", ")}function ei(e,t,n){return"dark"===t?zo(e,{theme:t,backgroundColor:n})[5]:e}function ti(e){const t=[];if(["light","dark"].forEach((n=>{if(e[n])switch(e.type){case"brandColor":t.push(function(e,t){return("dark"===e?Qo:Jo)("string"==typeof(n=t)?" --color-brand: ".concat(n,";\n"):[" --color-brand: ".concat(n.default,";")," --color-brand-hover: ".concat(n.hover,";")," --color-brand-active: ".concat(n.active,";"),""].join("\n"));var n}(n,e[n]));break;case"baseColors":t.push(function(e,t,n){return("dark"===e?Qo:Jo)("".concat(function(e,t){return Object.entries(e).flatMap((e=>{var[n,r]=e;return function(e){if(!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid base color name: ".concat(JSON.stringify(e)))}(n),r.map(((e,r)=>[" --palette-".concat(n,"-").concat(r+1,"-channel: ").concat(Zo(e),";")].concat("dark"===t?[]:" --palette-".concat(n,"-").concat(r+1,": rgb(var(--palette-").concat(n,"-").concat(r+1,"-channel));")).join("\n"))).concat("")})).join("\n")}(function(e,t,n){return Object.fromEntries(Object.entries(e).map((e=>{var[r,o]=e;return[r,zo(o,"dark"===t?{theme:t,backgroundColor:n}:void 0)]})))}(t,e,n),e),"\n").concat(function(e,t,n){return Object.entries({green:"green",red:"red",blue:"blue",orange:"orange",cyan:"cyan",purple:"purple",geekblue:"indigo"}).flatMap((r=>{var[o,i]=r;return[" --theme-".concat(o,"-color-rgb-channel: ").concat(Zo(ei(t[i],e,n)),";"),..."dark"===e?[]:[" --theme-".concat(o,"-color: var(--palette-").concat(i,"-6);")," --theme-".concat(o,"-border-color: var(--palette-").concat(i,"-3);")]," --theme-".concat(o,"-background: var(--palette-").concat(i,"-").concat("dark"===e?2:1,");"),""]})).join("\n")}(e,t,n)))}(n,e[n],e.backgroundColor));break;case"variables":t.push(function(e,t){return("dark"===e?Qo:Jo)(function(e){return Object.entries(e).map((e=>{var[t,n]=e;return function(e){if(!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))throw new Error("Invalid css variable name: ".concat(JSON.stringify(e)))}(t)," ".concat(t,": ").concat(n,";")})).concat("").join("\n")}(t))}(n,e[n]))}})),t.length>0){const e=document.createElement("style");return e.textContent=t.join("\n\n"),document.head.appendChild(e),()=>{e.remove()}}}let ni,ri,oi,ii,si;function ai(e){if(ni)throw new Error("Cannot create multiple runtimes");return window.addEventListener("message",(e=>{let{data:t}=e;if((null==t?void 0:t.source)!==U)return;const n=t.payload;switch(null==n?void 0:n.type){case F:K=n.active;break;case D:j=n.panel}})),si=null==e?void 0:e.hooks,(0,c.initializeI18n)(Gt,zt),d.locale(c.i18n.language),c.i18n.on("languageChanged",(()=>{d.locale(c.i18n.language)})),A(),ni=new di,ni}Object.keys(qo).forEach((function(e){Yo[e]=zo(qo[e]),Yo[e].primary=Yo[e][5],Xo[e]=zo(qo[e],{theme:"dark",backgroundColor:"#141414"}),Xo[e].primary=Xo[e][5]})),Yo.red,Yo.volcano,Yo.gold,Yo.orange,Yo.yellow,Yo.lime,Yo.green,Yo.cyan,Yo.blue,Yo.geekblue,Yo.purple,Yo.magenta,Yo.grey;const ci=function(){const e=S();if(e)return function(){return new Proxy(e.getRuntime(),{get(){switch(arguments.length<=1?void 0:arguments[1]){case"getCurrentApp":case"getRecentApps":case"hasInstalledApp":case"getDesktops":case"getLaunchpadSettings":case"getLaunchpadSiteMap":case"toggleLaunchpadEffect":case"applyPageTitle":case"getNavConfig":case"getFeatureFlags":case"getMiscSettings":case"getBrandSettings":return Reflect.get(...arguments)}}})}}()||function(){return ni};var li=new WeakMap,ui=new WeakMap;class di{constructor(){(0,i.A)(this,li,!1),(0,i.A)(this,ui,!1),(0,o.A)(this,"version",3)}initialize(e){var t;if((0,a.A)(li,this))throw new Error("The runtime cannot be initialized more than once");(0,s.A)(li,this,!0),function(e){(0,u.isObject)(e.settings)&&(0,u.deepFreeze)(e.settings),e.brickPackages&&(0,u.deepFreeze)(e.brickPackages)}(e),ri=e;const{notification:n,dialog:r}=fi();var o;!1!==n&&(o=n??"basic.show-notification",(0,this.loadBricks)([o]).then((()=>{en=document.createElement(o)}),(e=>{console.error("Load notification service failed:",e)}))),!1!==r&&function(e,t){t([e]).then((()=>{qt=document.createElement(e)}),(e=>{console.error("Load dialog service failed:",e)}))}(r??"basic.show-dialog",this.loadBricks),function(e){e&&(e.brandColor?ti({type:"brandColor",...e.brandColor}):e.baseColors?ti({type:"baseColors",...e.baseColors}):e.variables&&ti({type:"variables",...e.variables}))}(null===(t=e.settings)||void 0===t||null===(t=t.misc)||void 0===t?void 0:t.theme)}async bootstrap(e){if(e&&this.initialize(e),(0,a.A)(ui,this))throw new Error("The runtime cannot be bootstrapped more than once");(0,s.A)(ui,this,!0),oi=new Io(ri.storyboards),await oi.bootstrap()}getRecentApps(){var e;return(null===(e=oi)||void 0===e?void 0:e.getRecentApps())??{}}getCurrentApp(){var e;return null===(e=oi)||void 0===e?void 0:e.getRecentApps().currentApp}hasInstalledApp(e,t){return ze(e,t)}getFeatureFlags(){var e,t;return{...null===(e=ri)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.featureFlags,...null===(t=oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.featureFlags,"migrate-to-brick-next-v3":!0}}getMiscSettings(){var e,t;return{...null===(e=ri)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.misc,...null===(t=oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.settings)||void 0===t?void 0:t.misc}}getBrandSettings(){var e;return{base_title:"DevOps 管理专家",...null===(e=ri)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.brand}}getLaunchpadSettings(){var e;return{columns:7,rows:4,...null===(e=ri)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.launchpad}}getDesktops(){var e;return(null===(e=ri)||void 0===e?void 0:e.desktops)??[]}getLaunchpadSiteMap(){var e;return(null===(e=ri)||void 0===e?void 0:e.siteSort)??[]}toggleLaunchpadEffect(e){document.body.classList.toggle("launchpad-open",e)}applyPageTitle(e){var t;const n=this.getBrandSettings().base_title;document.title=(null===(t=oi)||void 0===t||null===(t=t.getRecentApps().currentApp)||void 0===t?void 0:t.localeTitle)||(e?`${e} - ${n}`:n)}getNavConfig(){var e;return null===(e=oi)||void 0===e?void 0:e.getNavConfig()}loadBricks(e){return(0,l.loadBricksImperatively)(e,pi())}}function pi(){var e;return ii??(ii=function(e,t){if(null==t||!t.length)return e;const n=new Map;return[...t,...e].forEach((e=>{const t=e.filePath.split("/")[1];n.has(t)||n.set(t,e)})),Array.from(n.values())}((null===(e=ri)||void 0===e?void 0:e.brickPackages)??Po??window.STANDALONE_BRICK_PACKAGES??[],window.PUBLIC_DEPS))}function fi(){var e;return(null===(e=ri)||void 0===e||null===(e=e.settings)||void 0===e?void 0:e.presetBricks)??{}}function hi(){var e;return null===(e=oi)||void 0===e?void 0:e.getRenderId()}function mi(){var e;return null===(e=oi)||void 0===e?void 0:e.getRuntimeContext()}function gi(e){var t;return null===(t=ri)||void 0===t||null===(t=t.storyboards)||void 0===t?void 0:t.find((t=>t.app.id===e))}function vi(e){var t;return null===(t=gi(e))||void 0===t?void 0:t.app}function yi(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==si||null===(e=si.auth)||void 0===e||null===(t=e.authenticate)||void 0===t||t.call(e,...r)}function wi(){var e;return null==si||null===(e=si.auth)||void 0===e?void 0:e.getAuth()}function bi(){var e,t;return null==si||null===(e=si.auth)||void 0===e||null===(t=e.logout)||void 0===t?void 0:t.call(e)}function Ei(){var e;return null==si||null===(e=si.auth)||void 0===e?void 0:e.isLoggedIn()}var Si=new WeakMap;const Ai=new class{constructor(){(0,i.A)(this,Si,new Map)}define(e,t){(0,a.A)(Si,this).has(e)?console.error(`Custom editor of "${e}" already registered`):(0,a.A)(Si,this).set(e,t)}get(e){return(0,a.A)(Si,this).get(e)}};async function ki(e,t,n){return nt(await Xe(e),e,"resolve",t,n)}function Ii(e){let t,{portal:n,scope:r="fragment",unknownBricks:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n;t=n||(()=>(i=document.createElement("div"),i.style.position="absolute",i.style.width=i.style.height="0",document.body.append(i),i));let s,a,l=!1;return{async render(n){let{theme:u,uiVersion:d,language:p,context:f,functions:m,templates:g,i18n:v,url:y,app:w}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l)throw new Error("The root is unmounted and cannot be rendered any more");const b=[].concat(n),E=s,S=(0,h.uniqueId)("render-id-");s=new Hn(r,{unknownBricks:o,renderId:S});const A={ctxStore:new Mr("CTX",void 0,s),pendingPermissionsPreCheck:[],tplStateStoreMap:new Map,formStateStoreMap:new Map};if(y){const e=new URL(y);A.query=e.searchParams,A.location={pathname:e.pathname,search:e.search,hash:e.hash,state:void 0}}const k={tag:_n.ROOT,container:e,createPortal:t};if("page"===r){var I;Q(u??"light"),ie("default"),uo(d),p&&await c.i18n.changeLanguage(p),w??(w={id:"demo",homepage:"/demo"}),A.app=w;const e={app:w,meta:{i18n:v,customTemplates:g}};null===(I=a)||void 0===I||I(),a=L(e),lo(e),me(m,w)}A.ctxStore.define(f,A);let C,R=!1,O=[];try{C=await Xr(k,b,A,s,[],{}),O=Qr(A),await Zr(C,A,O)}catch(e){R=!0,C={node:await qr(e,k,"page"===r),blockingList:[]}}if(k.child=C.node,null==E||E.dispatchOnUnmount(),null==E||E.dispose(),Pn(e),i&&Pn(i),"page"===r&&(R||s.dispatchBeforePageLoad(),te(),ae()),Mn(k),"page"===r&&window.scrollTo(0,0),!R){for(const e of O)e.mountAsyncData();"page"===r&&s.dispatchPageLoad(),s.dispatchOnMount(),s.initializeScrollIntoView(),s.initializeMediaChange(),s.initializeMessageDispatcher()}},unmount(){l||(l=!0,Pn(e),i&&(Pn(i),n||i.remove()))}}}function Ci(e){let{useRealTimeQuery:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...mi()};t&&(n.query=new URLSearchParams(k().location.search));const r=t=>{if("string"==typeof t){if((0,O.isEvaluable)(t)){const e=ut(t,n);return Qe(e),e}return(0,_.inject)(t,n)}return!(0,u.isObject)(t)||Ze(e)?t:Array.isArray(t)?t.map((e=>r(e))):Object.fromEntries(Object.entries(t).map((e=>{let[t,n]=e;return[r(t),r(n)]})))};return r(e)}}}]);
3
- //# sourceMappingURL=799.0d07ef57.js.map