@abtnode/webapp 1.16.23-beta-abdda301 → 1.16.23-beta-035db744

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 (160) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/build/asset-manifest.json +84 -74
  4. package/build/index.html +1 -1
  5. package/build/service-worker.js +1 -1
  6. package/build/static/js/1255.55dc5016.chunk.js +1 -0
  7. package/build/static/js/1279.3644d7cd.chunk.js +1 -0
  8. package/build/static/js/1366.d53a732c.chunk.js +2 -0
  9. package/build/static/js/1371.d5b7b2ae.chunk.js +1 -0
  10. package/build/static/js/{1667.c2e0f7d3.chunk.js → 1667.db634784.chunk.js} +1 -1
  11. package/build/static/js/1846.4b9fec13.chunk.js +1 -0
  12. package/build/static/js/{3732.d5b401f7.chunk.js → 1884.890fa2b0.chunk.js} +1 -1
  13. package/build/static/js/2201.071b5207.chunk.js +1 -0
  14. package/build/static/js/2251.442ccceb.chunk.js +1 -0
  15. package/build/static/js/{4494.765058da.chunk.js → 2365.a3571172.chunk.js} +1 -1
  16. package/build/static/js/2537.66c0f7e7.chunk.js +1 -0
  17. package/build/static/js/2611.e3589447.chunk.js +1 -0
  18. package/build/static/js/27.43967fa7.chunk.js +1 -0
  19. package/build/static/js/2739.2c4ef1d7.chunk.js +1 -0
  20. package/build/static/js/3003.47348306.chunk.js +1 -0
  21. package/build/static/js/318.f59bbed5.chunk.js +1 -0
  22. package/build/static/js/3239.21f53604.chunk.js +1 -0
  23. package/build/static/js/3389.b81683f9.chunk.js +1 -0
  24. package/build/static/js/3732.8f85738c.chunk.js +1 -0
  25. package/build/static/js/3748.897c3551.chunk.js +1 -0
  26. package/build/static/js/3910.7717fd80.chunk.js +2 -0
  27. package/build/static/js/4335.afdfe6af.chunk.js +2 -0
  28. package/build/static/js/4382.aa6ec982.chunk.js +2 -0
  29. package/build/static/js/4471.af415e19.chunk.js +1 -0
  30. package/build/static/js/4522.30555616.chunk.js +1 -0
  31. package/build/static/js/4549.d784c0dc.chunk.js +1 -0
  32. package/build/static/js/4775.36c4603d.chunk.js +1 -0
  33. package/build/static/js/4870.e20710f3.chunk.js +1 -0
  34. package/build/static/js/4906.b23f9eba.chunk.js +1 -0
  35. package/build/static/js/5015.4a15d35b.chunk.js +1 -0
  36. package/build/static/js/5059.7520ca24.chunk.js +1 -0
  37. package/build/static/js/{5074.217389e9.chunk.js → 5074.beb0a29b.chunk.js} +1 -1
  38. package/build/static/js/{6950.17ce7cb3.chunk.js → 5126.a0f7c984.chunk.js} +1 -1
  39. package/build/static/js/5165.7238a6aa.chunk.js +1 -0
  40. package/build/static/js/5217.3f129aac.chunk.js +1 -0
  41. package/build/static/js/5454.0ea3ca19.chunk.js +1 -0
  42. package/build/static/js/5522.de3357ec.chunk.js +1 -0
  43. package/build/static/js/5539.829c3ff0.chunk.js +1 -0
  44. package/build/static/js/5545.75c8138a.chunk.js +2 -0
  45. package/build/static/js/5672.913b0d63.chunk.js +1 -0
  46. package/build/static/js/5716.bdba5b4b.chunk.js +1 -0
  47. package/build/static/js/5941.054253be.chunk.js +1 -0
  48. package/build/static/js/5979.9ba4cc65.chunk.js +1 -0
  49. package/build/static/js/6019.8d8dc069.chunk.js +1 -0
  50. package/build/static/js/{7638.e427e7eb.chunk.js → 6076.ebfd327c.chunk.js} +1 -1
  51. package/build/static/js/6230.90c4c4f0.chunk.js +1 -0
  52. package/build/static/js/6296.0c2fd782.chunk.js +1 -0
  53. package/build/static/js/6448.4997f673.chunk.js +1 -0
  54. package/build/static/js/6499.6b17e117.chunk.js +1 -0
  55. package/build/static/js/6511.559f5478.chunk.js +1 -0
  56. package/build/static/js/6580.f68738f7.chunk.js +1 -0
  57. package/build/static/js/6771.5d826eed.chunk.js +1 -0
  58. package/build/static/js/6931.a2c645a5.chunk.js +1 -0
  59. package/build/static/js/6944.324ea8dc.chunk.js +1 -0
  60. package/build/static/js/6974.a54976fd.chunk.js +2 -0
  61. package/build/static/js/7096.3b166778.chunk.js +1 -0
  62. package/build/static/js/7131.e9b49104.chunk.js +2 -0
  63. package/build/static/js/7288.9408f652.chunk.js +1 -0
  64. package/build/static/js/730.6863aa68.chunk.js +1 -0
  65. package/build/static/js/7327.bd5ce26d.chunk.js +1 -0
  66. package/build/static/js/{744.74c12fbb.chunk.js → 744.3ca8c691.chunk.js} +1 -1
  67. package/build/static/js/7534.922dfbaf.chunk.js +1 -0
  68. package/build/static/js/{3135.38b886dd.chunk.js → 7558.10c2eb9c.chunk.js} +1 -1
  69. package/build/static/js/{7676.96ca7a9d.chunk.js → 7676.065418f9.chunk.js} +2 -2
  70. package/build/static/js/7880.3033e72c.chunk.js +1 -0
  71. package/build/static/js/{7913.2a92d95b.chunk.js → 7913.7536ae3f.chunk.js} +1 -1
  72. package/build/static/js/7998.1b37b898.chunk.js +1 -0
  73. package/build/static/js/{8219.6a609267.chunk.js → 8219.50ba71f3.chunk.js} +1 -1
  74. package/build/static/js/8342.53d61f70.chunk.js +1 -0
  75. package/build/static/js/8353.147d5d03.chunk.js +1 -0
  76. package/build/static/js/8387.c80dae7e.chunk.js +1 -0
  77. package/build/static/js/{9038.aa97e3e5.chunk.js → 9038.8440f044.chunk.js} +1 -1
  78. package/build/static/js/9147.1d34e02a.chunk.js +1 -0
  79. package/build/static/js/{9249.7f9c1c36.chunk.js → 9249.56a634fd.chunk.js} +1 -1
  80. package/build/static/js/9364.8a0a4d02.chunk.js +2 -0
  81. package/build/static/js/9534.e20c7fe7.chunk.js +1 -0
  82. package/build/static/js/9552.9a49abdd.chunk.js +1 -0
  83. package/build/static/js/9636.f68486b9.chunk.js +1 -0
  84. package/build/static/js/9760.ee24f252.chunk.js +1 -0
  85. package/build/static/js/9811.24d24075.chunk.js +2 -0
  86. package/build/static/js/9940.1532b9e6.chunk.js +1 -0
  87. package/build/static/js/main.f8c34aa4.js +2 -0
  88. package/package.json +1 -1
  89. package/build/static/js/1279.16c56464.chunk.js +0 -1
  90. package/build/static/js/1366.409596f3.chunk.js +0 -2
  91. package/build/static/js/1371.9dada426.chunk.js +0 -1
  92. package/build/static/js/1524.3b0ec35f.chunk.js +0 -1
  93. package/build/static/js/1685.5ad36577.chunk.js +0 -2
  94. package/build/static/js/1846.c065e8f3.chunk.js +0 -1
  95. package/build/static/js/2168.b50899db.chunk.js +0 -1
  96. package/build/static/js/2183.ddd3936e.chunk.js +0 -1
  97. package/build/static/js/2334.84a8e434.chunk.js +0 -1
  98. package/build/static/js/2365.f0c1d3f5.chunk.js +0 -1
  99. package/build/static/js/253.4a3aa017.chunk.js +0 -1
  100. package/build/static/js/2537.10cf10fb.chunk.js +0 -1
  101. package/build/static/js/2611.a6ba28ea.chunk.js +0 -1
  102. package/build/static/js/271.f6faf47d.chunk.js +0 -1
  103. package/build/static/js/2746.3c3fbc71.chunk.js +0 -1
  104. package/build/static/js/2880.9bfbce77.chunk.js +0 -2
  105. package/build/static/js/2960.d9d73c56.chunk.js +0 -1
  106. package/build/static/js/3058.361813c3.chunk.js +0 -1
  107. package/build/static/js/318.b12ac498.chunk.js +0 -2
  108. package/build/static/js/3216.04d7e546.chunk.js +0 -1
  109. package/build/static/js/3389.8123efdc.chunk.js +0 -1
  110. package/build/static/js/3883.5ba68533.chunk.js +0 -1
  111. package/build/static/js/406.35792759.chunk.js +0 -1
  112. package/build/static/js/436.f8d09df9.chunk.js +0 -1
  113. package/build/static/js/4382.2e63293f.chunk.js +0 -2
  114. package/build/static/js/4471.be33bf7f.chunk.js +0 -1
  115. package/build/static/js/4509.979a620a.chunk.js +0 -2
  116. package/build/static/js/4549.2d28f369.chunk.js +0 -1
  117. package/build/static/js/4775.0e4bd5d9.chunk.js +0 -1
  118. package/build/static/js/4852.b6d13b15.chunk.js +0 -1
  119. package/build/static/js/4901.639e63b2.chunk.js +0 -1
  120. package/build/static/js/4906.117d19c2.chunk.js +0 -1
  121. package/build/static/js/5015.43a32df6.chunk.js +0 -1
  122. package/build/static/js/5059.70e9adb7.chunk.js +0 -1
  123. package/build/static/js/5374.d9d1223d.chunk.js +0 -1
  124. package/build/static/js/5672.80be8e95.chunk.js +0 -1
  125. package/build/static/js/5760.25b1d70f.chunk.js +0 -1
  126. package/build/static/js/5887.aada06d9.chunk.js +0 -2
  127. package/build/static/js/5887.aada06d9.chunk.js.LICENSE.txt +0 -5
  128. package/build/static/js/5914.e88cf26d.chunk.js +0 -2
  129. package/build/static/js/592.5e930c27.chunk.js +0 -2
  130. package/build/static/js/5979.f31629cc.chunk.js +0 -1
  131. package/build/static/js/6016.e15d85af.chunk.js +0 -1
  132. package/build/static/js/6230.b9d9b3f3.chunk.js +0 -1
  133. package/build/static/js/6511.2aee4cca.chunk.js +0 -1
  134. package/build/static/js/6931.d2496fd4.chunk.js +0 -1
  135. package/build/static/js/6944.c3ed8c6e.chunk.js +0 -1
  136. package/build/static/js/7020.9e86a0f7.chunk.js +0 -1
  137. package/build/static/js/7534.b8e625dd.chunk.js +0 -1
  138. package/build/static/js/7657.79be5056.chunk.js +0 -2
  139. package/build/static/js/7687.8a828ac5.chunk.js +0 -1
  140. package/build/static/js/7718.672877c0.chunk.js +0 -1
  141. package/build/static/js/8986.70b9952f.chunk.js +0 -1
  142. package/build/static/js/9041.9226982f.chunk.js +0 -1
  143. package/build/static/js/9327.93934827.chunk.js +0 -1
  144. package/build/static/js/95.a50db679.chunk.js +0 -1
  145. package/build/static/js/9552.eb2bee16.chunk.js +0 -1
  146. package/build/static/js/9662.5b1fd43c.chunk.js +0 -1
  147. package/build/static/js/9958.525b838c.chunk.js +0 -1
  148. package/build/static/js/main.8e591dc1.js +0 -2
  149. /package/build/static/css/{7657.cc1ab277.chunk.css → 9811.cc1ab277.chunk.css} +0 -0
  150. /package/build/static/js/{1366.409596f3.chunk.js.LICENSE.txt → 1366.d53a732c.chunk.js.LICENSE.txt} +0 -0
  151. /package/build/static/js/{2880.9bfbce77.chunk.js.LICENSE.txt → 3910.7717fd80.chunk.js.LICENSE.txt} +0 -0
  152. /package/build/static/js/{1685.5ad36577.chunk.js.LICENSE.txt → 4335.afdfe6af.chunk.js.LICENSE.txt} +0 -0
  153. /package/build/static/js/{4382.2e63293f.chunk.js.LICENSE.txt → 4382.aa6ec982.chunk.js.LICENSE.txt} +0 -0
  154. /package/build/static/js/{318.b12ac498.chunk.js.LICENSE.txt → 5545.75c8138a.chunk.js.LICENSE.txt} +0 -0
  155. /package/build/static/js/{592.5e930c27.chunk.js.LICENSE.txt → 6974.a54976fd.chunk.js.LICENSE.txt} +0 -0
  156. /package/build/static/js/{5914.e88cf26d.chunk.js.LICENSE.txt → 7131.e9b49104.chunk.js.LICENSE.txt} +0 -0
  157. /package/build/static/js/{7676.96ca7a9d.chunk.js.LICENSE.txt → 7676.065418f9.chunk.js.LICENSE.txt} +0 -0
  158. /package/build/static/js/{4509.979a620a.chunk.js.LICENSE.txt → 9364.8a0a4d02.chunk.js.LICENSE.txt} +0 -0
  159. /package/build/static/js/{7657.79be5056.chunk.js.LICENSE.txt → 9811.24d24075.chunk.js.LICENSE.txt} +0 -0
  160. /package/build/static/js/{main.8e591dc1.js.LICENSE.txt → main.f8c34aa4.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
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(56869),l=t(72333),r=t(6352),s=t.n(r),c=t(35432),d=t(58238),m=t(14491);var p=t(96266);function u(e){let{blocklet:n,style:t,size:i,ancestors:o,...r}=e;const u=(0,d.h6)(),{logoUrl:h,inService:f}=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=f?()=>{}:e=>{e.target.src="".concat(u.imgPrefix,"/blocklet.png")};let b=(0,p.jsx)("img",{src:h,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(87543),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(44736),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(87543),h=t(52277),f=t.n(h),g=t(68420),x=t(96266);const b=(0,a.lazy)((()=>Promise.all([t.e(1294),t.e(4382)]).then(t.bind(t,23826)).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)(),h=(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:h,popup:!0,onUploadFinish:()=>{var e;m(),null===(e=h.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:f()("uploader-wrapper",o&&"enabled"),sx:Z,onClick:()=>{var e;null===(e=h.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(87543),h=t(6296),f=t(89969),g=t(37570),x=t(86205),b=t(47998),v=t(38312),Z=t(73529),j=t(5534),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),A=t.n(R),T=t(41843),_=t(56195),N=t(28726),O=t(89439),I=t(77277),F=t(86229),B=t(28641),z=t(69544),U=t(46568),D=t(28763),K=t(53066),W=t(54047),q=t(9222),G=t(91330),V=t(42915),H=t(72739),M=t(90820),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:h,renderImage:f,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]),A=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:h}),renderOption:(e,n)=>{var t;const i=-1!==L.indexOf(n);return(0,a.createElement)(ee,{component:"li",...e,key:n},f(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.Z,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:A}),(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.Z,{})})]}):(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(14491),ae=t(54063),le=t(63406),re=t(78410),se=t(31853),ce=t(66935),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)(he,{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 he=(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 fe,ge=t(13128),xe=t(81289),be=t(60967),ve=t(88574),Ze=t(54272),je=t(44024),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,h]=(0,a.useState)(!1),[f,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=()=>{h(!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:()=>{h(!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[f];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||f===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(fe||(fe=(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 Ae(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:h}=(0,a.useContext)(C.RD),[f,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:h("blocklet.config.name"),value:t.environments.find((e=>"BLOCKLET_APP_NAME"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_DESCRIPTION,description:h("blocklet.config.description"),value:t.environments.find((e=>"BLOCKLET_APP_DESCRIPTION"===e.key)).value},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL,description:h("blocklet.config.appUrl"),value:q?q.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_OWNER,description:h("blocklet.config.copyrightOwner"),value:G?G.value:""},{key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_COPYRIGHT_YEAR,description:h("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:f;H.push({key:I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE,description:h("blocklet.config.clusterSize"),value:n,cpuCores:f})}const M=async(e,n)=>{if(e===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const e=(0,oe.I)({value:n,cpuCores:f});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:h("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:h("blocklet.config.logoRect")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("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:h("blocklet.config.logoFavicon")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("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:[h("blocklet.config.access.publicToStore"),(0,X.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.access.publicInstanceTip")})]}),(0,X.jsx)(T.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:h("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:h("blocklet.config.selectLanguagesTip"),placeholder:h("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:h("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:h("router.domainSecurity.cors.title")}),(0,X.jsx)(u.Z,{mb:1.5,className:"config-desc",children:h("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(A()(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:h("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:[h("blocklet.config.deletable.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:h(K?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable")})]}),(0,X.jsx)(T.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:h("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:h("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}}),h("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:[h("blocklet.config.clearCache.name"),(0,X.jsx)(u.Z,{className:"config-desc",children:h("blocklet.config.clearCache.purpose")})]}),(0,X.jsx)(re.Z,{teamDid:R})]})})]})]})}const Te=(0,le.V)(Ae,"mutate_blocklets"),_e=(0,le.V)(Ae,"",oe.Wf);function Ne(e){const{inService:n}=(0,ie.h6)();return n?(0,X.jsx)(_e,{...e}):(0,X.jsx)(Te,{...e})}Ae.propTypes={blocklet:s().object.isRequired,onUpdate:s().func,hasPermission:s().bool},Ae.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(35214),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,t;const{api:i}=(0,ie.h6)(),{blocklet:o}=(0,pe.y0)(),{t:a}=(0,C.PE)(),{confirmApi:l,confirmHolder:r}=$e(),s=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,c=Object.assign({...en},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.notification)||void 0===t?void 0:t.email)||{}),{handleSubmit:d,control:m,formState:p,watch:h,reset:f}=(0,We.cI)({defaultValues:Ue()(c,Object.keys(en))}),g=(0,De.Z)({testReceiver:"",testReceiverError:""}),x=h("enabled"),b=(0,Ke.Z)((async function(e,n){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];try{var o,l;const{blocklet:n}=await i.configNotification({input:{did:s,notification:JSON.stringify({email:e})}}),r=Object.assign({...en},(null===n||void 0===n||null===(o=n.settings)||void 0===o||null===(l=o.notification)||void 0===l?void 0:l.email)||{});f(r),t&&F.Z.success(a("oauth.saveSuccess"))}catch(r){if(!t)throw r;F.Z.error(r.message||a("oauth.saveFailed"))}})),v=(0,Ke.Z)((async(e,n,t)=>{try{p.isDirty&&await b(e,n,!1),await i.sendEmail({input:{did:s,receiver:t,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),F.Z.success(a("notification.email.testSuccess"))}catch(o){F.Z.error(o.message||a("notification.email.testfailed"))}})),Z=(0,Ke.Z)(((e,n)=>{g.testReceiver="",g.testReceiverError="",l.open({title:a("notification.email.testSendEmail"),content:()=>(0,X.jsx)(u.Z,{sx:{width:"300px"},children:(0,X.jsx)(H.Z,{fullWidth:!0,name:"testReceiver",label:a("notification.email.inputTestReceiver"),value:g.testReceiver,onChange:e=>{g.testReceiver=e.target.value},error:!!g.testReceiverError,helperText:g.testReceiverError||"\u3000"})}),async onConfirm(t){var i;const o=null===(i=g.testReceiver)||void 0===i?void 0:i.trim();o?Ge()(o)?(g.testReceiverError="",await v(e,n,o),t()):g.testReceiverError=a("notification.email.receiverInvalid"):g.testReceiverError=a("notification.email.receiverRequired")}})})),j=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!Ge()(n)||a("notification.email.fromInvalid"):a("notification.email.fromRequired")})),y=(0,Ke.Z)((e=>{const n=null===e||void 0===e?void 0:e.trim();return n?!!He()(n,{require_host:!1,protocols:[]})||a("notification.email.hostInvalid"):a("notification.email.hostRequired")})),k=(0,Ke.Z)((e=>e?!!Ye()(e)||a("notification.email.portInvalid"):a("notification.email.portRequired"))),w=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.userRequired"))),S=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("notification.email.passwordRequired"))),E=(0,Ke.Z)((()=>!0));return(0,X.jsxs)(u.Z,{children:[(0,X.jsxs)("form",{onSubmit:d(b),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:m,render:e=>{let{field:n}=e;return(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(T.Z,{checked:n.value,...n}),label:a("notification.email.enable"),sx:{marginBottom:"8px"}})}}),(0,X.jsx)(We.Qr,{name:"from",control:m,rules:{validate:x?j:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:a("notification.email.from"),error:!!p.errors[t.name],helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"host",control:m,rules:{validate:x?y:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.host"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"port",control:m,rules:{validate:x?k:E},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:!!p.errors[t.name],label:a("notification.email.port"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"user",control:m,rules:{validate:x?w:E},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!p.errors[t.name],label:a("notification.email.user"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"password",control:m,rules:{validate:x?S:E},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:!!p.errors[t.name],label:a("notification.email.password"),helperText:(null===(n=p.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!x})})}}),(0,X.jsx)(We.Qr,{name:"secure",control:m,rules:{validate:E},render:e=>{let{field:n}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(Ze.Z,{control:(0,X.jsx)(T.Z,{checked:n.value,...n,disabled:!x}),label:a("notification.email.secure"),style:{marginBottom:16}})})}}),(0,X.jsx)(N.Z,{variant:"outlined",color:"warning",onClick:d(Z),sx:{mr:2},disabled:!x,children:a("oauth.runTest")}),(0,X.jsx)(N.Z,{type:"submit",variant:"contained",disabled:!p.isDirty,children:a("oauth.save")})]}),r]})},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(8262),ln=t(69292),rn=t(65700),sn=t(7549),cn=t(24558),dn=t(74286),mn=t(76282),pn=t(15410),un=t(19403),hn=t(15598),fn=t(77699),gn=t(27006),xn=t(8650);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:fn.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)(),[h,f]=(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=h||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.Z,{})}),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(!h){f(!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(),f(!1)}catch(e){f(!1),F.Z.error((0,oe.Z)(e))}}},color:"primary",disabled:R,variant:"contained",autoFocus:!0,"data-cy":"config-access-confirm",children:[h&&(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)(hn.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)(),h=i[0]||t,f="/".concat(i.map((e=>e.mountPoint||"/")).join("/"),"/").concat(t.mountPoint||"/").replace(/\/+/g,"/"),g=(0,oe.vH)({blocklet:h,domain:{value:p},mountPoint:f,params:(0,oe.f0)(h,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.Z,{fontSize:"inherit"})}),{access:y,roles:k}=kn(t,h,{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)(An,{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 An=(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 Tn=t(12958),_n=t(44784);const Nn=function(){var e,n,t;const{api:i}=(0,ie.h6)(),{blocklet:o}=(0,pe.y0)(),{t:a}=(0,C.PE)(),l=null===o||void 0===o||null===(e=o.meta)||void 0===e?void 0:e.did,r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{}),{handleSubmit:s,control:c,formState:d,watch:m,reset:p}=(0,We.cI)({defaultValues:Ue()(r,["domain","clientId","enabled"])}),h=m("enabled"),f=(0,Ke.Z)((async e=>{try{var n,t;const{blocklet:o}=await i.configOAuth({input:{did:l,oauth:JSON.stringify({auth0:e})}}),r=Object.assign({enabled:!1,domain:"",clientId:""},(null===o||void 0===o||null===(n=o.settings)||void 0===n||null===(t=n.oauth)||void 0===t?void 0:t.auth0)||{});p(r),F.Z.success(a("oauth.saveSuccess"))}catch(o){F.Z.error(o.message||a("oauth.saveFailed"))}})),g=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.domainDescribe"))),x=(0,Ke.Z)((e=>!(null===e||void 0===e||!e.trim())||a("oauth.auth0.clientIdDescribe"))),b=(0,Ke.Z)((()=>!0));return(0,X.jsx)(u.Z,{children:(0,X.jsxs)("form",{onSubmit:s(f),disabled:!0,children:[(0,X.jsx)(We.Qr,{name:"enabled",control:c,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:a("oauth.auth0.enable"),sx:{marginBottom:2,ml:1}})}}),(0,X.jsx)(We.Qr,{name:"domain",control:c,rules:{validate:h?g:b},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,label:a("oauth.auth0.domain"),error:!!d.errors[t.name],helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,X.jsx)(We.Qr,{name:"clientId",control:c,rules:{validate:h?x:b},render:e=>{var n;let{field:t}=e;return(0,X.jsx)(Be.Z,{fullWidth:!0,children:(0,X.jsx)(H.Z,{...t,error:!!d.errors[t.name],label:a("oauth.auth0.clientId"),helperText:(null===(n=d.errors[t.name])||void 0===n?void 0:n.message)||"\u3000",disabled:!h})})}}),(0,X.jsx)(Tn.Z,{type:"submit",variant:"contained",onSubmit:s(f),disabled:!d.isDirty,children:a("oauth.save")})]})})};var On=t(85723),In=t(28145);const Fn={ttl:604800};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)(Tn.Z,{type:"submit",variant:"contained",onSubmit:l(m),disabled:!s.isDirty,children:d("oauth.save")})]})})}var Un=t(94755),Dn=t(94324),Kn=t(63748),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,i;const{t:o}=(0,a.useContext)(C.RD),{blocklet:l}=(0,pe.y0)(),{api:r}=(0,ie.h6)(),s=(0,De.Z)({mode:"view",show:!1,data:{},callback:Qe()}),c=(0,Yn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,p=(0,Ke.Z)((()=>{s.mode="view",s.data={},s.callback=Qe()}),[]),h=(0,Ke.Z)((()=>{s.show=!1,setTimeout((()=>{p()}),d)}),[]),f=(0,Ke.Z)((e=>{s.mode="view",s.show=!0,s.data=e}),[]),g=(0,Ke.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qe();s.mode="approve",s.show=!0,s.data=e,s.callback=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:h,approve:g})),[f,h,g]);const x=(0,Fe.Z)((()=>{if(!s.show)return[];s.data.migratedFrom=[s.data.appId,s.data.appPid];const e=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return!1!==s.data.isMaster&&Vn()(e,"appliedAt","status"),e.map((e=>{const n=o("federated.info.".concat(e));let t=s.data[e];if("appName"===e&&s.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()(s.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:s.data.appName})}catch{t=(0,X.jsx)("img",{src:e,width:"60",height:"60",alt:s.data.appName})}}if("status"===e&&(t=t&&o("federated.status.".concat(t))),"migratedFrom"===e){t=(s.data.migratedFrom||[]).filter((e=>![s.data.appId,s.data.appPid].includes(e))).map((e=>(0,X.jsx)(Jn.kL,{children:e})))}return Mn()(t)&&(t="-"),{name:n,value:t}}))}),[s.data]),b="approve"===s.mode,v=(0,Ke.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"rejected"}}),h(),null===s||void 0===s||s.callback(!1)})),Z=(0,Ke.Z)((async()=>{await r.auditFederatedLogin({input:{memberPid:s.data.appPid,did:l.appPid,status:"approved"}}),h(),null===s||void 0===s||s.callback(!0)}));return(0,X.jsx)(ge.ZP,{open:s.show,title:o(b?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:h,actions:b?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tn.Z,{color:"error",variant:"contained",onClick:v,children:o("common.reject")}),(0,X.jsx)(Tn.Z,{variant:"contained",onClick:Z,children:o("common.approve")})]}):(0,X.jsx)(Tn.Z,{variant:"outlined",onClick:h,children:o("common.close")}),children:x.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,i;const o=(0,Yn.Fg)(),l=(null===o||void 0===o||null===(t=o.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,{t:r}=(0,a.useContext)(C.RD),s=(0,De.Z)({show:!1,data:{link:""}}),c=(0,Ke.Z)((()=>{s.data.link=""}),[]),d=(0,Ke.Z)((()=>{s.show=!1,setTimeout((()=>{c()}),l)}),[]),m=(0,Ke.Z)((e=>{let{link:n}=e;s.show=!0,s.data.link=n}),[]);(0,a.useImperativeHandle)(n,(()=>({open:m,close:d})),[m,d]);const p=(0,Ke.Z)((()=>{tt()(s.data.link),d()}),[d]);return(0,X.jsxs)(ge.ZP,{open:s.show,title:r("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:p,children:r("common.copyAndClose")}),children:[(0,X.jsx)(u.Z,{mb:1,children:r("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:s.data.link})})]})}));function ot(e){var n,t,i,o,l;let{mode:r}=e;const s=(0,a.useRef)(null),c=(0,a.useRef)(null),{t:d,locale:m}=(0,a.useContext)(C.RD),{blocklet:p,actions:{refreshBlocklet:h}}=(0,pe.y0)(),{confirmApi:f,confirmHolder:g}=$e(),{api:x}=(0,ie.h6)(),b=(null===(n=p.settings.federated)||void 0===n?void 0:n.sites)||[],v=(null===(t=p.settings.federated)||void 0===t?void 0:t.config)||{},Z=!1!==v.isMaster,j=(0,Ke.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.open(e)})),y=(0,Ke.Z)((e=>{var n;null===(n=c.current)||void 0===n||n.approve(e,h)})),k=(0,Ke.Z)((e=>{f.open({title:d("federated.disableFederatedLogin"),content:d("federated.disableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"revoked"}}),n()}})})),w=(0,Ke.Z)((e=>{f.open({title:d("federated.enableFederatedLogin"),content:d("federated.enableFederatedLoginDescription"),async onConfirm(n){await x.auditFederatedLogin({input:{memberPid:e.appPid,did:p.appPid,status:"approved"}}),n()}})})),S=(0,Fe.Z)((()=>{const e=[{label:d("common.name"),name:"appName",options:{customBodyRenderLite:e=>{const n=b[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:d("common.did"),name:"appId",options:{customBodyRenderLite:e=>{const n=b[e];return(0,X.jsx)(Wn.Z,{children:n.appId})}}},{label:d("common.status"),name:"status",options:{customBodyRenderLite:e=>{const n=b[e],t=!1!==n.isMaster;return(0,X.jsx)(u.Z,{children:t?"-":d("federated.status.".concat(n.status))})}}}];return Z&&e.push({label:d("common.actions"),name:"actions",options:{customBodyRenderLite:e=>{const n=b[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:d("federated.status.rejected")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"secondary",size:"small",onClick:e=>{e.stopPropagation()},children:d("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(),y(n)},children:d("federated.status.pending")}),"approved"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"error",size:"small",onClick:e=>{e.stopPropagation(),k(n)},style:{whiteSpace:"nowrap"},children:d("federated.revoke")}),"revoked"===n.status&&(0,X.jsx)(N.Z,{variant:"contained",color:"warning",size:"small",onClick:e=>{e.stopPropagation(),w(n)},style:{whiteSpace:"nowrap"},children:d("federated.approve")})]})})}}}),e}),[v.appId,b,Z,d]),E=(0,Fe.Z)((()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n){let{dataIndex:t}=n;const i=b[t];j(i)}})),[]),L=(0,Ke.Z)((()=>{const e=p.environments.find((e=>e.key===I.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL));var n;null!==e&&void 0!==e&&e.value?null===(n=s.current)||void 0===n||n.open({link:e.value}):F.Z.error(d("federated.failedToGetFederatedLoginLink"))}),[null===(i=p.site)||void 0===i||null===(o=i.domainAliases)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.href]),P=(0,Ke.Z)((()=>{f.open({title:d("federated.quitFederatedLogin"),content:d("federated.quitFederatedLoginDescription"),async onConfirm(e){await x.quitFederatedLogin({input:{did:p.appPid}}),e()}})})),R=(0,Ke.Z)((()=>{f.open({title:d("federated.disbandFederatedLogin"),content:d("federated.disbandFederatedLoginDescription"),async onConfirm(e){await x.disbandFederatedLogin({input:{did:p.appPid}}),e()}})})),A=[];return"master"!==r?A.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",color:"error",onClick:P,sx:{ml:1},children:d("federated.quitFederatedLogin")},"quitFederatedLogin")):(A.push((0,X.jsx)(N.Z,{size:"small",variant:"contained",onClick:L,sx:{ml:1},children:d("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),A.push((0,X.jsx)(N.Z,{color:"error",size:"small",variant:"contained",onClick:R,sx:{ml:1},children:d("federated.disbandFederatedLogin")},"disbandFederatedLogin"))),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Kn.Z,{className:"main-table",locale:m,data:b,columns:S,customButtons:A,title:(0,X.jsx)(u.Z,{className:"table-toolbar-left",children:d("oauth.federated")}),options:E}),g,(0,X.jsx)(it,{ref:s}),(0,X.jsx)($n,{ref:c})]})}ot.propTypes={mode:s().oneOf(["member","master"])},ot.defaultProps={mode:"member"};const at=ot,lt=(0,a.forwardRef)(((e,n)=>{var t,i;const{t:o}=(0,a.useContext)(C.RD),{api:l}=(0,ie.h6)(),{blocklet:r}=(0,pe.y0)(),s=null===r||void 0===r?void 0:r.appPid,c=(0,Yn.Fg)(),d=(null===c||void 0===c||null===(t=c.transitions)||void 0===t||null===(i=t.duration)||void 0===i?void 0:i.leavingScreen)||300,m=(0,De.Z)({show:!1,appUrl:"",appUrlError:"",callback:Qe()}),p=(0,Ke.Z)((()=>{m.appUrl="",m.appUrlError="",m.callback=Qe()}),[]),h=(0,Ke.Z)((()=>{m.show=!1,setTimeout((()=>{p()}),d)}),[]),f=(0,Ke.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe();m.show=!0,m.callback=e}),[]);(0,a.useImperativeHandle)(n,(()=>({open:f,close:h})),[f,h]);const g=(0,Ke.Z)((e=>{if(!e)throw new Error(o("federated.federatedJoinAppUrlRequired"));if(!Xn()(e))throw new Error(o("federated.federatedJoinAppUrlInvalid"))})),x=(0,Ke.Z)((async()=>{try{g(m.appUrl);const e=await l.joinFederatedLogin({input:{did:s,appUrl:m.appUrl}});m.show=!1,h(),null===m||void 0===m||m.callback(e)}catch(e){m.appUrlError=e.message}}),[h,s]);return(0,X.jsxs)(ge.ZP,{open:m.show,title:o("federated.joinFederatedLogin"),onClose:h,PaperProps:{style:{minHeight:"unset"}},actions:(0,X.jsx)(N.Z,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,children:o("common.confirm")}),children:[(0,X.jsx)(u.Z,{mb:1,children:o("federated.joinFederatedLoginDescription")}),(0,X.jsx)(H.Z,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:o("federated.federatedJoinAppUrl"),label:o("federated.federatedJoinAppUrl"),value:m.appUrl,error:!!m.appUrlError,helperText:m.appUrlError||"eg: https://www.arcblock.io",onChange:e=>{m.appUrl=e.target.value}})]})}));function rt(){var e,n,t,i;const o=(0,a.useRef)(null),l=(0,a.useRef)(null),{t:r}=(0,a.useContext)(C.RD),{blocklet:s,actions:{refreshBlocklet:c}}=(0,pe.y0)(),d=(0,Ke.Z)((()=>{var e,n,t;const i=null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href;if(i)try{var a;const e=new URL(i);null===(a=o.current)||void 0===a||a.open({link:e.origin})}catch{F.Z.error(r("federated.failedToGetFederatedLoginLink"))}}),[null===(e=s.site)||void 0===e||null===(n=e.domainAliases)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.href]),m=(0,Ke.Z)((()=>{var e;null===(e=l.current)||void 0===e||e.open((()=>{c()}))}),[c]);if((null===(i=s.settings.federated)||void 0===i?void 0:i.sites.length)>0){var p;const e=!1!==(null===(p=s.settings.federated)||void 0===p?void 0:p.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:d,children:r("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:m,children:r("federated.joinFederatedLogin")})]}),(0,X.jsx)(it,{ref:o}),(0,X.jsx)(lt,{ref:l})]})}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)(f.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.Z,{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)(h.ZP,{container:!0,spacing:4,columns:24,children:[(0,X.jsx)(h.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)(h.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(69544),r=t(68420),s=t(14491),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:h}=(0,c.h6)(),[f,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 h.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:[f?(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(87543),r=t(72739),s=t(69544),c=t(46568),d=t(28763),m=t(53066),p=t(35406),u=t(11875),h=t(95890),f=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),[A,T]=(0,i.useState)(P),_=async()=>{L(!0);try{if(!1===await Z(A))T(P);else{let e=A;"function"===typeof C&&(e=C(A)),T(e),R(e)}}catch(e){T(P)}finally{L(!1),S(!1)}},N=w?(0,f.jsx)(r.Z,{style:{flex:1},fullWidth:!0,value:A,onChange:e=>{var n;n=e.target.value,T(n),x(n)},autoFocus:!0,size:"small",variant:"outlined",placeholder:b,onKeyDown:e=>{"Enter"===e.key&&_()},disabled:t,type:j?"password":"text",...k}):(0,f.jsx)(l.Z,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:g(A,j,a)});return(0,f.jsx)(u.Z,{className:"form",style:v,children:(0,f.jsxs)(l.Z,{className:"form-item",children:[(0,f.jsxs)(l.Z,{className:"form-item-label",children:[n,o&&(0,f.jsx)(p.Z,{})]}),(0,f.jsxs)(l.Z,{className:"form-item-body",children:[(0,f.jsx)(l.Z,{className:"form-item-input",children:N}),(0,f.jsx)(l.Z,{className:"form-item-action",children:w?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-confirm",onClick:_,disabled:t||E,size:"large",children:E?(0,f.jsx)(s.Z,{size:24}):(0,f.jsx)(d.Z,{})}),(0,f.jsx)(m.Z,{"data-cy":"schema-form-item-cancel",onClick:()=>{T(P),S(!1)},disabled:t||E,size:"large",children:(0,f.jsx)(c.Z,{})})]}):(0,f.jsx)(h.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(87543);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(53066),s=t(12958),c=t(83388),d=t(87669),m=t(15418),p=t(38473),u=t(90820),h=t(76282),f=t(58870),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)(f.Z,{id:"split-button-menu",autoFocusItem:!0,children:n.map((e=>(0,g.jsx)(h.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")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6296],{6296:(n,t,e)=>{e.d(t,{ZP:()=>y});var o=e(31461),r=e(7896),c=e(5057),i=e(9978),a=e(89554),s=e(53079),p=e(91213),u=e(91149),l=e(84722),m=e(8262);const d=c.createContext();var f=e(31821),g=e(18561);function w(n){return(0,g.ZP)("MuiGrid",n)}const b=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],h=(0,f.Z)("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map((n=>"spacing-xs-".concat(n))),...["column-reverse","column","row-reverse","row"].map((n=>"direction-xs-".concat(n))),...["nowrap","wrap-reverse","wrap"].map((n=>"wrap-xs-".concat(n))),...b.map((n=>"grid-xs-".concat(n))),...b.map((n=>"grid-sm-".concat(n))),...b.map((n=>"grid-md-".concat(n))),...b.map((n=>"grid-lg-".concat(n))),...b.map((n=>"grid-xl-".concat(n)))]);var x=e(96266);const k=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function S(n){const t=parseFloat(n);return"".concat(t).concat(String(n).replace(String(t),"")||"px")}function v(n){let{breakpoints:t,values:e}=n,o="";Object.keys(e).forEach((n=>{""===o&&0!==e[n]&&(o=n)}));const r=Object.keys(t).sort(((n,e)=>t[n]-t[e]));return r.slice(0,r.indexOf(o))}const W=(0,u.ZP)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(n,t)=>{const{ownerState:e}=n,{container:o,direction:r,item:c,spacing:i,wrap:a,zeroMinWidth:s,breakpoints:p}=e;let u=[];o&&(u=function(n,t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n||n<=0)return[];if("string"===typeof n&&!Number.isNaN(Number(n))||"number"===typeof n)return[e["spacing-xs-".concat(String(n))]];const o=[];return t.forEach((t=>{const r=n[t];Number(r)>0&&o.push(e["spacing-".concat(t,"-").concat(String(r))])})),o}(i,p,t));const l=[];return p.forEach((n=>{const o=e[n];o&&l.push(t["grid-".concat(n,"-").concat(String(o))])})),[t.root,o&&t.container,c&&t.item,s&&t.zeroMinWidth,...u,"row"!==r&&t["direction-xs-".concat(String(r))],"wrap"!==a&&t["wrap-xs-".concat(String(a))],...l]}})((n=>{let{ownerState:t}=n;return(0,r.Z)({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},"wrap"!==t.wrap&&{flexWrap:t.wrap})}),(function(n){let{theme:t,ownerState:e}=n;const o=(0,a.P$)({values:e.direction,breakpoints:t.breakpoints.values});return(0,a.k9)({theme:t},o,(n=>{const t={flexDirection:n};return 0===n.indexOf("column")&&(t["& > .".concat(h.item)]={maxWidth:"none"}),t}))}),(function(n){let{theme:t,ownerState:e}=n;const{container:o,rowSpacing:r}=e;let c={};if(o&&0!==r){const n=(0,a.P$)({values:r,breakpoints:t.breakpoints.values});let e;"object"===typeof n&&(e=v({breakpoints:t.breakpoints.values,values:n})),c=(0,a.k9)({theme:t},n,((n,o)=>{var r;const c=t.spacing(n);return"0px"!==c?{marginTop:"-".concat(S(c)),["& > .".concat(h.item)]:{paddingTop:S(c)}}:null!=(r=e)&&r.includes(o)?{}:{marginTop:0,["& > .".concat(h.item)]:{paddingTop:0}}}))}return c}),(function(n){let{theme:t,ownerState:e}=n;const{container:o,columnSpacing:r}=e;let c={};if(o&&0!==r){const n=(0,a.P$)({values:r,breakpoints:t.breakpoints.values});let e;"object"===typeof n&&(e=v({breakpoints:t.breakpoints.values,values:n})),c=(0,a.k9)({theme:t},n,((n,o)=>{var r;const c=t.spacing(n);return"0px"!==c?{width:"calc(100% + ".concat(S(c),")"),marginLeft:"-".concat(S(c)),["& > .".concat(h.item)]:{paddingLeft:S(c)}}:null!=(r=e)&&r.includes(o)?{}:{width:"100%",marginLeft:0,["& > .".concat(h.item)]:{paddingLeft:0}}}))}return c}),(function(n){let t,{theme:e,ownerState:o}=n;return e.breakpoints.keys.reduce(((n,c)=>{let i={};if(o[c]&&(t=o[c]),!t)return n;if(!0===t)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===t)i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=(0,a.P$)({values:o.columns,breakpoints:e.breakpoints.values}),p="object"===typeof s?s[c]:s;if(void 0===p||null===p)return n;const u="".concat(Math.round(t/p*1e8)/1e6,"%");let l={};if(o.container&&o.item&&0!==o.columnSpacing){const n=e.spacing(o.columnSpacing);if("0px"!==n){const t="calc(".concat(u," + ").concat(S(n),")");l={flexBasis:t,maxWidth:t}}}i=(0,r.Z)({flexBasis:u,flexGrow:0,maxWidth:u},l)}return 0===e.breakpoints.values[c]?Object.assign(n,i):n[e.breakpoints.up(c)]=i,n}),{})}));const Z=n=>{const{classes:t,container:e,direction:o,item:r,spacing:c,wrap:i,zeroMinWidth:a,breakpoints:s}=n;let u=[];e&&(u=function(n,t){if(!n||n<=0)return[];if("string"===typeof n&&!Number.isNaN(Number(n))||"number"===typeof n)return["spacing-xs-".concat(String(n))];const e=[];return t.forEach((t=>{const o=n[t];if(Number(o)>0){const n="spacing-".concat(t,"-").concat(String(o));e.push(n)}})),e}(c,s));const l=[];s.forEach((t=>{const e=n[t];e&&l.push("grid-".concat(t,"-").concat(String(e)))}));const m={root:["root",e&&"container",r&&"item",a&&"zeroMinWidth",...u,"row"!==o&&"direction-xs-".concat(String(o)),"wrap"!==i&&"wrap-xs-".concat(String(i)),...l]};return(0,p.Z)(m,w,t)},M=c.forwardRef((function(n,t){const e=(0,l.Z)({props:n,name:"MuiGrid"}),{breakpoints:a}=(0,m.Z)(),p=(0,s.Z)(e),{className:u,columns:f,columnSpacing:g,component:w="div",container:b=!1,direction:h="row",item:S=!1,rowSpacing:v,spacing:M=0,wrap:y="wrap",zeroMinWidth:N=!1}=p,z=(0,o.Z)(p,k),j=v||M,P=g||M,G=c.useContext(d),E=b?f||12:G,O={},B=(0,r.Z)({},z);a.keys.forEach((n=>{null!=z[n]&&(O[n]=z[n],delete B[n])}));const C=(0,r.Z)({},p,{columns:E,container:b,direction:h,item:S,rowSpacing:j,columnSpacing:P,wrap:y,zeroMinWidth:N,spacing:M},O,{breakpoints:a.keys}),L=Z(C);return(0,x.jsx)(d.Provider,{value:E,children:(0,x.jsx)(W,(0,r.Z)({ownerState:C,className:(0,i.Z)(L.root,u),as:w,ref:t},B))})}));const y=M}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6448],{67231:(e,t,o)=>{o.d(t,{Z:()=>v});var n=o(31461),r=o(7896),a=o(5057),l=o(34612),i=o(91213),s=o(20662),d=o(91149),u=o(84722),c=o(26505),p=o(96266);const m=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],h=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[...(0,s.Gx)(e,t),!o.disableUnderline&&t.underline]}})((e=>{let{theme:t,ownerState:o}=e;var n;const a="light"===t.palette.mode,l=a?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=a?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=a?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",d=a?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return(0,r.Z)({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},["&.".concat(c.Z.focused)]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},["&.".concat(c.Z.disabled)]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:d}},!o.disableUnderline&&{"&::after":{borderBottom:"2px solid ".concat(null==(n=(t.vars||t).palette[o.color||"primary"])?void 0:n.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},["&.".concat(c.Z.focused,":after")]:{transform:"scaleX(1) translateX(0)"},["&.".concat(c.Z.error)]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:"1px solid ".concat(t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / ").concat(t.vars.opacity.inputUnderline,")"):l),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},["&:hover:not(.".concat(c.Z.disabled,", .").concat(c.Z.error,"):before")]:{borderBottom:"1px solid ".concat((t.vars||t).palette.text.primary)},["&.".concat(c.Z.disabled,":before")]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&(0,r.Z)({padding:"25px 12px 8px"},"small"===o.size&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&"small"===o.size&&{paddingTop:8,paddingBottom:9}))})),f=(0,d.ZP)(s.rA,{name:"MuiFilledInput",slot:"Input",overridesResolver:s._o})((e=>{let{theme:t,ownerState:o}=e;return(0,r.Z)({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===o.size&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&"small"===o.size&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})})),b=a.forwardRef((function(e,t){var o,a,d,b;const v=(0,u.Z)({props:e,name:"MuiFilledInput"}),{components:g={},componentsProps:Z,fullWidth:y=!1,inputComponent:w="input",multiline:x=!1,slotProps:S,slots:C={},type:R="text"}=v,P=(0,n.Z)(v,m),I=(0,r.Z)({},v,{fullWidth:y,inputComponent:w,multiline:x,type:R}),O=(e=>{const{classes:t,disableUnderline:o}=e,n={root:["root",!o&&"underline"],input:["input"]},a=(0,i.Z)(n,c._,t);return(0,r.Z)({},t,a)})(v),k={root:{ownerState:I},input:{ownerState:I}},F=(null!=S?S:Z)?(0,l.Z)(k,null!=S?S:Z):k,W=null!=(o=null!=(a=C.root)?a:g.Root)?o:h,B=null!=(d=null!=(b=C.input)?b:g.Input)?d:f;return(0,p.jsx)(s.ZP,(0,r.Z)({slots:{root:W,input:B},componentsProps:F,fullWidth:y,inputComponent:w,multiline:x,ref:t,type:R},P,{classes:O}))}));b.muiName="Input";const v=b},26505:(e,t,o)=>{o.d(t,{Z:()=>s,_:()=>i});var n=o(7896),r=o(31821),a=o(18561),l=o(19053);function i(e){return(0,a.ZP)("MuiFilledInput",e)}const s=(0,n.Z)({},l.Z,(0,r.Z)("MuiFilledInput",["root","underline","input"]))},35214:(e,t,o)=>{o.d(t,{Z:()=>y});var n=o(31461),r=o(7896),a=o(5057),l=o(9978),i=o(91213),s=o(84722),d=o(91149),u=o(88815),c=o(4360),p=o(36448),m=o(78158),h=o(31821),f=o(18561);function b(e){return(0,f.ZP)("MuiFormControl",e)}(0,h.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var v=o(96266);const g=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Z=(0,d.ZP)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:o}=e;return(0,r.Z)({},t.root,t["margin".concat((0,c.Z)(o.margin))],o.fullWidth&&t.fullWidth)}})((e=>{let{ownerState:t}=e;return(0,r.Z)({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},"normal"===t.margin&&{marginTop:16,marginBottom:8},"dense"===t.margin&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})})),y=a.forwardRef((function(e,t){const o=(0,s.Z)({props:e,name:"MuiFormControl"}),{children:d,className:h,color:f="primary",component:y="div",disabled:w=!1,error:x=!1,focused:S,fullWidth:C=!1,hiddenLabel:R=!1,margin:P="none",required:I=!1,size:O="medium",variant:k="outlined"}=o,F=(0,n.Z)(o,g),W=(0,r.Z)({},o,{color:f,component:y,disabled:w,error:x,fullWidth:C,hiddenLabel:R,margin:P,required:I,size:O,variant:k}),B=(e=>{const{classes:t,margin:o,fullWidth:n}=e,r={root:["root","none"!==o&&"margin".concat((0,c.Z)(o)),n&&"fullWidth"]};return(0,i.Z)(r,b,t)})(W),[M,A]=a.useState((()=>{let e=!1;return d&&a.Children.forEach(d,(t=>{if(!(0,p.Z)(t,["Input","Select"]))return;const o=(0,p.Z)(t,["Select"])?t.props.input:t;o&&(0,u.B7)(o.props)&&(e=!0)})),e})),[N,z]=a.useState((()=>{let e=!1;return d&&a.Children.forEach(d,(t=>{(0,p.Z)(t,["Input","Select"])&&((0,u.vd)(t.props,!0)||(0,u.vd)(t.props.inputProps,!0))&&(e=!0)})),e})),[E,j]=a.useState(!1);w&&E&&j(!1);const L=void 0===S||w?E:S;let T;const D=a.useMemo((()=>({adornedStart:M,setAdornedStart:A,color:f,disabled:w,error:x,filled:N,focused:L,fullWidth:C,hiddenLabel:R,size:O,onBlur:()=>{j(!1)},onEmpty:()=>{z(!1)},onFilled:()=>{z(!0)},onFocus:()=>{j(!0)},registerEffect:T,required:I,variant:k})),[M,f,w,x,N,L,C,R,T,I,O,k]);return(0,v.jsx)(m.Z.Provider,{value:D,children:(0,v.jsx)(Z,(0,r.Z)({as:y,ownerState:W,className:(0,l.Z)(B.root,h),ref:t},F,{children:d}))})}))},67626:(e,t,o)=>{o.d(t,{Z:()=>v});var n=o(31461),r=o(7896),a=o(5057),l=o(91213),i=o(34612),s=o(20662),d=o(91149),u=o(84722),c=o(17354),p=o(96266);const m=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],h=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[...(0,s.Gx)(e,t),!o.disableUnderline&&t.underline]}})((e=>{let{theme:t,ownerState:o}=e;let n="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n="rgba(".concat(t.vars.palette.common.onBackgroundChannel," / ").concat(t.vars.opacity.inputUnderline,")")),(0,r.Z)({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:"2px solid ".concat((t.vars||t).palette[o.color].main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},["&.".concat(c.Z.focused,":after")]:{transform:"scaleX(1) translateX(0)"},["&.".concat(c.Z.error)]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},["&:hover:not(.".concat(c.Z.disabled,", .").concat(c.Z.error,"):before")]:{borderBottom:"2px solid ".concat((t.vars||t).palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(n)}},["&.".concat(c.Z.disabled,":before")]:{borderBottomStyle:"dotted"}})})),f=(0,d.ZP)(s.rA,{name:"MuiInput",slot:"Input",overridesResolver:s._o})({}),b=a.forwardRef((function(e,t){var o,a,d,b;const v=(0,u.Z)({props:e,name:"MuiInput"}),{disableUnderline:g,components:Z={},componentsProps:y,fullWidth:w=!1,inputComponent:x="input",multiline:S=!1,slotProps:C,slots:R={},type:P="text"}=v,I=(0,n.Z)(v,m),O=(e=>{const{classes:t,disableUnderline:o}=e,n={root:["root",!o&&"underline"],input:["input"]},a=(0,l.Z)(n,c.l,t);return(0,r.Z)({},t,a)})(v),k={root:{ownerState:{disableUnderline:g}}},F=(null!=C?C:y)?(0,i.Z)(null!=C?C:y,k):k,W=null!=(o=null!=(a=R.root)?a:Z.Root)?o:h,B=null!=(d=null!=(b=R.input)?b:Z.Input)?d:f;return(0,p.jsx)(s.ZP,(0,r.Z)({slots:{root:W,input:B},slotProps:F,fullWidth:w,inputComponent:x,multiline:S,ref:t,type:P},I,{classes:O}))}));b.muiName="Input";const v=b},17354:(e,t,o)=>{o.d(t,{Z:()=>s,l:()=>i});var n=o(7896),r=o(31821),a=o(18561),l=o(19053);function i(e){return(0,a.ZP)("MuiInput",e)}const s=(0,n.Z)({},l.Z,(0,r.Z)("MuiInput",["root","underline","input"]))},20662:(e,t,o)=>{o.d(t,{rA:()=>L,Ej:()=>j,ZP:()=>D,_o:()=>E,Gx:()=>z});var n=o(31461),r=o(7896),a=o(90118),l=o(5057),i=o(9978),s=o(91213),d=o(53627),u=o(60730),c=o(9962),p=o(56073),m=o(77339),h=o(96266);const f=["onChange","maxRows","minRows","style","value"];function b(e){return parseInt(e,10)||0}const v={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function g(e){return void 0===e||null===e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflow}const Z=l.forwardRef((function(e,t){const{onChange:o,maxRows:a,minRows:i=1,style:s,value:Z}=e,y=(0,n.Z)(e,f),{current:w}=l.useRef(null!=Z),x=l.useRef(null),S=(0,u.Z)(t,x),C=l.useRef(null),R=l.useRef(0),[P,I]=l.useState({outerHeightStyle:0}),O=l.useCallback((()=>{const t=x.current,o=(0,c.Z)(t).getComputedStyle(t);if("0px"===o.width)return{outerHeightStyle:0};const n=C.current;n.style.width=o.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");const r=o.boxSizing,l=b(o.paddingBottom)+b(o.paddingTop),s=b(o.borderBottomWidth)+b(o.borderTopWidth),d=n.scrollHeight;n.value="x";const u=n.scrollHeight;let p=d;i&&(p=Math.max(Number(i)*u,p)),a&&(p=Math.min(Number(a)*u,p)),p=Math.max(p,u);return{outerHeightStyle:p+("border-box"===r?l+s:0),overflow:Math.abs(p-d)<=1}}),[a,i,e.placeholder]),k=(e,t)=>{const{outerHeightStyle:o,overflow:n}=t;return R.current<20&&(o>0&&Math.abs((e.outerHeightStyle||0)-o)>1||e.overflow!==n)?(R.current+=1,{overflow:n,outerHeightStyle:o}):e},F=l.useCallback((()=>{const e=O();g(e)||I((t=>k(t,e)))}),[O]);(0,p.Z)((()=>{const e=()=>{R.current=0,(()=>{const e=O();g(e)||d.flushSync((()=>{I((t=>k(t,e)))}))})()};let t;const o=(0,m.Z)(e),n=x.current,r=(0,c.Z)(n);let a;return r.addEventListener("resize",o),"undefined"!==typeof ResizeObserver&&(a=new ResizeObserver(e),a.observe(n)),()=>{o.clear(),cancelAnimationFrame(t),r.removeEventListener("resize",o),a&&a.disconnect()}}),[O]),(0,p.Z)((()=>{F()})),l.useEffect((()=>{R.current=0}),[Z]);return(0,h.jsxs)(l.Fragment,{children:[(0,h.jsx)("textarea",(0,r.Z)({value:Z,onChange:e=>{R.current=0,w||F(),o&&o(e)},ref:S,rows:i,style:(0,r.Z)({height:P.outerHeightStyle,overflow:P.overflow?"hidden":void 0},s)},y)),(0,h.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:C,tabIndex:-1,style:(0,r.Z)({},v,s,{paddingTop:0,paddingBottom:0})})]})}));var y=o(39584),w=o(59193),x=o(78158),S=o(3844),C=o(91149),R=o(84722),P=o(4360),I=o(12085),O=o(95449),k=o(63280),F=o(16161),W=o(44577);const B=function(e){return(0,h.jsx)(k.Z,(0,r.Z)({},e,{defaultTheme:F.Z,themeId:W.Z}))};var M=o(88815),A=o(19053);const N=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],z=(e,t)=>{const{ownerState:o}=e;return[t.root,o.formControl&&t.formControl,o.startAdornment&&t.adornedStart,o.endAdornment&&t.adornedEnd,o.error&&t.error,"small"===o.size&&t.sizeSmall,o.multiline&&t.multiline,o.color&&t["color".concat((0,P.Z)(o.color))],o.fullWidth&&t.fullWidth,o.hiddenLabel&&t.hiddenLabel]},E=(e,t)=>{const{ownerState:o}=e;return[t.input,"small"===o.size&&t.inputSizeSmall,o.multiline&&t.inputMultiline,"search"===o.type&&t.inputTypeSearch,o.startAdornment&&t.inputAdornedStart,o.endAdornment&&t.inputAdornedEnd,o.hiddenLabel&&t.inputHiddenLabel]},j=(0,C.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:z})((e=>{let{theme:t,ownerState:o}=e;return(0,r.Z)({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",["&.".concat(A.Z.disabled)]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},o.multiline&&(0,r.Z)({padding:"4px 0 5px"},"small"===o.size&&{paddingTop:1}),o.fullWidth&&{width:"100%"})})),L=(0,C.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:E})((e=>{let{theme:t,ownerState:o}=e;const n="light"===t.palette.mode,a=(0,r.Z)({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),l={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return(0,r.Z)({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":a,"&::-moz-placeholder":a,"&:-ms-input-placeholder":a,"&::-ms-input-placeholder":a,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},["label[data-shrink=false] + .".concat(A.Z.formControl," &")]:{"&::-webkit-input-placeholder":l,"&::-moz-placeholder":l,"&:-ms-input-placeholder":l,"&::-ms-input-placeholder":l,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},["&.".concat(A.Z.disabled)]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},"small"===o.size&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===o.type&&{MozAppearance:"textfield"})})),T=(0,h.jsx)(B,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),D=l.forwardRef((function(e,t){var o;const d=(0,R.Z)({props:e,name:"MuiInputBase"}),{"aria-describedby":u,autoComplete:c,autoFocus:p,className:m,components:f={},componentsProps:b={},defaultValue:v,disabled:g,disableInjectingGlobalStyles:C,endAdornment:k,fullWidth:F=!1,id:W,inputComponent:B="input",inputProps:z={},inputRef:E,maxRows:D,minRows:U,multiline:H=!1,name:V,onBlur:K,onChange:_,onClick:q,onFocus:X,onKeyDown:G,onKeyUp:J,placeholder:Q,readOnly:Y,renderSuffix:$,rows:ee,slotProps:te={},slots:oe={},startAdornment:ne,type:re="text",value:ae}=d,le=(0,n.Z)(d,N),ie=null!=z.value?z.value:ae,{current:se}=l.useRef(null!=ie),de=l.useRef(),ue=l.useCallback((e=>{0}),[]),ce=(0,I.Z)(de,E,z.ref,ue),[pe,me]=l.useState(!1),he=(0,S.Z)();const fe=(0,w.Z)({props:d,muiFormControl:he,states:["color","disabled","error","hiddenLabel","size","required","filled"]});fe.focused=he?he.focused:pe,l.useEffect((()=>{!he&&g&&pe&&(me(!1),K&&K())}),[he,g,pe,K]);const be=he&&he.onFilled,ve=he&&he.onEmpty,ge=l.useCallback((e=>{(0,M.vd)(e)?be&&be():ve&&ve()}),[be,ve]);(0,O.Z)((()=>{se&&ge({value:ie})}),[ie,ge,se]);l.useEffect((()=>{ge(de.current)}),[]);let Ze=B,ye=z;H&&"input"===Ze&&(ye=ee?(0,r.Z)({type:void 0,minRows:ee,maxRows:ee},ye):(0,r.Z)({type:void 0,maxRows:D,minRows:U},ye),Ze=Z);l.useEffect((()=>{he&&he.setAdornedStart(Boolean(ne))}),[he,ne]);const we=(0,r.Z)({},d,{color:fe.color||"primary",disabled:fe.disabled,endAdornment:k,error:fe.error,focused:fe.focused,formControl:he,fullWidth:F,hiddenLabel:fe.hiddenLabel,multiline:H,size:fe.size,startAdornment:ne,type:re}),xe=(e=>{const{classes:t,color:o,disabled:n,error:r,endAdornment:a,focused:l,formControl:i,fullWidth:d,hiddenLabel:u,multiline:c,readOnly:p,size:m,startAdornment:h,type:f}=e,b={root:["root","color".concat((0,P.Z)(o)),n&&"disabled",r&&"error",d&&"fullWidth",l&&"focused",i&&"formControl",m&&"medium"!==m&&"size".concat((0,P.Z)(m)),c&&"multiline",h&&"adornedStart",a&&"adornedEnd",u&&"hiddenLabel",p&&"readOnly"],input:["input",n&&"disabled","search"===f&&"inputTypeSearch",c&&"inputMultiline","small"===m&&"inputSizeSmall",u&&"inputHiddenLabel",h&&"inputAdornedStart",a&&"inputAdornedEnd",p&&"readOnly"]};return(0,s.Z)(b,A.u,t)})(we),Se=oe.root||f.Root||j,Ce=te.root||b.root||{},Re=oe.input||f.Input||L;return ye=(0,r.Z)({},ye,null!=(o=te.input)?o:b.input),(0,h.jsxs)(l.Fragment,{children:[!C&&T,(0,h.jsxs)(Se,(0,r.Z)({},Ce,!(0,y.X)(Se)&&{ownerState:(0,r.Z)({},we,Ce.ownerState)},{ref:t,onClick:e=>{de.current&&e.currentTarget===e.target&&de.current.focus(),q&&q(e)}},le,{className:(0,i.Z)(xe.root,Ce.className,m,Y&&"MuiInputBase-readOnly"),children:[ne,(0,h.jsx)(x.Z.Provider,{value:null,children:(0,h.jsx)(Re,(0,r.Z)({ownerState:we,"aria-invalid":fe.error,"aria-describedby":u,autoComplete:c,autoFocus:p,defaultValue:v,disabled:fe.disabled,id:W,onAnimationStart:e=>{ge("mui-auto-fill-cancel"===e.animationName?de.current:{value:"x"})},name:V,placeholder:Q,readOnly:Y,required:fe.required,rows:ee,value:ie,onKeyDown:G,onKeyUp:J,type:re},ye,!(0,y.X)(Re)&&{as:Ze,ownerState:(0,r.Z)({},we,ye.ownerState)},{ref:ce,className:(0,i.Z)(xe.input,ye.className,Y&&"MuiInputBase-readOnly"),onBlur:e=>{K&&K(e),z.onBlur&&z.onBlur(e),he&&he.onBlur?he.onBlur(e):me(!1)},onChange:function(e){if(!se){const t=e.target||de.current;if(null==t)throw new Error((0,a.Z)(1));ge({value:t.value})}for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];z.onChange&&z.onChange(e,...o),_&&_(e,...o)},onFocus:e=>{fe.disabled?e.stopPropagation():(X&&X(e),z.onFocus&&z.onFocus(e),he&&he.onFocus?he.onFocus(e):me(!0))}}))}),k,$?$((0,r.Z)({},fe,{startAdornment:ne})):null]}))]})}))},19053:(e,t,o)=>{o.d(t,{Z:()=>l,u:()=>a});var n=o(31821),r=o(18561);function a(e){return(0,r.ZP)("MuiInputBase",e)}const l=(0,n.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"])},88815:(e,t,o)=>{function n(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function r(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(n(e.value)&&""!==e.value||t&&n(e.defaultValue)&&""!==e.defaultValue)}function a(e){return e.startAdornment}o.d(t,{B7:()=>a,vd:()=>r})},90657:(e,t,o)=>{o.d(t,{Z:()=>S});var n,r=o(31461),a=o(7896),l=o(5057),i=o(91213),s=o(91149),d=o(96266);const u=["children","classes","className","label","notched"],c=(0,s.ZP)("fieldset",{shouldForwardProp:s.FO})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),p=(0,s.ZP)("legend",{shouldForwardProp:s.FO})((e=>{let{ownerState:t,theme:o}=e;return(0,a.Z)({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},t.withLabel&&(0,a.Z)({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})}))}));var m=o(3844),h=o(59193),f=o(97487),b=o(20662),v=o(84722);const g=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],Z=(0,s.ZP)(b.Ej,{shouldForwardProp:e=>(0,s.FO)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:b.Gx})((e=>{let{theme:t,ownerState:o}=e;const n="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return(0,a.Z)({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,["&:hover .".concat(f.Z.notchedOutline)]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{["&:hover .".concat(f.Z.notchedOutline)]:{borderColor:t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):n}},["&.".concat(f.Z.focused," .").concat(f.Z.notchedOutline)]:{borderColor:(t.vars||t).palette[o.color].main,borderWidth:2},["&.".concat(f.Z.error," .").concat(f.Z.notchedOutline)]:{borderColor:(t.vars||t).palette.error.main},["&.".concat(f.Z.disabled," .").concat(f.Z.notchedOutline)]:{borderColor:(t.vars||t).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&(0,a.Z)({padding:"16.5px 14px"},"small"===o.size&&{padding:"8.5px 14px"}))})),y=(0,s.ZP)((function(e){const{className:t,label:o,notched:l}=e,i=(0,r.Z)(e,u),s=null!=o&&""!==o,m=(0,a.Z)({},e,{notched:l,withLabel:s});return(0,d.jsx)(c,(0,a.Z)({"aria-hidden":!0,className:t,ownerState:m},i,{children:(0,d.jsx)(p,{ownerState:m,children:s?(0,d.jsx)("span",{children:o}):n||(n=(0,d.jsx)("span",{className:"notranslate",children:"\u200b"}))})}))}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})((e=>{let{theme:t}=e;const o="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?"rgba(".concat(t.vars.palette.common.onBackgroundChannel," / 0.23)"):o}})),w=(0,s.ZP)(b.rA,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:b._o})((e=>{let{theme:t,ownerState:o}=e;return(0,a.Z)({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===o.size&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})})),x=l.forwardRef((function(e,t){var o,n,s,u,c;const p=(0,v.Z)({props:e,name:"MuiOutlinedInput"}),{components:x={},fullWidth:S=!1,inputComponent:C="input",label:R,multiline:P=!1,notched:I,slots:O={},type:k="text"}=p,F=(0,r.Z)(p,g),W=(e=>{const{classes:t}=e,o=(0,i.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},f.e,t);return(0,a.Z)({},t,o)})(p),B=(0,m.Z)(),M=(0,h.Z)({props:p,muiFormControl:B,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),A=(0,a.Z)({},p,{color:M.color||"primary",disabled:M.disabled,error:M.error,focused:M.focused,formControl:B,fullWidth:S,hiddenLabel:M.hiddenLabel,multiline:P,size:M.size,type:k}),N=null!=(o=null!=(n=O.root)?n:x.Root)?o:Z,z=null!=(s=null!=(u=O.input)?u:x.Input)?s:w;return(0,d.jsx)(b.ZP,(0,a.Z)({slots:{root:N,input:z},renderSuffix:e=>(0,d.jsx)(y,{ownerState:A,className:W.notchedOutline,label:null!=R&&""!==R&&M.required?c||(c=(0,d.jsxs)(l.Fragment,{children:[R,"\u2009","*"]})):R,notched:"undefined"!==typeof I?I:Boolean(e.startAdornment||e.filled||e.focused)}),fullWidth:S,inputComponent:C,multiline:P,ref:t,type:k},F,{classes:(0,a.Z)({},W,{notchedOutline:null})}))}));x.muiName="Input";const S=x},97487:(e,t,o)=>{o.d(t,{Z:()=>s,e:()=>i});var n=o(7896),r=o(31821),a=o(18561),l=o(19053);function i(e){return(0,a.ZP)("MuiOutlinedInput",e)}const s=(0,n.Z)({},l.Z,(0,r.Z)("MuiOutlinedInput",["root","notchedOutline","input"]))},70116:(e,t,o)=>{o.d(t,{Z:()=>$});var n=o(7896),r=o(31461),a=o(5057),l=o(9978),i=o(34612),s=o(90118),d=(o(97408),o(91213)),u=o(32852),c=o(90569),p=o(4360),m=o(6019),h=o(31821),f=o(18561);function b(e){return(0,f.ZP)("MuiNativeSelect",e)}const v=(0,h.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var g=o(91149),Z=o(96266);const y=["className","disabled","error","IconComponent","inputRef","variant"],w=e=>{let{ownerState:t,theme:o}=e;return(0,n.Z)({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":(0,n.Z)({},o.vars?{backgroundColor:"rgba(".concat(o.vars.palette.common.onBackgroundChannel," / 0.05)")}:{backgroundColor:"light"===o.palette.mode?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},["&.".concat(v.disabled)]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},"filled"===t.variant&&{"&&&":{paddingRight:32}},"outlined"===t.variant&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}})},x=(0,g.ZP)("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:g.FO,overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.select,t[o.variant],o.error&&t.error,{["&.".concat(v.multiple)]:t.multiple}]}})(w),S=e=>{let{ownerState:t,theme:o}=e;return(0,n.Z)({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,["&.".concat(v.disabled)]:{color:(o.vars||o).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},"filled"===t.variant&&{right:7},"outlined"===t.variant&&{right:7})},C=(0,g.ZP)("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,o.variant&&t["icon".concat((0,p.Z)(o.variant))],o.open&&t.iconOpen]}})(S),R=a.forwardRef((function(e,t){const{className:o,disabled:i,error:s,IconComponent:u,inputRef:c,variant:m="standard"}=e,h=(0,r.Z)(e,y),f=(0,n.Z)({},e,{disabled:i,variant:m,error:s}),v=(e=>{const{classes:t,variant:o,disabled:n,multiple:r,open:a,error:l}=e,i={select:["select",o,n&&"disabled",r&&"multiple",l&&"error"],icon:["icon","icon".concat((0,p.Z)(o)),a&&"iconOpen",n&&"disabled"]};return(0,d.Z)(i,b,t)})(f);return(0,Z.jsxs)(a.Fragment,{children:[(0,Z.jsx)(x,(0,n.Z)({ownerState:f,className:(0,l.Z)(v.select,o),disabled:i,ref:c||t},h)),e.multiple?null:(0,Z.jsx)(C,{as:u,ownerState:f,className:v.icon})]})}));var P=o(88815),I=o(12085),O=o(93159);function k(e){return(0,f.ZP)("MuiSelect",e)}const F=(0,h.Z)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var W;const B=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],M=(0,g.ZP)("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{["&.".concat(F.select)]:t.select},{["&.".concat(F.select)]:t[o.variant]},{["&.".concat(F.error)]:t.error},{["&.".concat(F.multiple)]:t.multiple}]}})(w,{["&.".concat(F.select)]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),A=(0,g.ZP)("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.icon,o.variant&&t["icon".concat((0,p.Z)(o.variant))],o.open&&t.iconOpen]}})(S),N=(0,g.ZP)("input",{shouldForwardProp:e=>(0,g.Dz)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function z(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function E(e){return null==e||"string"===typeof e&&!e.trim()}const j=a.forwardRef((function(e,t){var o;const{"aria-describedby":i,"aria-label":h,autoFocus:f,autoWidth:b,children:v,className:g,defaultOpen:y,defaultValue:w,disabled:x,displayEmpty:S,error:C=!1,IconComponent:R,inputRef:F,labelId:j,MenuProps:L={},multiple:T,name:D,onBlur:U,onChange:H,onClose:V,onFocus:K,onOpen:_,open:q,readOnly:X,renderValue:G,SelectDisplayProps:J={},tabIndex:Q,value:Y,variant:$="standard"}=e,ee=(0,r.Z)(e,B),[te,oe]=(0,O.Z)({controlled:Y,default:w,name:"Select"}),[ne,re]=(0,O.Z)({controlled:q,default:y,name:"Select"}),ae=a.useRef(null),le=a.useRef(null),[ie,se]=a.useState(null),{current:de}=a.useRef(null!=q),[ue,ce]=a.useState(),pe=(0,I.Z)(t,F),me=a.useCallback((e=>{le.current=e,e&&se(e)}),[]),he=null==ie?void 0:ie.parentNode;a.useImperativeHandle(pe,(()=>({focus:()=>{le.current.focus()},node:ae.current,value:te})),[te]),a.useEffect((()=>{y&&ne&&ie&&!de&&(ce(b?null:he.clientWidth),le.current.focus())}),[ie,b]),a.useEffect((()=>{f&&le.current.focus()}),[f]),a.useEffect((()=>{if(!j)return;const e=(0,c.Z)(le.current).getElementById(j);if(e){const t=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[j]);const fe=(e,t)=>{e?_&&_(t):V&&V(t),de||(ce(b?null:he.clientWidth),re(e))},be=a.Children.toArray(v),ve=e=>t=>{let o;if(t.currentTarget.hasAttribute("tabindex")){if(T){o=Array.isArray(te)?te.slice():[];const t=te.indexOf(e.props.value);-1===t?o.push(e.props.value):o.splice(t,1)}else o=e.props.value;if(e.props.onClick&&e.props.onClick(t),te!==o&&(oe(o),H)){const n=t.nativeEvent||t,r=new n.constructor(n.type,n);Object.defineProperty(r,"target",{writable:!0,value:{value:o,name:D}}),H(r,e)}T||fe(!1,t)}},ge=null!==ie&&ne;let Ze,ye;delete ee["aria-invalid"];const we=[];let xe=!1,Se=!1;((0,P.vd)({value:te})||S)&&(G?Ze=G(te):xe=!0);const Ce=be.map((e=>{if(!a.isValidElement(e))return null;let t;if(T){if(!Array.isArray(te))throw new Error((0,s.Z)(2));t=te.some((t=>z(t,e.props.value))),t&&xe&&we.push(e.props.children)}else t=z(te,e.props.value),t&&xe&&(ye=e.props.children);return t&&(Se=!0),a.cloneElement(e,{"aria-selected":t?"true":"false",onClick:ve(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));xe&&(Ze=T?0===we.length?null:we.reduce(((e,t,o)=>(e.push(t),o<we.length-1&&e.push(", "),e)),[]):ye);let Re,Pe=ue;!b&&de&&ie&&(Pe=he.clientWidth),Re="undefined"!==typeof Q?Q:x?null:0;const Ie=J.id||(D?"mui-component-select-".concat(D):void 0),Oe=(0,n.Z)({},e,{variant:$,value:te,open:ge,error:C}),ke=(e=>{const{classes:t,variant:o,disabled:n,multiple:r,open:a,error:l}=e,i={select:["select",o,n&&"disabled",r&&"multiple",l&&"error"],icon:["icon","icon".concat((0,p.Z)(o)),a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return(0,d.Z)(i,k,t)})(Oe),Fe=(0,n.Z)({},L.PaperProps,null==(o=L.slotProps)?void 0:o.paper),We=(0,u.Z)();return(0,Z.jsxs)(a.Fragment,{children:[(0,Z.jsx)(M,(0,n.Z)({ref:me,tabIndex:Re,role:"combobox","aria-controls":We,"aria-disabled":x?"true":void 0,"aria-expanded":ge?"true":"false","aria-haspopup":"listbox","aria-label":h,"aria-labelledby":[j,Ie].filter(Boolean).join(" ")||void 0,"aria-describedby":i,onKeyDown:e=>{if(!X){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),fe(!0,e))}},onMouseDown:x||X?null:e=>{0===e.button&&(e.preventDefault(),le.current.focus(),fe(!0,e))},onBlur:e=>{!ge&&U&&(Object.defineProperty(e,"target",{writable:!0,value:{value:te,name:D}}),U(e))},onFocus:K},J,{ownerState:Oe,className:(0,l.Z)(J.className,ke.select,g),id:Ie,children:E(Ze)?W||(W=(0,Z.jsx)("span",{className:"notranslate",children:"\u200b"})):Ze})),(0,Z.jsx)(N,(0,n.Z)({"aria-invalid":C,value:Array.isArray(te)?te.join(","):te,name:D,ref:ae,"aria-hidden":!0,onChange:e=>{const t=be.find((t=>t.props.value===e.target.value));void 0!==t&&(oe(t.props.value),H&&H(e,t))},tabIndex:-1,disabled:x,className:ke.nativeInput,autoFocus:f,ownerState:Oe},ee)),(0,Z.jsx)(A,{as:R,className:ke.icon,ownerState:Oe}),(0,Z.jsx)(m.Z,(0,n.Z)({id:"menu-".concat(D||""),anchorEl:he,open:ge,onClose:e=>{fe(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},L,{MenuListProps:(0,n.Z)({"aria-labelledby":j,role:"listbox","aria-multiselectable":T?"true":void 0,disableListWrap:!0,id:We},L.MenuListProps),slotProps:(0,n.Z)({},L.slotProps,{paper:(0,n.Z)({},Fe,{style:(0,n.Z)({minWidth:Pe},null!=Fe?Fe.style:null)})}),children:Ce}))]})}));var L=o(59193),T=o(3844),D=o(33375),U=o(67626),H=o(67231),V=o(90657),K=o(84722);const _=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],q=["root"],X={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,g.FO)(e)&&"variant"!==e,slot:"Root"},G=(0,g.ZP)(U.Z,X)(""),J=(0,g.ZP)(V.Z,X)(""),Q=(0,g.ZP)(H.Z,X)(""),Y=a.forwardRef((function(e,t){const o=(0,K.Z)({name:"MuiSelect",props:e}),{autoWidth:s=!1,children:d,classes:u={},className:c,defaultOpen:p=!1,displayEmpty:m=!1,IconComponent:h=D.Z,id:f,input:b,inputProps:v,label:g,labelId:y,MenuProps:w,multiple:x=!1,native:S=!1,onClose:C,onOpen:P,open:O,renderValue:k,SelectDisplayProps:F,variant:W="outlined"}=o,B=(0,r.Z)(o,_),M=S?R:j,A=(0,T.Z)(),N=(0,L.Z)({props:o,muiFormControl:A,states:["variant","error"]}),z=N.variant||W,E=(0,n.Z)({},o,{variant:z,classes:u}),U=(e=>{const{classes:t}=e;return t})(E),H=(0,r.Z)(U,q),V=b||{standard:(0,Z.jsx)(G,{ownerState:E}),outlined:(0,Z.jsx)(J,{label:g,ownerState:E}),filled:(0,Z.jsx)(Q,{ownerState:E})}[z],X=(0,I.Z)(t,V.ref);return(0,Z.jsx)(a.Fragment,{children:a.cloneElement(V,(0,n.Z)({inputComponent:M,inputProps:(0,n.Z)({children:d,error:N.error,IconComponent:h,variant:z,type:void 0,multiple:x},S?{id:f}:{autoWidth:s,defaultOpen:p,displayEmpty:m,labelId:y,MenuProps:w,onClose:C,onOpen:P,open:O,renderValue:k,SelectDisplayProps:(0,n.Z)({id:f},F)},v,{classes:v?(0,i.Z)(H,v.classes):H},b?b.props.inputProps:{})},x&&S&&"outlined"===z?{notched:!0}:{},{ref:X,className:(0,l.Z)(V.props.className,c,U.root)},!b&&{variant:z},B))})}));Y.muiName="Select";const $=Y},33375:(e,t,o)=>{o.d(t,{Z:()=>a});o(5057);var n=o(93350),r=o(96266);const a=(0,n.Z)((0,r.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown")}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6499],{96499:(e,t,i)=>{i.r(t),i.d(t,{default:()=>I});var n,a=i(71171),s=i(5057),r=i(33518),o=i(15849),l=i(55898),c=i.n(l),d=i(5609),p=i(12549),f=i(92251),m=i(15598),u=i(69544),g=i(56569),x=i(69292),h=i(56869),j=i(56195),y=i(60967),Z=i(44024),b=i(54272),v=i(64147),N=i(53066),w=i(29285),k=i(87543),C=i(19636),R=i(28726),D=i(68420),M=i(7403),z=i(14491),A=i(63406),_=i(58238),U=i(96266);function q(e){let{api:t,paging:i,loading:n,notifications:a,updateNotifications:r,teamDid:l}=e;const{inService:c}=(0,_.h6)(),[q,T]=(0,s.useState)(!0),[I,$]=(0,s.useState)(!1),{t:B,locale:F}=(0,s.useContext)(D.RD),L=async e=>{c?await t.readBlockletNotifications({input:{id:e,teamDid:l}}):await t.readNotifications({input:{id:e}}),r()},P=q?a:a.filter((e=>!1===e.read)),O=a.filter((e=>!1===e.read)).length>0,W=e=>(0,U.jsxs)("div",{className:"title",children:[e.title," ",(0,U.jsx)("span",{className:"time-ago",title:(0,z.B2)(e.createdAt,F),children:(0,d.WU)(new Date(e.createdAt),(0,z.FF)(F))})]});return(0,U.jsxs)(S,{children:[(0,U.jsxs)(y.Z,{component:"h2",variant:"h4",className:"page-header",color:"textPrimary",children:[B("notification.title"),(0,U.jsxs)(y.Z,{component:"span",className:"notification-actions",children:[(0,U.jsx)(b.Z,{control:(0,U.jsx)(Z.Z,{checked:q,onChange:()=>T(!q),name:"showRead",color:"primary"}),label:B("notification.showRead")}),(0,U.jsx)(A.Z,{permission:c?"":"mutate_notification",role:c?z.Wf:[],children:O&&(0,U.jsxs)(R.Z,{disabled:I,onClick:async()=>{$(!0);const e=a.filter((e=>!1===e.read)).map((e=>e.id)).join(",");c?await t.readBlockletNotifications({input:{id:e,teamDid:l}}):await t.readNotifications({input:{id:e}}),r(),$(!1)},className:"",children:[I&&(0,U.jsx)(u.Z,{size:16,style:{marginRight:"1em"}}),B("notification.markAllAsRead")]})})]})]}),(0,U.jsx)(j.Z,{}),(0,U.jsxs)(p.Z,{className:"notification-list",children:[n&&(0,U.jsx)(u.Z,{size:[32,20],style:{opacity:"0.8",zIndex:1e4,position:"fixed",top:30,left:"50%",marginLeft:-16}}),0===P.length&&(0,U.jsx)(y.Z,{component:"p",variant:"body1",className:"notification-tip",children:B("notification.empty")}),P.length>0&&P.map((e=>e.action?(0,U.jsxs)(f.ZP,{component:o.Link,to:e.action,alignItems:"flex-start",disabled:e.read,children:[(0,U.jsx)(g.Z,{className:"list-item-avatar",children:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(h.Z,{children:e.entityType.substr(0,1).toUpperCase()}),(0,U.jsx)(M.Z,{className:"notification-tag",status:e.severity})]})}),(0,U.jsx)(m.Z,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:W(e),secondary:e.description}),!1===e.read&&(0,U.jsx)(v.Z,{children:(0,U.jsx)(x.Z,{title:B("notification.markAsRead"),children:(0,U.jsx)(N.Z,{edge:"end","aria-label":"delete",onClick:()=>L(e.id),size:"large",children:(0,U.jsx)(w.Z,{})})})})]},e.id):(0,U.jsxs)(f.ZP,{alignItems:"flex-start",disabled:e.read,children:[(0,U.jsx)(g.Z,{className:"list-item-avatar",children:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(h.Z,{children:e.entityType.substr(0,1).toUpperCase()}),(0,U.jsx)(M.Z,{className:"notification-tag",status:e.severity})]})}),(0,U.jsx)(m.Z,{className:"list-item-text",classes:{secondary:"list-item-secondary-text"},primary:W(e),secondary:e.description}),!1===e.read&&(0,U.jsx)(v.Z,{children:(0,U.jsx)(x.Z,{title:B("notification.markAsRead"),children:(0,U.jsx)(N.Z,{edge:"end","aria-label":"delete",onClick:()=>L(e.id),size:"large",children:(0,U.jsx)(w.Z,{})})})})]},e.id)))]}),!!P.length&&i.pageCount>1&&(0,U.jsx)(k.Z,{mt:2,display:"flex",justifyContent:"flex-end",children:(0,U.jsx)(C.Z,{disabled:n,count:i.pageCount,page:i.page,onChange:(e,t)=>{r({page:t})}})})]})}const S=r.Z.div(n||(n=(0,a.Z)(["\n min-height: 60vh;\n\n .page-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n .notification-actions {\n width: auto;\n display: flex;\n justify-content: space-between;\n }\n }\n\n .page-content {\n margin-top: 16px;\n }\n\n .list-item-avatar {\n display: flex;\n flex-direction: column;\n align-items: center;\n min-width: 80px;\n\n .notification-tag {\n margin-top: 4px;\n }\n }\n\n .MuiListItem-root:not(.Mui-disabled) {\n .MuiAvatar-root {\n background: ",";\n }\n }\n\n .list-item-text {\n .title {\n display: flex;\n align-items: center;\n .time-ago {\n background: #bdbdbd;\n font-size: 11px;\n margin-left: 8px;\n color: #f7f8f8;\n border-radius: 3px;\n padding: 1px 4px;\n }\n }\n }\n .Mui-disabled .list-item-text .title .time-ago {\n background: #666;\n }\n\n .list-item-secondary-text {\n word-break: break-word;\n }\n"])),(e=>e.theme.palette.primary.light));q.propTypes={loading:c().bool,paging:c().objectOf(c().any),api:c().shape({readNotifications:c().func.isRequired,readBlockletNotifications:c().func.isRequired}).isRequired,notifications:c().arrayOf(c().shape({id:c().string,read:c().bool,entityType:c().string,title:c().string,createdAt:c().string,description:c().string}).isRequired).isRequired,updateNotifications:c().func.isRequired,teamDid:c().string},q.defaultProps={paging:!1,loading:!1,teamDid:""};var T=i(27690);function I(){const{api:e,data:t,paging:i,refresh:n,loading:a}=(0,T.nw)();return(0,U.jsx)(q,{paging:i,loading:a,api:e,notifications:t,updateNotifications:n})}},29285:(e,t,i)=>{var n=i(71600);t.Z=void 0;var a=n(i(84115)),s=i(96266);t.Z=(0,a.default)((0,s.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},5609:(e,t,i)=>{i.d(t,{WU:()=>c});var n=["second","minute","hour","day","week","month","year"];var a=["\u79d2","\u5206\u949f","\u5c0f\u65f6","\u5929","\u5468","\u4e2a\u6708","\u5e74"];var s={},r=function(e,t){s[e]=t},o=[60,60,24,7,365/7/12,12];function l(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}var c=function(e,t,i){var n=function(e,t){return(+(t?l(t):new Date)-+l(e))/1e3}(e,i&&i.relativeDate);return function(e,t){for(var i=e<0?1:0,n=e=Math.abs(e),a=0;e>=o[a]&&a<o.length;a++)e/=o[a];return(e=Math.floor(e))>(0===(a*=2)?9:1)&&(a+=1),t(e,a,n)[i].replace("%s",e.toString())}(n,function(e){return s[e]||s.en_US}(t))};r("en_US",(function(e,t){if(0===t)return["just now","right now"];var i=n[Math.floor(t/2)];return e>1&&(i+="s"),[e+" "+i+" ago","in "+e+" "+i]})),r("zh_CN",(function(e,t){if(0===t)return["\u521a\u521a","\u7247\u523b\u540e"];var i=a[~~(t/2)];return[e+" "+i+"\u524d",e+" "+i+"\u540e"]}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6511],{86511:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ae});var a=n(71171),i=n(5057),o=n(33518),l=n(85493),s=n(15849),c=n(68420),r=n(82084),d=n(59793),u=n(47125),p=n(45807),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(87543),w=n(35432),P=n(66935),j=n(58238),S=n(29054),B=n(73545),Z=n(14491),C=n(4651),E=n(96266);const L=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(w.DEFAULT_DID_DOMAIN)))||"").replace(".".concat(w.DEFAULT_DID_DOMAIN),"");return l?i.replace(a,"".concat(l,"-").concat(n,".").concat(w.DEFAULT_IP_DOMAIN_SUFFIX)):i}return i.replace(t.meta.bundleDid,t.appPid)};function D(){const{t:e}=(0,c.PE)(),{api:t}=(0,B.T)(),{blocklet:n}=(0,S.y0)(),{inService:a}=(0,j.h6)(),[o,l]=(0,i.useState)(!1),[s,r]=(0,i.useState)(5),d=n&&n.structVersion!==w.APP_STRUCT_VERSION;return[d&&(0,E.jsxs)(v.Z,{type:"warning",style:{margin:"12px 0"},children:[(0,E.jsxs)(x.Z,{display:"flex",alignItems:"center",children:[(0,E.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=L(n);if(t)return void y.Z.error(e("blocklet.migrate.tip.duplicate",{name:t}));l(!0)}catch(t){y.Z.error((0,Z.Z)(t))}})(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),(0,E.jsx)("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map((t=>(0,E.jsx)(x.Z,{display:"flex",alignItems:"center",children:e("blocklet.migrate.intro.".concat(t))},t)))]},"alert"),n&&(0,E.jsx)(P.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,C.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")]}D.propTypes={};var A,N=n(35966),G=n(85531),U=n(13798),T=n(78123),I=n(75793),O=n(17022),K=n(93677),z=n(74094),R=n(7199);const F=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(730),n.e(4549)]).then(n.bind(n,64549)))),M=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(6296),n.e(506),n.e(5716),n.e(5545),n.e(3732),n.e(6230)]).then(n.bind(n,64558)))),V=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(4631),n.e(6547),n.e(6296),n.e(6771),n.e(506),n.e(5716),n.e(1255),n.e(1294),n.e(7131),n.e(4775)]).then(n.bind(n,14775)))),Y=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(6771),n.e(442),n.e(9636),n.e(7676),n.e(3239)]).then(n.bind(n,13239)))),$=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(7288),n.e(6974),n.e(5979),n.e(2537)]).then(n.bind(n,75979)))),W=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(9364),n.e(5672),n.e(5217)]).then(n.bind(n,75672)))),X=(0,i.lazy)((()=>Promise.all([n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(5539),n.e(4335),n.e(5015)]).then(n.bind(n,85555)))),J=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6296),n.e(2251),n.e(2911),n.e(5539),n.e(442),n.e(5526),n.e(7288),n.e(6076),n.e(4335),n.e(9811),n.e(7558),n.e(5545),n.e(5165),n.e(1846),n.e(318)]).then(n.bind(n,20318)))),Q=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(7998),n.e(8219)]).then(n.bind(n,92379)))),q=(0,i.lazy)((()=>Promise.all([n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(6296),n.e(7534)]).then(n.bind(n,87534)))),H=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(6296),n.e(2251),n.e(5539),n.e(5454),n.e(2611)]).then(n.bind(n,42611)))),ee=(0,i.lazy)((()=>Promise.all([n.e(6448),n.e(2739),n.e(8537),n.e(4631),n.e(2294),n.e(1279),n.e(6547),n.e(3748),n.e(9940),n.e(1846),n.e(9552)]).then(n.bind(n,39552)))),te=e=>{let{children:t}=e;return t};function ne(){var e;const t=(0,l.useNavigate)(),{tab:n="overview"}=(0,l.useParams)(),{did:a,blocklet:o,error:x,client:P,actions:{setBlocklet:j,refreshBlocklet:S}}=(0,K.y0)(),{refresh:B}=(0,I.h6)(),{t:Z}=(0,c.PE)(),C=(0,i.useCallback)((()=>(0,E.jsx)(Y,{scope:a})),[a]),L=(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,_=e=>(0,z.bV)(e,L),A=e=>{t("/blocklets/".concat(a,"/").concat(e))},G=e=>{e&&j(e),S()},ne=!o||(0,z.wS)(o.status)?[]:(0,g.getAppMissingConfigs)(o);let ae=null;const oe=[{label:Z("common.overview"),value:"overview"},{breadcrumbsLabel:Z("common.components"),label:(0,E.jsx)(p.Z,{color:"error",variant:"dot",invisible:!ne.length,children:Z("common.components")}),value:"components"}];if(x)ae=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v.Z,{type:"error",variant:"icon",children:(0,z.Z)(x)}),(0,E.jsx)(h.Z,{onClick:()=>S(),children:(0,E.jsx)("span",{style:{textDecoration:"underline"},children:Z("common.retry")})})]});else if(o){var le;const e={overview:(0,E.jsx)(F,{}),configuration:M,navigation:V,services:X,members:(0,E.jsx)(W,{type:"blocklet",createPassportSvg:_}),passports:$,components:J,"audit-logs":C,logs:Q,runtime:(0,E.jsx)(q,{}),traffic:(0,E.jsx)(H,{client:P,did:a}),storage:(0,E.jsx)(ee,{})};"configuration"===n&&(0,z.wS)(o.status)&&A("overview"),(0,z.wS)(o.status)||(oe.push({label:Z("common.members"),value:"members"}),oe.push({label:Z("common.passport"),value:"passports"}),oe.push({label:Z("common.configuration"),value:"configuration"})),oe.push({label:Z("common.auditLogs"),value:"audit-logs"}),o&&null!==(le=o.children)&&void 0!==le&&le.length&&o.structVersion===w.APP_STRUCT_VERSION&&oe.push({label:Z("common.logs"),value:"logs"}),oe.push({label:Z("common.configNavigation"),value:"navigation"}),oe.push({label:Z("common.runtime"),value:"runtime"}),oe.push({label:Z("common.traffic"),value:"traffic"}),oe.push({label:Z("common.storage"),value:"storage"});(0,g.getBlockletServices)(o).length&&oe.splice(2,0,{label:Z("blocklet.services"),value:"services"});const t=e[n]||e.overview;ae=(0,E.jsxs)(f.g,{type:"components",children:[!(0,g.isExternalBlocklet)(o)&&(0,E.jsx)(m.Z,{tabs:oe,current:n,onChange:A,scrollButtons:"auto"}),(0,E.jsx)("div",{className:"page-content",children:(0,E.jsx)(i.Suspense,{fallback:(0,E.jsx)(N.Z,{relative:"parent",children:(0,E.jsx)(U.Z,{})}),children:(0,i.isValidElement)(t)?t:(0,E.jsx)(t,{blocklet:o,onUpdate:G,createPassportSvg:_})})})]})}else ae=(0,E.jsx)(N.Z,{relative:"parent",children:(0,E.jsx)(U.Z,{})});const se=oe.find((e=>e.value===n)),ce=o?O.G6:te;return(0,E.jsx)(ce,{teamDid:a,children:(0,E.jsxs)(ie,{children:[(0,E.jsxs)(d.Z,{separator:"\u203a","aria-label":"breadcrumb",className:"page-breadcrumb",children:[(0,E.jsx)(s.Link,{color:"textSecondary",to:"/blocklets",children:Z("common.blocklets")}),(0,E.jsx)(s.NavLink,{to:"/blocklets/".concat(a,"/overview"),style:e=>e?{color:"inherit"}:{},children:Z("common.detail")}),(0,E.jsx)(r.Z,{color:"textSecondary",children:se?se.breadcrumbsLabel||se.label:""})]}),(0,E.jsxs)(r.Z,{component:"div",className:"page-header",children:[(0,E.jsxs)(r.Z,{component:"h2",variant:"h4",className:"page-title",color:"textPrimary",children:[o?(0,E.jsx)(k.Z,{blocklet:o,style:{marginRight:16}}):null,o?(0,E.jsxs)(u.Z,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,children:[(0,E.jsx)(u.Z,{children:(0,g.getDisplayName)(o)}),"unknown"!==(null===o||void 0===o?void 0:o.status)&&(0,E.jsx)(b.Z,{size:"12px",status:o.status,source:o.source,progress:o.progress})]}):"".concat(Z("common.blocklet")," ").concat(Z("common.detail"))]}),(0,E.jsx)(R.Z,{permission:"mutate_blocklets",children:!!o&&!(0,g.isExternalBlocklet)(o)&&(0,E.jsx)(T.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,E.jsx)(D,{}),ae]})})}function ae(){const{did:e}=(0,l.useParams)();return e?(0,E.jsx)(K.$8,{did:e,children:(0,E.jsx)(G.wV,{children:(0,E.jsx)(ne,{})})}):null}const ie=o.Z.main(A||(A=(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(14491);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]),[Z,C]=(0,a.useState)(!1),{backups:E}=g({deps:[P],setLoading:C}),[L,_]=(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:L,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(),_(e)},deleteSpaceGateway:async e=>{e&&(e.endpoint!==B?(await i.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:null===e||void 0===e?void 0:e.did}}),I(),_(e)):l.Z.warning(n("storage.spaces.gateway.delete.failedForConnected")))},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:E,backupsLoading:Z,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,n;return(null===e||void 0===e||null===(t=e.configs)||void 0===t||null===(n=t.find((e=>e.key===o.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)))||void 0===n?void 0:n.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}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6580,2611],{16580:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ee});var a=n(71171),o=n(5057),r=n(33518),i=n(85493),s=n(82084),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 h=n(45603),f=n.n(h),v=n(90049),g=n.n(v),y=n(47125),x=n(29585),Z=n(57126),b=n(61971),j=n(63748),k=n(13798),I=n(35966),E=n(66506),D=n(35432),R=n(77277),L=n(86229),P=n(1722),C=n(80378),N=n(14491),S=n(38242),_=n(56169),w=n(1979),T=n(55898),O=n.n(T),F=n(50844),B=n(60967),U=n(25400),z=n(87543),M=n(844);const Y=(0,F.Z)((e=>({root:{height:10},colorPrimary:{backgroundColor:e.palette.grey["light"===e.palette.mode?200:700]},bar:{backgroundColor:e.palette.secondary.main}})))(U.Z);function q(e){const{value:t}=e;return(0,u.jsxs)(z.Z,{display:"flex",alignItems:"center",mt:2,children:[(0,u.jsx)(z.Z,{width:"100%",style:{overflow:"hidden"},mr:1,children:(0,u.jsx)(Y,{variant:"determinate",...e})}),(0,u.jsx)(z.Z,{minWidth:35,children:(0,u.jsx)(B.Z,{variant:"body2",color:"textSecondary",children:"".concat(Math.round(t),"%")})})]})}function A(e){let{disk:t,platform:n}=e;const{t:a}=(0,o.useContext)(c.RD),r=[{id:1,className:"used",title:a("system.used"),metric:(0,N.RR)(t.used,n)},{id:2,className:"free",title:a("system.free"),metric:(0,N.RR)(t.free,n)},{id:3,className:"total",title:a("system.total"),metric:(0,N.RR)(t.total,n)}];return(0,u.jsx)(M.Z,{title:"".concat(a("common.disk")," (").concat(t.device,")"),value:(0,N.RR)(t.used,n),graph:(0,u.jsx)(z.Z,{mt:3,children:(0,u.jsx)(q,{value:t.used/t.total*100})}),description:r.map(((e,t)=>(0,u.jsxs)(z.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title)))})}q.propTypes={value:O().number.isRequired},A.propTypes={disk:O().shape({used:O().number,free:O().number,total:O().number,device:O().string}),platform:O().string},A.defaultProps={disk:{used:0,free:0,total:1,device:""},platform:""};var K=n(67654),W=n(52926),H=n(52581),G=n(34937);const V={uptime:0,pid:-1,cpuUsage:0,memoryUsage:0},Q="Blocklet Server";function X(e){let{initialBlocklets:t}=e;const{t:n,locale:a}=(0,c.PE)(),{api:r}=(0,m.h6)(),[i,l]=(0,K.Z)("runtime-view-interval",6),d=(0,o.useMemo)((()=>{const e=[];return e.push({type:"server",groupId:"server",groupName:Q,id:"server:daemon",name:"Server (Daemon)",runtimeInfo:V}),e.push({type:"server",groupId:"server",groupName:Q,id:"server:service",name:"Server (Service)",runtimeInfo:V}),t.forEach((t=>{(0,S.forEachBlockletSync)(t,((n,a)=>{let{id:o,ancestors:r}=a;n.runtimeInfo&&e.push({type:"blocklet",groupId:t.meta.did,groupName:(0,S.getDisplayName)(t),id:o,name:(0,S.getDisplayName)(n,!0),blocklet:t,component:n,runtimeInfo:n.runtimeInfo,ancestors:r})}))})),e}),[]),[p,h]=(0,o.useState)(d),[v,k]=(0,o.useState)({os:{platform:""},mem:{used:0,free:0,total:1},cpu:{cpus:[],currentLoad:1},disks:[],daemon:{},service:{}}),[I,T]=(0,o.useState)({cpu:[],mem:[],daemonMem:[],serviceMem:[]});(0,G.mU)(D.EVENTS.NODE_RUNTIME_INFO,(e=>{e.mem.total=e.mem.total||0,e.mem.used=e.mem.total-(e.mem.available||0),k(e),h((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,G.mU)(D.EVENTS.BLOCKLETS_RUNTIME_INFO,(e=>{e&&e.length?h((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 O=e=>{h((t=>t.filter((t=>t.groupId!==e.meta.did))))},F=async e=>{try{const{blocklet:t}=await r.getBlocklet({input:{did:e.meta.did,attachRuntimeInfo:!0}});"running"!==t.status&&O(t),h((e=>{const n=e.filter((e=>e.groupId!==t.meta.did));return(0,S.forEachBlockletSync)(t,((e,a)=>{let{id:o,ancestors:r}=a;e.runtimeInfo&&n.push({type:"blocklet",groupId:t.meta.did,groupName:(0,S.getDisplayName)(t),id:o,name:(0,S.getDisplayName)(e,!0),blocklet:t,component:e,runtimeInfo:e.runtimeInfo,ancestors:r})})),n}))}catch(t){L.Z.error(t.message)}};(0,G.mU)(R.BlockletEvents.removed,O),(0,G.mU)(R.BlockletEvents.startFailed,O),(0,G.mU)(R.BlockletEvents.statusChange,(e=>{"running"===e.status?F(e):O(e)})),(0,G.mU)(R.BlockletEvents.updated,F),(0,G.mU)(R.BlockletEvents.started,F);(0,o.useEffect)((()=>{r.getNodeRuntimeHistory({input:{hours:i}}).then((e=>{const t=e.history||[];T({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=>{L.Z.error(e.message)}))}),[i]);const B=[{label:n("common.group"),name:"groupName",options:{customBodyRenderLite(e){const{type:t,blocklet:n,groupName:a}=p[e];return"server"===t?(0,u.jsxs)(y.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(H.r,{width:"14",height:"14"}),(0,u.jsx)(y.Z,{ml:1,children:a})]}):(0,u.jsxs)(y.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(P.Z,{size:14,blocklet:n}),(0,u.jsx)(y.Z,{ml:1,children:a})]})}}},{label:n("common.name"),name:"name",options:{customBodyRenderLite(e){const{type:t,name:n,component:a,ancestors:o}=p[e];return"server"===t?(0,u.jsxs)(y.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(E.Z,{width:"14",height:"14"}),(0,u.jsx)(y.Z,{ml:1,children:n})]}):(0,u.jsxs)(y.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(C.Z,{size:14,blocklet:a,ancestors:o}),(0,u.jsx)(y.Z,{ml:1,children:n})]})}}},{label:n("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(e){const{runtimeInfo:t}=p[e];return n=t.uptime,f()(Number(n||0),{locale:(0,N.FF)(a)});var n}}},{label:n("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(e){const{runtimeInfo:t}=p[e];return g()((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)(y.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)(b.Z,{size:"small",exclusive:!0,value:i,onChange:(e,t)=>l(t),children:[1,3,6,12,24].map((e=>(0,u.jsxs)(Z.Z,{value:e,children:[e,"H"]},e)))})]}),(0,u.jsxs)(x.ZP,{mb:4,container:!0,spacing:4,children:[(0,u.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(_.Z,{...v.cpu,history:I.cpu})},"cpu"),(0,u.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(w.Z,{...v.mem,history:I.mem})},"memory"),(0,u.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(w.Z,{title:"".concat(n("common.memory")," (Daemon)"),used:v.daemon.memoryUsage||0,history:I.daemonMem})},"memory-daemon"),(0,u.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(w.Z,{title:"".concat(n("common.memory")," (Service)"),instanceCount:v.service.instanceCount||0,used:v.service.memoryUsage||0,history:I.serviceMem})},"memory-service"),v.disks.map((e=>(0,u.jsx)(x.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,u.jsx)(A,{disk:e,platform:v.os.platform})},"disk")))]}),(0,u.jsx)(j.Z,{className:"runtime-insight-list",title:n("analytics.detail"),locale:a,data:p,columns:B,options:{download:!1,filter:!1,print:!1,pagination:!1,rowsPerPage:100}})]})}function J(){const{data:e,externalData:t,initialized:n}=(0,W.RJ)();if(!n)return(0,u.jsx)(I.Z,{relative:"parent",children:(0,u.jsx)(k.Z,{})});const a=[...e,...t]||[];return(0,u.jsx)(X,{initialBlocklets:a})}var $;function ee(){const e=(0,i.useNavigate)(),{t:t}=(0,o.useContext)(c.RD),{tab:n="traffic"}=(0,i.useParams)(),a=[{label:t("common.traffic"),value:"traffic"},{label:t("common.runtime"),value:"runtime"}],r={traffic:p,runtime:J},d=r[n]||r.traffic;return(0,u.jsxs)(te,{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:a,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 te=r.Z.main($||($=(0,a.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 a,o=n(71171),r=n(55898),i=n.n(r),s=n(33518),l=n(15008),c=n(51744),d=n(60967),m=n(87543),u=n(96266);function p(e){let{style:t,title:n,value:a,graph:o,description:r}=e;return(0,u.jsx)(h,{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:a}),o,!!r&&(0,u.jsx)(m.Z,{display:"flex",sx:{fontSize:12,marginTop:3},color:"text.secondary",children:r})]})})}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 h=(0,s.Z)(l.Z)(a||(a=(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 a=n(5057),o=n(55898),r=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:r,data:m,dateFn:u,valueFn:p}=e;const h=(0,a.useRef)(null),f=(0,a.useRef)(null),v=(0,i.Z)({style:{top:0,left:0},hidden:!0,textContent:""}),[g,y]=(0,a.useState)(null),x=(0,s.Z)(g),Z={onmousemove(e,t){const{date:n,value:a}=t;v.textContent="".concat(u(n),": ").concat(p(a)),v.style.top=-30,v.style.left=80,v.hidden=!1},onmouseout(){v.hidden=!0}};return(0,a.useEffect)((()=>{setTimeout((()=>{y(document.querySelector(".".concat(t))),setTimeout((()=>{h.current&&(0,l.Z)(h.current,m||[],Z)}),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:h,className:"sparkline",width:(null===x||void 0===x?void 0:x.width)||100,height:30,strokeWidth:"2"}),(0,d.jsx)("span",{className:"tooltip",ref:f,hidden:v.hidden,style:{...v.style},children:v.textContent})]}),description:r})}m.propTypes={id:r().string.isRequired,title:r().string.isRequired,current:r().any.isRequired,description:r().any,data:r().array,dateFn:r().func,valueFn:r().func},m.defaultProps={description:null,data:[],dateFn:e=>e,valueFn:e=>e}},56169:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(5057),o=n(55898),r=n.n(o),i=n(68420),s=n(52959),l=n(14491),c=n(96266);const d=e=>"".concat(e,"%");function m(e){let{cpus:t,currentLoad:n,history:o}=e;const{t:r,locale:m}=(0,a.useContext)(i.RD);return(0,c.jsx)(s.Z,{id:"cpu-sparkline",title:r("common.cpu"),current:"".concat(Math.floor(n||0),"%"),data:o,description:"".concat(r("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:r().array,currentLoad:r().number,history:r().array},m.defaultProps={cpus:[],currentLoad:0,history:[]}},1979:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(55898),o=n.n(a),r=n(90049),i=n.n(r),s=n(87543),l=n(68420),c=n(52959),d=n(14491),m=n(96266);function u(e){let{instanceCount:t,title:n,total:a,used:o,history:r}=e;const{t:u,locale:p}=(0,l.PE)(),h=!!a,f=a-o,v=h?"(".concat(Math.floor(o/a*100),"%)"):"",g=[];return t&&g.push({title:u("system.instances"),metric:t}),g.push({title:u("system.used"),metric:i()(o)}),h&&g.push({title:u("system.free"),metric:i()(f)},{title:u("system.total"),metric:i()(a)}),(0,m.jsx)(c.Z,{id:"mem-sparkline",title:n||u("common.memory"),current:"".concat(i()(Math.floor(o||0))," ").concat(v),data:r,description:g.map(((e,t)=>(0,m.jsxs)(s.Z,{sx:{marginLeft:0===t?0:2},children:[e.title,": ",e.metric]},e.title))),dateFn:e=>(0,d.mr)(e,"HH:mm:ss",p),valueFn:i()})}u.propTypes={title:o().string,instanceCount:o().number,total:o().number,used:o().number,history:o().array},u.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[]}},42611:(e,t,n)=>{n.r(t),n.d(t,{default:()=>q,getDefaultRanges:()=>Y});var a=n(5057),o=n(1577),r=n.n(o),i=n(6465),s=n.n(i),l=n(6352),c=n.n(l),d=n(90049),m=n.n(d),u=n(74511),p=n(96181),h=n(58717),f=n(69544),v=n(6296),g=n(60967),y=n(12958),x=n(53066),Z=n(50410),b=n(36645),j=n(77946),k=n(94448),I=n(88868),E=n(53919),D=n(68420),R=n(35432),L=n(87364),P=n(39458),C=n(4903),N=n(44926),S=n(90298),_=n(43713),w=n(59497),T=n(9732),O=n(13379),F=n(14491),B=n(58238),U=n(52959),z=n(96266);const M=s()(0),Y=(e,t)=>[{label:"This Week",startDate:(0,L.Z)(e,{locale:t}),endDate:(0,P.Z)(e,{locale:t})},{label:"Last Week",startDate:(0,L.Z)((0,C.Z)(e,-1),{locale:t}),endDate:(0,P.Z)((0,C.Z)(e,-1),{locale:t})},{label:"Last 7 Days",startDate:(0,C.Z)(e,-1),endDate:e},{label:"This Month",startDate:(0,N.Z)(e),endDate:(0,S.Z)(e)},{label:"Last Month",startDate:(0,N.Z)((0,_.Z)(e,-1)),endDate:(0,S.Z)((0,_.Z)(e,-1))},{label:"This Year",startDate:(0,w.Z)(e),endDate:(0,T.Z)(e)},{label:"Last Year",startDate:(0,w.Z)((0,O.Z)(e,-1)),endDate:(0,T.Z)((0,O.Z)(e,-1))}];function q(e){let{client:t,did:n}=e;const o=r()().subtract(1,"day").toDate(),{info:i,inService:s}=(0,B.h6)(),{t:l,locale:d}=(0,D.PE)(),[L,P]=(0,a.useState)(null),[C,N]=(0,a.useState)(!1),[S,_]=(0,a.useState)(o),[w,T]=(0,a.useState)({startDate:r()().subtract(30,"day").toDate(),endDate:o}),O=(0,u.Z)((async()=>(await t.getTrafficInsights({input:{did:n,startDate:r()(w.startDate).format("YYYY-MM-DD"),endDate:r()(w.endDate).format("YYYY-MM-DD")}})).list));(0,a.useEffect)((()=>{O.loading||w.startDate&&w.endDate&&O.retry()}),[w]);const q=e=>{P(L?null:e.currentTarget)},A=O.value||[],{loading:K,error:W}=O;if(!A.length&&K)return(0,z.jsx)(f.Z,{});if(W)return(0,z.jsx)(h.Z,{severity:"error",children:(0,F.Z)(W)});const H={totalRequests:M,validRequests:M,failedRequests:M,uniqueVisitors:M,uniqueFiles:M,uniqueReferrers:M,uniqueNotFound:M,uniqueStaticFiles:M,logSize:m(),bandwidth:m()},G=Object.keys(H).map((e=>({id:"".concat(e,"_chart"),title:l("analytics.traffic.".concat(e)),current:A.length?H[e](A[0][e]):0,data:A.map((t=>({date:t.date,value:t[e]}))).reverse(),dateFn:M,valueFn:H[e]}))),V=Boolean(L),Q=V?"date-range-picker-popover":void 0,X=s?R.WELLKNOWN_SERVICE_PATH_PREFIX:i.routing.adminPath,J=c()(window.location.origin,X,"/api/analytics/traffic?date=".concat(r()(S).format("YYYY-MM-DD"),"&did=").concat(n));return(0,z.jsxs)("div",{children:[(0,z.jsxs)(g.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:[l("analytics.trend"),(0,z.jsxs)(y.Z,{onClick:q,variant:"outlined",size:"small",color:"secondary",children:[(0,F.pz)(w.startDate,d)," - ",(0,F.pz)(w.endDate,d)]})]}),(0,z.jsx)(Z.ZP,{id:Q,open:V,anchorEl:L,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,z.jsx)(j.D,{open:!0,toggle:q,maxDate:o,definedRanges:Y(S),onChange:e=>{T(e),P(null)}})}),(0,z.jsx)(v.ZP,{container:!0,spacing:4,children:G.map((e=>(0,z.jsx)(v.ZP,{item:!0,lg:3,md:6,sm:6,xs:12,children:(0,z.jsx)(U.Z,{...e})},e.id)))}),(0,z.jsxs)(g.Z,{component:"div",variant:"h5",className:"page-header",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mt:4,mb:1,children:[l("analytics.detail"),(0,z.jsxs)("span",{children:[C&&(0,z.jsx)(x.Z,{onClick:()=>{window.open(J)},style:{marginRight:32},children:(0,z.jsx)(b.Z,{})}),(0,z.jsx)(E._,{dateAdapter:I.y,children:(0,z.jsx)(k.M,{disableFuture:!0,format:"ll",value:r()(S),onChange:e=>{_(e.toDate()),N(!1)},slotProps:{textField:{size:"small"}}})})]})]}),(0,z.jsx)(p.Z,{url:J,width:"100%",height:"100%",frameBorder:0,onLoad:()=>N(!0),styles:{border:0,minHeight:"400vh"}})]})}},1722:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(55898),o=n.n(a),r=n(56869),i=n(72333),s=n(77277),l=n(49522),c=n(96266);function d(e){let{blocklet:t,style:n,size:a,...o}=e;const{logoUrl:d}=(0,l.Z)({blocklet:t}),{variant:m}=o;let u=(0,c.jsx)("img",{src:d,alt:"",style:{width:a}});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)(r.Z,{variant:m||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,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 a=n(55898),o=n.n(a),r=n(56869),i=n(72333),s=n(6352),l=n.n(s),c=n(35432),d=n(58238),m=n(14491);var u=n(96266);function p(e){let{blocklet:t,style:n,size:a,ancestors:o,...s}=e;const p=(0,d.h6)(),{logoUrl:h,inService:f}=function(e){var t;let{blocklet:n,ancestors:a=[]}=e;const o=(0,d.h6)(),{inService:r}=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=r?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=a.concat(n),o=r?t.slice(1):t;s=l()(e,"/blocklet/logo-bundle".concat(o.map((e=>"/".concat(e.meta.did))).join("")),i)}return{logoUrl:s,inService:r}}({blocklet:t,ancestors:o}),{variant:v}=s,g=f?()=>{}:e=>{e.target.src="".concat(p.imgPrefix,"/blocklet.png")};let y=(0,u.jsx)("img",{src:h,onError:g,alt:t.meta.name,style:{width:a}});return t.meta.logo||(y=(0,u.jsx)(i.Z,{did:t.meta.did||"",responsive:!0})),(0,u.jsx)(r.Z,{variant:v||"square",style:Object.assign({backgroundColor:"transparent",width:a,height:a,borderRadius:10},n),...s,children:y})}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 a=n(6352),o=n.n(a),r=n(77277),i=n(58238),s=n(14491);const l=(e,t)=>{let n="?v=";var a;t?n+=(0,s.Qi)(t):n+="".concat(null===e||void 0===e||null===(a=e.meta)||void 0===a?void 0:a.version).concat((0,s.wS)(null===e||void 0===e?void 0:e.status)?"~":"");return n};function c(e){var t,n,a,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===r.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===r.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT)))||void 0===n?void 0:n.value,p=null===(a=((null===c||void 0===c?void 0:c.environments)||[]).find((e=>e.key===r.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON)))||void 0===a?void 0:a.value,h=(null===(s=window.env)||void 0===s?void 0:s.apiPrefix)||"/";return{logoUrl:o()(h,"/blocklet/logo/".concat(d?"":c.meta.did),l(c,m)),rectLogoUrl:o()(h,"/blocklet/logo-rect/".concat(d?"":c.meta.did),l(c,u)),faviconUrl:o()(h,"/blocklet/logo-favicon/".concat(d?"":c.meta.did),l(c,p))}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6771],{33167:(e,t,n)=>{n.d(t,{Z:()=>D});var o=n(7896),i=n(31461),r=n(5057),a=n(9978),c=n(91213),s=n(32788),l=n(44358);const u=n(60730).Z;const d=n(2534).Z;const p=n(46890).Z;var f=n(71171),h=n(74621),g=n(21371),b=n(96266);const m=function(e){const{className:t,classes:n,pulsate:o=!1,rippleX:i,rippleY:c,rippleSize:s,in:l,onExited:u,timeout:d}=e,[p,f]=r.useState(!1),h=(0,a.Z)(t,n.ripple,n.rippleVisible,o&&n.ripplePulsate),g={width:s,height:s,top:-s/2+c,left:-s/2+i},m=(0,a.Z)(n.child,p&&n.childLeaving,o&&n.childPulsate);return l||p||f(!0),r.useEffect((()=>{if(!l&&null!=u){const e=setTimeout(u,d);return()=>{clearTimeout(e)}}}),[u,l,d]),(0,b.jsx)("span",{className:h,style:g,children:(0,b.jsx)("span",{className:m})})};var v=n(31821);const y=(0,v.Z)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]);var Z,k,x,R;const A=["center","classes","className"];let T,w,M,S;const C=(0,g.keyframes)(T||(T=Z||(Z=(0,f.Z)(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])))),P=(0,g.keyframes)(w||(w=k||(k=(0,f.Z)(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])))),O=(0,g.keyframes)(M||(M=x||(x=(0,f.Z)(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])))),z=(0,s.ZP)("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),B=(0,s.ZP)(m,{name:"MuiTouchRipple",slot:"Ripple"})(S||(S=R||(R=(0,f.Z)(["\n opacity: 0;\n position: absolute;\n\n &."," {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n &."," {\n animation-duration: ","ms;\n }\n\n & ."," {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & ."," {\n opacity: 0;\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n & ."," {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ",";\n animation-duration: 2500ms;\n animation-timing-function: ",";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"]))),y.rippleVisible,C,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),y.ripplePulsate,(e=>{let{theme:t}=e;return t.transitions.duration.shorter}),y.child,y.childLeaving,P,550,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}),y.childPulsate,O,(e=>{let{theme:t}=e;return t.transitions.easing.easeInOut})),V=r.forwardRef((function(e,t){const n=(0,l.Z)({props:e,name:"MuiTouchRipple"}),{center:c=!1,classes:s={},className:u}=n,d=(0,i.Z)(n,A),[p,f]=r.useState([]),g=r.useRef(0),m=r.useRef(null);r.useEffect((()=>{m.current&&(m.current(),m.current=null)}),[p]);const v=r.useRef(!1),Z=r.useRef(0),k=r.useRef(null),x=r.useRef(null);r.useEffect((()=>()=>{Z.current&&clearTimeout(Z.current)}),[]);const R=r.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:o,rippleSize:i,cb:r}=e;f((e=>[...e,(0,b.jsx)(B,{classes:{ripple:(0,a.Z)(s.ripple,y.ripple),rippleVisible:(0,a.Z)(s.rippleVisible,y.rippleVisible),ripplePulsate:(0,a.Z)(s.ripplePulsate,y.ripplePulsate),child:(0,a.Z)(s.child,y.child),childLeaving:(0,a.Z)(s.childLeaving,y.childLeaving),childPulsate:(0,a.Z)(s.childPulsate,y.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:o,rippleSize:i},g.current)])),g.current+=1,m.current=r}),[s]),T=r.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:o=!1,center:i=c||t.pulsate,fakeElement:r=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&v.current)return void(v.current=!1);"touchstart"===(null==e?void 0:e.type)&&(v.current=!0);const a=r?null:x.current,s=a?a.getBoundingClientRect():{width:0,height:0,left:0,top:0};let l,u,d;if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(s.width/2),u=Math.round(s.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-s.left),u=Math.round(n-s.top)}if(i)d=Math.sqrt((2*s.width**2+s.height**2)/3),d%2===0&&(d+=1);else{const e=2*Math.max(Math.abs((a?a.clientWidth:0)-l),l)+2,t=2*Math.max(Math.abs((a?a.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===k.current&&(k.current=()=>{R({pulsate:o,rippleX:l,rippleY:u,rippleSize:d,cb:n})},Z.current=setTimeout((()=>{k.current&&(k.current(),k.current=null)}),80)):R({pulsate:o,rippleX:l,rippleY:u,rippleSize:d,cb:n})}),[c,R]),w=r.useCallback((()=>{T({},{pulsate:!0})}),[T]),M=r.useCallback(((e,t)=>{if(clearTimeout(Z.current),"touchend"===(null==e?void 0:e.type)&&k.current)return k.current(),k.current=null,void(Z.current=setTimeout((()=>{M(e,t)})));k.current=null,f((e=>e.length>0?e.slice(1):e)),m.current=t}),[]);return r.useImperativeHandle(t,(()=>({pulsate:w,start:T,stop:M})),[w,T,M]),(0,b.jsx)(z,(0,o.Z)({className:(0,a.Z)(y.root,s.root,u),ref:x},d,{children:(0,b.jsx)(h.Z,{component:null,exit:!0,children:p})}))}));var F=n(18561);function I(e){return(0,F.ZP)("MuiButtonBase",e)}const L=(0,v.Z)("MuiButtonBase",["root","disabled","focusVisible"]),W=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],E=(0,s.ZP)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},["&.".concat(L.disabled)]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),D=r.forwardRef((function(e,t){const n=(0,l.Z)({props:e,name:"MuiButtonBase"}),{action:s,centerRipple:f=!1,children:h,className:g,component:m="button",disabled:v=!1,disableRipple:y=!1,disableTouchRipple:Z=!1,focusRipple:k=!1,LinkComponent:x="a",onBlur:R,onClick:A,onContextMenu:T,onDragLeave:w,onFocus:M,onFocusVisible:S,onKeyDown:C,onKeyUp:P,onMouseDown:O,onMouseLeave:z,onMouseUp:B,onTouchEnd:F,onTouchMove:L,onTouchStart:D,tabIndex:N=0,TouchRippleProps:j,touchRippleRef:H,type:X}=n,_=(0,i.Z)(n,W),Y=r.useRef(null),K=r.useRef(null),U=u(K,H),{isFocusVisibleRef:$,onFocus:q,onBlur:J,ref:G}=p(),[Q,ee]=r.useState(!1);v&&Q&&ee(!1),r.useImperativeHandle(s,(()=>({focusVisible:()=>{ee(!0),Y.current.focus()}})),[]);const[te,ne]=r.useState(!1);r.useEffect((()=>{ne(!0)}),[]);const oe=te&&!y&&!v;function ie(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z;return d((o=>{t&&t(o);return!n&&K.current&&K.current[e](o),!0}))}r.useEffect((()=>{Q&&k&&!y&&te&&K.current.pulsate()}),[y,k,Q,te]);const re=ie("start",O),ae=ie("stop",T),ce=ie("stop",w),se=ie("stop",B),le=ie("stop",(e=>{Q&&e.preventDefault(),z&&z(e)})),ue=ie("start",D),de=ie("stop",F),pe=ie("stop",L),fe=ie("stop",(e=>{J(e),!1===$.current&&ee(!1),R&&R(e)}),!1),he=d((e=>{Y.current||(Y.current=e.currentTarget),q(e),!0===$.current&&(ee(!0),S&&S(e)),M&&M(e)})),ge=()=>{const e=Y.current;return m&&"button"!==m&&!("A"===e.tagName&&e.href)},be=r.useRef(!1),me=d((e=>{k&&!be.current&&Q&&K.current&&" "===e.key&&(be.current=!0,K.current.stop(e,(()=>{K.current.start(e)}))),e.target===e.currentTarget&&ge()&&" "===e.key&&e.preventDefault(),C&&C(e),e.target===e.currentTarget&&ge()&&"Enter"===e.key&&!v&&(e.preventDefault(),A&&A(e))})),ve=d((e=>{k&&" "===e.key&&K.current&&Q&&!e.defaultPrevented&&(be.current=!1,K.current.stop(e,(()=>{K.current.pulsate(e)}))),P&&P(e),A&&e.target===e.currentTarget&&ge()&&" "===e.key&&!e.defaultPrevented&&A(e)}));let ye=m;"button"===ye&&(_.href||_.to)&&(ye=x);const Ze={};"button"===ye?(Ze.type=void 0===X?"button":X,Ze.disabled=v):(_.href||_.to||(Ze.role="button"),v&&(Ze["aria-disabled"]=v));const ke=u(t,G,Y);const xe=(0,o.Z)({},n,{centerRipple:f,component:m,disabled:v,disableRipple:y,disableTouchRipple:Z,focusRipple:k,tabIndex:N,focusVisible:Q}),Re=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:o,classes:i}=e,r={root:["root",t&&"disabled",n&&"focusVisible"]},a=(0,c.Z)(r,I,i);return n&&o&&(a.root+=" ".concat(o)),a})(xe);return(0,b.jsxs)(E,(0,o.Z)({as:ye,className:(0,a.Z)(Re.root,g),ownerState:xe,onBlur:fe,onClick:A,onContextMenu:ae,onFocus:he,onKeyDown:me,onKeyUp:ve,onMouseDown:re,onMouseLeave:le,onMouseUp:se,onDragLeave:ce,onTouchEnd:de,onTouchMove:pe,onTouchStart:ue,ref:ke,tabIndex:v?-1:N,type:X},Ze,_,{children:[h,oe?(0,b.jsx)(V,(0,o.Z)({ref:U,center:f},j)):null]}))}))},22388:(e,t,n)=>{n.d(t,{Z:()=>E});var o=n(7896),i=n(31461),r=n(90118),a=n(34612),c=n(61040),s=n(53682),l=n(82655);var u=n(66685);const d={black:"#000",white:"#fff"},p={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},f={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},h={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},b={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},m={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},v={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=["mode","contrastThreshold","tonalOffset"],Z={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:d.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function x(e,t,n,o){const i=o.light||o,r=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,u.$n)(e.main,i):"dark"===t&&(e.dark=(0,u._j)(e.main,r)))}function R(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:c=.2}=e,s=(0,i.Z)(e,y),l=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[200],light:b[50],dark:b[400]}:{main:b[700],light:b[400],dark:b[800]}}(t),R=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:f[200],light:f[50],dark:f[400]}:{main:f[500],light:f[300],dark:f[700]}}(t),A=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h[500],light:h[300],dark:h[700]}:{main:h[700],light:h[400],dark:h[800]}}(t),T=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[400],light:m[300],dark:m[700]}:{main:m[700],light:m[500],dark:m[900]}}(t),w=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[400],light:v[300],dark:v[700]}:{main:v[800],light:v[500],dark:v[900]}}(t),M=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(t);function S(e){return(0,u.mi)(e,k.text.primary)>=n?k.text.primary:Z.text.primary}const C=e=>{let{color:t,name:n,mainShade:i=500,lightShade:a=300,darkShade:s=700}=e;if(t=(0,o.Z)({},t),!t.main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error((0,r.Z)(11,n?" (".concat(n,")"):"",i));if("string"!==typeof t.main)throw new Error((0,r.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return x(t,"light",a,c),x(t,"dark",s,c),t.contrastText||(t.contrastText=S(t.main)),t},P={dark:k,light:Z};return(0,a.Z)((0,o.Z)({common:(0,o.Z)({},d),mode:t,primary:C({color:l,name:"primary"}),secondary:C({color:R,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:C({color:A,name:"error"}),warning:C({color:M,name:"warning"}),info:C({color:T,name:"info"}),success:C({color:w,name:"success"}),grey:p,contrastThreshold:n,getContrastText:S,augmentColor:C,tonalOffset:c},P[t]),s)}const A=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const T={textTransform:"uppercase"},w='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){const n="function"===typeof t?t(e):t,{fontFamily:r=w,fontSize:c=14,fontWeightLight:s=300,fontWeightRegular:l=400,fontWeightMedium:u=500,fontWeightBold:d=700,htmlFontSize:p=16,allVariants:f,pxToRem:h}=n,g=(0,i.Z)(n,A);const b=c/14,m=h||(e=>"".concat(e/p*b,"rem")),v=(e,t,n,i,a)=>{return(0,o.Z)({fontFamily:r,fontWeight:e,fontSize:m(t),lineHeight:n},r===w?{letterSpacing:"".concat((c=i/t,Math.round(1e5*c)/1e5),"em")}:{},a,f);var c},y={h1:v(s,96,1.167,-1.5),h2:v(s,60,1.2,-.5),h3:v(l,48,1.167,0),h4:v(l,34,1.235,.25),h5:v(l,24,1.334,0),h6:v(u,20,1.6,.15),subtitle1:v(l,16,1.75,.15),subtitle2:v(u,14,1.57,.1),body1:v(l,16,1.5,.15),body2:v(l,14,1.43,.15),button:v(u,14,1.75,.4,T),caption:v(l,12,1.66,.4),overline:v(l,12,2.66,1,T),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,a.Z)((0,o.Z)({htmlFontSize:p,pxToRem:m,fontFamily:r,fontSize:c,fontWeightLight:s,fontWeightRegular:l,fontWeightMedium:u,fontWeightBold:d},y),g,{clone:!1})}function S(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const C=["none",S(0,2,1,-1,0,1,1,0,0,1,3,0),S(0,3,1,-2,0,2,2,0,0,1,5,0),S(0,3,3,-2,0,3,4,0,0,1,8,0),S(0,2,4,-1,0,4,5,0,0,1,10,0),S(0,3,5,-1,0,5,8,0,0,1,14,0),S(0,3,5,-1,0,6,10,0,0,1,18,0),S(0,4,5,-2,0,7,10,1,0,2,16,1),S(0,5,5,-3,0,8,10,1,0,3,14,2),S(0,5,6,-3,0,9,12,1,0,3,16,2),S(0,6,6,-3,0,10,14,1,0,4,18,3),S(0,6,7,-4,0,11,15,1,0,4,20,3),S(0,7,8,-4,0,12,17,2,0,5,22,4),S(0,7,8,-4,0,13,19,2,0,5,24,4),S(0,7,9,-4,0,14,21,2,0,5,26,4),S(0,8,9,-5,0,15,22,2,0,6,28,5),S(0,8,10,-5,0,16,24,2,0,6,30,5),S(0,8,11,-5,0,17,26,2,0,6,32,5),S(0,9,11,-5,0,18,28,2,0,7,34,6),S(0,9,12,-6,0,19,29,2,0,7,36,6),S(0,10,13,-6,0,20,31,3,0,8,38,7),S(0,10,13,-6,0,21,33,3,0,8,40,7),S(0,10,14,-6,0,22,35,3,0,8,42,7),S(0,11,14,-7,0,23,36,3,0,9,44,8),S(0,11,15,-7,0,24,38,3,0,9,46,8)],P=["duration","easing","delay"],O={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},z={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function B(e){return"".concat(Math.round(e),"ms")}function V(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function F(e){const t=(0,o.Z)({},O,e.easing),n=(0,o.Z)({},z,e.duration);return(0,o.Z)({getAutoHeightDuration:V,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:r=n.standard,easing:a=t.easeInOut,delay:c=0}=o;(0,i.Z)(o,P);return(Array.isArray(e)?e:[e]).map((e=>"".concat(e," ").concat("string"===typeof r?r:B(r)," ").concat(a," ").concat("string"===typeof c?c:B(c)))).join(",")}},e,{easing:t,duration:n})}const I={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},L=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function W(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mixins:t={},palette:n={},transitions:u={},typography:d={}}=e,p=(0,i.Z)(e,L);if(e.vars)throw new Error((0,r.Z)(18));const f=R(n),h=(0,c.Z)(e);let g=(0,a.Z)(h,{mixins:(b=h.breakpoints,m=t,(0,o.Z)({toolbar:{minHeight:56,[b.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[b.up("sm")]:{minHeight:64}}},m)),palette:f,shadows:C.slice(),typography:M(f,d),transitions:F(u),zIndex:(0,o.Z)({},I)});var b,m;g=(0,a.Z)(g,p);for(var v=arguments.length,y=new Array(v>1?v-1:0),Z=1;Z<v;Z++)y[Z-1]=arguments[Z];return g=y.reduce(((e,t)=>(0,a.Z)(e,t)),g),g.unstable_sxConfig=(0,o.Z)({},s.Z,null==p?void 0:p.unstable_sxConfig),g.unstable_sx=function(e){return(0,l.Z)({sx:e,theme:this})},g}const E=W()},87445:(e,t,n)=>{n.d(t,{Z:()=>o});const o="$$material"},32788:(e,t,n)=>{n.d(t,{FO:()=>a,ZP:()=>c});var o=n(39732),i=n(22388),r=n(87445);const a=e=>(0,o.x9)(e)&&"classes"!==e,c=(0,o.ZP)({themeId:r.Z,defaultTheme:i.Z,rootShouldForwardProp:a})},44358:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(53263),i=n(22388),r=n(87445);function a(e){let{props:t,name:n}=e;return(0,o.Z)({props:t,name:n,defaultTheme:i.Z,themeId:r.Z})}},45375:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n(58472).Z}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[6931],{78123:(e,n,t)=>{t.d(n,{Z:()=>z});var o,l=t(71171),i=t(5057),a=t(55898),r=t.n(a),c=t(33518),s=t(85493),d=t(15849),u=t(67654),m=t(53066),p=t(6019),v=t(56195),g=t(83388),f=t(69544),b=t(76282),h=t(60765),k=t(83963),y=t(15598),Z=t(60967),x=t(11891),w=t(19712),C=t(54272),E=t(58717),L=t(28726),j=t(38242),R=t(68420),B=t(77277),D=t(86229),O=t(14491),S=t(4651),P=t(58238),U=t(70461),_=t(55419),T=t(29054),A=t(96266);function N(e){var n,t,o,l;let{blocklet:a,onStart:r,onComplete:c,variant:N,hasPermission:I,useBlockletUrlEvaluation:M,...z}=e;const G=(0,s.useNavigate)(),F=(0,P.h6)(),[q,X]=(0,i.useState)(null),[V,W]=(0,i.useState)(null),[Y,Q]=(0,i.useState)(!1),[H,J]=(0,i.useState)(null),{t:$}=(0,i.useContext)(R.RD),[ee]=(0,u.Z)("skip-blocklet-setup",!1),{loading:ne,recommendedUrl:te}=M(a),{nftState:oe}=(0,T.y0)(),le=(0,j.isInProgress)(a.status);let ie=(null===a||void 0===a||null===(n=a.controller)||void 0===n||null===(t=n.status)||void 0===t?void 0:t.value)===B.BLOCKLET_CONTROLLER_STATUS.suspended;null!==oe&&void 0!==oe&&oe.expired||(null===a||void 0===a||null===(o=a.controller)||void 0===o||null===(l=o.status)||void 0===l?void 0:l.reason)!==B.SUSPENDED_REASON.expired||(ie=!1);const{inService:ae}=F,re=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return async()=>{const o=async t=>{r({action:e,blocklet:a}),Q(!0),W(e);let o=!1;try{if("remove"===e)await n(t);else if("start"===e){var l;if(!(0,j.hasRunnableComponent)(a))return void D.Z.error($("blocklet.noComponent"));if(!ae&&!ee&&(null===(l=a.settings)||void 0===l||!l.initialized)&&a.mode!==B.BLOCKLET_MODES.DEVELOPMENT){const n=(0,S.RU)(F.info),t=new URL(te);return t.searchParams.set("serverUrl",n),window.open(t.href),void c({action:e,blocklet:a})}const t=a.children.filter((e=>!(0,j.isInProgress)(e.status)&&"running"!==e.status)).map((e=>e.meta.did)),o={did:a.meta.did,componentDids:t};await n({input:o})}else if(["stop","restart","reload"].includes(e)){const e=a.children.filter((e=>"running"===e.status)).map((e=>e.meta.did)),t={did:a.meta.did,componentDids:e};await n({input:t})}else{const e={did:a.meta.did};await n({input:e})}"remove"===e?o=!0:await(0,O._v)(1e3),"reload"===e&&D.Z.success($("blocklet.reloadSuccess")),J(null),c({action:e,blocklet:a})}catch(i){const n="Blocklet ".concat(e," failed: ").concat((0,O.Z)(i));throw c({action:e,blocklet:a,error:new Error(n)}),new Error(n)}finally{o||Q(!1)}},l=()=>{Q(!1),J(null)},i=(0,j.getDisplayName)(a,!0),s=a.mode===B.BLOCKLET_MODES.DEVELOPMENT?{description:()=>(0,A.jsx)(Z.Z,{component:"div",children:(0,A.jsx)(Z.Z,{gutterBottom:!0,children:$("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(e,n)=>(0,A.jsxs)(Z.Z,{component:"div",children:[(0,A.jsx)(Z.Z,{gutterBottom:!0,children:$("blocklet.action.removeApplicationDescription")}),(0,A.jsxs)(w.Z,{name:"removeType",value:e.removeType,onChange:t=>n({...e,removeType:t.target.value}),children:[(0,A.jsx)(C.Z,{value:"backup",control:(0,A.jsx)(x.Z,{}),label:$("blocklet.action.removeApplicationAfterBackup")}),(0,A.jsx)(C.Z,{value:"complete",control:(0,A.jsx)(x.Z,{}),label:$("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},d={stop:{title:"".concat($("common.stop")," ").concat(i),description:$("blocklet.action.stopDescription"),confirm:$("blocklet.action.confirmStop"),cancel:$("common.cancel"),onConfirm:o,onCancel:l},restart:{title:"".concat($("common.restart")," ").concat(i),description:$("blocklet.action.restartDescription"),confirm:$("blocklet.action.confirmRestart"),cancel:$("common.cancel"),onConfirm:o,onCancel:l},remove:{title:"".concat($("common.remove")," ").concat(i),confirm:$("blocklet.action.confirmRemove"),cancel:$("common.cancel"),onConfirm:o,onCancel:l,...s},cancelDownload:{title:"".concat($("common.cancel")),description:$("blocklet.action.cancelDownloadDescription",{name:i}),confirm:$("common.confirm"),cancel:$("common.cancel"),onConfirm:o,onCancel:l}};t?J(d[e]):await o()}},ce=Boolean(q),se=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}X(e.currentTarget)},de=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}X(null)},ue=async(e,n)=>{try{n.stopPropagation(),n.preventDefault()}catch{}if("function"===typeof e.handler)try{Q(!0),W(e.action),await e.handler()}catch(t){console.error("Blocklet ".concat(e.name," failed: "),t)}finally{Q(!1),X(null)}else X(null)},me=!ae&&(0,j.isDeletableBlocklet)(a)?{action:"remove",icon:_.Z.Remove,name:$("common.remove"),handler:re("remove",(async e=>{let{removeType:n}=e;"backup"===n&&await F.api.backupBlocklet({input:{appDid:a.appDid,to:"disk"}}),await F.api.deleteBlocklet({input:{did:a.meta.did,keepData:!1}})}),!0),disabled:le}:null,pe={action:"remove",icon:_.Z.Remove,name:$("common.cancel"),handler:re("cancelDownload",F.api.cancelDownloadBlocklet,!0)},ve=(0,j.getAppMissingConfigs)(a),ge=[{action:"start",icon:_.Z.Start,name:$("common.start"),handler:re("start",F.api.startBlocklet),disabled:ie||a.children.every((e=>"running"===e.status))||(0,O.XN)(a.status)||ne||le},{action:"stop",icon:_.Z.Stop,name:$("common.stop"),handler:re("stop",F.api.stopBlocklet,!0),disabled:!["running","starting"].includes(a.status)},{action:"restart",icon:_.Z.Restart,name:$("common.restart"),handler:re("restart",F.api.restartBlocklet,!0),disabled:ie||"running"!==a.status},{action:"reload",icon:_.Z.Reload,name:$("common.reload"),handler:re("reload",F.api.reloadBlocklet),disabled:ie||"running"!==a.status},(0,O.XN)(a.status)?pe:me,{separator:!0},{onlyInMenu:!0,action:"config",icon:_.Z.Config,name:$("common.config"),handler:()=>{G("/blocklets/".concat(a.meta.did,"/configuration"))},disabled:(0,O.XN)(a.status)},{onlyInMenu:!0,action:"team",icon:_.Z.Group,name:$("common.manageTeam"),handler:()=>{G("/blocklets/".concat(a.meta.did,"/members"))},disabled:(0,O.XN)(a.status)},{onlyInMenu:!0,action:"log",icon:_.Z.Log,name:$("common.log"),handler:()=>{G("/logs/blocklet-".concat(a.meta.did))},disabled:(0,O.XN)(a.status)}].filter(Boolean);return"menu"===N?(0,A.jsxs)(K,{"data-cy":"blocklet-actions",children:[(0,A.jsx)(m.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":a.meta.did,onClick:se,size:"small",disabled:!I||!(0,O.XN)(a.status)&&Y,children:(0,A.jsx)(h.Z,{})}),(0,A.jsxs)(p.Z,{id:"actions-menu",anchorEl:q,keepMounted:!0,open:ce,onClose:de,PaperProps:{},children:[ve.length>0&&(0,A.jsxs)(E.Z,{style:{maxWidth:"400px"},severity:"error",children:[$("blocklet.config.missingRequired"),(0,A.jsx)("br",{}),(0,A.jsx)(d.Link,{to:"/blocklets/".concat(a.meta.did,"/components"),children:$("blocklet.config.gotoFix")})]}),ge.map(((e,n)=>e.separator?(0,A.jsx)(v.Z,{},"separator-".concat(n)):(0,A.jsxs)(b.Z,{dense:!0,onClick:n=>ue(e,n),disabled:Y||e.disabled,"data-cy":"".concat(e.action,"-blocklet"),children:[(0,A.jsx)(k.Z,{style:{minWidth:24},children:V===e.action&&Y?(0,A.jsx)(f.Z,{size:16,sx:{marginRight:1}}):(0,A.jsx)(e.icon,{fontSize:"small"})}),(0,A.jsx)(y.Z,{primary:e.name})]},e.name)))]}),H&&(0,A.jsx)(U.Z,{title:H.title,description:H.description,confirm:H.confirm,cancel:H.cancel,params:H.params,onConfirm:H.onConfirm,onCancel:H.onCancel})]}):(0,A.jsxs)(K,{"data-cy":"blocklet-actions",...z,children:[(0,A.jsx)(g.Z,{children:ge.filter((e=>!e.separator&&!e.onlyInMenu)).map((e=>(0,A.jsxs)(L.Z,{title:e.name,"data-cy":"".concat(e.action,"-blocklet"),onClick:()=>ue(e),disabled:Boolean(e.disabled)||Y,children:[V===e.action&&Y?(0,A.jsx)(f.Z,{size:16,sx:{marginRight:1}}):(0,A.jsx)(e.icon,{}),(0,A.jsx)("span",{className:"blocklet-action-text",children:e.name})]},e.name)))}),H&&(0,A.jsx)(U.Z,{title:H.title,description:H.description,confirm:H.confirm,cancel:H.cancel,params:H.params,onConfirm:H.onConfirm,onCancel:H.onCancel})]})}N.propTypes={blocklet:r().object.isRequired,onStart:r().func.isRequired,onComplete:r().func.isRequired,variant:r().oneOf(["menu","group"]),hasPermission:r().bool,useBlockletUrlEvaluation:r().func},N.defaultProps={variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e,n;return{loading:!1,recommendedUrl:null===(e=window)||void 0===e||null===(n=e.location)||void 0===n?void 0:n.href}}};const K=c.Z.div(o||(o=(0,l.Z)(["\n display: flex;\n align-items: center;\n\n @media (max-width: ","px) {\n .MuiButton-root {\n padding: 4px;\n font-size: 10px;\n }\n }\n"])),(e=>e.theme.breakpoints.values.sm));var I=t(7199),M=t(24138);function z(e){let{...n}=e;const t=(0,I.V)(N,"mutate_blocklets");return(0,A.jsx)(t,{...n,useBlockletUrlEvaluation:M.BZ})}},7199:(e,n,t)=>{t.d(n,{V:()=>o.V,Z:()=>o.Z});var o=t(63406)},24138:(e,n,t)=>{t.d(n,{BZ:()=>b,ZN:()=>h});var o=t(5057),l=t(6352),i=t.n(l),a=t(35432),r=t(49714),c=t(41365),s=t.n(c),d=t(32243),u=t.n(d),m=t(68420),p=t(14491);const v=u()((e=>s()(i()(new URL(e).origin,a.WELLKNOWN_PING_PREFIX)))),g={};function f(e){let{urls:n,checkAccessible:t=s(),disableCache:l=!1}=e;const i=(0,o.useRef)(n.filter((e=>g[e])).map((e=>g[e]))),a=i.current.length===n.length,[c,d]=(0,o.useState)(a?i.current:[]),[u,m]=(0,o.useState)(!a),p=(0,o.useMemo)((()=>!u&&c.length?c[0]:null),[c,u]);return(0,o.useEffect)((()=>{if((null===n||void 0===n?void 0:n.length)>0&&!a){(async()=>{let e;if(m(!0),l)e=await(0,r.evaluateURLs)(n,{checkAccessible:t}),e.forEach((e=>{g[e.url]=e}));else{(await(0,r.evaluateURLs)(n.filter((e=>!g[e])),{checkAccessible:t})).forEach((e=>{g[e.url]=e})),e=n.map((e=>g[e])).sort(((e,n)=>n.score-e.score))}d(e),m(!1)})()}}),[n,l,a]),{urlsState:c,loading:u,recommendedUrlState:p,recommendedUrl:null===p||void 0===p?void 0:p.url}}function b(e){const{locale:n}=(0,o.useContext)(m.RD),t=(0,o.useMemo)((()=>e?(0,p.A6)({blocklet:e,params:(0,p.f0)(e,n)}):[]),[e,n]),{loading:l,recommendedUrlState:i,recommendedUrl:a}=f({urls:t,checkAccessible:v});return{urls:t,loading:l,recommendedUrlState:i,recommendedUrl:a}}function h(e){const n=(0,o.useMemo)((()=>e.map((e=>(0,p.Sk)(e)))),[e]),{urlsState:t,loading:l,recommendedUrl:i}=f({urls:n,checkAccessible:v});let a;if(l)a={domainsAccessibility:e.reduce(((e,n)=>({...e,[n]:{loading:!0}})),{}),recommendedDomain:null};else{var r;const e=t.reduce(((e,n)=>{const t=new URL(n.url).hostname;return e[t]={...n,domain:t},e}),{}),n=(null===(r=t.find((e=>e.accessible)))||void 0===r?void 0:r.url)||i;a={domainsAccessibility:e,recommendedDomain:n?new URL(n).hostname:null}}return a}},1722:(e,n,t)=>{t.d(n,{Z:()=>d});var o=t(55898),l=t.n(o),i=t(56869),a=t(72333),r=t(77277),c=t(49522),s=t(96266);function d(e){let{blocklet:n,style:t,size:o,...l}=e;const{logoUrl:d}=(0,c.Z)({blocklet:n}),{variant:u}=l;let m=(0,s.jsx)("img",{src:d,alt:"",style:{width:o}});if(!n.meta.logo){var p;(null===(p=(n.configs||[]).find((e=>e.key===r.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)))||void 0===p?void 0:p.value)||(m=(0,s.jsx)(a.Z,{did:n.meta.did||"",responsive:!0}))}return(0,s.jsx)(i.Z,{variant:u||"square",style:Object.assign({backgroundColor:"transparent",width:o,height:o,borderRadius:10},t),...l,children:m})}d.propTypes={blocklet:l().object.isRequired,style:l().object,size:l().oneOfType([l().number,l().string])},d.defaultProps={style:{},size:40}},55419:(e,n,t)=>{t.d(n,{Z:()=>u});var o=t(95122),l=t(20714),i=t(78601),a=t(74643),r=t(78377),c=t(12497),s=t(29263),d=t(19403);const u={Start:l.Z,Stop:i.Z,Restart:a.Z,Reload:r.Z,Remove:o.Z,Config:c.Z,Log:s.Z,Group:d.Z}},81010:(e,n,t)=>{t.d(n,{Z:()=>v});var o=t(5057),l=t(55898),i=t.n(l),a=t(69544),r=t(69292),c=t(68420),s=t(38242),d=t(69569),u=t(22228),m=t(96266);const p={yellow:"#FFCF71",grey:"#888888"};function v(e){let{status:n,variant:t,source:l,progress:i,...v}=e;const{t:g}=(0,o.useContext)(c.RD),f={added:p.grey,waiting:p.yellow,downloading:p.yellow,extracting:p.yellow,downloaded:p.grey,installing:p.yellow,installed:p.grey,starting:p.yellow,running:"success",stopping:p.yellow,stopped:p.grey,error:"error",upgrading:p.yellow,restarting:p.yellow,corrupted:"error",deleting:p.yellow},b=(0,s.isInProgress)(n),h=g("blocklet.status.".concat(n));return"dot"===t?(0,m.jsx)(r.Z,{title:g("blocklet.statusTip",{status:h}),children:(0,m.jsx)(d.Z,{color:f[n],...v})}):(0,m.jsxs)(u.Z,{type:{added:"primary",waiting:"warning",downloading:"warning",extracting:"warning",downloaded:"primary",installing:"warning",installed:"primary",starting:"warning",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"warning",restarting:"warning",corrupted:"error",deleting:"warning"}[n],...v,children:[b&&(0,m.jsx)(a.Z,{size:12,color:"inherit",style:{marginRight:5}}),h,"downloading"===n&&i?(0,m.jsx)("div",{style:{marginLeft:5},children:"".concat(i," %")}):null]})}v.propTypes={status:i().string.isRequired,variant:i().oneOf(["dot","tag"]),source:i().string,progress:i().number},v.defaultProps={variant:"tag",source:"",progress:0}},29054:(e,n,t)=>{t.d(n,{BlockletContext:()=>l,y0:()=>r});var o=t(5057);const l=(0,o.createContext)({}),{Provider:i,Consumer:a}=l;function r(){return(0,o.useContext)(l)}},87363:(e,n,t)=>{t.d(n,{K:()=>u,g:()=>d});var o=t(5057),l=t(55898),i=t.n(l),a=t(69163),r=t.n(a),c=t(96266);const s=(0,o.createContext)({});function d(e){let{children:n,type:t}=e;const[l,i]=(0,o.useState)([]),a=(0,o.useRef)([]),d=e=>{if(a.current.includes(e)){const n=a.current.filter((n=>n!==e));i(n),a.current=n}};return(0,c.jsx)(s.Provider,{value:{type:t,deletingBlocklets:l,addDeletingDid:e=>{if(!a.current.includes(e)){const n=[...a.current,e];i(n),a.current=n}},removeDeletingDid:d,matchDeletingDid:e=>{const n=l.filter((n=>e.find((e=>e===n))));r()(n,l).forEach((e=>d(e)))}},children:n})}function u(){return(0,o.useContext)(s)}d.propTypes={type:i().string,children:i().node.isRequired},d.defaultProps={type:"blocklets"}},69569:(e,n,t)=>{t.d(n,{Z:()=>c});var o,l=t(71171),i=t(33518);const a={success:"#3ab39d",error:"#D0021B"},r="10px",c=i.Z.div(o||(o=(0,l.Z)(["\n display: inline-block;\n min-width: ",";\n min-height: ",";\n background: ",";\n border-radius: 100%;\n"])),(e=>e.size||r),(e=>e.size||r),(e=>a[e.color]||e.color||a.success))},49522:(e,n,t)=>{t.d(n,{Z:()=>s});var o=t(6352),l=t.n(o),i=t(77277),a=t(58238),r=t(14491);const c=(e,n)=>{let t="?v=";var o;n?t+=(0,r.Qi)(n):t+="".concat(null===e||void 0===e||null===(o=e.meta)||void 0===o?void 0:o.version).concat((0,r.wS)(null===e||void 0===e?void 0:e.status)?"~":"");return t};function s(e){var n,t,o,r;let{blocklet:s}=e;const{inService:d}=(0,a.h6)(),u=null===(n=((null===s||void 0===s?void 0:s.environments)||[]).find((e=>e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_SQUARE)))||void 0===n?void 0:n.value,m=null===(t=((null===s||void 0===s?void 0:s.environments)||[]).find((e=>e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT)))||void 0===t?void 0:t.value,p=null===(o=((null===s||void 0===s?void 0:s.environments)||[]).find((e=>e.key===i.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON)))||void 0===o?void 0:o.value,v=(null===(r=window.env)||void 0===r?void 0:r.apiPrefix)||"/";return{logoUrl:l()(v,"/blocklet/logo/".concat(d?"":s.meta.did),c(s,u)),rectLogoUrl:l()(v,"/blocklet/logo-rect/".concat(d?"":s.meta.did),c(s,m)),faviconUrl:l()(v,"/blocklet/logo-favicon/".concat(d?"":s.meta.did),c(s,p))}}},22228:(e,n,t)=>{t.d(n,{Z:()=>r});var o=t(55898),l=t.n(o),i=t(19778),a=t(96266);function r(e){let{children:n,style:t,...o}=e;return(0,a.jsx)(i.Z,{style:t,...o,children:n})}r.propTypes={children:l().any.isRequired,style:l().object},r.defaultProps={style:{}}}}]);