@abtnode/webapp 1.16.26-beta-818ea1c5 → 1.16.26-beta-cca12425

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 (103) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +54 -52
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/1059.577f662e.chunk.js +1 -0
  7. package/build/static/js/1366.b27f4401.chunk.js +2 -0
  8. package/build/static/js/1575.aac11098.chunk.js +1 -0
  9. package/build/static/js/1641.28b81b2a.chunk.js +1 -0
  10. package/build/static/js/{1667.34ff0c47.chunk.js → 1667.dd9ab75a.chunk.js} +1 -1
  11. package/build/static/js/{1846.6e3f3612.chunk.js → 1846.7c384de2.chunk.js} +1 -1
  12. package/build/static/js/{1986.44b1949e.chunk.js → 1986.8a971924.chunk.js} +1 -1
  13. package/build/static/js/2019.a2d8670f.chunk.js +1 -0
  14. package/build/static/js/2080.1b558a42.chunk.js +1 -0
  15. package/build/static/js/2217.6a22ef31.chunk.js +1 -0
  16. package/build/static/js/233.b8ef7cd9.chunk.js +1 -0
  17. package/build/static/js/{3389.7f3e3f8a.chunk.js → 3389.659cab57.chunk.js} +1 -1
  18. package/build/static/js/3803.54aaf418.chunk.js +1 -0
  19. package/build/static/js/3930.8a91ec91.chunk.js +1 -0
  20. package/build/static/js/4235.82e1ffd8.chunk.js +1 -0
  21. package/build/static/js/4296.8887004f.chunk.js +1 -0
  22. package/build/static/js/440.09c3a54d.chunk.js +1 -0
  23. package/build/static/js/4423.f9aa4282.chunk.js +1 -0
  24. package/build/static/js/4465.e11fb354.chunk.js +1 -0
  25. package/build/static/js/4549.c4d87199.chunk.js +1 -0
  26. package/build/static/js/{4550.2818aacf.chunk.js → 4550.6b5e2469.chunk.js} +1 -1
  27. package/build/static/js/475.f8cdcb9d.chunk.js +1 -0
  28. package/build/static/js/4804.0799b676.chunk.js +2 -0
  29. package/build/static/js/{4906.89c01125.chunk.js → 4906.f8af0bfa.chunk.js} +1 -1
  30. package/build/static/js/506.fe1f4c17.chunk.js +1 -0
  31. package/build/static/js/5296.5812dffa.chunk.js +2 -0
  32. package/build/static/js/5312.bb165dac.chunk.js +1 -0
  33. package/build/static/js/{9237.0eb04d60.chunk.js → 5570.eca72753.chunk.js} +2 -2
  34. package/build/static/js/5748.a2be56d1.chunk.js +1 -0
  35. package/build/static/js/5784.372681fa.chunk.js +1 -0
  36. package/build/static/js/6511.072d29a7.chunk.js +1 -0
  37. package/build/static/js/{6547.01abc819.chunk.js → 6547.7b4a8db4.chunk.js} +1 -1
  38. package/build/static/js/6743.5a8d8d86.chunk.js +2 -0
  39. package/build/static/js/6906.22761c9e.chunk.js +1 -0
  40. package/build/static/js/6944.80d9f271.chunk.js +1 -0
  41. package/build/static/js/{7327.b271984c.chunk.js → 7327.d1805380.chunk.js} +1 -1
  42. package/build/static/js/{7913.f687f9d2.chunk.js → 7913.554f4e7d.chunk.js} +1 -1
  43. package/build/static/js/8139.94d2309f.chunk.js +1 -0
  44. package/build/static/js/8170.fcb2e3fb.chunk.js +1 -0
  45. package/build/static/js/{8427.4a662c59.chunk.js → 8427.591d6dee.chunk.js} +2 -2
  46. package/build/static/js/8590.71bbe56c.chunk.js +1 -0
  47. package/build/static/js/8646.4850021f.chunk.js +1 -0
  48. package/build/static/js/8721.4095221a.chunk.js +2 -0
  49. package/build/static/js/8986.41d2268d.chunk.js +1 -0
  50. package/build/static/js/9132.50e5bf38.chunk.js +1 -0
  51. package/build/static/js/9282.21bb92f3.chunk.js +2 -0
  52. package/build/static/js/9476.883b7a77.chunk.js +1 -0
  53. package/build/static/js/{9552.962b8ba3.chunk.js → 9552.024c3ae2.chunk.js} +1 -1
  54. package/build/static/js/9586.19d0a41d.chunk.js +1 -0
  55. package/build/static/js/main.38a3525f.js +2 -0
  56. package/package.json +1 -1
  57. package/build/static/js/1059.1deb37a5.chunk.js +0 -1
  58. package/build/static/js/1366.bf33872e.chunk.js +0 -2
  59. package/build/static/js/1575.af6d3a81.chunk.js +0 -1
  60. package/build/static/js/2019.8653d735.chunk.js +0 -1
  61. package/build/static/js/233.652dccad.chunk.js +0 -1
  62. package/build/static/js/2537.10cf10fb.chunk.js +0 -1
  63. package/build/static/js/3803.13752d01.chunk.js +0 -1
  64. package/build/static/js/3930.c2e49ec4.chunk.js +0 -1
  65. package/build/static/js/406.7c629ae6.chunk.js +0 -1
  66. package/build/static/js/4423.55691e47.chunk.js +0 -1
  67. package/build/static/js/4465.e73128b3.chunk.js +0 -1
  68. package/build/static/js/4509.2b57b6dd.chunk.js +0 -2
  69. package/build/static/js/4549.40465785.chunk.js +0 -1
  70. package/build/static/js/4804.01fd0c3d.chunk.js +0 -2
  71. package/build/static/js/4930.a556409d.chunk.js +0 -1
  72. package/build/static/js/506.7795a2df.chunk.js +0 -1
  73. package/build/static/js/5672.12d96543.chunk.js +0 -1
  74. package/build/static/js/5748.7b20575b.chunk.js +0 -1
  75. package/build/static/js/6230.648419c5.chunk.js +0 -1
  76. package/build/static/js/6511.9a280bb3.chunk.js +0 -1
  77. package/build/static/js/670.cc95cf88.chunk.js +0 -1
  78. package/build/static/js/6743.f19f7583.chunk.js +0 -2
  79. package/build/static/js/6906.c013a8e6.chunk.js +0 -1
  80. package/build/static/js/6944.af327aad.chunk.js +0 -1
  81. package/build/static/js/7534.58ee2840.chunk.js +0 -1
  82. package/build/static/js/8167.6f5f3c09.chunk.js +0 -1
  83. package/build/static/js/8170.637d34f1.chunk.js +0 -1
  84. package/build/static/js/8590.fa219950.chunk.js +0 -1
  85. package/build/static/js/8646.a93fb6cc.chunk.js +0 -1
  86. package/build/static/js/8656.b42c647d.chunk.js +0 -1
  87. package/build/static/js/8986.ecf4d834.chunk.js +0 -1
  88. package/build/static/js/9450.5a43999b.chunk.js +0 -1
  89. package/build/static/js/9586.cbc4bbba.chunk.js +0 -1
  90. package/build/static/js/9590.694b5369.chunk.js +0 -2
  91. package/build/static/js/9818.dd9e917b.chunk.js +0 -2
  92. package/build/static/js/main.29b1b2c1.js +0 -2
  93. /package/build/static/css/{6230.9cab926a.chunk.css → 5312.9cab926a.chunk.css} +0 -0
  94. /package/build/static/css/{9237.bceba133.chunk.css → 5570.bceba133.chunk.css} +0 -0
  95. /package/build/static/js/{1366.bf33872e.chunk.js.LICENSE.txt → 1366.b27f4401.chunk.js.LICENSE.txt} +0 -0
  96. /package/build/static/js/{4804.01fd0c3d.chunk.js.LICENSE.txt → 4804.0799b676.chunk.js.LICENSE.txt} +0 -0
  97. /package/build/static/js/{4509.2b57b6dd.chunk.js.LICENSE.txt → 5296.5812dffa.chunk.js.LICENSE.txt} +0 -0
  98. /package/build/static/js/{9237.0eb04d60.chunk.js.LICENSE.txt → 5570.eca72753.chunk.js.LICENSE.txt} +0 -0
  99. /package/build/static/js/{6743.f19f7583.chunk.js.LICENSE.txt → 6743.5a8d8d86.chunk.js.LICENSE.txt} +0 -0
  100. /package/build/static/js/{8427.4a662c59.chunk.js.LICENSE.txt → 8427.591d6dee.chunk.js.LICENSE.txt} +0 -0
  101. /package/build/static/js/{9590.694b5369.chunk.js.LICENSE.txt → 8721.4095221a.chunk.js.LICENSE.txt} +0 -0
  102. /package/build/static/js/{9818.dd9e917b.chunk.js.LICENSE.txt → 9282.21bb92f3.chunk.js.LICENSE.txt} +0 -0
  103. /package/build/static/js/{main.29b1b2c1.js.LICENSE.txt → main.38a3525f.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6230],{80378:(e,n,t)=>{t.d(n,{Z:()=>u});var i=t(55898),o=t.n(i),a=t(62681),l=t(72333),r=t(6352),s=t.n(r),c=t(35432),d=t(58238),m=t(46090);var p=t(96266);function u(e){let{blocklet:n,style:t,size:i,ancestors:o,...r}=e;const u=(0,d.h6)(),{logoUrl:f,inService:h}=function(e){var n;let{blocklet:t,ancestors:i=[]}=e;const o=(0,d.h6)(),{inService:a}=o,l="?v=".concat(null===t||void 0===t||null===(n=t.meta)||void 0===n?void 0:n.version).concat((0,m.XN)(null===t||void 0===t?void 0:t.status)?"~":"");let r=a?s()(m.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",l):s()(o.imgPrefix,"blocklet.png");if("registry"===t.source&&t.deployedFrom&&t.meta.logo)r=s()(t.deployedFrom,(0,m.lk)(t.meta.bundleDid,t.meta.logo),l);else{const e=window.env.apiPrefix||"/",n=i.concat(t),o=a?n.slice(1):n;r=s()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),l)}return{logoUrl:r,inService:a}}({blocklet:n,ancestors:o}),{variant:g}=r,x=h?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let b=(0,p.jsx)("img",{src:f,onError:x,alt:n.meta.name,style:{width:i}});return n.meta.logo||(b=(0,p.jsx)(l.Z,{did:n.meta.did||"",responsive:!0})),(0,p.jsx)(a.Z,{variant:g||"square",style:Object.assign({backgroundColor:"transparent",width:i,height:i,borderRadius:10},t),...r,children:b})}u.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},u.defaultProps={style:{},size:40,ancestors:[]}},74286:(e,n,t)=>{t.d(n,{Z:()=>r});var i=t(55898),o=t.n(i),a=t(39948),l=t(96266);function r(e){let{depth:n,className:t}=e;return(0,l.jsx)(a.Z,{ml:Math.max(2*(n-1),0),className:t,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}r.propTypes={depth:o().number,className:o().string},r.defaultProps={depth:1,className:""}},44784:(e,n,t)=>{t.d(n,{Z:()=>d});var i,o=t(71171),a=t(33518),l=t(82790),r=t(96266);function s(e){let{labelProps:n,className:t,style:i,...o}=e;const a={...n,labelPlacement:(null===n||void 0===n?void 0:n.labelPlacement)||"start"};return(0,r.jsx)(c,{className:t,style:i,children:(0,r.jsx)(l.Z,{labelProps:a,...o})})}s.propTypes=l.Z.propTypes,s.defaultProps=l.Z.defaultProps;const c=a.Z.div(i||(i=(0,o.Z)(["\n max-width: 300px;\n > label {\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n "," {\n max-width: 100%;\n }\n"])),(e=>{let{theme:n}=e;return n.breakpoints.down("sm")})),d=s},59375:(e,n,t)=>{t.d(n,{Z:()=>Z});var i,o=t(71171),a=t(5057),l=t(55898),r=t.n(l),s=t(6352),c=t.n(s),d=t(33518),m=t(92706),p=t.n(m),u=t(39948),f=t(52277),h=t.n(f),g=t(68420),x=t(96266);const b=(0,a.lazy)((()=>Promise.all([t.e(6547),t.e(5760),t.e(6743),t.e(9818),t.e(1294),t.e(4804)]).then(t.bind(t,84804)).then((e=>({default:e.Uploader}))))),v="/blocklet/logo/upload";function Z(e){let{url:n,height:t,width:i,enabled:o,type:l,did:r,prefix:s,headers:d,onUploaded:m}=e;const{t:p}=(0,g.PE)(),f=(0,a.useRef)(null),Z={cursor:o?"pointer":"default","&::after":{content:'"'.concat(p("common.switch"),'"')}};return(0,x.jsxs)(j,{id:"uploader-".concat(r,"-").concat(l),children:[(0,x.jsx)(b,{ref:f,popup:!0,onUploadFinish:()=>{var e;m(),null===(e=f.current)||void 0===e||e.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:c()(s,v,l,r),disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*",".jpg",".jpeg",".png",".gif",".svg"],maxFileSize:10485760,maxNumberOfFiles:1}},tusProps:{headers:d}}),(0,x.jsx)(u.Z,{className:h()("uploader-wrapper",o&&"enabled"),sx:Z,onClick:()=>{var e;null===(e=f.current)||void 0===e||e.open()},children:(0,x.jsx)("img",{alt:"Logo",src:n,style:{height:t,width:i}})})]},"uploader-".concat(r,"-").concat(l))}Z.propTypes={url:r().string.isRequired,type:r().oneOf(["square","rect","favicon"]).isRequired,did:r().string.isRequired,prefix:r().string.isRequired,headers:r().func,onUploaded:r().func,height:r().number,width:r().any,enabled:r().bool},Z.defaultProps={height:80,width:"auto",enabled:!0,headers:()=>({}),onUploaded:p()};const j=d.Z.div(i||(i=(0,o.Z)(["\n .uploader-wrapper {\n display: inline-flex;\n position: relative;\n font-size: 0px;\n &.enabled {\n cursor: pointer;\n }\n &::after {\n display: none;\n }\n &.enabled::after {\n display: block;\n opacity: 0;\n position: absolute;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n left: 0;\n right: 0;\n height: 2.2em;\n color: white;\n text-align: center;\n font-size: 12px;\n line-height: 2em;\n transition: opacity 0.3s ease;\n }\n &:hover::after {\n opacity: 1;\n }\n }\n"])))},64558:(e,n,t)=>{t.r(n),t.d(n,{default:()=>mt});var i,o=t(71171),a=t(5057),l=t(33518),r=t(55898),s=t.n(r),c=t(96181),d=t(6352),m=t.n(d),p=t(35432),u=t(39948),f=t(55402),h=t(82275),g=t(96399),x=t(65688),b=t(37633),v=t(48037),Z=t(92273),j=t(76720),y=t(15849),C=t(68420),k=t(94464),w=t(38242),S=t(80378),E=t(1722),L=t(43681),P=t.n(L),R=t(50482),T=t.n(R),A=t(16147),_=t(29034),N=t(28726),O=t(80578),I=t(77277),F=t(86229),B=t(28641),z=t(44846),U=t(13727),D=t(56184),K=t(67680),W=t(19654),q=t(90067),G=t(39646),V=t(43897),H=t(47020),M=t(49020),Y=t(35406),J=t(11875),Q=t(95890),X=t(96266);function $(e){let{label:n,disabled:t,required:i,initialValue:o,onChange:l,style:r,onSubmit:s,triggers:c,options:d,formatterBeforeSubmit:m,helperText:p,placeholder:f,renderImage:h,renderLabel:g,filterKeys:x,noEmpty:b,...v}=e;const[Z,j]=(0,a.useState)(!1),[y,C]=(0,a.useState)(!1),[k,w]=a.useState(""),[S,E]=(0,a.useState)(o),[L,P]=(0,a.useState)(S),R=(0,a.useMemo)((()=>{if(!d)return{};const e={};return d.forEach((n=>{e[n.code]=n})),e}),[d]),T=Z?(0,X.jsx)(G.Z,{options:d,value:L,onChange:(e,n)=>{if(!Array.isArray(n))return P([]),void l([]);const t=n.filter((e=>R[e]));if(!t.length)return P([]),void l([]);P(t),l(t)},inputValue:k,onInputChange:(e,n)=>{w(n)},PopperComponent:ne,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:()=>{if(!d)return[];if(!k)return d.map((e=>e.code));const e=new RegExp(k.toLowerCase());return d.filter((n=>{for(let i=0;i<x.length;i++){var t;const o=x[i];if(e.test(null===(t=n[o])||void 0===t?void 0:t.toLowerCase()))return!0}return!1})).map((e=>e.code))},getOptionLabel:e=>{var n;return null===(n=R[e])||void 0===n?void 0:n.name},renderInput:e=>(0,X.jsx)(H.Z,{...e,label:"",placeholder:f}),renderOption:(e,n)=>{var t;const i=-1!==L.indexOf(n);return(0,a.createElement)(ee,{component:"li",...e,key:n},h(R[n]||{}),(0,X.jsx)(u.Z,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:i?"700":"normal"},children:g(n,R[n])||(null===(t=R[n])||void 0===t?void 0:t.name)}),(0,X.jsx)(u.Z,{component:U.default,sx:{opacity:.5,width:18,height:18},style:{visibility:i?"visible":"hidden"}}))},...v}):(0,X.jsx)(u.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:L.filter((e=>d.some((n=>n.code===e)))).map((e=>(0,X.jsx)(W.Z,{label:d.find((n=>n.code===e)).name,style:{marginRight:8},size:"small"},e)))});return(0,X.jsx)(J.Z,{className:"form",style:r,children:(0,X.jsxs)(u.Z,{className:"form-item",children:[(0,X.jsxs)(u.Z,{className:"form-item-label",children:[n,i&&(0,X.jsx)(Y.Z,{})]}),(0,X.jsxs)(u.Z,{className:"form-item-body",children:[(0,X.jsx)(u.Z,{className:"form-item-input",children:T}),(0,X.jsx)(u.Z,{className:"form-item-action",children:Z?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-confirm",onClick:async()=>{C(!0);try{!1===await s("function"===typeof m?m(L):L)?P(S):b&&!L.length?(P(o),E(o)):(P(L),E(L))}catch(e){P(S)}finally{C(!1),j(!1)}},disabled:t||y,size:"large",children:y?(0,X.jsx)(z.Z,{size:24}):(0,X.jsx)(D.Z,{})}),(0,X.jsx)(K.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{P(S),j(!1)},disabled:t||y,size:"large",children:(0,X.jsx)(U.default,{})})]}):(0,X.jsx)(Q.Z,{triggers:c,onEnterEdit:()=>j(!0),disabled:t})})]}),Z&&p&&(0,X.jsx)(q.Z,{children:p})]})})}$.propTypes={style:s().object,onSubmit:s().func,onChange:s().func,label:s().string,initialValue:s().string,required:s().bool,disabled:s().bool,triggers:s().array,options:s().array,helperText:s().string,formatterBeforeSubmit:s().func,placeholder:s().string,renderImage:s().func,filterKeys:s().arrayOf(s().string),noEmpty:s().bool,renderLabel:s().func},$.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const ee=l.Z.div(i||(i=(0,o.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n font-size: 1.1em;\n"]))),ne=(0,l.Z)(M.Z)((()=>({["& .".concat(V.Z.paper)]:{boxShadow:"0px 8px 12px rgba(92, 92, 92, 0.04), 0px -10px 12px rgba(92, 92, 92, 0.04)",borderRadius:"6px",width:"100%",border:"1px solid rgba(0, 0, 0, 0.12)",color:"inherit",fontSize:13,position:"absolute",left:0,top:0},["& .".concat(V.Z.listbox)]:{padding:0}})));var te,ie=t(58238),oe=t(46090),ae=t(54063),le=t(63406),re=t(78410),se=t(31853),ce=t(22425),de=t(70461),me=t(73545),pe=t(29054);function ue(e){let{initialValue:n,onChange:t,disabled:i,loading:o}=e;const{t:a}=(0,C.PE)(),{api:l}=(0,me.T)(),{blocklet:r}=(0,pe.y0)(),[s,c]=(0,se.Z)({newAppSk:"",isConnectOpen:!1}),d=()=>c({isConnectOpen:!1}),m=r.structVersion===p.APP_STRUCT_VERSION?[{key:"rotate-with-did-wallet",title:"Migrate with DID Wallet",handler:()=>{(0,oe.An)(r.status)?F.Z.error(a("blocklet.error.isRunning")):(0,w.isInProgress)(r.status)?F.Z.error(a("blocklet.error.isInProgress")):c({isConnectOpen:!0})}}]:[];return[(0,X.jsx)(B.Z,{disabled:i,loading:o,initialValue:n,onSubmit:e=>(c({newAppSk:e}),!1),triggers:m,secure:!0}),s.newAppSk&&(0,X.jsx)(de.Z,{title:a("blocklet.config.appSkTitle"),description:(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(u.Z,{children:a("blocklet.config.appSkChangeTip")}),(0,X.jsx)(u.Z,{fontWeight:"bold",mt:2,children:a("blocklet.config.appDidChangeTip")}),(0,X.jsxs)(fe,{children:[(0,X.jsx)("li",{children:a("blocklet.config.appDidChangeTipL1")}),(0,X.jsx)("li",{children:a("blocklet.config.appDidChangeTipL2")})]})]}),confirm:a("confirm"),cancel:a("cancel"),onConfirm:()=>(async e=>{try{await t(e)}finally{c({newAppSk:""})}})(s.newAppSk),onCancel:()=>c({newAppSk:""})}),(0,X.jsx)(ce.Z,{popup:!0,open:s.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:l.get,checkTimeout:3e5,onSuccess:d,extraParams:{appDid:r.appDid},messages:{title:a("setup.keyPair.title"),scan:a("setup.keyPair.scan"),confirm:a("setup.keyPair.confirm"),success:a("setup.keyPair.success")},onClose:d})]}ue.propTypes={initialValue:s().string,onChange:s().func,disabled:s().bool,loading:s().bool},ue.defaultProps={initialValue:"default",onChange:()=>{},disabled:!1,loading:!1};const fe=(0,l.Z)("ul")(te||(te=(0,o.Z)(["\n padding-left: 16px;\n li {\n margin-top: 8px;\n list-style: disk;\n font-weight: bold;\n }\n"])));var he,ge=t(13128),xe=t(55372),be=t(11750),ve=t(88574),Ze=t(26174),je=t(88092),ye=t(50185),Ce=t(17425);function ke(e){let{onCancel:n,onSuccess:t,onError:i}=e;const{api:o}=(0,a.useContext)(me.B),[l,r]=(0,a.useState)(!1),{t:s,locale:c}=(0,C.PE)(),[d,m]=(0,a.useState)(""),[p,f]=(0,a.useState)(!1),[h,g]=(0,a.useState)(0),[x,b]=(0,a.useState)(""),{endpoint:v}=(0,Ce.DJ)(),[Z,j]=(0,a.useState)(!1),y=e=>{m(null),r(!0);try{b(e.result),g(w.length-1)}catch(n){const e=(0,oe.Z)(n);m(e),i(n)}finally{r(!1)}},k=()=>{f(!1),g(0)},w=[{body:(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(be.Z,{children:s("team.transferApp.transferDialog.tips.progress")}),(0,X.jsx)(be.Z,{mt:3,mb:2,children:s("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:s("common.cancel"),confirm:s("team.transferApp.transferDialog.createTransferLink"),onCancel:n,onConfirm:()=>{f(!0),g(1)}},{body:()=>(0,X.jsx)(ce.Z,{action:"transfer-app-owner",open:p,locale:c,checkFn:o.get,onClose:k,onSuccess:y,checkTimeout:3e5,extraParams:{},messages:{title:s("team.transferApp.connectDialog.title"),scan:s("team.transferApp.connectDialog.scan"),confirm:s("team.transferApp.connectDialog.confirm"),success:s("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const e=(0,oe.VP)({transferId:x.transferId,endpoint:v});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(u.Z,{component:we,dangerouslySetInnerHTML:{__html:s("team.transferApp.transferDialog.createSuccessTip1")}}),(0,X.jsx)(u.Z,{component:we,mt:2,children:(0,X.jsx)(we,{children:s("team.transferApp.transferDialog.createSuccessTip3")})}),(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(u.Z,{component:we,mt:2,children:(0,X.jsx)(we,{children:s("team.transferApp.transferDialog.createSuccessTip2",{expireDate:(0,oe.B2)(x.expireDate,c)})})}),(0,X.jsx)(u.Z,{my:1,children:(0,X.jsx)(ye.Z,{children:e})})]}),(0,X.jsx)("div",{children:(0,X.jsx)(Ze.Z,{value:"end",control:(0,X.jsx)(je.Z,{checked:Z,onChange:e=>j(e.target.checked)}),label:s("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:s("common.confirm"),onConfirm:t}],S=w[h];return(0,X.jsxs)(ge.ZP,{title:(0,X.jsx)(we,{className:"title",children:s("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,X.jsxs)(X.Fragment,{children:[S.cancel&&(0,X.jsx)(N.Z,{onClick:S.onCancel,color:"inherit",children:S.cancel}),(0,X.jsxs)(N.Z,{onClick:S.onConfirm,color:"error",disabled:l||h===w.length-1&&!Z,variant:"contained",autoFocus:!0,children:[l&&(0,X.jsx)(z.Z,{size:16}),S.confirm]})]}),children:[(0,X.jsx)(xe.Z,{component:"div",children:"function"===typeof S.body?S.body():S.body}),!!d&&(0,X.jsx)(ve.Z,{type:"error",variant:"icon",children:d})]})}ke.propTypes={onCancel:s().func.isRequired,onSuccess:s().func.isRequired,onError:s().func},ke.defaultProps={onError:()=>{}};const we=l.Z.div(he||(he=(0,o.Z)(["\n font-size: 16px;\n font-weight: bold;\n &.title {\n font-size: 20px;\n }\n"])));var Se,Ee=t(49522),Le=t(59375);const Pe=Object.keys(I.SUPPORTED_LANGUAGES).map((e=>({code:e,name:I.SUPPORTED_LANGUAGES[e].nativeName,enName:I.SUPPORTED_LANGUAGES[e].name}))),Re=["name","enName","code"];function Te(e){var n;let{blocklet:t,onUpdate:i,hasPermission:o,...l}=e;const{api:r,inService:s,prefix:c,getSessionInHeader:d,ws:{useSubscription:m}}=(0,ie.h6)(),{t:f}=(0,a.useContext)(C.RD),[h,g]=(0,a.useState)(""),[x,b]=(0,a.useState)(""),[v,Z]=(0,a.useState)(!1),j=(0,w.getWhoCanAccess)(t),y=null===t||void 0===t||null===(n=t.settings)||void 0===n?void 0:n.publicToStore,k=x||!o,{logoUrl:S,rectLogoUrl:E,faviconUrl:L}=(0,Ee.Z)({blocklet:t}),{did:R}=t.meta,{site:z}=t,U=P()(t.meta,"capabilities.clusterMode",!1);if(m(p.EVENTS.NODE_RUNTIME_INFO,(e=>{U&&g(P()(e,"cpu.physicalCores",""))})),(0,oe.wS)(t.status))return null;const D=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE)),K=!D||"yes"===D.value,W=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LANGUAGES)),q=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL)),G=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER)),V=t.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR)),H=[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_NAME,description:f("blocklet.config.name"),value:t.environments.find((e=>"BLOCKLET_APP_NAME"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:f("blocklet.config.description"),value:t.environments.find((e=>"BLOCKLET_APP_DESCRIPTION"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:f("blocklet.config.appUrl"),value:q?q.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:f("blocklet.config.copyrightOwner"),value:G?G.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:f("blocklet.config.copyrightYear"),value:V?V.value:""}];if(U){const e=t.configs.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE)),n=e?e.value:h;H.push({key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:f("blocklet.config.clusterSize"),value:n,cpuCores:h})}const M=async(e,n)=>{if(e===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const e=(0,oe.I)({value:n,cpuCores:h});if(e)return void F.Z.error(e)}const o=[{key:e,value:n}];try{b(!0);const{blocklet:e}=await r.configBlocklet({input:{did:t.meta.did,configs:o}});i(e)}catch(a){F.Z.error(a.message)}finally{b(!1)}};return(0,X.jsxs)(Oe,{...l,children:[H.map((e=>(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:e.description}),(0,X.jsx)(B.Z,{style:{marginTop:0},disabled:x||k,loading:x,initialValue:e.value,onSubmit:n=>M(e.key,n)})]}))),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:1,sx:{flexGrow:0,width:"auto"},children:f("blocklet.config.logoSquare")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,width:80,type:"square",prefix:c,url:S,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:f("blocklet.config.logoRect")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:f("blocklet.config.logoRectDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:80,type:"rect",prefix:c,url:E,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mt:4,children:f("blocklet.config.logoFavicon")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:f("blocklet.config.logoFaviconDesc")}),(0,X.jsx)(Le.Z,{did:t.meta.did,height:25,width:25,type:"favicon",prefix:c,url:L,enabled:o,headers:d}),(0,X.jsx)(u.Z,{className:"config-form",children:"all"===j&&"registry"===t.source&&(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[f("blocklet.config.access.publicToStore"),(0,X.jsx)(u.Z,{className:"config-desc",children:f("blocklet.config.access.publicInstanceTip")})]}),(0,X.jsx)(A.Z,{disabled:k,checked:y,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configPublicToStore({input:{did:t.meta.did,publicToStore:n}});i(o)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:f("blocklet.config.languages")}),(0,X.jsx)($,{style:{marginTop:0},disabled:x||k,loading:x,options:Pe,noEmpty:!0,initialValue:W?W.value.split(","):["en","zh"],onSubmit:e=>M("BLOCKLET_APP_LANGUAGES",e),helperText:f("blocklet.config.selectLanguagesTip"),placeholder:f("blocklet.config.languagesSearch"),filterKeys:Re,renderLabel:(e,n)=>n.name===n.enName?"".concat(n.name," (").concat(e.toUpperCase(),")"):"".concat(n.name,", ").concat(n.enName," (").concat(e.toUpperCase(),")")})]}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:(0,X.jsx)(u.Z,{className:"config-label",mb:0,children:f("common.security")})}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:f("router.domainSecurity.cors.title")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:f("router.domainSecurity.cors.description",{name:"the blocklet"})}),(0,X.jsx)(B.Z,{style:{marginTop:0},disabled:x||k,loading:x,initialValue:(z.corsAllowedOrigins||[]).join(", "),onSubmit:async e=>{const n=z.corsAllowedOrigins||[],i=e.split(",").map((e=>e.trim())).filter(Boolean);if(T()(n,i))return!1;try{b(!0);const e=i.length?i:["__none__"];await r.updateRoutingSite({input:{id:z.id,corsAllowedOrigins:e,teamDid:t.meta.did}}),b(!1)}catch(o){return F.Z.error(o.message),b(!1),!1}return!0}})]}),(0,X.jsx)(u.Z,{className:"config-form",component:_.Z,my:3}),(0,X.jsx)(u.Z,{mb:2,className:"config-label",fontSize:20,children:f("blocklet.config.dangerZone")}),(0,X.jsxs)(u.Z,{px:2,py:1,sx:{border:"1px solid red",borderRadius:2},children:[(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:!s&&(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[f("blocklet.config.deletable.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:f(K?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,X.jsx)(A.Z,{disabled:k,checked:!K,defaultChecked:!0,onChange:async e=>{if(!x){b(!0);try{const{checked:n}=e.target,{blocklet:o}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE,value:n?"no":"yes"}]}});i(o)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]})}),(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsx)(u.Z,{className:"config-label",fontSize:14,mb:0,children:f("blocklet.config.sk")}),(0,X.jsx)(ue,{disabled:x||k,loading:x,initialValue:t.environments.find((e=>"BLOCKLET_APP_SK"===e.key)).value,onChange:async e=>{if(!x){b(!0);try{const{blocklet:n}=await r.configBlocklet({input:{did:t.meta.did,configs:[{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SK,value:e}]}});i(n)}catch(n){F.Z.error(n.message)}finally{b(!1)}}}})]}),s&&(0,X.jsx)(le.Z,{role:"owner",children:e=>(e||ae.C)&&(0,X.jsxs)(u.Z,{className:"config-form",mt:2,children:[(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsx)(u.Z,{className:"config-label",mb:0,children:f("team.transferApp.name")}),(0,X.jsxs)(N.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"transfer-app",onClick:()=>Z(!0),children:[(0,X.jsx)(O.Z,{style:{fontSize:"1.3em",marginRight:4}}),f("team.transferApp.name")]})]}),v&&(0,X.jsx)(ke,{onCancel:()=>Z(!1),onSuccess:()=>Z(!1)})]})}),(0,X.jsx)(u.Z,{className:"config-form",mt:2,children:(0,X.jsxs)(u.Z,{className:"config-item",children:[(0,X.jsxs)(u.Z,{className:"config-label",children:[f("blocklet.config.clearCache.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:f("blocklet.config.clearCache.purpose")})]}),(0,X.jsx)(re.Z,{teamDid:R})]})})]})]})}const Ae=(0,le.V)(Te,"mutate_blocklets"),_e=(0,le.V)(Te,"",oe.Wf);function Ne(e){const{inService:n}=(0,ie.h6)();return n?(0,X.jsx)(_e,{...e}):(0,X.jsx)(Ae,{...e})}Te.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,hasPermission:s().bool},Te.defaultProps={onUpdate:()=>{},hasPermission:!1};const Oe=l.Z.div(Se||(Se=(0,o.Z)(["\n padding-top: 24px;\n .config-form {\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n }\n }\n\n .config-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 16px 0;\n }\n\n .config-label {\n font-weight: bold;\n }\n\n .config-desc {\n font-weight: normal;\n font-size: 12px;\n color: #666;\n }\n\n .form-item {\n margin-top: 0;\n }\n"])),(e=>e.theme.breakpoints.down("md")));var Ie=t(25710),Fe=t(93066),Be=t(80576),ze=t(8708),Ue=t.n(ze),De=t(12673),Ke=t(99360),We=t(80506),qe=t(766),Ge=t.n(qe),Ve=t(24529),He=t.n(Ve),Me=t(16727),Ye=t.n(Me),Je=t(92706),Qe=t.n(Je);const Xe=(0,a.forwardRef)(((e,n)=>{const{t:t}=(0,a.useContext)(C.RD),i=(0,De.Z)({show:!1,title:"",content:"",onConfirm:Qe(),onCancel:Qe(),loading:!1}),o=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.show=!0,i.title=e.title,i.content=e.content,i.onConfirm=e.onConfirm||Qe(),i.onCancel=e.onCancel||Qe(),i.loading=!1})),l=(0,Ke.Z)((()=>{i.title="",i.content="",i.onConfirm=Qe(),i.onCancel=Qe()})),r=(0,Ke.Z)((()=>{i.show=!1,setTimeout((()=>{l()}),300)})),s=(0,Ke.Z)((()=>{r(),null===i||void 0===i||i.onCancel()}),[]),c=(0,Ke.Z)((async()=>{i.loading=!0;try{await(null===i||void 0===i?void 0:i.onConfirm(r))}finally{i.loading=!1}}),[]);return(0,a.useImperativeHandle)(n,(()=>({open:o,close:r})),[o,r]),(0,X.jsx)(ge.I4,{open:i.show,title:i.title,onConfirm:c,onCancel:s,confirmButton:{text:t("common.confirm"),props:{variant:"contained",color:"primary",loading:i.loading}},cancelButton:{text:t("common.cancel"),props:{variant:"outlined",color:"primary"}},children:i.content instanceof Function?i.content():i.content})}));function $e(){const e=(0,a.useRef)(null),n=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.open(...i)})),t=(0,Ke.Z)((function(){for(var n,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];null===(n=e.current)||void 0===n||n.close(...i)})),i={open:n,close:t};return{confirmHolder:(0,X.jsx)(Xe,{ref:e}),confirmApi:i}}const en={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:""};const nn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,pe.y0)(),{t:o}=(0,C.PE)(),{confirmApi:a,confirmHolder:l}=$e(),r=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,s=Object.assign({...en},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.notification)||void 0===n?void 0:n.email)||{}),{handleSubmit:c,control:d,formState:m,watch:p,reset:f}=(0,We.cI)({defaultValues:Ue()(s,Object.keys(en))}),h=(0,De.Z)({testReceiver:"",testReceiverError:""}),g=p("enabled"),x=(0,Ke.Z)((async function(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];try{var a;const{blocklet:n}=await t.configNotification({input:{did:r,notification:JSON.stringify({email:e})}}),l=Object.assign({...en},(null===n||void 0===n||null===(a=n.settings)||void 0===a||null===(a=a.notification)||void 0===a?void 0:a.email)||{});f(l),i&&F.Z.success(o("oauth.saveSuccess"))}catch(l){if(!i)throw l;F.Z.error(l.message||o("oauth.saveFailed"))}})),b=(0,Ke.Z)((async(e,n,i)=>{try{m.isDirty&&await x(e,n,!1),await t.sendEmail({input:{did:r,receiver:i,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),F.Z.success(o("notification.email.testSuccess"))}catch(a){F.Z.error(a.message||o("notification.email.testfailed"))}})),v=(0,Ke.Z)(((e,n)=>{h.testReceiver="",h.testReceiverError="",a.open({title:o("notification.email.testSendEmail"),content:()=>(0,X.jsx)(u.Z,{sx:{width:"300px"},children:(0,X.jsx)(H.Z,{fullWidth:!0,name:"testReceiver",label:o("notification.email.inputTestReceiver"),value:h.testReceiver,onChange:e=>{h.testReceiver=e.target.value},error:!!h.testReceiverError,helperText:h.testReceiverError||"\u3000"})}),async onConfirm(t){var i;const a=null===(i=h.testReceiver)||void 0===i?void 0:i.trim();a?Ge()(a)?(h.testReceiverError="",await b(e,n,a),t()):h.testReceiverError=o("notification.email.receiverInvalid"):h.testReceiverError=o("notification.email.receiverRequired")}})})),Z=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Ge()(n)||o("notification.email.fromInvalid"):o("notification.email.fromRequired")})),j=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!He()(n,{require_host:!1,protocols:[]})||o("notification.email.hostInvalid"):o("notification.email.hostRequired")})),y=(0,Ke.Z)((e=>e?!!Ye()(e)||o("notification.email.portInvalid"):o("notification.email.portRequired"))),k=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("notification.email.userRequired"))),w=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("notification.email.passwordRequired"))),S=(0,Ke.Z)((()=>!0));return(0,X.jsxs)(u.Z,{children:[(0,X.jsxs)("form",{onSubmit:c(x),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:d,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(A.Z,{checked:n.value,...n}),label:o("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,X.jsx)(We.Qr,{name:"from",control:d,rules:{validate:g?Z:S},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:o("notification.email.from"),error:!!m.errors[t.name],helperText:(null===(n=m.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"host",control:d,rules:{validate:g?j:S},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!m.errors[t.name],label:o("notification.email.host"),helperText:(null===(n=m.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"port",control:d,rules:{validate:g?y:S},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,type:"number",error:!!m.errors[t.name],label:o("notification.email.port"),helperText:(null===(n=m.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"user",control:d,rules:{validate:g?k:S},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!m.errors[t.name],label:o("notification.email.user"),helperText:(null===(n=m.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"password",control:d,rules:{validate:g?w:S},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,type:"password",error:!!m.errors[t.name],label:o("notification.email.password"),helperText:(null===(n=m.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!g})})}}),(0,X.jsx)(We.Qr,{name:"secure",control:d,rules:{validate:S},render:e=>{let{field:n}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(A.Z,{checked:n.value,...n,disabled:!g}),label:o("notification.email.secure"),style:{marginBottom:16}})})}}),(0,X.jsx)(N.Z,{variant:"outlined",color:"warning",onClick:c(v),sx:{mr:2},disabled:!g,children:o("oauth.runTest")}),(0,X.jsx)(N.Z,{type:"submit",variant:"contained",disabled:!m.isDirty,children:o("oauth.save")})]}),l]})},tn=[{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"More"}),value:"more"}];const on=function(){const[e,n]=(0,a.useState)(tn[0].value),{t:t}=(0,a.useContext)(C.RD),i=(0,Fe.Z)((()=>({email:(0,X.jsx)(nn,{}),more:(0,X.jsx)(u.Z,{children:(0,X.jsx)(Ie.Z,{children:t("notification.comingSoon")})})})),[t]);return(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(k.Z,{tabs:tn,current:e,onChange:n}),(0,X.jsx)(u.Z,{marginTop:"10px",children:i[e]})]})};var an=t(96366),ln=t(75239),rn=t(48342),sn=t(94552),cn=t(24558),dn=t(74286),mn=t(74490),pn=t(76667),un=t(70648),fn=t(44067),hn=t(7664),gn=t(44123),xn=t(53906);const bn=[{value:p.WHO_CAN_ACCESS.ALL,icon:xn.Z,title:{zh:"\u6240\u6709\u4eba\u53ef\u8bbf\u95ee",en:"Accessible to all"},description:{zh:"\u5411\u6240\u6709\u4eba\u5f00\u653e\uff0c\u65e0\u9700\u901a\u884c\u8bc1\u5373\u53ef\u8bbf\u95ee\u5e94\u7528",en:"Open to the world anyone can access without passport"}},{value:p.WHO_CAN_ACCESS.INVITED,icon:gn.Z,title:{zh:"\u53ea\u6709\u88ab\u9080\u8bf7\u7684\u4eba\u53ef\u4ee5\u8bbf\u95ee",en:"Only invited people can access"},description:{zh:"\u7a0d\u540e\u60a8\u53ef\u4ee5\u5728\u7ba1\u7406\u9875\u9762\u4e2d\u9080\u8bf7\u6210\u5458",en:"You can invite members later in the admin page"}},{value:p.WHO_CAN_ACCESS.OWNER,icon:hn.Z,title:{zh:"\u53ea\u6709\u5e94\u7528\u6240\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee",en:"Only Owner of the blocklet can access"},description:{zh:"\u5fc5\u987b\u63d0\u4f9b\u6240\u6709\u8005\u901a\u884c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5e94\u7528",en:"You must provide owner passport to access this application"}}];var vn,Zn;const jn="roles",yn=[...bn,{value:jn,icon:un.Z,title:{zh:"\u6307\u5b9a\u901a\u884c\u8bc1\u53ef\u8bbf\u95ee",en:"Accessible to selected passports"},description:{zh:"\u53ea\u6709\u6307\u5b9a\u7684\u901a\u884c\u8bc1\u53ef\u4ee5\u8bbf\u95ee",en:"Only specified passports can access"}}],Cn=(e,n)=>{if(e&&e.startsWith(p.WHO_CAN_ACCESS_PREFIX_ROLES)){const t=(0,w.getRolesFromAuthConfig)({whoCanAccess:e}),i=n.filter((e=>t.includes(e.name)));return{access:jn,roles:i}}return{access:e,roles:[]}},kn=function(e,n){let{roles:t=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(e.configs||[]).find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO));if(i)return Cn(i.value,t);if(n&&P()(n,"settings.whoCanAccess")&&P()(n,"settings.whoCanAccess")!==p.WHO_CAN_ACCESS.ALL)return Cn(P()(n,"settings.whoCanAccess"),t);const o=(0,w.findServiceFromMeta)(e.meta,p.NODE_SERVICES.AUTH);return P()(o,"config.whoCanAccess")?Cn(o.config.whoCanAccess,t):{access:p.WHO_CAN_ACCESS.ALL,roles:[]}};function wn(e){let{blocklet:n,ancestors:t,children:i}=e;const o=(0,an.Z)(),[l,r]=(0,a.useState)(""),{t:s,locale:c}=(0,C.PE)(),{api:d}=(0,ie.h6)(),{roles:m}=(0,Ce.DJ)(),[f,h]=(0,a.useState)(""),g=t[0]||n,{access:x,roles:b}=kn(n,g,{roles:m}),[v,Z]=(0,a.useState)(x),[j,y]=(0,a.useState)(b),k=[...t.map((e=>e.meta.did)),n.meta.did],S={marginRight:4,fontSize:18,verticalAlign:"text-bottom",color:o.palette.text.secondary},E=t.concat(n).map((e=>(0,w.getDisplayName)(e,!0))).join(" / ");if((0,oe.wS)(n.status))return null;if("unknown"===n.status&&(0,oe.wS)(n.status))return null;const L=()=>{r(!1)},P=e=>{e.stopPropagation(),r(!0)},R=f||v===jn&&!j.length;return["function"===typeof i?i({open:P}):(0,X.jsx)(K.Z,{onClick:P,"data-cy":"action-config-component",children:(0,X.jsx)(pn.default,{})}),l&&(0,X.jsxs)(Sn,{open:!0,fullWidth:!0,title:E,onClose:L,PaperProps:{style:{minHeight:"auto"}},actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(N.Z,{onClick:L,color:"inherit","data-cy":"config-access-cancel",children:s("common.cancel")}),(0,X.jsxs)(N.Z,{onClick:async()=>{if(!f){h(!0);try{let e=v;e===jn&&(e="".concat(p.WHO_CAN_ACCESS_PREFIX_ROLES).concat(j.map((e=>e.name)).join(","))),await d.updateWhoCanAccess({input:{did:k,whoCanAccess:e}}),F.Z.success(s("blocklet.config.access.updatedTip")),L(),h(!1)}catch(e){h(!1),F.Z.error((0,oe.Z)(e))}}},color:"primary",disabled:R,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[f&&(0,X.jsx)(z.Z,{size:16}),s("common.confirm")]})]}),children:[(0,X.jsx)(u.Z,{mt:4,mb:3,children:(0,X.jsx)(H.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:v,onChange:e=>{const{value:n}=e.target;Z(n)},"data-cy":"config-access-select",SelectProps:{renderValue:e=>{const n=yn.find((n=>n.value===e));return n?(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(n.icon,{style:S}),n.title[c]]}):null}},children:yn.map((e=>(0,X.jsxs)(En,{value:e.value,sx:{display:"block"},"data-cy":"config-access-opt-".concat(e.value),children:[(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center",children:[(0,X.jsx)(e.icon,{style:S}),(0,X.jsx)(u.Z,{children:e.title[c]})]}),(0,X.jsx)(u.Z,{children:(0,X.jsx)(u.Z,{className:"tip",children:e.description[c]})})]})))})}),v===jn&&(0,X.jsx)(u.Z,{mt:4,mb:3,children:(0,X.jsx)(H.Z,{label:s("blocklet.config.access.description"),select:!0,fullWidth:!0,value:j.map((e=>e.name)),onChange:e=>{y(m.filter((n=>(e.target.value||[]).includes(n.name))))},SelectProps:{multiple:!0,renderValue:e=>(0,X.jsx)(u.Z,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:e.map((e=>{const n=m.find((n=>n.name===e));return(0,X.jsx)(W.Z,{label:n.title},n.text)}))})},children:m.map((e=>{let{name:n,title:t}=e;return(0,X.jsxs)(mn.Z,{value:n,children:[(0,X.jsx)(je.Z,{checked:j.some((e=>e.name===n))}),(0,X.jsx)(fn.Z,{primary:t})]},n)}))})})]})]}wn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,children:s().any},wn.defaultProps={ancestors:[],children:null};const Sn=(0,l.Z)(ge.ZP)(vn||(vn=(0,o.Z)(["\n .MuiDialogContent-root {\n padding-top: 0;\n margin-top: -32px;\n }\n .MuiToolbar-root {\n padding-right: 12px;\n }\n .ux-dialog_right {\n padding-right: 20px;\n }\n"]))),En=(0,l.Z)(mn.Z)(Zn||(Zn=(0,o.Z)(["\n .tip {\n font-size: 12px;\n color: ",";\n }\n"])),(e=>e.theme.palette.text.secondary));var Ln;function Pn(e){var n;let{blocklet:t,ancestors:i,depth:o}=e;const l=(0,an.Z)(),{t:r,locale:s}=(0,C.PE)(),{roles:c}=(0,Ce.DJ)(),[d,m]=(0,a.useState)(!0),{recommendedDomain:p}=(0,pe.y0)(),f=i[0]||t,h="/".concat(i.map((e=>e.mountPoint||"/")).join("/"),"/").concat(t.mountPoint||"/").replace(/\/+/g,"/"),g=(0,oe.vH)({blocklet:f,domain:{value:p},mountPoint:h,params:(0,oe.f0)(f,s)}),x={fill:l.palette.text.secondary},b=o>0&&t.children.length>0,v=(0,X.jsx)(K.Z,{size:"small",children:d?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.default,{fontSize:"inherit"})}),{access:y,roles:k}=kn(t,f,{roles:c});let E;if("roles"!==y)E=bn.find((e=>e.value===y))||bn[2];else{const e=k.map((e=>e.title)).join("/");E={title:{zh:"\u53ea\u6709 ".concat(e," \u53ef\u4ee5\u8bbf\u95ee"),en:"Only ".concat(e," can access")}}}return[(o>0||"gateway"!==t.meta.group)&&(0,X.jsxs)(u.Z,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[(0,X.jsxs)(u.Z,{pl:Math.max(2*(o-1),0),width:{xs:300,md:400},display:"flex",alignItems:"center",style:{cursor:b?"pointer":"cursor"},onClick:()=>b&&m(!d),children:[b?v:(0,X.jsx)(u.Z,{width:28}),(0,X.jsx)(S.Z,{blocklet:t,ancestors:i}),(0,X.jsxs)(u.Z,{ml:"16px",children:[(0,X.jsx)(u.Z,{style:{color:"#222",fontSize:18},children:(0,w.getDisplayName)(t,!0)}),(0,X.jsx)(u.Z,{display:"flex",alignItems:"center",children:(0,X.jsx)(u.Z,{color:"text.secondary",children:E.title[s]})})]})]},t),(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(ln.Z,{title:r("common.visit"),children:(0,X.jsx)("a",{target:"_blank",href:g,rel:"noopener noreferrer",title:g,children:(0,X.jsx)(K.Z,{children:(0,X.jsx)(sn.Z,{})})})}),(0,X.jsx)(wn,{blocklet:t,ancestors:i,children:e=>{let{open:n}=e;return(0,X.jsx)(ln.Z,{title:r("common.edit"),children:(0,X.jsx)(K.Z,{onClick:n,"data-cy":"btn-edit-".concat(t.meta.did),children:(0,X.jsx)(cn.Z,{style:x})})})}})]},"actions")]},"group-not-gateway-box"),(0,X.jsx)(dn.Z,{depth:o},"line"),null!==(n=t.children)&&void 0!==n&&n.length?(0,X.jsx)(rn.Z,{in:d,children:t.children.map((e=>(0,X.jsx)(Pn,{blocklet:e,ancestors:[...i,t],depth:o+1},"".concat(o+1,"-").concat(e.meta.did))))},"blocklet-collapse"):null]}function Rn(){const{t:e}=(0,C.PE)(),{blocklet:n}=(0,pe.y0)(),t=[...n.children]||[];return"gateway"!==n.meta.group&&t.unshift(n),(0,X.jsx)(Tn,{component:"div",children:t&&t.length?[(0,X.jsx)(u.Z,{mt:2,ml:{xs:"-12px",md:"-24px"},style:{maxWidth:1080},children:(0,X.jsx)(Pn,{blocklet:n},"0-".concat(n.meta.did))},"top-blocklet-".concat(n.meta.did))]:(0,X.jsx)(u.Z,{mt:8,children:(0,X.jsx)(Ie.Z,{children:e("blocklet.component.noComponent")})})})}Pn.propTypes={blocklet:s().object.isRequired,ancestors:s().array,depth:s().number},Pn.defaultProps={ancestors:[],depth:0},Rn.propTypes={};const Tn=(0,l.Z)(u.Z)(Ln||(Ln=(0,o.Z)(["\n .title {\n font-size: 1.2rem;\n font-weight: bold;\n margin-top: ",";\n margin-bottom: ",";\n &.first {\n margin-top: 0;\n }\n }\n"])),(e=>e.theme.spacing(5)),(e=>e.theme.spacing(3)));var An=t(56556),_n=t(44784);const Nn=function(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,pe.y0)(),{t:o}=(0,C.PE)(),a=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,l=Object.assign({enabled:!1,domain:"",clientId:""},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.auth0)||{}),{handleSubmit:r,control:s,formState:c,watch:d,reset:m}=(0,We.cI)({defaultValues:Ue()(l,["domain","clientId","enabled"])}),p=d("enabled"),f=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.configOAuth({input:{did:a,oauth:JSON.stringify({auth0:e})}}),l=Object.assign({enabled:!1,domain:"",clientId:""},(null===i||void 0===i||null===(n=i.settings)||void 0===n||null===(n=n.oauth)||void 0===n?void 0:n.auth0)||{});m(l),F.Z.success(o("oauth.saveSuccess"))}catch(i){F.Z.error(i.message||o("oauth.saveFailed"))}})),h=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.auth0.domainDescribe"))),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||o("oauth.auth0.clientIdDescribe"))),x=(0,Ke.Z)((()=>!0));return(0,X.jsx)(u.Z,{children:(0,X.jsxs)("form",{onSubmit:r(f),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:s,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(_n.Z,{checked:n.value,style:{marginRight:"6px"},...n}),label:o("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"domain",control:s,rules:{validate:p?h:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:o("oauth.auth0.domain"),error:!!c.errors[t.name],helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!p})})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:s,rules:{validate:p?g:x},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!c.errors[t.name],label:o("oauth.auth0.clientId"),helperText:(null===(n=c.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!p})})}}),(0,X.jsx)(An.Z,{type:"submit",variant:"contained",onSubmit:r(f),disabled:!c.isDirty,children:o("oauth.save")})]})})};var On=t(62362),In=t(24103);const Fn={ttl:p.SESSION_TTL};function Bn(e){const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?86400*e.ttl:e.ttl/86400;return{...e,ttl:n}}function zn(){var e,n;const{api:t}=(0,ie.h6)(),{blocklet:i}=(0,pe.y0)(),o=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,a=Object.assign({},Fn,(null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{}),{handleSubmit:l,control:r,formState:s,reset:c}=(0,We.cI)({defaultValues:Ue()(Bn(a),["ttl"])}),{t:d}=(0,C.PE)(),m=(0,Ke.Z)((async e=>{try{var n;const{blocklet:i}=await t.updateAppSessionConfig({input:{did:o,config:Bn(e,!0)}}),a=Object.assign({},Fn,Ue()((null===i||void 0===i||null===(n=i.settings)||void 0===n?void 0:n.session)||{},["ttl"]));c(Bn(a)),F.Z.success(d("common.configSuccess"))}catch(i){F.Z.error(i.message)}}));return(0,X.jsx)(u.Z,{children:(0,X.jsxs)("form",{onSubmit:l(m),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"ttl",control:r,render:e=>{let{field:n}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,sx:{mb:2},children:(0,X.jsxs)(In.Z,{px:3,children:[(0,X.jsx)(u.Z,{mx:-3,my:.5,children:d("blocklet.config.session.ttl",{day:n.value})}),(0,X.jsx)(On.ZP,{...n,defaultValue:7,step:1,marks:[{value:1,label:d("blocklet.config.session.day",{day:1})},{value:7,label:d("blocklet.config.session.days",{day:7})},{value:14,label:d("blocklet.config.session.days",{day:14})},{value:21,label:d("blocklet.config.session.days",{day:21})},{value:30,label:d("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto",style:{maxWidth:"360px"}})]})})}}),(0,X.jsx)(An.Z,{type:"submit",variant:"contained",onSubmit:l(m),disabled:!s.isDirty,children:d("oauth.save")})]})})}var Un=t(82555),Dn=t(30333),Kn=t(75760),Wn=t(97038),qn=t(64886),Gn=t(42080),Vn=t.n(Gn),Hn=t(75506),Mn=t.n(Hn),Yn=t(47685),Jn=t(13260),Qn=t(82434),Xn=t.n(Qn);const $n=(0,a.forwardRef)(((e,n)=>{var t;const{t:i}=(0,a.useContext)(C.RD),{blocklet:o}=(0,pe.y0)(),{api:l}=(0,ie.h6)(),r=(0,De.Z)({mode:"view",show:!1,data:{},callback:Qe()}),s=(0,Yn.Fg)(),c=(null===s||void 0===s||null===(t=s.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,d=(0,Ke.Z)((()=>{r.mode="view",r.data={},r.callback=Qe()}),[]),p=(0,Ke.Z)((()=>{r.show=!1,setTimeout((()=>{d()}),c)}),[]),f=(0,Ke.Z)((e=>{r.mode="view",r.show=!0,r.data=e}),[]),h=(0,Ke.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qe();r.mode="approve",r.show=!0,r.data=e,r.callback=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:p,approve:h})),[f,p,h]);const g=(0,Fe.Z)((()=>{if(!r.show)return[];r.data.migratedFrom=[r.data.appId,r.data.appPid];const e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==r.data.isMaster&&Vn()(e,"appliedAt","status"),e.map((e=>{const n=i("federated.info.".concat(e));let t=r.data[e];if("appName"===e&&r.data.isMaster&&(t=(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(Un.Z,{component:Dn.Z}),t]})),["appId","appPid","serverId"].includes(e)&&(t=(0,X.jsx)(Jn.kL,{children:t})),["appUrl"].includes(e)&&(t=(0,X.jsx)(u.Z,{component:"a",href:t,target:"_blank",children:t})),["appLogo"].includes(e)){const e=Xn()(t)?t:m()(r.data.appUrl||"",t||"");try{const n=new URL(e);n.searchParams.set("imageFilter","resize"),n.searchParams.set("w","80"),n.searchParams.set("h","80"),t=(0,X.jsx)("img",{src:n.href,width:"60",height:"60",alt:r.data.appName})}catch{t=(0,X.jsx)("img",{src:e,width:"60",height:"60",alt:r.data.appName})}}if("status"===e&&(t=t&&i("federated.status.".concat(t))),"migratedFrom"===e){t=(r.data.migratedFrom||[]).filter((e=>![r.data.appId,r.data.appPid].includes(e))).map((e=>(0,X.jsx)(Jn.kL,{children:e})))}return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[r.data]),x="approve"===r.mode,b=(0,Ke.Z)((async()=>{await l.auditFederatedLogin({input:{memberPid:r.data.appPid,did:o.appPid,status:"rejected"}}),p(),null===r||void 0===r||r.callback(!1)})),v=(0,Ke.Z)((async()=>{await l.auditFederatedLogin({input:{memberPid:r.data.appPid,did:o.appPid,status:"approved"}}),p(),null===r||void 0===r||r.callback(!0)}));return(0,X.jsx)(ge.ZP,{open:r.show,title:i(x?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:p,actions:x?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(An.Z,{color:"error",variant:"contained",onClick:b,children:i("common.reject")}),(0,X.jsx)(An.Z,{variant:"contained",onClick:v,children:i("common.approve")})]}):(0,X.jsx)(An.Z,{variant:"outlined",onClick:p,children:i("common.close")}),children:g.map((e=>(0,X.jsx)(qn.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:e.name,children:e.value},e.name)))})}));var et=t(79842),nt=t(85408),tt=t.n(nt);const it=(0,a.forwardRef)(((e,n)=>{var t;const i=(0,Yn.Fg)(),o=(null===i||void 0===i||null===(t=i.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,{t:l}=(0,a.useContext)(C.RD),r=(0,De.Z)({show:!1,data:{link:""}}),s=(0,Ke.Z)((()=>{r.data.link=""}),[]),c=(0,Ke.Z)((()=>{r.show=!1,setTimeout((()=>{s()}),o)}),[]),d=(0,Ke.Z)((e=>{let{link:n}=e;r.show=!0,r.data.link=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:d,close:c})),[d,c]);const m=(0,Ke.Z)((()=>{tt()(r.data.link),c()}),[c]);return(0,X.jsxs)(ge.ZP,{open:r.show,title:l("federated.joinFederatedLogin"),onClose:c,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:m,children:l("common.copyAndClose")}),children:[(0,X.jsx)(u.Z,{mb:1,children:l("federated.inviteJoinFederatedLoginDescription")}),(0,X.jsx)(u.Z,{sx:{"& .copy-button":{display:"none !important"}},children:(0,X.jsx)(et.Z,{language:"shell",style:{marginBottom:0},children:r.data.link})})]})}));function ot(e){var n,t,i;let{mode:o}=e;const l=(0,a.useRef)(null),r=(0,a.useRef)(null),{t:s,locale:c}=(0,a.useContext)(C.RD),{blocklet:d,actions:{refreshBlocklet:m}}=(0,pe.y0)(),{confirmApi:p,confirmHolder:f}=$e(),{api:h}=(0,ie.h6)(),g=(null===(n=d.settings.federated)||void 0===n?void 0:n.sites)||[],x=(null===(t=d.settings.federated)||void 0===t?void 0:t.config)||{},b=!1!==x.isMaster,v=(0,Ke.Z)((e=>{var n;null===(n=r.current)||void 0===n||n.open(e)})),Z=(0,Ke.Z)((e=>{var n;null===(n=r.current)||void 0===n||n.approve(e,m)})),j=(0,Ke.Z)((e=>{p.open({title:s("federated.disableFederatedLogin"),content:s("federated.disableFederatedLoginDescription"),async onConfirm(n){await h.auditFederatedLogin({input:{memberPid:e.appPid,did:d.appPid,status:"revoked"}}),n()}})})),y=(0,Ke.Z)((e=>{p.open({title:s("federated.enableFederatedLogin"),content:s("federated.enableFederatedLoginDescription"),async onConfirm(n){await h.auditFederatedLogin({input:{memberPid:e.appPid,did:d.appPid,status:"approved"}}),n()}})})),k=(0,Fe.Z)((()=>{const e=[{label:s("common.name"),name:"appName",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{display:"inline-block",children:(0,X.jsxs)(u.Z,{component:"a",display:"flex",alignItems:"center",href:n.appUrl,target:"_blank",onClick:e=>{e.stopPropagation()},children:[t&&(0,X.jsx)(Un.Z,{component:Dn.Z,style:{marginRight:"4px"}}),n.appName]})})}}},{label:s("common.did"),name:"appId",options:{customBodyRenderLite:e=>{const n=g[e];return(0,X.jsx)(Wn.Z,{children:n.appId})}}},{label:s("common.status"),name:"status",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{children:t?"-":s("federated.status.".concat(n.status))})}}}];return b&&e.push({label:s("common.actions"),name:"actions",options:{customBodyRenderLite:e=>{const n=g[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{display:"flex",gap:1,children:t?(0,X.jsxs)(X.Fragment,{children:["rejected"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation()},children:s("federated.status.rejected")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"secondary",size:"small",onClick:e=>{e.stopPropagation()},children:s("federated.status.revoked")})]}):(0,X.jsxs)(X.Fragment,{children:["pending"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"primary",size:"small",onClick:e=>{e.stopPropagation(),Z(n)},children:s("federated.status.pending")}),"approved"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation(),j(n)},style:{whiteSpace:"nowrap"},children:s("federated.revoke")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"warning",size:"small",onClick:e=>{e.stopPropagation(),y(n)},style:{whiteSpace:"nowrap"},children:s("federated.approve")})]})})}}}),e}),[x.appId,g,b,s]),w=(0,Fe.Z)((()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n){let{dataIndex:t}=n;const i=g[t];v(i)}})),[]),S=(0,Ke.Z)((()=>{const e=d.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL));var n;null!==e&&void 0!==e&&e.value?null===(n=l.current)||void 0===n||n.open({link:e.value}):F.Z.error(s("federated.failedToGetFederatedLoginLink"))}),[null===(i=d.site)||void 0===i||null===(i=i.domainAliases)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.href]),E=(0,Ke.Z)((()=>{p.open({title:s("federated.quitFederatedLogin"),content:s("federated.quitFederatedLoginDescription"),async onConfirm(e){await h.quitFederatedLogin({input:{did:d.appPid}}),e()}})})),L=(0,Ke.Z)((()=>{p.open({title:s("federated.disbandFederatedLogin"),content:s("federated.disbandFederatedLoginDescription"),async onConfirm(e){await h.disbandFederatedLogin({input:{did:d.appPid}}),e()}})})),P=[];return"master"!==o?P.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",color:"error",onClick:E,sx:{ml:1},children:s("federated.quitFederatedLogin")},"quitFederatedLogin")):(P.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",onClick:S,sx:{ml:1},children:s("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),P.push((0,X.jsx)(N.Z,{color:"error",size:"small",variant:"contained",onClick:L,sx:{ml:1},children:s("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Kn.Z,{className:"main-table",locale:c,data:g,columns:k,customButtons:P,title:(0,X.jsx)(u.Z,{className:"table-toolbar-left",children:s("oauth.federated")}),options:w}),f,(0,X.jsx)(it,{ref:l}),(0,X.jsx)($n,{ref:r})]})}ot.propTypes={mode:s().oneOf(["member","master"])},ot.defaultProps={mode:"member"};const at=ot,lt=(0,a.forwardRef)(((e,n)=>{var t;const{t:i}=(0,a.useContext)(C.RD),{api:o}=(0,ie.h6)(),{blocklet:l}=(0,pe.y0)(),r=null===l||void 0===l?void 0:l.appPid,s=(0,Yn.Fg)(),c=(null===s||void 0===s||null===(t=s.transitions)||void 0===t||null===(t=t.duration)||void 0===t?void 0:t.leavingScreen)||300,d=(0,De.Z)({show:!1,appUrl:"",appUrlError:"",callback:Qe()}),m=(0,Ke.Z)((()=>{d.appUrl="",d.appUrlError="",d.callback=Qe()}),[]),p=(0,Ke.Z)((()=>{d.show=!1,setTimeout((()=>{m()}),c)}),[]),f=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe();d.show=!0,d.callback=e}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:p})),[f,p]);const h=(0,Ke.Z)((e=>{if(!e)throw new Error(i("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(i("federated.federatedJoinAppUrlInvalid"))})),g=(0,Ke.Z)((async()=>{try{h(d.appUrl);const e=await o.joinFederatedLogin({input:{did:r,appUrl:d.appUrl}});d.show=!1,p(),null===d||void 0===d||d.callback(e)}catch(e){d.appUrlError=e.message}}),[p,r]);return(0,X.jsxs)(ge.ZP,{open:d.show,title:i("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:g,children:i("common.confirm")}),children:[(0,X.jsx)(u.Z,{mb:1,children:i("federated.joinFederatedLoginDescription")}),(0,X.jsx)(H.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:i("federated.federatedJoinAppUrl"),label:i("federated.federatedJoinAppUrl"),value:d.appUrl,error:!!d.appUrlError,helperText:d.appUrlError||"eg: https://www.arcblock.io",onChange:e=>{d.appUrl=e.target.value}})]})}));function rt(){var e,n;const t=(0,a.useRef)(null),i=(0,a.useRef)(null),{t:o}=(0,a.useContext)(C.RD),{blocklet:l,actions:{refreshBlocklet:r}}=(0,pe.y0)(),s=(0,Ke.Z)((()=>{var e;const n=null===(e=l.site)||void 0===e||null===(e=e.domainAliases)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.href;if(n)try{var i;const e=new URL(n);null===(i=t.current)||void 0===i||i.open({link:e.origin})}catch{F.Z.error(o("federated.failedToGetFederatedLoginLink"))}}),[null===(e=l.site)||void 0===e||null===(e=e.domainAliases)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.href]),c=(0,Ke.Z)((()=>{var e;null===(e=i.current)||void 0===e||e.open((()=>{r()}))}),[r]);if((null===(n=l.settings.federated)||void 0===n?void 0:n.sites.length)>0){var d;const e=!1!==(null===(d=l.settings.federated)||void 0===d?void 0:d.config.isMaster);return(0,X.jsx)(at,{mode:e?"master":"member"})}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(u.Z,{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px",children:[(0,X.jsx)(N.Z,{variant:"contained",onClick:s,children:o("federated.inviteJoinFederatedLogin")}),(0,X.jsx)(_.Z,{sx:{width:"150px",color:"rgba(0, 0, 0, 0.3)"},children:"OR"}),(0,X.jsx)(N.Z,{variant:"outlined",onClick:c,children:o("federated.joinFederatedLogin")})]}),(0,X.jsx)(it,{ref:t}),(0,X.jsx)(lt,{ref:i})]})}const st=function(){const{t:e}=(0,a.useContext)(C.RD),n=[{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.commonSettings")}),value:"settings"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.federated")}),value:"federated"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:"Auth0"}),value:"auth0"},{label:(0,X.jsx)(u.Z,{textAlign:"center",width:"100%",children:e("oauth.moreLogin")}),value:"more"}],[t,i]=(0,a.useState)(n[0].value),o=(0,Fe.Z)((()=>({auth0:(0,X.jsx)(Nn,{}),federated:(0,X.jsx)(rt,{}),more:(0,X.jsx)(u.Z,{children:(0,X.jsx)(Ie.Z,{children:e("oauth.comingSoon")})}),settings:(0,X.jsx)(u.Z,{children:(0,X.jsx)(zn,{})})})),[e]);return(0,X.jsxs)(u.Z,{children:[(0,X.jsx)(k.Z,{tabs:n,current:t,onChange:i}),(0,X.jsx)(u.Z,{marginTop:"10px",children:o[t]})]})};var ct;const dt=e=>{let{tabs:n,blocklet:t,ancestors:i=[],depth:o=1,t:a}=e;const l=[...i.map((e=>e.meta.did)),t.meta.did].join("/"),r=!(null!==i&&void 0!==i&&i.length);n.push({label:(0,X.jsxs)(u.Z,{pl:2*Math.max(1,o-1),display:"flex",alignItems:"center",justifyContent:"flex-start",children:[r?(0,X.jsx)(E.Z,{size:24,blocklet:t}):(0,X.jsx)(S.Z,{size:24,blocklet:t,ancestors:i}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:r?a("blocklet.component.container"):(0,w.getDisplayName)(t,!0)})})]},l),value:l}),t.children.length>0&&t.children.forEach((e=>{dt({tabs:n,blocklet:e,ancestors:[...i,t],depth:o+1,t:a})}))};function mt(e){let{blocklet:n,onUpdate:t,...i}=e;const{t:o}=(0,a.useContext)(C.RD),{info:l,inService:r}=(0,ie.h6)(),[s,d]=(0,a.useState)(!0),[w,S]=(0,y.useSearchParams)(),E=w.get("tab")||"general",L=[{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-general",children:[(0,X.jsx)(h.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.general")})})]},"general"),value:"general"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-access",children:[(0,X.jsx)(g.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.access")})})]},"access"),value:"access"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-oauth",children:[(0,X.jsx)(x.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.login")})})]},"oauth"),value:"oauth"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-notification",children:[(0,X.jsx)(b.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.notification")})})]},"notification"),value:"notification"},{label:(0,X.jsxs)(u.Z,{display:"flex",alignItems:"center","data-cy":"configuration-tab-preference",children:[(0,X.jsx)(u.Z,{ml:-2,style:{transform:"translateY(2px)"},children:s?(0,X.jsx)(j.Z,{fontSize:"inherit"}):(0,X.jsx)(Z.default,{fontSize:"inherit"})}),(0,X.jsx)(v.Z,{sx:{fontSize:24}}),(0,X.jsx)(u.Z,{ml:"16px",children:(0,X.jsx)(u.Z,{style:{color:"#222"},children:o("common.preferences")})})]},"preference"),value:"preference"}];s&&dt({tabs:L,blocklet:n,t:o});let P=null;if("general"===E)P=(0,X.jsx)(Ne,{blocklet:n,onUpdate:t});else if("access"===E)P=(0,X.jsx)(Rn,{});else if("oauth"===E)P=(0,X.jsx)(st,{});else if("notification"===E)P=(0,X.jsx)(on,{});else{const e=r?p.WELLKNOWN_SERVICE_PATH_PREFIX:l.routing.adminPath,n=new URLSearchParams;r||n.set("authKey","__sst"),n.set("schemaKey",m()(window.location.origin,e,"/api/preferences?id=".concat(encodeURIComponent(E)))),P=(0,X.jsx)(c.Z,{url:"".concat(m()(window.location.origin,e,"/hosted/form-collector/"),"?").concat(n.toString()),width:"100%",height:"100%",frameBorder:0,styles:{border:0}})}return(0,X.jsx)(pt,{...i,children:(0,X.jsxs)(f.ZP,{container:!0,spacing:4,columns:24,children:[(0,X.jsx)(f.ZP,{item:!0,sm:7,md:5,children:(0,X.jsx)(k.Z,{tabs:L,current:E,orientation:"vertical",onChange:e=>{"preference"===e?d(!s):S((n=>("general"===e?n.delete("tab"):n.set("tab",e),n)))},sx:{borderRight:1,height:"100%",borderColor:"divider"}})}),(0,X.jsx)(f.ZP,{item:!0,sm:17,md:19,children:(0,X.jsx)(u.Z,{style:{minHeight:"66vh",height:"100%",position:"relative",overflow:"hidden"},children:P})})]})})}mt.propTypes={blocklet:s().object.isRequired,onUpdate:s().func},mt.defaultProps={onUpdate:()=>{}};const pt=l.Z.div(ct||(ct=(0,o.Z)(["\n .MuiTab-root {\n text-align: left;\n align-items: flex-start;\n font-weight: normal;\n }\n .Mui-selected {\n font-weight: bold;\n }\n"])))},78410:(e,n,t)=>{t.d(n,{Z:()=>p});var i=t(5057),o=t(86229),a=t(28726),l=t(44846),r=t(68420),s=t(46090),c=t(58238),d=t(70461),m=t(96266);function p(e){let{teamDid:n,size:t="small",...p}=e;const{t:u}=(0,r.PE)(),{api:f}=(0,c.h6)(),[h,g]=(0,i.useState)(!1),[x,b]=(0,i.useState)(null),v={title:u("blocklet.config.clearCache.title"),description:u("blocklet.config.clearCache.description"),confirm:u("common.confirm"),cancel:u("common.cancel"),onConfirm:async()=>{try{var e;g(!0);const t=await f.clearCache({input:{teamDid:n}});o.Z.success(u("blocklet.config.clearCache.success",{count:(null===(e=t.removed)||void 0===e?void 0:e.length)||0}))}catch(t){o.Z.error((0,s.Z)(t))}finally{g(!1),b(null)}},onCancel:()=>{g(!1),b(null)}};return(0,m.jsxs)("div",{...p,children:[(0,m.jsxs)(a.Z,{onClick:()=>b(v),color:"error",variant:"outlined",size:t,children:[h?(0,m.jsx)(l.Z,{size:16,style:{marginRight:5}}):null,u("blocklet.config.clearCache.action")]}),x&&(0,m.jsx)(d.Z,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}},50185:(e,n,t)=>{t.d(n,{Z:()=>c});var i=t(5057),o=t(55898),a=t.n(o),l=t(12937),r=t(68420),s=t(96266);function c(e){let{children:n,...t}=e;const{t:o}=(0,i.useContext)(r.RD);return(0,s.jsx)(l.Z,{tip:o("common.copyTip"),copiedTip:o("common.copiedTip"),...t,children:n})}c.propTypes={children:a().any.isRequired}},28641:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(39948),r=t(47020),s=t(44846),c=t(13727),d=t(56184),m=t(67680),p=t(35406),u=t(11875),f=t(95890),h=t(96266);const g=(e,n,t)=>null===e&&n&&t?"******":e?n?"******":e:"";function x(e){let{label:n,disabled:t,required:o,initialValue:a,onChange:x,placeholder:b,style:v,onSubmit:Z,secure:j,triggers:y,formatterBeforeSubmit:C,...k}=e;const[w,S]=(0,i.useState)(!1),[E,L]=(0,i.useState)(!1),[P,R]=(0,i.useState)(j&&"__encrypted__"===a?null:a),[T,A]=(0,i.useState)(P),_=async()=>{L(!0);try{if(!1===await Z(T))A(P);else{let e=T;"function"===typeof C&&(e=C(T)),A(e),R(e)}}catch(e){A(P)}finally{L(!1),S(!1)}},N=w?(0,h.jsx)(r.Z,{style:{flex:1},fullWidth:!0,value:T,onChange:e=>{var n;n=e.target.value,A(n),x(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:b,onKeyDown:e=>{"Enter"===e.key&&_()},disabled:t,type:j?"password":"text",...k}):(0,h.jsx)(l.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:g(T,j,a)});return(0,h.jsx)(u.Z,{className:"form",style:v,children:(0,h.jsxs)(l.Z,{className:"form-item",children:[(0,h.jsxs)(l.Z,{className:"form-item-label",children:[n,o&&(0,h.jsx)(p.Z,{})]}),(0,h.jsxs)(l.Z,{className:"form-item-body",children:[(0,h.jsx)(l.Z,{className:"form-item-input",children:N}),(0,h.jsx)(l.Z,{className:"form-item-action",children:w?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(m.Z,{"data-cy":"schema-form-item-confirm",onClick:_,disabled:t||E,size:"large",children:E?(0,h.jsx)(s.Z,{size:24}):(0,h.jsx)(d.Z,{})}),(0,h.jsx)(m.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{A(P),S(!1)},disabled:t||E,size:"large",children:(0,h.jsx)(c.default,{})})]}):(0,h.jsx)(f.Z,{triggers:y,onEnterEdit:()=>S(!0),disabled:t})})]})]})})}x.propTypes={style:a().object,onSubmit:a().func,onChange:a().func,label:a().string,initialValue:a().string,placeholder:a().string,required:a().bool,disabled:a().bool,secure:a().bool,triggers:a().array,formatterBeforeSubmit:a().func},x.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",placeholder:"",required:!1,disabled:!1,secure:!1,triggers:[],formatterBeforeSubmit:null}},11875:(e,n,t)=>{t.d(n,{Z:()=>r});var i,o=t(71171),a=t(33518),l=t(39948);const r=(0,a.Z)(l.Z)(i||(i=(0,o.Z)(["\n width: 100%;\n flex-grow: 1;\n overflow-y: auto;\n "," {\n width: 100%;\n flex-shrink: 0;\n padding: 0 24px;\n transform: translate(0, 0);\n /* max-height: 60vh; */\n }\n\n .form-item {\n width: 100%;\n margin-bottom: 24px;\n position: relative;\n "," {\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n flex-shrink: 0;\n }\n }\n\n .form-item-body {\n display: flex;\n align-items: center;\n width: 100%;\n margin-top: 4px;\n }\n\n .form-item-label {\n line-height: 1.2;\n font-size: 14px;\n color: #888;\n font-weight: bold;\n\n "," {\n text-align: left;\n width: auto;\n flex-grow: 1;\n }\n }\n\n .form-item-input {\n flex-grow: 1;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &.slot {\n height: 40px;\n line-height: 40px;\n background: #f8f8f8;\n font-size: 16px;\n\n .MuiChip-root {\n margin-top: -4px;\n }\n }\n\n .MuiSelect-select {\n padding: 8px;\n }\n }\n\n .form-item-action {\n // width: 100px;\n text-align: left;\n margin-left: 12px;\n flex-shrink: 0;\n "," {\n width: auto;\n margin-left: 0px;\n }\n .MuiIconButton-root {\n padding: 8px;\n svg {\n fill: #888;\n }\n &.Mui-disabled {\n opacity: 0.4;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.breakpoints.down("md")))},95890:(e,n,t)=>{t.d(n,{Z:()=>x});var i=t(5057),o=t(55898),a=t.n(o),l=t(24558),r=t(67680),s=t(56556),c=t(80633),d=t(49390),m=t(72113),p=t(25228),u=t(49020),f=t(74490),h=t(1733),g=t(96266);function x(e){let{triggers:n,onEnterEdit:t,disabled:o}=e;const a=i.useRef(null),[x,b]=i.useState(!1);return 0===n.length?(0,g.jsx)(r.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(c.Z,{variant:"outlined",ref:a,"aria-label":"split button",children:[(0,g.jsx)(s.Z,{"data-cy":"schema-form-item-edit",onClick:t,disabled:o,size:"large",children:(0,g.jsx)(l.Z,{})}),(0,g.jsx)(s.Z,{size:"small","aria-controls":x?"split-button-menu":void 0,"aria-expanded":x?"true":void 0,onClick:()=>{b((e=>!e))},children:(0,g.jsx)(d.Z,{})})]}),(0,g.jsx)(u.Z,{sx:{zIndex:9999},open:x,anchorEl:a.current,role:void 0,placement:"bottom-end",children:(0,g.jsx)(p.Z,{children:(0,g.jsx)(m.d,{onClickAway:e=>{a.current&&a.current.contains(e.target)||b(!1)},children:(0,g.jsx)(h.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,g.jsx)(f.Z,{onClick:()=>{return n=e.handler,b(!1),void n();var n},children:e.title},e.key)))})})})})]})}x.propTypes={triggers:a().arrayOf(a().shape({key:a().string.isRequired,title:a().string.isRequired,handler:a().func.isRequired})),onEnterEdit:a().func.isRequired,disabled:a().bool.isRequired},x.defaultProps={triggers:[]}},35406:(e,n,t)=>{t.d(n,{Z:()=>a});var i,o=t(71171);const a=t(33518).Z.span(i||(i=(0,o.Z)(["\n color: ",";\n &::before {\n content: '*';\n }\n"])),(e=>e.theme.palette.error.main))},54063:(e,n,t)=>{t.d(n,{C:()=>i});const i="true"===localStorage.getItem("enableDebug")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ne});var a=n(71171),i=n(5057),o=n(33518),l=n(85493),s=n(15849),c=n(68420),r=n(11750),d=n(39434),u=n(39948),p=n(83407),m=n(94464),v=n(88574),h=n(28726),g=n(38242),b=n(81010),f=n(87363),y=(n(5892),n(86229)),k=n(1722),x=n(35432),w=n(22425),P=n(58238),j=n(29054),S=n(73545),B=n(46090),E=n(4651),L=n(96266);const Z=e=>{const t={};let n=null;return(0,g.forEachBlockletSync)(e,(e=>{t[e.meta.bundleDid]?n=(0,g.getDisplayName)(e,!0):e.meta.bundleDid&&(t[e.meta.bundleDid]=!0)})),n},_=(e,t,n)=>{const{hostname:a,href:i}=e;if(!t)return i;if(n){var o;const e=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(a);if(!e)return i;const n=e[0],l=(((null===(o=t.site)||void 0===o?void 0:o.domainAliases)||[]).map((e=>e.value)).filter(Boolean).find((e=>e.endsWith(x.DEFAULT_DID_DOMAIN)))||"").replace(".".concat(x.DEFAULT_DID_DOMAIN),"");return l?i.replace(a,"".concat(l,"-").concat(n,".").concat(x.DEFAULT_IP_DOMAIN_SUFFIX)):i}return i.replace(t.meta.bundleDid,t.appPid)};function C(){const{t:e}=(0,c.PE)(),{api:t}=(0,S.T)(),{blocklet:n}=(0,j.y0)(),{inService:a}=(0,P.h6)(),[o,l]=(0,i.useState)(!1),[s,r]=(0,i.useState)(5),d=n&&n.structVersion!==x.APP_STRUCT_VERSION;return[d&&(0,L.jsxs)(v.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,L.jsxs)(u.Z,{display:"flex",alignItems:"center",children:[(0,L.jsx)(h.Z,{variant:"contained",size:"small",color:"primary",onClick:()=>(()=>{try{if("running"===n.status)return void y.Z.error(e("blocklet.migrate.tip.running"));const t=Z(n);if(t)return void y.Z.error(e("blocklet.migrate.tip.duplicate",{name:t}));l(!0)}catch(t){y.Z.error((0,B.Z)(t))}})(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,L.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((t=>(0,L.jsx)(u.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(t))},t)))]},"alert"),n&&(0,L.jsx)(w.Z,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:3e5,onSuccess:()=>{const e=_(window.location,n,a);setTimeout((()=>{window.location.href=e}),5e3),r(5),setInterval((()=>{r((e=>e-1))}),1e3)},extraParams:{appDid:n.appDid,did:n.meta.did,wt:(0,E.iK)(n,!0),title:(0,g.getDisplayName)(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:s>=0?e("blocklet.migrate.success",{sec:s}):"Redirecting..."},onClose:()=>l(!1)},"connect")]}C.propTypes={};var D,A=n(35966),N=n(85531),G=n(44846),U=n(2712),T=n(75793),I=n(17022),O=n(21289),K=n(74094),z=n(7199);const R=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(4549)]).then(n.bind(n,64549)))),F=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(6547),n.e(9085),n.e(5760),n.e(506),n.e(2362),n.e(4852),n.e(4509),n.e(6230)]).then(n.bind(n,64558)))),M=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(4631),n.e(6547),n.e(6743),n.e(506),n.e(4852),n.e(1294),n.e(3555),n.e(4775)]).then(n.bind(n,14775)))),V=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(442),n.e(9662),n.e(7676),n.e(8986)]).then(n.bind(n,13239)))),Y=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(5745),n.e(9725),n.e(5374),n.e(592),n.e(5979),n.e(2537)]).then(n.bind(n,75979)))),$=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(6547),n.e(9085),n.e(5760),n.e(6743),n.e(9818),n.e(9590),n.e(5672),n.e(3216)]).then(n.bind(n,75672)))),W=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(9085),n.e(4901),n.e(1685),n.e(5015)]).then(n.bind(n,85555)))),X=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(9085),n.e(2911),n.e(4901),n.e(5745),n.e(442),n.e(5526),n.e(9725),n.e(7638),n.e(1685),n.e(9237),n.e(3135),n.e(406),n.e(1846),n.e(8646),n.e(8427)]).then(n.bind(n,48427)))),J=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(9327),n.e(8219)]).then(n.bind(n,92379)))),Q=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(6547),n.e(9085),n.e(5760),n.e(7534)]).then(n.bind(n,87534)))),q=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(4901),n.e(4232),n.e(2611)]).then(n.bind(n,42611)))),H=(0,i.lazy)((()=>Promise.all([n.e(7718),n.e(7020),n.e(8537),n.e(4631),n.e(2294),n.e(6547),n.e(9085),n.e(5760),n.e(406),n.e(1846),n.e(9552)]).then(n.bind(n,39552)))),ee=e=>{let{children:t}=e;return t};function te(){var e;const t=(0,l.useNavigate)(),{tab:n="overview"}=(0,l.useParams)(),{did:a,blocklet:o,error:w,client:P,actions:{setBlocklet:j,refreshBlocklet:S}}=(0,O.y0)(),{refresh:B}=(0,T.h6)(),{t:E}=(0,c.PE)(),Z=(0,i.useCallback)((()=>(0,L.jsx)(V,{scope:a})),[a]),_=(null===o||void 0===o||null===(e=o.environments.find((e=>"BLOCKLET_APP_URL"===e.key)))||void 0===e?void 0:e.value)||window.location.origin,D=e=>(0,K.bV)(e,_),N=e=>{t("/blocklets/".concat(a,"/").concat(e))},te=e=>{e&&j(e),S()},ne=!o||(0,K.wS)(o.status)?[]:(0,g.getAppMissingConfigs)(o);let ie=null;const oe=[{label:E("common.overview"),value:"overview"},{breadcrumbsLabel:E("common.components"),label:(0,L.jsx)(p.Z,{color:"error",variant:"dot",invisible:!ne.length,children:E("common.components")}),value:"components"}];if(w)ie=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(v.Z,{type:"error",variant:"icon",children:(0,K.Z)(w)}),(0,L.jsx)(h.Z,{onClick:()=>S(),children:(0,L.jsx)("span",{style:{textDecoration:"underline"},children:E("common.retry")})})]});else if(o){var le;const e={overview:(0,L.jsx)(R,{}),configuration:F,navigation:M,services:W,members:(0,L.jsx)($,{type:"blocklet",createPassportSvg:D}),passports:Y,components:X,"audit-logs":Z,logs:J,runtime:(0,L.jsx)(Q,{}),traffic:(0,L.jsx)(q,{client:P,did:a}),storage:(0,L.jsx)(H,{})};"configuration"===n&&(0,K.wS)(o.status)&&N("overview"),(0,K.wS)(o.status)||(oe.push({label:E("common.members"),value:"members"}),oe.push({label:E("common.passport"),value:"passports"}),oe.push({label:E("common.configuration"),value:"configuration"})),oe.push({label:E("common.auditLogs"),value:"audit-logs"}),o&&null!==(le=o.children)&&void 0!==le&&le.length&&o.structVersion===x.APP_STRUCT_VERSION&&oe.push({label:E("common.logs"),value:"logs"}),oe.push({label:E("common.configNavigation"),value:"navigation"}),oe.push({label:E("common.runtime"),value:"runtime"}),oe.push({label:E("common.traffic"),value:"traffic"}),oe.push({label:E("common.storage"),value:"storage"});(0,g.getBlockletServices)(o).length&&oe.splice(2,0,{label:E("blocklet.services"),value:"services"});const t=e[n]||e.overview;ie=(0,L.jsxs)(f.g,{type:"components",children:[!(0,g.isExternalBlocklet)(o)&&(0,L.jsx)(m.Z,{tabs:oe,current:n,onChange:N,scrollButtons:"auto"}),(0,L.jsx)("div",{className:"page-content",children:(0,L.jsx)(i.Suspense,{fallback:(0,L.jsx)(A.Z,{relative:"parent",children:(0,L.jsx)(G.Z,{})}),children:(0,i.isValidElement)(t)?t:(0,L.jsx)(t,{blocklet:o,onUpdate:te,createPassportSvg:D})})})]})}else ie=(0,L.jsx)(A.Z,{relative:"parent",children:(0,L.jsx)(G.Z,{})});const se=oe.find((e=>e.value===n)),ce=o?I.G6:ee;return(0,L.jsx)(ce,{teamDid:a,children:(0,L.jsxs)(ae,{children:[(0,L.jsxs)(d.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,L.jsx)(s.Link,{color:"textSecondary",to:"/blocklets",children:E("common.blocklets")}),(0,L.jsx)(s.NavLink,{to:"/blocklets/".concat(a,"/overview"),style:e=>e?{color:"inherit"}:{},children:E("common.detail")}),(0,L.jsx)(r.Z,{color:"textSecondary",children:se?se.breadcrumbsLabel||se.label:""})]}),(0,L.jsxs)(r.Z,{component:"div",className:"page-header",children:[(0,L.jsxs)(r.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[o?(0,L.jsx)(k.Z,{blocklet:o,style:{marginRight:16}}):null,o?(0,L.jsxs)(u.Z,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[(0,L.jsx)(u.Z,{children:(0,g.getDisplayName)(o)}),"unknown"!==(null===o||void 0===o?void 0:o.status)&&(0,L.jsx)(b.Z,{size:"12px",status:o.status,source:o.source,progress:o.progress})]}):"".concat(E("common.blocklet")," ").concat(E("common.detail"))]}),(0,L.jsx)(z.Z,{permission:"mutate_blocklets",children:!!o&&!(0,g.isExternalBlocklet)(o)&&(0,L.jsx)(U.Z,{className:"page-actions",blocklet:o,onStart:()=>{},onComplete:e=>{let{action:n,error:a}=e;a?y.Z.error(a.message):"remove"===n?(B(),t("/blocklets")):S()},variant:"group"})})]}),(0,L.jsx)(C,{}),ie]})})}function ne(){const{did:e}=(0,l.useParams)();return e?(0,L.jsx)(O.$8,{did:e,children:(0,L.jsx)(N.wV,{children:(0,L.jsx)(te,{})})}):null}const ae=o.Z.main(D||(D=(0,a.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 16px;\n }\n\n .page-title {\n display: flex;\n align-items: center;\n\n .page-link {\n font-size: 15px;\n margin-top: 8px;\n margin-left: 8px;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n @media (max-width: ","px) {\n .page-header {\n flex-direction: column;\n align-items: flex-start;\n .page-actions,\n .MuiButtonGroup-root {\n width: 100%;\n }\n .MuiButtonGroup-root {\n .MuiButtonBase-root {\n flex: 1;\n }\n .blocklet-action-text {\n display: none;\n }\n }\n }\n\n .page-title {\n margin-bottom: 15px;\n }\n }\n"])),(e=>e.theme.breakpoints.values.md))},85531:(e,t,n)=>{n.d(t,{wV:()=>w,XN:()=>P});var a=n(5057),i=n(55898),o=n.n(i),l=n(86229),s=n(68420),c=n(77277),r=n(29054),d=n(84584),u=n(41899),p=n(58238),m=n(65873);var v=n(46090);function h(){var e;let{setLoading:t,refresh:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blocklet:i,actions:{refreshBlocklet:o}}=(0,r.y0)(),s=null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did,[c,h]=(0,a.useState)([]),{api:g}=(0,p.h6)();return(0,u.Z)((async()=>{try{if(!s)return void h([]);null===t||void 0===t||t(!0);const{spaceGateways:e}=await g.getBlockletSpaceGateways({input:{did:s}}),n=await async function(e){let{blockletDid:t,nodeApi:n,spaceGateways:a}=e,i=!1;const o=await Promise.all(a.map((async e=>{let{name:t}=e;const n=await(0,d.nU)(e.endpoint);return(0,m.isEmpty)(n)||n===t||(t=n,i=!0),{...e,name:t}})));return i&&await Promise.all(o.filter((e=>e.did)).map((e=>n.updateBlockletSpaceGateway({input:{did:t,where:{did:e.did},spaceGateway:{...e}}})))),o}({blockletDid:s,nodeApi:g,spaceGateways:e});h(null!==n&&void 0!==n?n:[])}catch(e){console.error(e),l.Z.error((0,v.Z)(e))}finally{null===t||void 0===t||t(!1)}}),[s,o,n]),{spaceGateways:c}}function g(){var e;let{deps:t,setLoading:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[],setLoading:()=>{}};const{blocklet:i}=(0,r.y0)(),[o,s]=(0,a.useState)([]),{api:c}=(0,p.h6)(),d=(0,m.debounce)((async()=>{try{if(n(!0),!i)return void s([]);const{backups:e}=await c.getBlockletBackups({input:{did:i.meta.did}});s(null!==e&&void 0!==e?e:[])}catch(e){console.error(e),l.Z.error((0,v.Z)(e))}finally{n(!1)}}),2e3);return(0,u.Z)((async()=>{d()}),[null===i||void 0===i||null===(e=i.meta)||void 0===e?void 0:e.did].concat(t)),{backups:o}}const b=function(e){let{appDid:t}=e;const{backups:n}=g(),[i,o]=(0,a.useState)({message:"",progress:0,completed:!1}),l=(0,p.h6)(),{ws:{useSubscription:s}}=l;return s(c.BlockletEvents.backupProgress,(e=>{t===(null===e||void 0===e?void 0:e.appDid)&&o((()=>({...e})))}),[t]),(0,a.useEffect)((()=>{var e;if(null!==n&&void 0!==n&&n.length&&(0,m.isNull)(null===(e=n[0])||void 0===e?void 0:e.status)){const[e]=n;o((()=>({message:e.message,progress:e.progress,completed:Boolean(e.progress>=100)})))}}),[n]),i};var f=n(96266);const y=(0,a.createContext)({}),{Provider:k,Consumer:x}=y;function w(e){let{children:t}=e;const{t:n}=(0,s.PE)(),{api:i}=(0,p.h6)(),{blocklet:o}=(0,r.y0)(),[m,v]=(0,a.useState)(!1),[y,x]=(0,a.useState)(!1),{spaceGateways:w}=h({refresh:y,setLoading:v}),P=b({appDid:null===o||void 0===o?void 0:o.appDid}),[j,S]=(0,a.useState)(!1),B=(0,a.useMemo)((()=>(0,d.mo)(null===o||void 0===o?void 0:o.environments)),[o,y,j]),[E,L]=(0,a.useState)(!1),{backups:Z}=g({deps:[P],setLoading:L}),[_,C]=(0,a.useState)(null===w||void 0===w?void 0:w.find((e=>e.endpoint===B))),[D,A]=(0,a.useState)(!1),N=function(){var e;let{deps:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[]};const{blocklet:n}=(0,r.y0)(),{api:i}=(0,p.h6)(),[o,l]=(0,a.useState)(null);return(0,u.Z)((async()=>{var e;if(null!==n&&void 0!==n&&null!==(e=n.meta)&&void 0!==e&&e.did){const{autoBackup:e}=await i.getAutoBackup({input:{did:n.meta.did}});l(e)}}),[null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did].concat(t)),o}({deps:[D]}),[G,U]=(0,a.useState)(!1),T=function(){var e;let{deps:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{deps:[]};const{blocklet:n}=(0,r.y0)(),{api:i}=(0,p.h6)(),[o,l]=(0,a.useState)(null);return(0,u.Z)((async()=>{var e;if(null!==n&&void 0!==n&&null!==(e=n.meta)&&void 0!==e&&e.did){const{autoCheckUpdate:e}=await i.getAutoCheckUpdate({input:{did:n.meta.did}});l(e)}}),[null===n||void 0===n||null===(e=n.meta)||void 0===e?void 0:e.did].concat(t)),o}({deps:[G]}),I=()=>{x((e=>!e))};return(0,f.jsx)(k,{value:{spaceGateways:w,selectedSpaceGateway:_,addSpaceGateway:async(e,t)=>{w.push({...e,loading:!0}),await i.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:e}}),B!==t&&await i.configBlocklet({input:{did:[o.meta.did],configs:[{key:c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t}]}}),I(),C(e)},deleteSpaceGateway:async e=>{e&&(await i.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:null===e||void 0===e?void 0:e.did}}),I(),C(e))},updateSpaceGateway:async e=>{var t;await i.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:e.did},spaceGateway:e}}),B!==e.endpoint&&await i.configBlocklet({input:{did:[o.meta.did],configs:[{key:c.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:e.endpoint}]}}),l.Z.success(n("storage.spaces.connectedWithName",{name:null!==(t=null===e||void 0===e?void 0:e.name)&&void 0!==t?t:"DID Spaces"})),I()},refreshSpaceGateways:I,spaceGatewaysLoading:m,spaceGatewayIsSelected:e=>(null===e||void 0===e?void 0:e.endpoint)===B,updateAutoBackup:async e=>{await i.updateAutoBackup({input:{did:o.meta.did,autoBackup:e}}),A((e=>!e))},updateAutoCheckUpdate:async e=>{await i.updateAutoCheckUpdate({input:{did:o.meta.did,autoCheckUpdate:e}}),U((e=>!e))},autoCheckUpdate:T,backupEndpoint:B,backupProgress:P,backups:Z,backupsLoading:E,refreshBackupEndpoint:()=>{S((e=>!e))},autoBackup:N},children:t})}function P(){return(0,a.useContext)(y)}w.propTypes={children:o().any.isRequired},w.defaultProps={}},60344:(e,t,n)=>{n.d(t,{hi:()=>o,od:()=>i.a});var a=n(10458),i=n.n(a);i().defaults.timeout=1e4;const o=i().create()},84584:(e,t,n)=>{n.d(t,{EJ:()=>f,Jf:()=>b,LQ:()=>u,Nb:()=>p,UV:()=>y,Xv:()=>r,Z3:()=>k,ag:()=>v,mo:()=>m,nD:()=>d,nU:()=>g,w2:()=>h});var a=n(82434),i=n.n(a),o=n(77277),l=n(65873),s=n(2842),c=n(60344);function r(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/"),a=n.at(-4),i=n.at(-2);return(0,s.xn)(t,"space",a,"apps",i,"explorer?key=/apps/".concat(i,"/.did-objects/").concat(i,"/"))}function d(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(t,"space",n)}function u(e){return e.replace(/\/$/,"").split("/").at(-4)}async function p(e){try{if(!i()(e))return!1;const{headers:t}=await c.hi.head(e,{timeout:5e3});return"true"===t["x-listable"]&&"true"===t["x-readable"]&&"true"===t["x-writeable"]}catch(t){return console.error(t),!1}}function m(e){var t;return(null===e||void 0===e||null===(t=e.find((e=>e.key===o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT)))||void 0===t?void 0:t.value)||""}function v(e){const t=new URL(e);return(0,s.xn)(t.origin,t.pathname)}async function h(e){try{if(!i()(e))return!1;const t=v(e),n=(0,s.xn)(t,"space/api/did/one-click-authorization/token"),{status:a,data:o}=await c.hi.get(n,{timeout:5e3});return 200===a&&(0,l.isObject)(o)}catch(t){return console.error(t),!1}}async function g(e){let{timeout:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e3};try{if(!i()(e))return"";const{headers:n}=await c.hi.head(e,{timeout:t}),a=n["x-space-name"];return a?decodeURIComponent(a):""}catch(n){return console.error(n),""}}function b(e){const t=e.replace(/\/api\/space\/.+/,""),n=e.replace(/\/$/,"").split("/").at(-4);return(0,s.xn)(t,"/api/space/nft/display?spaceDid=".concat(n))}const f=e=>{var t;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(t=t.find((e=>e.key===o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===t?void 0:t.value)||null};async function y(e){const t={};return t.did=u(e),t.name=await g(e),t.url=function(e){return null===e||void 0===e?void 0:e.replace(/\/api\/space\/.+/,"")}(e),t.endpoint=e,t}async function k(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4,withSearchParams:!0};if(!(0,l.isString)(e))throw new Error("url(".concat(e,") must be a string"));const a=e.startsWith("http")?e:"https://".concat(e),i=new URL(a),{data:o}=await c.hi.get((0,s.xn)(i.origin,"/__blocklet__.js?type=json"),{timeout:n.timeout}),r=null===(t=o.componentMountPoints.findLast((e=>"z8iZnaYxnkMD5AKRjTKiCb8pQr1ut8UantAcf"===e.did)))||void 0===t?void 0:t.mountPoint;if(!r)throw new Error("MountPoint(".concat(r,") not found"));const d=(0,s.xn)(i.origin,r);return n.withSearchParams&&i.searchParams.get("spaceDid")?(0,s.xn)(d,"?spaceDid=".concat(i.searchParams.get("spaceDid"))):d}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[670,2611],{16580:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var r=n(71171),o=n(5057),a=n(33518),i=n(85493),s=n(11750),l=n(94464),c=n(68420),d=n(42611),m=n(75793),u=n(96266);function p(){const{api:e,info:t}=(0,m.h6)();return(0,u.jsx)(d.default,{client:e,did:t.did})}var f=n(45603),h=n.n(f),v=n(39948),y=n(55402),g=n(55222),x=n(28768),b=n(75760),Z=n(44846),j=n(35966),k=n(66506),w=n(35432),P=n(77277),E=n(86229),D=n(1722),I=n(80378),O=n(46090),C=n(38242),L=n(56169),N=n(1979),R=n(55898),S=n.n(R),T=n(50844),_=n(99154),z=n(844);const B=(0,T.Z)((e=>({root:{height:10},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.mode?200:700]},bar:{backgroundColor:e.palette.secondary.main}})))(_.Z);function F(e){const{value:t}=e;return(0,u.jsxs)(v.Z,{display:"flex",alignItems:"center",mt:2,children:[(0,u.jsx)(v.Z,{width:"100%",style:{overflow:"hidden"},mr:1,children:(0,u.jsx)(B,{variant:"determinate",...e})}),(0,u.jsx)(v.Z,{minWidth:35,children:(0,u.jsx)(s.Z,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(t),"%")})})]})}function U(e){let{disk:t}=e;const{t:n}=(0,o.useContext)(c.RD),r=[{id:1,className:"used",title:n("system.used"),metric:(0,O.Gw)(t.used)},{id:2,className:"free",title:n("system.free"),metric:(0,O.Gw)(t.free)},{id:3,className:"total",title:n("system.total"),metric:(0,O.Gw)(t.total)}];return(0,u.jsx)(z.Z,{title:"".concat(n("common.disk")," (").concat(t.device,")"),value:(0,O.Gw)(t.used),graph:(0,u.jsx)(v.Z,{mt:3,children:(0,u.jsx)(F,{value:t.used/t.total*100})}),description:r.map(((e,t)=>(0,u.jsxs)(v.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title)))})}F.propTypes={value:S().number.isRequired},U.propTypes={disk:S().shape({used:S().number,free:S().number,total:S().number,device:S().string})},U.defaultProps={disk:{used:0,free:0,total:1,device:""}};var M=n(67654),G=n(52926),Y=n(52581),q=n(34937),A=n(74094);const K={uptime:0,pid:-1,cpuUsage:0,memoryUsage:0},V="Blocklet Server";function H(e){let{initialBlocklets:t}=e;const{t:n,locale:r}=(0,c.PE)(),{api:a}=(0,m.h6)(),[i,l]=(0,M.Z)("runtime-view-interval",6),d=(0,o.useMemo)((()=>{const e=[];return e.push({type:"server",groupId:"server",groupName:V,id:"server:daemon",name:"Server (Daemon)",runtimeInfo:K}),e.push({type:"server",groupId:"server",groupName:V,id:"server:service",name:"Server (Service)",runtimeInfo:K}),t.forEach((t=>{(0,C.forEachBlockletSync)(t,((n,r)=>{let{id:o,ancestors:a}=r;n.runtimeInfo&&e.push({type:"blocklet",groupId:t.meta.did,groupName:(0,C.getDisplayName)(t),id:o,name:(0,C.getDisplayName)(n,!0),blocklet:t,component:n,runtimeInfo:n.runtimeInfo,ancestors:a})}))})),e}),[]),[p,f]=(0,o.useState)(d),[Z,j]=(0,o.useState)({os:{platform:""},mem:{used:0,free:0,total:1},cpu:{cpus:[],currentLoad:1},disks:[],daemon:{},service:{}}),[R,S]=(0,o.useState)({cpu:[],mem:[],daemonMem:[],serviceMem:[]});(0,q.mU)(w.EVENTS.NODE_RUNTIME_INFO,(e=>{e.mem.total=e.mem.total||0,e.mem.used=e.mem.total-(e.mem.available||0),j(e),f((t=>t.map((t=>"server:daemon"===t.id?{...t,runtimeInfo:{...t.runtimeInfo,...e.daemon}}:"server:service"===t.id?{...t,runtimeInfo:{...t.runtimeInfo,...e.service}}:t))))})),(0,q.mU)(w.EVENTS.BLOCKLETS_RUNTIME_INFO,(e=>{e&&e.length?f((t=>t.map((t=>{const n=e.find((e=>e.componentId===t.id));return n?{...t,runtimeInfo:{...t.runtimeInfo,...n.runtimeInfo}}:t})))):console.error("incorrect blocklets runtime info format",e)}));const T=e=>{f((t=>t.filter((t=>t.groupId!==e.meta.did))))},_=async e=>{try{const{blocklet:t}=await a.getBlocklet({input:{did:e.meta.did,attachRuntimeInfo:!0}});"running"!==t.status&&T(t),f((e=>{const n=e.filter((e=>e.groupId!==t.meta.did));return(0,C.forEachBlockletSync)(t,((e,r)=>{let{id:o,ancestors:a}=r;e.runtimeInfo&&n.push({type:"blocklet",groupId:t.meta.did,groupName:(0,C.getDisplayName)(t),id:o,name:(0,C.getDisplayName)(e,!0),blocklet:t,component:e,runtimeInfo:e.runtimeInfo,ancestors:a})})),n}))}catch(t){E.Z.error(t.message)}};(0,q.mU)(P.BlockletEvents.removed,T),(0,q.mU)(P.BlockletEvents.startFailed,T),(0,q.mU)(P.BlockletEvents.statusChange,(e=>{"running"===e.status?_(e):T(e)})),(0,q.mU)(P.BlockletEvents.updated,_),(0,q.mU)(P.BlockletEvents.started,_);(0,o.useEffect)((()=>{a.getNodeRuntimeHistory({input:{hours:i}}).then((e=>{const t=e.history||[];S({cpu:t.map((e=>({date:e.date,value:e.cpu}))),mem:t.map((e=>({date:e.date,value:e.mem}))),daemonMem:t.map((e=>({date:e.date,value:e.daemonMem}))),serviceMem:t.map((e=>({date:e.date,value:e.serviceMem})))})})).catch((e=>{E.Z.error(e.message)}))}),[i]);const z=[{label:n("common.group"),name:"groupName",options:{customBodyRenderLite(e){const{type:t,blocklet:n,groupName:r}=p[e];return"server"===t?(0,u.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(Y.r,{width:"14",height:"14"}),(0,u.jsx)(v.Z,{ml:1,children:r})]}):(0,u.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(D.Z,{size:14,blocklet:n}),(0,u.jsx)(v.Z,{ml:1,children:r})]})}}},{label:n("common.name"),name:"name",options:{customBodyRenderLite(e){const{type:t,name:n,component:r,ancestors:o}=p[e];return"server"===t?(0,u.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(k.Z,{width:"14",height:"14"}),(0,u.jsx)(v.Z,{ml:1,children:n})]}):(0,u.jsxs)(v.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(I.Z,{size:14,blocklet:r,ancestors:o}),(0,u.jsx)(v.Z,{ml:1,children:n})]})}}},{label:n("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:t}=p[e];return n=t.uptime,h()(Number(n||0),{locale:(0,O.FF)(r)});var n}}},{label:n("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=p[e];return(0,A.Gw)((null===t||void 0===t?void 0:t.memoryUsage)||0)},sortDirection:"asc"}},{label:n("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=p[e];return"".concat((t.cpuUsage||0).toFixed(1),"%")}}},{label:n("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid"},{label:n("blocklet.runtimeInfo.port"),name:"runtimeInfo.port"}];return(0,u.jsxs)("div",{children:[(0,u.jsxs)(v.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[(0,u.jsx)(s.Z,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},children:n("analytics.trend")}),(0,u.jsx)(x.Z,{size:"small",exclusive:!0,value:i,onChange:(e,t)=>l(t),children:[1,3,6,12,24].map((e=>(0,u.jsxs)(g.Z,{value:e,children:[e,"H"]},e)))})]}),(0,u.jsxs)(y.ZP,{mb:4,container:!0,spacing:4,children:[(0,u.jsx)(y.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(L.Z,{...Z.cpu,history:R.cpu})},"cpu"),(0,u.jsx)(y.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(N.Z,{...Z.mem,history:R.mem})},"memory"),(0,u.jsx)(y.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(N.Z,{title:"".concat(n("common.memory")," (Daemon)"),used:Z.daemon.memoryUsage||0,history:R.daemonMem})},"memory-daemon"),(0,u.jsx)(y.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(N.Z,{title:"".concat(n("common.memory")," (Service)"),instanceCount:Z.service.instanceCount||0,used:Z.service.memoryUsage||0,history:R.serviceMem})},"memory-service"),Z.disks.map((e=>(0,u.jsx)(y.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(U,{disk:e})},"disk")))]}),(0,u.jsx)(b.Z,{className:"runtime-insight-list",title:n("analytics.detail"),locale:r,data:p,columns:z,options:{download:!1,filter:!1,print:!1,pagination:!1,rowsPerPage:100}})]})}function W(){const{data:e,externalData:t,initialized:n}=(0,G.RJ)();if(!n)return(0,u.jsx)(j.Z,{relative:"parent",children:(0,u.jsx)(Z.Z,{})});const r=[...e,...t]||[];return(0,u.jsx)(H,{initialBlocklets:r})}var Q;function X(){const e=(0,i.useNavigate)(),{t:t}=(0,o.useContext)(c.RD),{tab:n="traffic"}=(0,i.useParams)(),r=[{label:t("common.traffic"),value:"traffic"},{label:t("common.runtime"),value:"runtime"}],a={traffic:p,runtime:W},d=a[n]||a.traffic;return(0,u.jsxs)(J,{children:[(0,u.jsx)(s.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:t("common.analytics")}),(0,u.jsx)(l.Z,{tabs:r,current:n,onChange:t=>{e("/analytics/".concat(t))}}),(0,u.jsx)("div",{className:"page-content",children:(0,o.isValidElement)(d)?d:(0,u.jsx)(d,{})})]})}const J=a.Z.main(Q||(Q=(0,r.Z)(["\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .page-content {\n margin-top: 16px;\n }\n"])))},844:(e,t,n)=>{n.d(t,{Z:()=>p});var r,o=n(71171),a=n(55898),i=n.n(a),s=n(33518),l=n(38763),c=n(75392),d=n(11750),m=n(39948),u=n(96266);function p(e){let{style:t,title:n,value:r,graph:o,description:a}=e;return(0,u.jsx)(f,{children:(0,u.jsxs)(c.Z,{style:{...t},children:[(0,u.jsx)(d.Z,{sx:{fontSize:14},color:"text.secondary",children:n}),(0,u.jsx)(d.Z,{variant:"h5",component:"div",mt:1,children:r}),o,!!a&&(0,u.jsx)(m.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:a})]})})}p.propTypes={style:i().object,title:i().node,value:i().node,graph:i().node,description:i().any},p.defaultProps={style:{},title:null,value:null,graph:null,description:null};const f=(0,s.Z)(l.Z)(r||(r=(0,o.Z)(["\n .card-content {\n height: 150px;\n }\n\n .card-sparkline {\n flex: 2;\n display: flex;\n position: relative;\n *[hidden] {\n display: none;\n }\n }\n .sparkline {\n stroke: ",";\n fill: ","1A;\n }\n .tooltip {\n position: absolute;\n background: rgba(0, 0, 0, 0.7);\n color: #fff;\n padding: 2px 5px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 9999;\n }\n .sparkline--cursor {\n stroke: orange;\n }\n\n .sparkline--spot {\n fill: red;\n stroke: red;\n }\n"])),(e=>e.theme.palette.primary.main),(e=>e.theme.palette.primary.main))},52959:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(5057),o=n(55898),a=n.n(o),i=n(12673),s=n(28563),l=n(26089),c=n(844),d=n(96266);function m(e){let{id:t,title:n,current:o,description:a,data:m,dateFn:u,valueFn:p}=e;const f=(0,r.useRef)(null),h=(0,r.useRef)(null),v=(0,i.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),[y,g]=(0,r.useState)(null),x=(0,s.Z)(y),b={onmousemove(e,t){const{date:n,value:r}=t;v.textContent="".concat(u(n),": ").concat(p(r)),v.style.top=-30,v.style.left=80,v.hidden=!1},onmouseout(){v.hidden=!0}};return(0,r.useEffect)((()=>{setTimeout((()=>{g(document.querySelector(".".concat(t))),setTimeout((()=>{f.current&&(0,l.Z)(f.current,m||[],b)}),400)}))}),[m]),(0,d.jsx)(c.Z,{title:n,value:o,graph:(0,d.jsxs)("div",{className:"card-sparkline ".concat(t),style:{marginTop:16},children:[(0,d.jsx)("svg",{ref:f,className:"sparkline",width:(null===x||void 0===x?void 0:x.width)||100,height:30,strokeWidth:"2"}),(0,d.jsx)("span",{className:"tooltip",ref:h,hidden:v.hidden,style:{...v.style},children:v.textContent})]}),description:a})}m.propTypes={id:a().string.isRequired,title:a().string.isRequired,current:a().any.isRequired,description:a().any,data:a().array,dateFn:a().func,valueFn:a().func},m.defaultProps={description:null,data:[],dateFn:e=>e,valueFn:e=>e}},56169:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(5057),o=n(55898),a=n.n(o),i=n(68420),s=n(52959),l=n(46090),c=n(96266);const d=e=>"".concat(e,"%");function m(e){let{cpus:t,currentLoad:n,history:o}=e;const{t:a,locale:m}=(0,r.useContext)(i.RD);return(0,c.jsx)(s.Z,{id:"cpu-sparkline",title:a("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:o,description:"".concat(a("system.cores"),": ").concat((null===t||void 0===t?void 0:t.length)||0),dateFn:e=>(0,l.mr)(e,"HH:mm:ss",m),valueFn:d})}m.propTypes={cpus:a().array,currentLoad:a().number,history:a().array},m.defaultProps={cpus:[],currentLoad:0,history:[]}},1979:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(55898),o=n.n(r),a=n(39948),i=n(68420),s=n(52959),l=n(46090),c=n(96266);function d(e){let{instanceCount:t,title:n,total:r,used:o,history:d}=e;const{t:m,locale:u}=(0,i.PE)(),p=!!r,f=r-o,h=p?"(".concat(Math.floor(o/r*100),"%)"):"",v=[];return t&&v.push({title:m("system.instances"),metric:t}),v.push({title:m("system.used"),metric:(0,l.Gw)(o)}),p&&v.push({title:m("system.free"),metric:(0,l.Gw)(f)},{title:m("system.total"),metric:(0,l.Gw)(r)}),(0,c.jsx)(s.Z,{id:"mem-sparkline",title:n||m("common.memory"),current:"".concat((0,l.Gw)(Math.floor(o||0))," ").concat(h),data:d,description:v.map(((e,t)=>(0,c.jsxs)(a.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title))),dateFn:e=>(0,l.mr)(e,"HH:mm:ss",u),valueFn:l.Gw})}d.propTypes={title:o().string,instanceCount:o().number,total:o().number,used:o().number,history:o().array},d.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]}},42611:(e,t,n)=>{n.r(t),n.d(t,{default:()=>M,getDefaultRanges:()=>U});var r=n(5057),o=n(1577),a=n.n(o),i=n(6465),s=n.n(i),l=n(6352),c=n.n(l),d=n(74511),m=n(96181),u=n(93938),p=n(44846),f=n(55402),h=n(11750),v=n(56556),y=n(67680),g=n(11819),x=n(13811),b=n(49204),Z=n(79940),j=n(20425),k=n(34862),w=n(68420),P=n(35432),E=n(87364),D=n(39458),I=n(4903),O=n(44926),C=n(90298),L=n(43713),N=n(59497),R=n(9732),S=n(13379),T=n(46090),_=n(58238),z=n(52959),B=n(96266);const F=s()(0),U=(e,t)=>[{label:"This Week",startDate:(0,E.Z)(e,{locale:t}),endDate:(0,D.Z)(e,{locale:t})},{label:"Last Week",startDate:(0,E.Z)((0,I.Z)(e,-1),{locale:t}),endDate:(0,D.Z)((0,I.Z)(e,-1),{locale:t})},{label:"Last 7 Days",startDate:(0,I.Z)(e,-1),endDate:e},{label:"This Month",startDate:(0,O.Z)(e),endDate:(0,C.Z)(e)},{label:"Last Month",startDate:(0,O.Z)((0,L.Z)(e,-1)),endDate:(0,C.Z)((0,L.Z)(e,-1))},{label:"This Year",startDate:(0,N.Z)(e),endDate:(0,R.Z)(e)},{label:"Last Year",startDate:(0,N.Z)((0,S.Z)(e,-1)),endDate:(0,R.Z)((0,S.Z)(e,-1))}];function M(e){let{client:t,did:n}=e;const o=a()().subtract(1,"day").toDate(),{info:i,inService:s}=(0,_.h6)(),{t:l,locale:E}=(0,w.PE)(),[D,I]=(0,r.useState)(null),[O,C]=(0,r.useState)(!1),[L,N]=(0,r.useState)(o),[R,S]=(0,r.useState)({startDate:a()().subtract(30,"day").toDate(),endDate:o}),M=(0,d.Z)((async()=>(await t.getTrafficInsights({input:{did:n,startDate:a()(R.startDate).format("YYYY-MM-DD"),endDate:a()(R.endDate).format("YYYY-MM-DD")}})).list));(0,r.useEffect)((()=>{M.loading||R.startDate&&R.endDate&&M.retry()}),[R]);const G=e=>{I(D?null:e.currentTarget)},Y=M.value||[],{loading:q,error:A}=M;if(!Y.length&&q)return(0,B.jsx)(p.Z,{});if(A)return(0,B.jsx)(u.Z,{severity:"error",children:(0,T.Z)(A)});const K={totalRequests:F,validRequests:F,failedRequests:F,uniqueVisitors:F,uniqueFiles:F,uniqueReferrers:F,uniqueNotFound:F,uniqueStaticFiles:F,logSize:T.Gw,bandwidth:T.Gw},V=Object.keys(K).map((e=>({id:"".concat(e,"_chart"),title:l("analytics.traffic.".concat(e)),current:Y.length?K[e](Y[0][e]):0,data:Y.map((t=>({date:t.date,value:t[e]}))).reverse(),dateFn:F,valueFn:K[e]}))),H=Boolean(D),W=H?"date-range-picker-popover":void 0,Q=s?P.WELLKNOWN_SERVICE_PATH_PREFIX:i.routing.adminPath,X=c()(window.location.origin,Q,"/api/analytics/traffic?date=".concat(a()(L).format("YYYY-MM-DD"),"&did=").concat(n));return(0,B.jsxs)("div",{children:[(0,B.jsxs)(h.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[l("analytics.trend"),(0,B.jsxs)(v.Z,{onClick:G,variant:"outlined",size:"small",color:"secondary",children:[(0,T.pz)(R.startDate,E)," - ",(0,T.pz)(R.endDate,E)]})]}),(0,B.jsx)(g.ZP,{id:W,open:H,anchorEl:D,onClose:()=>I(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,B.jsx)(b.D,{open:!0,toggle:G,maxDate:o,definedRanges:U(L),onChange:e=>{S(e),I(null)}})}),(0,B.jsx)(f.ZP,{container:!0,spacing:4,children:V.map((e=>(0,B.jsx)(f.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,B.jsx)(z.Z,{...e})},e.id)))}),(0,B.jsxs)(h.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[l("analytics.detail"),(0,B.jsxs)("span",{children:[O&&(0,B.jsx)(y.Z,{onClick:()=>{window.open(X)},style:{marginRight:32},children:(0,B.jsx)(x.Z,{})}),(0,B.jsx)(k._,{dateAdapter:j.y,children:(0,B.jsx)(Z.M,{disableFuture:!0,format:"ll",value:a()(L),onChange:e=>{N(e.toDate()),C(!1)},slotProps:{textField:{size:"small"}}})})]})]}),(0,B.jsx)(m.Z,{url:X,width:"100%",height:"100%",frameBorder:0,onLoad:()=>C(!0),styles:{border:0,minHeight:"400vh"}})]})}},1722:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(55898),o=n.n(r),a=n(62681),i=n(72333),s=n(77277),l=n(49522),c=n(96266);function d(e){let{blocklet:t,style:n,size:r,...o}=e;const{logoUrl:d}=(0,l.Z)({blocklet:t}),{variant:m}=o;let u=(0,c.jsx)("img",{src:d,alt:"",style:{width:r}});if(!t.meta.logo){var p;(null===(p=(t.configs||[]).find((e=>e.key===s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)))||void 0===p?void 0:p.value)||(u=(0,c.jsx)(i.Z,{did:t.meta.did||"",responsive:!0}))}return(0,c.jsx)(a.Z,{variant:m||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},n),...o,children:u})}d.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string])},d.defaultProps={style:{},size:40}},80378:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(55898),o=n.n(r),a=n(62681),i=n(72333),s=n(6352),l=n.n(s),c=n(35432),d=n(58238),m=n(46090);var u=n(96266);function p(e){let{blocklet:t,style:n,size:r,ancestors:o,...s}=e;const p=(0,d.h6)(),{logoUrl:f,inService:h}=function(e){var t;let{blocklet:n,ancestors:r=[]}=e;const o=(0,d.h6)(),{inService:a}=o,i="?v=".concat(null===n||void 0===n||null===(t=n.meta)||void 0===t?void 0:t.version).concat((0,m.XN)(null===n||void 0===n?void 0:n.status)?"~":"");let s=a?l()(m.zn,c.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo-bundle",i):l()(o.imgPrefix,"blocklet.png");if("registry"===n.source&&n.deployedFrom&&n.meta.logo)s=l()(n.deployedFrom,(0,m.lk)(n.meta.bundleDid,n.meta.logo),i);else{const e=window.env.apiPrefix||"/",t=r.concat(n),o=a?t.slice(1):t;s=l()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),i)}return{logoUrl:s,inService:a}}({blocklet:t,ancestors:o}),{variant:v}=s,y=h?()=>{}:e=>{e.target.src="".concat(p.imgPrefix,"/blocklet.png")};let g=(0,u.jsx)("img",{src:f,onError:y,alt:t.meta.name,style:{width:r}});return t.meta.logo||(g=(0,u.jsx)(i.Z,{did:t.meta.did||"",responsive:!0})),(0,u.jsx)(a.Z,{variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:r,height:r,borderRadius:10},n),...s,children:g})}p.propTypes={blocklet:o().object.isRequired,style:o().object,size:o().oneOfType([o().number,o().string]),ancestors:o().array},p.defaultProps={style:{},size:40,ancestors:[]}},49522:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(6352),o=n.n(r),a=n(77277),i=n(58238),s=n(46090);const l=(e,t)=>{let n="?v=";var r;t?n+=(0,s.Qi)(t):n+="".concat(null===e||void 0===e||null===(r=e.meta)||void 0===r?void 0:r.version).concat((0,s.wS)(null===e||void 0===e?void 0:e.status)?"~":"");return n};function c(e){var t,n,r,s;let{blocklet:c}=e;const{inService:d}=(0,i.h6)(),m=null===(t=((null===c||void 0===c?void 0:c.environments)||[]).find((e=>e.key===a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)))||void 0===t?void 0:t.value,u=null===(n=((null===c||void 0===c?void 0:c.environments)||[]).find((e=>e.key===a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT)))||void 0===n?void 0:n.value,p=null===(r=((null===c||void 0===c?void 0:c.environments)||[]).find((e=>e.key===a.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON)))||void 0===r?void 0:r.value,f=(null===(s=window.env)||void 0===s?void 0:s.apiPrefix)||"/";return{logoUrl:o()(f,"/blocklet/logo/".concat(d?"":c.meta.did),l(c,m)),rectLogoUrl:o()(f,"/blocklet/logo-rect/".concat(d?"":c.meta.did),l(c,u)),faviconUrl:o()(f,"/blocklet/logo-favicon/".concat(d?"":c.meta.did),l(c,p))}}},66506:(e,t,n)=>{t.Z=void 0;(r=n(5057))&&r.__esModule;var r,o=n(96266);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){return(0,o.jsxs)("svg",i(i({},e),{},{children:[(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.083 3.2c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12v10.24a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V3.2zm2.24 1.12v8h23.36v-8H4.323zm-2.24 14.24c0-.619.501-1.12 1.12-1.12h25.6c.619 0 1.12.501 1.12 1.12V28.8a1.12 1.12 0 0 1-1.12 1.12h-25.6a1.12 1.12 0 0 1-1.12-1.12V18.56zm2.24 1.12v8h23.36v-8H4.323z",fill:"currentColor"}),(0,o.jsx)("path",{d:"M8.963 7.04h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64zm5.12-15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64V7.68a.64.64 0 0 0-.64-.64zm0 15.36h-1.28a.64.64 0 0 0-.64.64v1.28a.64.64 0 0 0 .64.64h1.28a.64.64 0 0 0 .64-.64v-1.28a.64.64 0 0 0-.64-.64z",fill:"currentColor"})]}))};l.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},l.displayName="server";t.Z=l},50844:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(7896),o=n(29218),a=n(5057),i=n(56129),s=n.n(i),l=n(92877);var c=n(95335),d=n(96266);const m=["defaultTheme","withTheme","name"],u=["classes"],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{const{defaultTheme:i,withTheme:p=!1,name:f}=t,h=(0,o.Z)(t,m);let v=f;const y=(0,l.Z)(e,(0,r.Z)({defaultTheme:i,Component:n,name:f||n.displayName,classNamePrefix:v},h)),g=a.forwardRef((function(e,t){const a=(0,o.Z)(e,u),s=y((0,r.Z)({},n.defaultProps,e));let l,m=a;return("string"===typeof f||p)&&(l=(0,c.Z)()||i,f&&(m=function(e){const{theme:t,name:n,props:o}=e;if(!t||!t.components||!t.components[n]||!t.components[n].defaultProps)return o;const a=(0,r.Z)({},o),i=t.components[n].defaultProps;let s;for(s in i)void 0===a[s]&&(a[s]=i[s]);return a}({theme:l,name:f,props:a})),p&&!m.theme&&(m.theme=l)),(0,d.jsx)(n,(0,r.Z)({ref:t,classes:s},m))}));return s()(g,n),g}}},88781:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(5057);function o(e){return r.Children.toArray(e).filter((e=>r.isValidElement(e)))}}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 6743.f19f7583.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6743],{5873:(e,n,t)=>{t.d(n,{Z:()=>m});var o=t(96266),i=(t(49631),t(5057)),r=t(55898),s=t.n(r),l=t(47220),a=t(68420),c=t(1033),d=t(615),u=t(6504),f=t(94457),p=t(59763),h=t(25162);function g(e){var n;let{meta:t,fallbackUrl:r,invalidPathFallback:s,headerAddons:d,sessionManagerProps:g,links:m,...v}=e;(0,h.x)();const b=(0,i.useContext)(l.B3),x=null===b||void 0===b||null===(n=b.session)||void 0===n?void 0:n.user,y=null===x||void 0===x?void 0:x.role,{locale:k}=(0,a.PE)()||{},w=(0,i.useMemo)((()=>{const e=Object.assign({},window.blocklet,t);try{return(0,f.RX)(e)}catch(n){return console.error("Failed to format blocklet info",n,e),e}}),[t]),{localizedNav:j,flattened:T,matchedIndex:M}=(0,i.useMemo)((()=>{var e;let n=(0,f.KN)(null===w||void 0===w||null===(e=w.navigation)||void 0===e?void 0:e.dashboard,k)||[];n=(0,f.Kb)(n,y),n=(0,u._J)(n,(e=>({title:e.title,url:e.link,icon:e.icon?(0,o.jsx)("iconify-icon",{height:"100%",width:"100%",icon:e.icon}):null,external:!0,children:e.items})),"items");const t=(0,u.Ik)(n).filter((e=>!!e.url)),i=(0,u.RX)(t.map((e=>e.url)));return-1!==i&&(t[i].active=!0),{localizedNav:n,flattened:t,matchedIndex:i}}),[w,k,y]),C="function"===typeof m?m(j):[...j,...m];if((0,i.useLayoutEffect)((()=>{!x||null!==T&&void 0!==T&&T.length||!r||(window.location.href=r)}),[r]),(0,i.useLayoutEffect)((()=>{var e;x&&null!==T&&void 0!==T&&T.length&&-1===M&&(s?s():window.location.href=(null===(e=T[0])||void 0===e?void 0:e.url)||f.iU)}),[s,T,M]),!w.appName)return null;const{appLogo:A,appLogoRect:Z,appName:P}=w,E=(0,o.jsx)(p.Z,{formattedBlocklet:w,addons:d,sessionManagerProps:g});return(0,o.jsx)(c.Z,{title:P,fullWidth:!0,sidebarWidth:128,legacy:!1,links:C,...v,headerProps:{homeLink:f.iU,logo:(0,o.jsx)("img",{src:Z||A,alt:"logo"}),addons:E,...v.headerProps}})}g.propTypes={meta:d.u,fallbackUrl:s().string,invalidPathFallback:s().func,headerAddons:s().oneOfType([s().func,s().node]),sessionManagerProps:d.r,links:s().oneOfType([s().array,s().func])},g.defaultProps={meta:{},fallbackUrl:f.iU,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=f.iU}},links:[]};const m=g},2484:(e,n,t)=>{t.d(n,{Z:()=>Y});var o,i=t(71171),r=t(96266),s=t(5057),l=t(55898),a=t.n(l),c=t(47685),d=t(52439),u=t(68420),f=t(71569),p=t(76223),h=t(24914),g=t.n(h),m=t(9498),v=t(39948);function b(e){let{name:n,logo:t,description:o,...i}=e;if(!n&&!t&&!o)return null;const l=(0,s.isValidElement)(t)?t:(0,r.jsx)("img",{src:t,alt:n});return(0,r.jsxs)(x,{...i,children:[(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("div",{className:"footer-brand-logo",children:l}),n&&(0,r.jsx)("div",{className:"footer-brand-name",children:n})]}),o&&(0,r.jsx)("div",{className:"footer-brand-desc",children:o})]})}b.propTypes={name:a().node,logo:a().node,description:a().string},b.defaultProps={name:"",logo:"",description:""};const x=(0,c.zo)("div")(o||(o=(0,i.Z)(["\n display: flex;\n flex-direction: column;\n font-size: 14px;\n a {\n text-decoration: none;\n color: inherit;\n }\n > div:first-of-type {\n display: flex;\n align-items: center;\n }\n .footer-brand-logo {\n display: flex;\n align-items: center;\n margin-right: 16px;\n line-height: 1;\n img,\n svg {\n width: auto;\n height: 44px;\n max-height: 44px;\n }\n }\n .footer-brand-name {\n font-size: 16px;\n font-weight: bold;\n }\n .footer-brand-desc {\n margin-top: 16px;\n }\n\n "," {\n width: auto;\n }\n\n "," {\n .footer-brand-logo {\n img,\n svg {\n height: 32px;\n max-height: 32px;\n }\n }\n }\n"])),(e=>e.theme.breakpoints.down("sm")),(e=>e.theme.breakpoints.down("md")));var y,k=t(9978),w=t(76720),j=t(79787);function T(e){let{links:n,flowLayout:t,...o}=e;const[i,l]=(0,s.useState)(-1);if(null===n||void 0===n||!n.length)return null;const a=n.some((e=>{var n;return null===(n=e.items)||void 0===n?void 0:n.length})),c=e=>{let{label:n,link:t,icon:o,render:i,props:s}=e,l=n;return i?l=i({label:n,link:t,props:s}):t&&(l=(0,r.jsx)("a",{href:t,"aria-label":"Footer link for ".concat(n),...s,children:n})),(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)(j.Z,{icon:o,size:20,sx:{mr:.5}}),l]})};return(0,r.jsx)(M,{...o,className:(0,k.Z)(o.className,{"footer-links--grouped":a,"footer-links--flow":t}),children:(0,r.jsxs)("div",{className:"footer-links-inner",children:[t&&n.map(((e,n)=>(0,r.jsx)("span",{className:"footer-links-item",children:c(e)},n))),!t&&n.map(((e,n)=>{const{items:t}=e,o=n===i;return(0,r.jsxs)("div",{className:(0,k.Z)("footer-links-group",{"footer-links-group--active":o}),onClick:()=>l(i===n?-1:n),children:[(0,r.jsxs)("span",{className:"footer-links-item",children:[c(e),!(null===t||void 0===t||!t.length)&&(0,r.jsx)("span",{className:"footer-links-group-expand-icon",children:(0,r.jsx)(w.Z,{style:{transform:"rotate(".concat(o?180:0,"deg)")}})})]}),!(null===t||void 0===t||!t.length)&&(0,r.jsx)("div",{className:"footer-links-sub",children:t.map(((e,n)=>(0,r.jsx)("span",{className:"footer-links-item",children:c(e)},n)))})]},n)}))]})})}T.propTypes={links:a().arrayOf(a().shape({label:a().string,link:a().string,render:a().func,props:a().object})),flowLayout:a().bool},T.defaultProps={links:[],flowLayout:!1};const M=(0,c.zo)("div")(y||(y=(0,i.Z)(["\n overflow: hidden;\n color: ",";\n .footer-links-inner {\n display: flex;\n justify-content: space-between;\n margin: 0 -8px;\n }\n .footer-links-group,\n .footer-links-sub {\n display: flex;\n flex-direction: column;\n }\n .footer-links-sub .footer-links-item {\n color: ",";\n }\n .footer-links-group-expand-icon {\n display: none;\n position: absolute;\n right: 16px;\n top: 50%;\n transform: translate(0, -50%);\n line-height: 1;\n svg {\n width: auto;\n height: 0.75em;\n }\n }\n .footer-links-item {\n display: inline-flex;\n align-items: center;\n position: relative;\n padding: 4px 8px;\n font-size: 14px;\n }\n &.footer-links--grouped {\n .footer-links-group {\n > .footer-links-item {\n font-weight: bold;\n }\n .footer-links-sub {\n margin-top: 8px;\n }\n }\n }\n a {\n display: inline-block;\n max-width: 150px;\n color: inherit;\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n\n &.footer-links--flow {\n display: inline-flex;\n .footer-links-inner {\n justify-content: center;\n flex-wrap: wrap;\n margin: 0 -8px;\n .footer-links-item {\n padding: 0 8px;\n }\n .footer-links-item + .footer-links-item::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translate(0, -50%);\n height: 1em;\n border-left: 1px solid ",";\n }\n }\n }\n\n "," {\n .footer-links-inner {\n flex-direction: column;\n margin: 0;\n }\n .footer-links-sub {\n display: none;\n }\n .footer-links-group {\n position: relative;\n padding: 12px 0;\n .footer-links-item .footer-links-group-expand-icon {\n display: inline-block;\n }\n }\n .footer-links-group + .footer-links-group {\n border-top: 1px solid ",";\n }\n .footer-links-group--active {\n .footer-links-sub {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n .footer-links-item {\n flex: 0 0 50%;\n }\n }\n }\n .footer-links-item {\n padding-left: 0;\n padding-right: 0;\n font-size: 13px;\n }\n &.footer-links--grouped {\n .footer-links-group {\n > .footer-links-item {\n font-size: 14px;\n }\n }\n }\n\n &.footer-links--flow {\n .footer-links-inner {\n flex-direction: row;\n }\n }\n }\n"])),(e=>e.theme.palette.grey[600]),(e=>e.theme.palette.grey[900]),(e=>e.theme.palette.grey[400]),(e=>e.theme.breakpoints.down("md")),(e=>e.theme.palette.grey[200]));var C;function A(e){let{items:n,...t}=e;const o=(0,c.Fg)();return null!==n&&void 0!==n&&n.length?(0,r.jsx)(Z,{...t,children:n.map(((e,n)=>(0,r.jsx)("a",{href:e.link,target:"_blank","aria-label":"Social media icon".concat(e.title?" for ".concat(e.title):""),rel:"noreferrer",children:(0,r.jsx)(j.Z,{icon:e.icon||e.title,sx:{bgcolor:o.palette.grey[600],color:"#fff"},size:24,component:"span"})},n)))}):null}A.propTypes={items:a().arrayOf(a().shape({icon:a().string,link:a().string}))},A.defaultProps={items:null};const Z=(0,c.zo)("div")(C||(C=(0,i.Z)(["\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 20px;\n a {\n color: ",";\n text-decoration: none;\n &:hover {\n color: ",";\n }\n }\n "," {\n gap: 12px;\n }\n"])),(e=>e.theme.palette.grey[400]),(e=>e.theme.palette.primary.light),(e=>e.theme.breakpoints.down("md")));var P;function E(e){let{owner:n,year:t,...o}=e;return(0,r.jsxs)(S,{...o,children:["Copyright \xa9 ",t," ",n]})}E.propTypes={owner:a().string,year:a().string},E.defaultProps={owner:"ArcBlock",year:"".concat((new Date).getFullYear())};const S=(0,c.zo)("p")(P||(P=(0,i.Z)(["\n display: flex;\n align-items: center;\n margin: 0;\n font-size: 13px;\n"])));var I,O=t(22139);function N(e){let{children:n,autoCenter:t,...o}=e;return n?(0,r.jsx)(z,{...o,className:(0,k.Z)(o.className,{"footer-row-auto-center":t}),children:n}):null}N.propTypes={children:a().any,autoCenter:a().bool},N.defaultProps={children:null,autoCenter:!1};const z=(0,c.zo)(v.Z)(I||(I=(0,i.Z)(["\n display: flex;\n justify-content: space-between;\n & + & {\n margin-top: 24px;\n }\n &.footer-row-auto-center > *:only-child {\n margin: 0 auto;\n }\n\n "," {\n align-items: stretch;\n flex-direction: column;\n gap: 16px;\n > * {\n flex: 1 0 100%;\n }\n &.footer-row-auto-center > * {\n margin: 0 auto;\n }\n }\n"])),(e=>e.theme.breakpoints.down("md")));var R;function _(e){var n;let{elements:t,data:o,...i}=e;return(0,r.jsx)(L,{...i,children:(0,r.jsxs)(O.Z,{children:[(0,r.jsxs)(v.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"center",md:"space-between"},gap:2,pb:3},children:[(0,r.jsx)(v.Z,{children:t.brand}),(0,r.jsx)(v.Z,{lineHeight:1,children:t.socialMedia})]}),!(null===(n=o.navigation)||void 0===n||!n.length)&&(0,r.jsx)(v.Z,{sx:{mb:6,pt:3,borderTop:1,borderColor:"grey.200"},children:t.navigation}),(0,r.jsxs)(N,{sx:{pt:3,borderTop:1,borderColor:"grey.200"},autoCenter:!0,children:[t.copyright,t.links]})]})})}_.propTypes={elements:a().shape({brand:a().element,navigation:a().element,socialMedia:a().element,copyright:a().element,links:a().element}).isRequired,data:a().object.isRequired};const L=(0,c.zo)("div")(R||(R=(0,i.Z)(["\n padding: 32px 0 24px 0;\n .footer-brand-name,\n .footer-brand-desc {\n display: none;\n }\n && .footer-brand-logo {\n margin-right: 0;\n }\n"]))),q=_;var F;function H(e){let{elements:n,data:t,...o}=e;return(0,r.jsx)(U,{...o,children:(0,r.jsxs)(O.Z,{className:"plain-layout-container",children:[!!t.links&&(0,r.jsxs)(N,{sx:{width:1},autoCenter:!0,children:[n.copyright,n.links]}),!t.links&&(0,r.jsxs)(r.Fragment,{children:[(0,s.cloneElement)(n.brand,{name:null,description:null}),n.copyright]})]})})}H.propTypes={elements:a().shape({brand:a().element,navigation:a().element,socialMedia:a().element,copyright:a().element,links:a().element}).isRequired,data:a().object.isRequired};const U=(0,c.zo)("div")(F||(F=(0,i.Z)(["\n padding: 24px 0;\n .plain-layout-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n }\n"]))),B=[{name:"plain",support:(e,n)=>{var t,o;return!(null!==(t=n.navigation)&&void 0!==t&&t.length)&&!(null!==(o=n.socialMedia)&&void 0!==o&&o.length)},component:H},{name:"standard",support:()=>!0,component:q}],D=B.reduce(((e,n)=>({...e,[n.name]:n})),{});function J(e){var n;const{brand:t,navigation:o,socialMedia:i,copyright:s,links:l,layout:a,...c}=e,d={brand:t?(0,r.jsx)(b,{...t}):null,navigation:null!==o&&void 0!==o&&o.length?(0,r.jsx)(T,{links:o}):null,socialMedia:null!==i&&void 0!==i&&i.length?(0,r.jsx)(A,{items:i}):null,copyright:(()=>{const e=(null===s||void 0===s?void 0:s.owner)||(null===t||void 0===t?void 0:t.name);return e?(0,r.jsx)(E,{owner:e,year:(null===s||void 0===s?void 0:s.year)||void 0}):null})(),links:null!==l&&void 0!==l&&l.length?(0,r.jsx)(T,{flowLayout:!0,links:l}):null};let u=null;var f;"auto"===a?u=B.find((n=>n.support(d,e))).component:u=null===(f=D[a])||void 0===f?void 0:f.component;if(!u)throw new Error("layout ".concat(a," is not supported."));return(0,r.jsxs)(v.Z,{position:"relative",...c,children:[(0,r.jsx)(u,{elements:d,data:e}),(0,r.jsx)(v.Z,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:null===(n=window)||void 0===n||null===(n=n.blocklet)||void 0===n?void 0:n.version})]})}J.propTypes={brand:a().shape({name:a().node,description:a().string,logo:a().node}),navigation:a().arrayOf(a().shape({label:a().node,link:a().string})),socialMedia:a().arrayOf(a().shape({icon:a().node,link:a().string})),copyright:a().shape({owner:a().string,year:a().oneOfType([a().string,a().number])}),links:a().arrayOf(a().shape({label:a().node,link:a().string})),layout:a().oneOf(["auto","standard","plain"])},J.defaultProps={brand:null,navigation:null,copyright:null,socialMedia:null,links:null,layout:"auto"};const $=J;var K,Q=t(6504),W=t(94457),X=t(615);function V(e){var n,t,o,i;let{meta:l,theme:a,...c}=e;const{locale:d}=(0,u.PE)()||{},f=(0,s.useMemo)((()=>{const e=Object.assign({},window.blocklet,l);try{return(0,W.RX)(e)}catch(n){return console.error("Failed to format blocklet info",n,e),e}}),[l]);if(!f.appName)return null;const{appLogo:p,appLogoRect:h,appName:v,appDescription:b,description:x,theme:y,copyright:k}=f,w={footerNav:(0,W.KN)(null===f||void 0===f||null===(n=f.navigation)||void 0===n?void 0:n.footer,d)||[],socialMedia:(0,W.KN)(null===f||void 0===f||null===(t=f.navigation)||void 0===t?void 0:t.social,d)||[],links:(0,W.KN)(null===f||void 0===f||null===(o=f.navigation)||void 0===o?void 0:o.bottom,d)||[]},j={brand:{name:v,description:b||x,logo:h||p},navigation:(0,Q._J)(w.footerNav,(e=>({...e,label:e.title,link:e.link})),"items"),copyright:k,socialMedia:w.socialMedia,links:w.links.map((e=>({...e,label:e.title})))};return(0,r.jsx)(m.Z,{theme:a,children:(0,r.jsx)(G,{...j,...g()(c,["bordered"]),$bordered:null===c||void 0===c?void 0:c.bordered,$bgcolor:null===y||void 0===y||null===(i=y.background)||void 0===i?void 0:i.footer})})}V.propTypes={meta:X.u,theme:a().object},V.defaultProps={meta:{},theme:null};const G=(0,c.zo)($)(K||(K=(0,i.Z)(["\n ","\n color: ",";\n ","\n font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n"])),(e=>{let{$bordered:n}=e;return"border-top: 1px solid ".concat(n?p.E.strokeSep:"#eee",";")}),(e=>e.theme.palette.grey[600]),(e=>{let{$bgcolor:n}=e;return n&&"background-color: ".concat(n,";")})),Y=(0,d.withErrorBoundary)(V,{FallbackComponent:f.H})},1192:(e,n,t)=>{t.d(n,{Z:()=>A});var o,i=t(71171),r=t(96266),s=t(5057),l=t(55898),a=t.n(l),c=t(52439),d=t(71569),u=t(47685),f=t(60391),p=t(48250),h=t(68420),g=t(76223),m=t(24914),v=t.n(m),b=t(79787),x=t(9498),y=t(615),k=t(6504),w=t(94457),j=t(59763),T=t(25162);function M(e){var n,t;let{meta:o,addons:i,sessionManagerProps:l,homeLink:a,theme:c,hideNavMenu:d,...u}=e;(0,T.x)();const{locale:f}=(0,h.PE)()||{},g=(0,s.useMemo)((()=>{const e=Object.assign({},window.blocklet,o);try{return(0,w.RX)(e)}catch(n){return console.error("Failed to format blocklet info",n,e),e}}),[o]);if(!g.appName)return null;const{appLogo:m,appLogoRect:y,theme:M}=g,A=(e=>{if(null===e||void 0===e||!e.length)return{navItems:[],activeId:null};let n=1;const t=(0,k._J)(e,(e=>{var t,o;const i=e.icon?(0,r.jsx)(b.Z,{icon:e.icon}):null;if(e.items)return{id:"".concat(n++),label:e.title,icon:i,children:e.items};let s={};return(null!==(t=e.link)&&void 0!==t&&t.startsWith("http://")||null!==(o=e.link)&&void 0!==o&&o.startsWith("https://"))&&(s={target:"_blank",rel:"noreferrer"}),{id:"".concat(n++),label:(0,r.jsx)("a",{href:e.link,...s,children:e.title}),icon:i,link:e.link}}),"items"),o=(0,k.Ik)(t),i=(0,k.RX)(o.map((e=>e.link)));return{navItems:t,activeId:i>=0?o[i].id:null}})((0,w.KN)(null===g||void 0===g||null===(n=g.navigation)||void 0===n?void 0:n.header,f)),{navItems:Z,activeId:P}=A,E="function"===typeof i?e=>i(e,{navigation:A}):i,S=(0,r.jsx)(j.Z,{formattedBlocklet:g,addons:E,sessionManagerProps:l});return(0,r.jsx)(x.Z,{theme:c,children:(0,r.jsx)(C,{homeLink:a,logo:(0,r.jsx)("img",{src:y||m,alt:"logo"}),addons:S,...v()(u,["bordered"]),$bordered:null===u||void 0===u?void 0:u.bordered,$bgcolor:null===M||void 0===M||null===(t=M.background)||void 0===t?void 0:t.header,children:d||null===Z||void 0===Z||!Z.length?null:e=>{let{isMobile:n}=e;return(0,r.jsx)(p.Z,{mode:n?"inline":"horizontal",activeId:P,items:Z,className:"header-nav",bgColor:"transparent",textColor:"#777"})}})})}M.propTypes={meta:y.u,addons:a().oneOfType([a().func,a().node]),sessionManagerProps:y.r,homeLink:a().string,theme:a().object,hideNavMenu:a().bool},M.defaultProps={meta:{},addons:null,sessionManagerProps:{showRole:!0},homeLink:w.iU,theme:null,hideNavMenu:!1};const C=(0,u.zo)(f.z)(o||(o=(0,i.Z)(["\n ","\n font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n .header-logo {\n min-width: 44px;\n }\n ","\n "," {\n .header-logo {\n min-width: 32px;\n }\n }\n .header-nav {\n .navmenu-sub .navmenu-item {\n min-width: 80px;\n }\n }\n .header-nav.navmenu--horizontal {\n .navmenu-root > .navmenu-sub,\n .navmenu-root > .navmenu-item {\n padding: 16px 4px;\n\n .navmenu-sub-container {\n padding-top: 0;\n }\n }\n .navmenu-item-icon > .MuiAvatar-root,\n .navmenu-sub-icon > .MuiAvatar-root {\n width: 20px;\n height: 20px;\n }\n }\n"])),(e=>{let{$bgcolor:n}=e;return"background-color: ".concat(n||"#fff",";")}),(e=>{let{$bordered:n}=e;return n?"border-bottom: 1px solid ".concat(g.E.strokeSep,";"):""}),(e=>e.theme.breakpoints.down("md"))),A=(0,c.withErrorBoundary)(M,{FallbackComponent:d.H})},79787:(e,n,t)=>{t.d(n,{Z:()=>a});var o=t(96266),i=(t(49631),t(55898)),r=t.n(i),s=t(62681),l=t(6504);function a(e){let{icon:n,size:t,sx:i,...r}=e;const a=[...Array.isArray(i)?i:[i]];if(t&&a.push({width:t,height:t}),r.variant||a.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),(0,l.CB)(n))return(0,o.jsx)(s.Z,{as:"span",...r,src:n,sx:a});if((0,l.Xk)(n)){const e=t?.6*t+4:0;return(0,o.jsx)(s.Z,{as:"span",...r,sx:a,children:(0,o.jsx)("iconify-icon",{icon:n,height:e||void 0})})}return n&&"string"===typeof n?(a.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),(0,o.jsx)(s.Z,{as:"span",...r,sx:a,children:Array.from(n)[0]})):null}a.propTypes={icon:r().string.isRequired,size:r().number,sx:r().oneOfType([r().array,r().func,r().object])},a.defaultProps={size:null,sx:null}},94457:(e,n,t)=>{t.d(n,{KN:()=>l,Kb:()=>u,RX:()=>c,iU:()=>s});var o,i,r=t(6504);const s=(null===(o=window)||void 0===o||null===(o=o.blocklet)||void 0===o?void 0:o.groupPrefix)||(null===(i=window)||void 0===i||null===(i=i.blocklet)||void 0===i?void 0:i.prefix)||"/",l=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";if(null===e||void 0===e||!e.length)return e;const t=(e,n)=>{if("string"===typeof e){if((0,r.CB)(e)){const t=new URL(e);return t.searchParams.set("locale",n),t.href}const t=new URL(e,window.location.origin);return t.searchParams.set("locale",n),t.pathname+t.search}return"object"===typeof e?e[n]||(null===e||void 0===e?void 0:e.en)||(null===e||void 0===e?void 0:e.zh):e};return(0,r._J)(e,(e=>{var o,i,r;return{...e,title:(i=e.title,r=n,"string"===typeof i?i:"object"===typeof i?i[r]||(null===i||void 0===i?void 0:i.en)||(null===i||void 0===i?void 0:i.zh):i),link:null!==(o=e.items)&&void 0!==o&&o.length?e.link:t(e.link,n),_rawLink:e.link}}),"items")},a=e=>{if(null===e||void 0===e||!e.length)return null;const n=(e=>(0,r._J)(e,(e=>e.role?{...e,role:Array.isArray(e.role)?e.role:[e.role]}:e),"items"))(e),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return n.forEach((e=>{if(e.section){if(Array.isArray(e.section))e.section.forEach((n=>{var o;null===(o=t[n])||void 0===o||o.push(e)}));else if("string"===typeof e.section){var n;null===(n=t[e.section])||void 0===n||n.push(e)}}else t.header.push(e)})),t},c=e=>{if(!e)return null;const n={...e};return n.theme=(e=>{const n={...e},t=null===e||void 0===e?void 0:e.background;return"string"===typeof t?n.background={header:t,footer:t,default:t}:t&&"object"===typeof t&&(n.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),n})(n.theme),n.navigation=a(d(n.navigation)),n},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,r.fA)(e,((e,n)=>{var t;return!!e.link||(null===(t=n.filteredChildren)||void 0===t?void 0:t.length)}),"items")},u=(e,n)=>(0,r.fA)(e,((e,t)=>{const o=!e.role||n&&e.role.includes(n);var i;return t.isLeaf?o:o&&(null===(i=t.filteredChildren)||void 0===i?void 0:i.length)}),"items")},59763:(e,n,t)=>{t.d(n,{Z:()=>N});var o=t(96266),i=(t(49631),t(5057)),r=t(55898),s=t.n(r),l=t(47220),a=t(51724),c=t(67680),d=t(49020),u=t(72113),f=t(7469),p=t(25228),h=t(19577),g=t(2478),m=t(79278),v=t(39948),b=t(11750),x=t(55498);const y={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},k={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};var w=t(12673),j=t(99360),T=t(28726),M=t(76223),C=t(21998),A=t(43907),Z=t(14520);function P(e){var n;let{session:t,locale:r,size:s}=e;const l=(null===(n=window)||void 0===n?void 0:n.blocklet)||{},a=(l.navigation||[]).filter((e=>"sessionManager"===e.section&&!["/sessionManager"].includes(e.id))).filter((e=>{var n;return!!((null===e||void 0===e?void 0:e.role)||[]).includes((null===t||void 0===t||null===(n=t.user)||void 0===n?void 0:n.role)||"guest")})).map((e=>{const n=((null===l||void 0===l?void 0:l.componentMountPoints)||[]).find((n=>e.component===n.name));return{...e,component:n}})),P=(0,i.useRef)(null),E=(0,w.Z)({open:!1}),S=(0,j.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!E.open;E.open=e}));return 0!==a.length&&null!==t&&void 0!==t&&t.user?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.Z,{size:"medium",ref:P,onClick:()=>S(),children:(0,o.jsx)(x.JO,{icon:y,fontSize:s,style:{transform:"scale(1.08)"}})}),(0,o.jsx)(d.Z,{open:E.open,onClose:()=>S(!1),anchorEl:P.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:e=>{let{TransitionProps:n}=e;return(0,o.jsx)(u.d,{onClickAway:e=>{e.preventDefault(),e.stopPropagation(),S(!1)},children:(0,o.jsx)(f.Z,{...n,timeout:350,children:(0,o.jsxs)(p.Z,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:M.E.lineStep,p:2,border:"0 !important",boxShadow:"0px 8px 16px 0px ".concat(M.E.gray6,", 0px 0px 0px 1px ").concat(M.E.gray6)},children:[(0,o.jsx)(h.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:a.map((e=>{var n;return(0,o.jsx)(g.ZP,{disablePadding:!0,children:(0,o.jsxs)(m.Z,{href:e.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:M.E.surfacePrimarySubtitle}},children:[null!==e&&void 0!==e&&null!==(n=e.component)&&void 0!==n&&n.did?(0,o.jsx)(v.Z,{component:"img",src:"".concat(C.Bu,"/blocklet/logo-bundle/").concat(e.component.did),sx:{borderRadius:2,width:50,height:50,objectFit:"contain"}}):(0,o.jsx)(x.JO,{fontSize:50,icon:e.icon||k,color:M.E.textSubtitle}),(0,o.jsx)(b.Z,{sx:{fontSize:"12px",color:M.E.textBase,textAlign:"center",lineHeight:"normal"},children:(0,Z.i0)(e.title,r)})]})},e.id)}))}),(0,o.jsx)(A.Z,{session:t,children:(0,o.jsx)(T.Z,{variant:"outlined",fullWidth:!0,href:C.Rt,sx:{mt:1,borderRadius:2,color:M.E.textBase,borderColor:M.E.lineBorderStrong,"&:hover":{color:M.E.primaryBase,borderColor:M.E.primaryBase}},children:"zh"===r?"\u7ba1\u7406":"Manage"})})]})})})}})]}):null}P.propTypes={session:s().object.isRequired,locale:s().string,size:s().number},P.defaultProps={locale:"en",size:24};var E=t(30296),S=t(68420),I=t(615),O=t(94457);function N(e){var n,t,r;let{formattedBlocklet:s,addons:c,sessionManagerProps:d}=e;const u=(0,i.useContext)(l.B3),{locale:f}=(0,S.PE)()||{},{enableConnect:p=!0,enableLocale:h=!0}=s,g=!(null===u||void 0===u||null===(n=u.session)||void 0===n||!n.user);let m=(0,O.KN)(null===s||void 0===s||null===(t=s.navigation)||void 0===t?void 0:t.sessionManager,f)||[];m=(0,O.Kb)(m,null===u||void 0===u||null===(r=u.session)||void 0===r||null===(r=r.user)||void 0===r?void 0:r.role);const v=(()=>{if(c&&"function"!==typeof c)return Array.isArray(c)?c:[c];let e=[];if(h&&f&&e.push((0,o.jsx)(E.Z,{showText:!1},"locale-selector")),p&&u){const n=[];if(g){(m?m.slice(0,5):[]).forEach((e=>{n.push({label:e.title,icon:e.icon?(0,o.jsx)("iconify-icon",{icon:e.icon,height:24,style:{marginRight:8}}):null,component:"a",href:e.link,key:e.link})}))}e.push((0,o.jsx)(P,{session:u.session,locale:f},"session-blocklet")),e.push((0,o.jsx)(a.Z,{session:u.session,locale:f,menu:n,showRole:!0,...d},"session-user"))}return"function"===typeof c&&(e=c(e)||[]),e})();return(0,i.createElement)(o.Fragment,null,...Array.isArray(v)?v:[v])}N.propTypes={formattedBlocklet:s().object.isRequired,addons:s().oneOfType([s().func,s().node]),sessionManagerProps:I.r},N.defaultProps={addons:null,sessionManagerProps:{showRole:!0}}},9498:(e,n,t)=>{t.d(n,{Z:()=>a});var o=t(96266),i=t(55898),r=t.n(i),s=t(47685);const l=(0,s.jG)();function a(e){let{theme:n,children:t}=e;const i=n?(0,s.jG)(n):l;return(0,o.jsx)(s.f6,{theme:i,children:t})}a.propTypes={children:r().any.isRequired,theme:r().object},a.defaultProps={theme:null}},25162:(e,n,t)=>{t.d(n,{x:()=>s});var o=t(5057),i=t(60829),r=t(15632);const s=()=>{const e=(0,i.Z)();(0,o.useEffect)((()=>{e.wallet&&r.Z.call("arcHideTopBar","{}")}),[e])}},615:(e,n,t)=>{t.d(n,{r:()=>s,u:()=>r});var o=t(55898),i=t.n(o);const r=i().shape({appLogo:i().node,appName:i().string,theme:i().shape({background:i().string}),enableConnect:i().bool,enableLocale:i().bool,navigation:i().arrayOf(i().shape({title:i().oneOfType([i().string,i().object]),link:i().oneOfType([i().string,i().object]),icon:i().string,items:i().arrayOf(i().shape({title:i().oneOfType([i().string,i().object]),link:i().oneOfType([i().string,i().object])}))}))}),s=i().shape({showText:i().bool,showRole:i().bool,switchDid:i().bool,switchProfile:i().bool,switchPassport:i().bool,disableLogout:i().bool,onLogin:i().func,onLogout:i().func,onSwitchDid:i().func,onSwitchProfile:i().func,onSwitchPassport:i().func,menu:i().array,menuRender:i().func,dark:i().bool,size:i().number})},6504:(e,n,t)=>{t.d(n,{CB:()=>s,Ik:()=>i,RX:()=>a,Xk:()=>l,_J:()=>o,fA:()=>r});const o=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return e.map((e=>Array.isArray(e[t])?n({...e,[t]:o(e[t],n,t)}):n(e)))},i=function(e){const n=[];return o(e,(e=>n.push(e)),arguments.length>1&&void 0!==arguments[1]?arguments[1]:"children"),n},r=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children";return e.map((e=>({...e}))).filter((e=>{const o=e[t];if(Array.isArray(o)){const i=r(o,n,t);e[t]=null!==i&&void 0!==i&&i.length?i:void 0}const i={filteredChildren:e[t],isLeaf:!(null!==o&&void 0!==o&&o.length)};return n(e,i)}))},s=e=>/^https?:\/\//.test(e),l=e=>/^[\w-]+:[\w-]+$/.test(e),a=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(((e,n)=>({path:e,index:n}))).filter((e=>(e=>{if(!e||null===e||void 0===e||!e.startsWith("/"))return!1;const n=e=>e.endsWith("/")?e:"".concat(e,"/"),t=n(window.location.pathname),o=n(new URL(e,window.location.origin).pathname);return t.startsWith(o)})(e.path)));if(null===e||void 0===e||!e.length)return-1;return e.slice(1).reduce(((e,n)=>e.path.length>=n.path.length?e:n),e[0]).index}},49631:(e,n,t)=>{var o=t(56666);const i=Object.freeze({left:0,top:0,width:16,height:16}),r=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),s=Object.freeze({...i,...r}),l=Object.freeze({...s,body:"",hidden:!1}),a=Object.freeze({width:null,height:null}),c=Object.freeze({...a,...r});const d=/[\s,]+/;const u={...c,preserveAspectRatio:""};function f(e){const n={...u},t=(n,t)=>e.getAttribute(n)||t;var o;return n.width=t("width",null),n.height=t("height",null),n.rotate=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const t=e.replace(/^-?[0-9.]*/,"");function o(e){for(;e<0;)e+=4;return e%4}if(""===t){const n=parseInt(e);return isNaN(n)?0:o(n)}if(t!==e){let n=0;switch(t){case"%":n=25;break;case"deg":n=90}if(n){let i=parseFloat(e.slice(0,e.length-t.length));return isNaN(i)?0:(i/=n,i%1===0?o(i):0)}}return n}(t("rotate","")),o=n,t("flip","").split(d).forEach((e=>{switch(e.trim()){case"horizontal":o.hFlip=!0;break;case"vertical":o.vFlip=!0}})),n.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),n}const p=/^[a-z0-9]+(-[a-z0-9]+)*$/,h=function(e,n,t){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const i=e.split(":");if("@"===e.slice(0,1)){if(i.length<2||i.length>3)return null;o=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const e=i.pop(),t=i.pop(),r={provider:i.length>0?i[0]:o,prefix:t,name:e};return n&&!g(r)?null:r}const r=i[0],s=r.split("-");if(s.length>1){const e={provider:o,prefix:s.shift(),name:s.join("-")};return n&&!g(e)?null:e}if(t&&""===o){const e={provider:o,prefix:"",name:r};return n&&!g(e,t)?null:e}return null},g=(e,n)=>!!e&&!(""!==e.provider&&!e.provider.match(p)||!(n&&""===e.prefix||e.prefix.match(p))||!e.name.match(p));function m(e,n){const t=function(e,n){const t={};!e.hFlip!==!n.hFlip&&(t.hFlip=!0),!e.vFlip!==!n.vFlip&&(t.vFlip=!0);const o=((e.rotate||0)+(n.rotate||0))%4;return o&&(t.rotate=o),t}(e,n);for(const o in l)o in r?o in e&&!(o in t)&&(t[o]=r[o]):o in n?t[o]=n[o]:o in e&&(t[o]=e[o]);return t}function v(e,n,t){const o=e.icons,i=e.aliases||Object.create(null);let r={};function s(e){r=m(o[e]||i[e],r)}return s(n),t.forEach(s),m(e,r)}function b(e,n){const t=[];if("object"!==typeof e||"object"!==typeof e.icons)return t;e.not_found instanceof Array&&e.not_found.forEach((e=>{n(e,null),t.push(e)}));const o=function(e,n){const t=e.icons,o=e.aliases||Object.create(null),i=Object.create(null);return(n||Object.keys(t).concat(Object.keys(o))).forEach((function e(n){if(t[n])return i[n]=[];if(!(n in i)){i[n]=null;const t=o[n]&&o[n].parent,r=t&&e(t);r&&(i[n]=[t].concat(r))}return i[n]})),i}(e);for(const i in o){const r=o[i];r&&(n(i,v(e,i,r)),t.push(i))}return t}const x={provider:"",aliases:{},not_found:{},...i};function y(e,n){for(const t in n)if(t in e&&typeof e[t]!==typeof n[t])return!1;return!0}function k(e){if("object"!==typeof e||null===e)return null;const n=e;if("string"!==typeof n.prefix||!e.icons||"object"!==typeof e.icons)return null;if(!y(e,x))return null;const t=n.icons;for(const i in t){const e=t[i];if(!i.match(p)||"string"!==typeof e.body||!y(e,l))return null}const o=n.aliases||Object.create(null);for(const i in o){const e=o[i],n=e.parent;if(!i.match(p)||"string"!==typeof n||!t[n]&&!o[n]||!y(e,l))return null}return n}const w=Object.create(null);function j(e,n){const t=w[e]||(w[e]=Object.create(null));return t[n]||(t[n]=function(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}(e,n))}function T(e,n){return k(n)?b(n,((n,t)=>{t?e.icons[n]=t:e.missing.add(n)})):[]}function M(e,n){let t=[];return("string"===typeof e?[e]:Object.keys(w)).forEach((e=>{("string"===typeof e&&"string"===typeof n?[n]:Object.keys(w[e]||{})).forEach((n=>{const o=j(e,n);t=t.concat(Object.keys(o.icons).map((t=>(""!==e?"@"+e+":":"")+n+":"+t)))}))})),t}let C=!1;function A(e){return"boolean"===typeof e&&(C=e),C}function Z(e){const n="string"===typeof e?h(e,!0,C):e;if(n){const e=j(n.provider,n.prefix),t=n.name;return e.icons[t]||(e.missing.has(t)?null:void 0)}}function P(e,n){const t=h(e,!0,C);if(!t)return!1;return function(e,n,t){try{if("string"===typeof t.body)return e.icons[n]={...t},!0}catch(o){}return!1}(j(t.provider,t.prefix),t.name,n)}function E(e,n){if("object"!==typeof e)return!1;if("string"!==typeof n&&(n=e.provider||""),C&&!n&&!e.prefix){let n=!1;return k(e)&&(e.prefix="",b(e,((e,t)=>{t&&P(e,t)&&(n=!0)}))),n}const t=e.prefix;if(!g({provider:n,prefix:t,name:"a"}))return!1;return!!T(j(n,t),e)}function S(e){return!!Z(e)}function I(e){const n=Z(e);return n?{...s,...n}:null}function O(e,n){e.forEach((e=>{const t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter((e=>e.id!==n)))}))}let N=0;const z=Object.create(null);function R(e,n){z[e]=n}function _(e){return z[e]||z[""]}var L={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function q(e,n,t,o){const i=e.resources.length,r=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let n=e.resources.slice(0);for(s=[];n.length>1;){const e=Math.floor(Math.random()*n.length);s.push(n[e]),n=n.slice(0,e).concat(n.slice(e+1))}s=s.concat(n)}else s=e.resources.slice(r).concat(e.resources.slice(0,r));const l=Date.now();let a,c="pending",d=0,u=null,f=[],p=[];function h(){u&&(clearTimeout(u),u=null)}function g(){"pending"===c&&(c="aborted"),h(),f.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),f=[]}function m(e,n){n&&(p=[]),"function"===typeof e&&p.push(e)}function v(){c="failed",p.forEach((e=>{e(void 0,a)}))}function b(){f.forEach((e=>{"pending"===e.status&&(e.status="aborted")})),f=[]}function x(){if("pending"!==c)return;h();const o=s.shift();if(void 0===o)return f.length?void(u=setTimeout((()=>{h(),"pending"===c&&(b(),v())}),e.timeout)):void v();const i={status:"pending",resource:o,callback:(n,t)=>{!function(n,t,o){const i="success"!==t;switch(f=f.filter((e=>e!==n)),c){case"pending":break;case"failed":if(i||!e.dataAfterTimeout)return;break;default:return}if("abort"===t)return a=o,void v();if(i)return a=o,void(f.length||(s.length?x():v()));if(h(),b(),!e.random){const t=e.resources.indexOf(n.resource);-1!==t&&t!==e.index&&(e.index=t)}c="completed",p.forEach((e=>{e(o)}))}(i,n,t)}};f.push(i),d++,u=setTimeout(x,e.rotate),t(o,n,i.callback)}return"function"===typeof o&&p.push(o),setTimeout(x),function(){return{startTime:l,payload:n,status:c,queriesSent:d,queriesPending:f.length,subscribe:m,abort:g}}}function F(e){const n={...L,...e};let t=[];function o(){t=t.filter((e=>"pending"===e().status))}return{query:function(e,i,r){const s=q(n,e,i,((e,n)=>{o(),r&&r(e,n)}));return t.push(s),s},find:function(e){return t.find((n=>e(n)))||null},setIndex:e=>{n.index=e},getIndex:()=>n.index,cleanup:o}}function H(e){let n;if("string"===typeof e.resources)n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const U=Object.create(null),B=["https://api.simplesvg.com","https://api.unisvg.com"],D=[];for(;B.length>0;)1===B.length||Math.random()>.5?D.push(B.shift()):D.push(B.pop());function J(e,n){const t=H(n);return null!==t&&(U[e]=t,!0)}function $(e){return U[e]}function K(){return Object.keys(U)}function Q(){}U[""]=H({resources:["https://api.iconify.design"].concat(D)});const W=Object.create(null);function X(e,n,t){let o,i;if("string"===typeof e){const n=_(e);if(!n)return t(void 0,424),Q;i=n.send;const r=function(e){if(!W[e]){const n=$(e);if(!n)return;const t={config:n,redundancy:F(n)};W[e]=t}return W[e]}(e);r&&(o=r.redundancy)}else{const n=H(e);if(n){o=F(n);const t=_(e.resources?e.resources[0]:"");t&&(i=t.send)}}return o&&i?o.query(n,i,t)().abort:(t(void 0,424),Q)}const V="iconify2",G="iconify",Y=G+"-count",ee=G+"-version",ne=36e5,te=168;function oe(e,n){try{return e.getItem(n)}catch(t){}}function ie(e,n,t){try{return e.setItem(n,t),!0}catch(o){}}function re(e,n){try{e.removeItem(n)}catch(t){}}function se(e,n){return ie(e,Y,n.toString())}function le(e){return parseInt(oe(e,Y))||0}const ae={local:!0,session:!0},ce={local:new Set,session:new Set};let de=!1;let ue="undefined"===typeof window?{}:window;function fe(e){const n=e+"Storage";try{if(ue&&ue[n]&&"number"===typeof ue[n].length)return ue[n]}catch(t){}ae[e]=!1}function pe(e,n){const t=fe(e);if(!t)return;const o=oe(t,ee);if(o!==V){if(o){const e=le(t);for(let n=0;n<e;n++)re(t,G+n.toString())}return ie(t,ee,V),void se(t,0)}const i=Math.floor(Date.now()/ne)-te,r=e=>{const o=G+e.toString(),r=oe(t,o);if("string"===typeof r){try{const t=JSON.parse(r);if("object"===typeof t&&"number"===typeof t.cached&&t.cached>i&&"string"===typeof t.provider&&"object"===typeof t.data&&"string"===typeof t.data.prefix&&n(t,e))return!0}catch(s){}re(t,o)}};let s=le(t);for(let l=s-1;l>=0;l--)r(l)||(l===s-1?(s--,se(t,s)):ce[e].add(l))}function he(){if(!de){de=!0;for(const e in ae)pe(e,(e=>{const n=e.data,t=j(e.provider,n.prefix);if(!T(t,n).length)return!1;const o=n.lastModified||-1;return t.lastModifiedCached=t.lastModifiedCached?Math.min(t.lastModifiedCached,o):o,!0}))}}function ge(e,n){function t(t){let o;if(!ae[t]||!(o=fe(t)))return;const i=ce[t];let r;if(i.size)i.delete(r=Array.from(i).shift());else if(r=le(o),!se(o,r+1))return;const s={cached:Math.floor(Date.now()/ne),provider:e.provider,data:n};return ie(o,G+r.toString(),JSON.stringify(s))}de||he(),n.lastModified&&!function(e,n){const t=e.lastModifiedCached;if(t&&t>=n)return t===n;if(e.lastModifiedCached=n,t)for(const o in ae)pe(o,(t=>{const o=t.data;return t.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===n}));return!0}(e,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&delete(n=Object.assign({},n)).not_found,t("local")||t("session"))}function me(){}function ve(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout((()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout((()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const o=e.provider,i=e.prefix;n.forEach((n=>{const r=n.icons,s=r.pending.length;r.pending=r.pending.filter((n=>{if(n.prefix!==i)return!0;const s=n.name;if(e.icons[s])r.loaded.push({provider:o,prefix:i,name:s});else{if(!e.missing.has(s))return t=!0,!0;r.missing.push({provider:o,prefix:i,name:s})}return!1})),r.pending.length!==s&&(t||O([e],n.id),n.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),n.abort))}))})))}(e)})))}const be=(e,n)=>{const t=function(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];return e.forEach((e=>{const i="string"===typeof e?h(e,n,t):e;i&&o.push(i)})),o}(e,!0,A()),o=function(e){const n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort(((e,n)=>e.provider!==n.provider?e.provider.localeCompare(n.provider):e.prefix!==n.prefix?e.prefix.localeCompare(n.prefix):e.name.localeCompare(n.name)));let o={provider:"",prefix:"",name:""};return e.forEach((e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;const i=e.provider,r=e.prefix,s=e.name,l=t[i]||(t[i]=Object.create(null)),a=l[r]||(l[r]=j(i,r));let c;c=s in a.icons?n.loaded:""===r||a.missing.has(s)?n.missing:n.pending;const d={provider:i,prefix:r,name:s};c.push(d)})),n}(t);if(!o.pending.length){let e=!0;return n&&setTimeout((()=>{e&&n(o.loaded,o.missing,o.pending,me)})),()=>{e=!1}}const i=Object.create(null),r=[];let s,l;return o.pending.forEach((e=>{const{provider:n,prefix:t}=e;if(t===l&&n===s)return;s=n,l=t,r.push(j(n,t));const o=i[n]||(i[n]=Object.create(null));o[t]||(o[t]=[])})),o.pending.forEach((e=>{const{provider:n,prefix:t,name:o}=e,r=j(n,t),s=r.pendingIcons||(r.pendingIcons=new Set);s.has(o)||(s.add(o),i[n][t].push(o))})),r.forEach((e=>{const{provider:n,prefix:t}=e;i[n][t].length&&function(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout((()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:t}=e,o=e.iconsToLoad;let i;delete e.iconsToLoad,o&&(i=_(n))&&i.prepare(n,t,o).forEach((t=>{X(n,t,(n=>{if("object"!==typeof n)t.icons.forEach((n=>{e.missing.add(n)}));else try{const t=T(e,n);if(!t.length)return;const o=e.pendingIcons;o&&t.forEach((e=>{o.delete(e)})),ge(e,n)}catch(o){console.error(o)}ve(e)}))}))})))}(e,i[n][t])})),n?function(e,n,t){const o=N++,i=O.bind(null,t,o);if(!n.pending.length)return i;const r={id:o,icons:n,callback:e,abort:i};return t.forEach((e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(r)})),i}(n,o,r):me},xe=e=>new Promise(((n,t)=>{const o="string"===typeof e?h(e,!0):e;o?be([o||e],(i=>{if(i.length&&o){const e=Z(o);if(e)return void n({...s,...e})}t(e)})):t(e)}));function ye(e,n){const t="string"===typeof e?h(e,!0,!0):null;if(!t){const n=function(e){try{const n="string"===typeof e?JSON.parse(e):e;if("string"===typeof n.body)return{...n}}catch(n){}}(e);return{value:e,data:n}}const o=Z(t);if(void 0!==o||!t.prefix)return{value:e,name:t,data:o};const i=be([t],(()=>n(e,t,Z(t))));return{value:e,name:t,loading:i}}function ke(e){return e.hasAttribute("inline")}let we=!1;try{we=0===navigator.vendor.indexOf("Apple")}catch(cn){}const je=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Te=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Me(e,n,t){if(1===n)return e;if(t=t||100,"number"===typeof e)return Math.ceil(e*n*t)/t;if("string"!==typeof e)return e;const o=e.split(je);if(null===o||!o.length)return e;const i=[];let r=o.shift(),s=Te.test(r);for(;;){if(s){const e=parseFloat(r);isNaN(e)?i.push(r):i.push(Math.ceil(e*n*t)/t)}else i.push(r);if(r=o.shift(),void 0===r)return i.join("");s=!s}}const Ce=e=>"unset"===e||"undefined"===e||"none"===e;function Ae(e,n){const t={...s,...e},o={...c,...n},i={left:t.left,top:t.top,width:t.width,height:t.height};let r=t.body;[t,o].forEach((e=>{const n=[],t=e.hFlip,o=e.vFlip;let s,l=e.rotate;switch(t?o?l+=2:(n.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),n.push("scale(-1 1)"),i.top=i.left=0):o&&(n.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),n.push("scale(1 -1)"),i.top=i.left=0),l<0&&(l-=4*Math.floor(l/4)),l%=4,l){case 1:s=i.height/2+i.top,n.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:n.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:s=i.width/2+i.left,n.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}l%2===1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),n.length&&(r='<g transform="'+n.join(" ")+'">'+r+"</g>")}));const l=o.width,a=o.height,d=i.width,u=i.height;let f,p;null===l?(p=null===a?"1em":"auto"===a?u:a,f=Me(p,d/u)):(f="auto"===l?d:l,p=null===a?Me(f,u/d):"auto"===a?u:a);const h={},g=(e,n)=>{Ce(n)||(h[e]=n.toString())};return g("width",f),g("height",p),h.viewBox=i.left.toString()+" "+i.top.toString()+" "+d.toString()+" "+u.toString(),{attributes:h,body:r}}let Ze=(()=>{let e;try{if(e=fetch,"function"===typeof e)return e}catch(cn){}})();function Pe(e){Ze=e}function Ee(){return Ze}const Se={prepare:(e,n,t)=>{const o=[],i=function(e,n){const t=$(e);if(!t)return 0;let o;if(t.maxURL){let e=0;t.resources.forEach((n=>{const t=n;e=Math.max(e,t.length)}));const i=n+".json?icons=";o=t.maxURL-e-t.path.length-i.length}else o=0;return o}(e,n),r="icons";let s={type:r,provider:e,prefix:n,icons:[]},l=0;return t.forEach(((t,a)=>{l+=t.length+1,l>=i&&a>0&&(o.push(s),s={type:r,provider:e,prefix:n,icons:[]},l=t.length),s.icons.push(t)})),o.push(s),o},send:(e,n,t)=>{if(!Ze)return void t("abort",424);let o=function(e){if("string"===typeof e){const n=$(e);if(n)return n.path}return"/"}(n.provider);switch(n.type){case"icons":{const e=n.prefix,t=n.icons.join(",");o+=e+".json?"+new URLSearchParams({icons:t}).toString();break}case"custom":{const e=n.uri;o+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void t("abort",400)}let i=503;Ze(e+o).then((e=>{const n=e.status;if(200===n)return i=501,e.json();setTimeout((()=>{t(function(e){return 404===e}(n)?"abort":"next",n)}))})).then((e=>{"object"===typeof e&&null!==e?setTimeout((()=>{t("success",e)})):setTimeout((()=>{404===e?t("abort",e):t("next",i)}))})).catch((()=>{t("next",i)}))}};function Ie(e,n){switch(e){case"local":case"session":ae[e]=n;break;case"all":for(const e in ae)ae[e]=n}}const Oe="data-style";let Ne="";function ze(e){Ne=e}function Re(e,n){let t=Array.from(e.childNodes).find((e=>e.hasAttribute&&e.hasAttribute(Oe)));t||(t=document.createElement("style"),t.setAttribute(Oe,Oe),e.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+Ne}function _e(){let e;R("",Se),A(!0);try{e=window}catch(cn){}if(e){if(he(),void 0!==e.IconifyPreload){const n=e.IconifyPreload,t="Invalid IconifyPreload syntax.";"object"===typeof n&&null!==n&&(n instanceof Array?n:[n]).forEach((e=>{try{("object"!==typeof e||null===e||e instanceof Array||"object"!==typeof e.icons||"string"!==typeof e.prefix||!E(e))&&console.error(t)}catch(n){console.error(t)}}))}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"===typeof t&&null!==t)for(const e in t){const o="IconifyProviders["+e+"] is invalid.";try{const n=t[e];if("object"!==typeof n||!n||void 0===n.resources)continue;J(e,n)||console.error(o)}catch(n){console.error(o)}}}}return{enableCache:e=>Ie(e,!0),disableCache:e=>Ie(e,!1),iconExists:S,getIcon:I,listIcons:M,addIcon:P,addCollection:E,calculateSize:Me,buildIcon:Ae,loadIcons:be,loadIcon:xe,addAPIProvider:J,appendCustomStyle:ze,_api:{getAPIConfig:$,setAPIModule:R,sendAPIQuery:X,setFetch:Pe,getFetch:Ee,listAPIProviders:K}}}function Le(e,n){let t=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in n)t+=" "+o+'="'+n[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}const qe={"background-color":"currentColor"},Fe={"background-color":"transparent"},He={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Ue={"-webkit-mask":qe,mask:qe,background:Fe};for(const dn in Ue){const e=Ue[dn];for(const n in He)e[dn+"-"+n]=He[n]}function Be(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}let De;function Je(e){return void 0===De&&function(){try{De=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(cn){De=null}}(),De?De.createHTML(e):e}function $e(e,n){const t=n.icon.data,o=n.customisations,i=Ae(t,o);o.preserveAspectRatio&&(i.attributes.preserveAspectRatio=o.preserveAspectRatio);const r=n.renderedMode;let l;if("svg"===r)l=function(e){const n=document.createElement("span"),t=e.attributes;let o="";t.width||(o="width: inherit;"),t.height||(o+="height: inherit;"),o&&(t.style=o);const i=Le(e.body,t);return n.innerHTML=Je(i),n.firstChild}(i);else l=function(e,n,t){const o=document.createElement("span");let i=e.body;-1!==i.indexOf("<a")&&(i+="\x3c!-- "+Date.now()+" --\x3e");const r=e.attributes,s='url("'+(c=Le(i,{...r,width:n.width+"",height:n.height+""}),"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(c)+'")'),l=o.style,a={"--svg":s,width:Be(r.width),height:Be(r.height),...t?qe:Fe};var c;for(const d in a)l.setProperty(d,a[d]);return o}(i,{...s,...t},"mask"===r);const a=Array.from(e.childNodes).find((e=>{const n=e.tagName&&e.tagName.toUpperCase();return"SPAN"===n||"SVG"===n}));a?"SPAN"===l.tagName&&a.tagName===l.tagName?a.setAttribute("style",l.getAttribute("style")):e.replaceChild(l,a):e.appendChild(l)}function Ke(e,n,t){return{rendered:!1,inline:n,icon:e,lastRender:t&&(t.rendered?t:t.lastRender)}}const Qe=function(){let e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"iconify-icon";try{e=window.customElements,n=window.HTMLElement}catch(cn){return}if(!e||!n)return;const i=e.get(t);if(i)return i;const r=["icon","mode","inline","width","height","rotate","flip"],s=class extends n{constructor(){super(),(0,o.Z)(this,"_shadowRoot",void 0),(0,o.Z)(this,"_state",void 0),(0,o.Z)(this,"_checkQueued",!1);const e=this._shadowRoot=this.attachShadow({mode:"open"}),n=ke(this);Re(e,n),this._state=Ke({value:""},n),this._queueCheck()}static get observedAttributes(){return r.slice(0)}attributeChangedCallback(e){if("inline"===e){const e=ke(this),n=this._state;e!==n.inline&&(n.inline=e,Re(this._shadowRoot,e))}else this._queueCheck()}get icon(){const e=this.getAttribute("icon");if(e&&"{"===e.slice(0,1))try{return JSON.parse(e)}catch(cn){}return e}set icon(e){"object"===typeof e&&(e=JSON.stringify(e)),this.setAttribute("icon",e)}get inline(){return ke(this)}set inline(e){e?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const e=this._state;if(e.rendered){const n=this._shadowRoot;if("svg"===e.renderedMode)try{return void n.lastChild.setCurrentTime(0)}catch(cn){}$e(n,e)}}get status(){const e=this._state;return e.rendered?"rendered":null===e.icon.data?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout((()=>{this._check()})))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const e=this._state,n=this.getAttribute("icon");if(n!==e.icon.value)return void this._iconChanged(n);if(!e.rendered)return;const t=this.getAttribute("mode"),o=f(this);(e.attrMode!==t||function(e,n){for(const t in u)if(e[t]!==n[t])return!0;return!1}(e.customisations,o))&&this._renderIcon(e.icon,o,t)}_iconChanged(e){const n=ye(e,((e,n,t)=>{const o=this._state;if(o.rendered||this.getAttribute("icon")!==e)return;const i={value:e,name:n,data:t};i.data?this._gotIconData(i):o.icon=i}));n.data?this._gotIconData(n):this._state=Ke(n,this._state.inline,this._state)}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,f(this),this.getAttribute("mode"))}_renderIcon(e,n,t){const o=function(e,n){switch(n){case"svg":case"bg":case"mask":return n}return"style"===n||!we&&-1!==e.indexOf("<a")?-1===e.indexOf("currentColor")?"bg":"mask":"svg"}(e.data.body,t),i=this._state.inline;$e(this._shadowRoot,this._state={rendered:!0,icon:e,inline:i,customisations:n,attrMode:t,renderedMode:o})}};r.forEach((e=>{e in s.prototype||Object.defineProperty(s.prototype,e,{get:function(){return this.getAttribute(e)},set:function(n){null!==n?this.setAttribute(e,n):this.removeAttribute(e)}})}));const l=_e();for(const o in l)s[o]=s.prototype[o]=l[o];return e.define(t,s),s}()||_e(),{enableCache:We,disableCache:Xe,iconExists:Ve,getIcon:Ge,listIcons:Ye,addIcon:en,addCollection:nn,calculateSize:tn,buildIcon:on,loadIcons:rn,loadIcon:sn,addAPIProvider:ln,_api:an}=Qe}}]);