@abtnode/blocklet-services 1.16.49-beta-20250812-040454-05aece54 → 1.16.49-beta-20250814-091924-eb162407

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 (187) hide show
  1. package/api/services/notification/queue.js +14 -9
  2. package/api/socket/channel/did.js +2 -2
  3. package/dist/assets/{AdapterDayjs-hXG6wgqC.js → AdapterDayjs-C9drjkA9.js} +1 -1
  4. package/dist/assets/{Google-CuUa2ivB.js → Google-Dr94kq2T.js} +1 -1
  5. package/dist/assets/{access-control-6guUEIIp.js → access-control-BpbeOd5l.js} +1 -1
  6. package/dist/assets/{add-component-core-4uFRHIpx.js → add-component-core-19fDzf7w.js} +1 -1
  7. package/dist/assets/{add-resource-_COpArrC.js → add-resource-DcF5DGBS.js} +1 -1
  8. package/dist/assets/{addon-Cmm3lxUs.js → addon-DTju-oLy.js} +1 -1
  9. package/dist/assets/{advanced-B05ps9YS.js → advanced-BKlOxllK.js} +1 -1
  10. package/dist/assets/{aigne-CsEmFLGi.js → aigne-DmJeSrJC.js} +1 -1
  11. package/dist/assets/{appearance-Bw11KiXQ.js → appearance-C0vB2Ngh.js} +1 -1
  12. package/dist/assets/{ar-gi-DUwmP.js → ar-DrftSIv3.js} +1 -1
  13. package/dist/assets/{ar-BrkwppMS.js → ar-RVOyZ73G.js} +1 -1
  14. package/dist/assets/{arrow-down.svg-_z1Gr5z1.js → arrow-down.svg-VpGUe2rM.js} +1 -1
  15. package/dist/assets/{audit-logs-CsQOeDrk.js → audit-logs-BOdMMiw_.js} +1 -1
  16. package/dist/assets/{authorize-DZczp4it.js → authorize-BXobLOwY.js} +1 -1
  17. package/dist/assets/{base32-CzDOk3cF.js → base32-eJwrCU_s.js} +1 -1
  18. package/dist/assets/{bind-account-TVWaibO6.js → bind-account-CLXdfK9k.js} +1 -1
  19. package/dist/assets/branding-Ba3KIUpk.js +1 -0
  20. package/dist/assets/{branding-DnBXFIg2.js → branding-CfffMIxe.js} +4 -4
  21. package/dist/assets/{branding-DIfO6Wlq.js → branding-DIT14xNK.js} +2 -2
  22. package/dist/assets/{bundle-avatar-CZNhHDkE.js → bundle-avatar-Cel6hFKM.js} +1 -1
  23. package/dist/assets/{button-B0AX6HJx.js → button-fR96s6VI.js} +1 -1
  24. package/dist/assets/{click-to-copy-CNVY2jyw.js → click-to-copy-rdt9ohrk.js} +1 -1
  25. package/dist/assets/{complete-BJRYgLYa.js → complete-BLE3iVY0.js} +1 -1
  26. package/dist/assets/{component-LYdOEk37.js → component-DcxUOYLY.js} +3 -3
  27. package/dist/assets/config-BWRPtM4k.js +53 -0
  28. package/dist/assets/{config-BsNFHebj.js → config-BfjLzc_R.js} +1 -1
  29. package/dist/assets/{config-DLIOyrIT.js → config-dkLCQy3T.js} +1 -1
  30. package/dist/assets/{config-navigation-B8lmgCq0.js → config-navigation-BHvF1mjF.js} +3 -3
  31. package/dist/assets/{config-space-Bf7RiOeS.js → config-space-tLO83-g6.js} +1 -1
  32. package/dist/assets/{confirm-B-Pohnpi.js → confirm-BDJGO8bh.js} +1 -1
  33. package/dist/assets/{connect-CQ41eSpn.js → connect-BSVgMFMm.js} +1 -1
  34. package/dist/assets/{connect-CxxQdWs5.js → connect-DM6B9M-Y.js} +1 -1
  35. package/dist/assets/{connect-to-qV7wuVVK.js → connect-to-BSrYiYdy.js} +1 -1
  36. package/dist/assets/{createClass-Dg_VTkOQ.js → createClass-Dj3hG9Dc.js} +1 -1
  37. package/dist/assets/dashboard-BgCxT1hg.js +106 -0
  38. package/dist/assets/{de-DjoPhrWS.js → de-BXIXPwxt.js} +1 -1
  39. package/dist/assets/{de-BtMLLcnl.js → de-CzR7Usym.js} +1 -1
  40. package/dist/assets/{delete-confirm-DkSfjrm9.js → delete-confirm-DHEsSepo.js} +1 -1
  41. package/dist/assets/{did-address-ByONFwMZ.js → did-address-F4eDvKaA.js} +1 -1
  42. package/dist/assets/domain-D8756S8u.js +9 -0
  43. package/dist/assets/{domain-action-card-CDmXQx1H.js → domain-action-card-CDOSKDR8.js} +1 -1
  44. package/dist/assets/{domains-ItVUzQLa.js → domains-CcpbD8O0.js} +1 -1
  45. package/dist/assets/{email-DCLJdLrL.js → email-D3Hg29bp.js} +1 -1
  46. package/dist/assets/engine-DNQukT7L.js +1 -0
  47. package/dist/assets/{es-CeY3141A.js → es-BHI4ILsC.js} +1 -1
  48. package/dist/assets/{es-BLM6BW2Z.js → es-DJvu101w.js} +1 -1
  49. package/dist/assets/{exchange-passport-CSiut7vw.js → exchange-passport-f10XLUlw.js} +1 -1
  50. package/dist/assets/{form-CXB49CUG.js → form-Bn8R25ZF.js} +1 -1
  51. package/dist/assets/{form-text-input-y9UkSEXJ.js → form-text-input-MaDVJnR3.js} +1 -1
  52. package/dist/assets/{fr-DHiivuwa.js → fr-BqKCXdV2.js} +1 -1
  53. package/dist/assets/{fr-DM9fauTH.js → fr-D9eGKSnG.js} +1 -1
  54. package/dist/assets/{fuel-jNlTLYIw.js → fuel-BWsNvj58.js} +1 -1
  55. package/dist/assets/{gen-access-key-DX2pH7fs.js → gen-access-key-C5aQP2Vo.js} +1 -1
  56. package/dist/assets/gen-simple-access-key-B9w6zJI5.js +1 -0
  57. package/dist/assets/get-safe-url-oIssn-5r.js +1 -0
  58. package/dist/assets/{hdkey-OYxbu68D.js → hdkey-14e6Nlg3.js} +1 -1
  59. package/dist/assets/{hi-DgD0hgry.js → hi-CSHwUi_Z.js} +1 -1
  60. package/dist/assets/{hi-zAkIId6q.js → hi-DlvVN0mm.js} +1 -1
  61. package/dist/assets/{home-DLBmoHQ2.js → home-C5YltZz-.js} +1 -1
  62. package/dist/assets/{id-DRypmlkS.js → id-Dc-m_i57.js} +1 -1
  63. package/dist/assets/{id-CNxc03tk.js → id-YNynvxGd.js} +1 -1
  64. package/dist/assets/{iframe-CDGyGqia.js → iframe-AOE2Nmtj.js} +1 -1
  65. package/dist/assets/{index-CLqfXh65.js → index-1gQVvBTN.js} +1 -1
  66. package/dist/assets/{index-C1MXs4dK.js → index-5Yk46iGv.js} +1 -1
  67. package/dist/assets/{index-kYCU1Exv.js → index-B5b9PR4S.js} +1 -1
  68. package/dist/assets/{index-BzuF1xQu.js → index-BJ1ubRag.js} +1 -1
  69. package/dist/assets/{index-DgBUoYTd.js → index-Bg647oh8.js} +1 -1
  70. package/dist/assets/{index-DR0oTIfe.js → index-BhPdV0UV.js} +1 -1
  71. package/dist/assets/index-By6tFcJ8.js +4 -0
  72. package/dist/assets/{index-BaJEVELd.js → index-CA6SmdD7.js} +1 -1
  73. package/dist/assets/{index-BNqNjoec.js → index-CTWp3jWl.js} +1 -1
  74. package/dist/assets/{index-BRr23LOn.js → index-CmcupnbA.js} +1 -1
  75. package/dist/assets/{index-wD9l4LeM.js → index-CrVkwp1D.js} +3 -3
  76. package/dist/assets/{index-Df2pSXXR.js → index-DD-656p6.js} +1 -1
  77. package/dist/assets/{index-CgNRJie5.js → index-DFZSZ5Jd.js} +1 -1
  78. package/dist/assets/{index-ZddejrLr.js → index-DKaM5HrD.js} +1 -1
  79. package/dist/assets/{index-CkE6QgrS.js → index-DL522gV-.js} +1 -1
  80. package/dist/assets/{index-BbMfrFOc.js → index-DQR-4jyw.js} +3 -3
  81. package/dist/assets/{index-BRP1KIY3.js → index-DRivg_5Z.js} +1 -1
  82. package/dist/assets/{index-C0n8v4Cp.js → index-D__4XYf7.js} +1 -1
  83. package/dist/assets/index-Dabem7F5.js +1 -0
  84. package/dist/assets/index-Dlxm5Tj2.js +55 -0
  85. package/dist/assets/{index-z-8ML1C9.js → index-DqJ-UXK3.js} +1 -1
  86. package/dist/assets/{index-D9CRulWG.js → index-DqPaEZqs.js} +1 -1
  87. package/dist/assets/{index-Dg-fihjm.js → index-DvIq19MO.js} +84 -84
  88. package/dist/assets/{index-7ARWVbTs.js → index-HZilmujw.js} +1 -1
  89. package/dist/assets/{index-CPzKPZVk.js → index-Mn5Bo2vG.js} +4 -4
  90. package/dist/assets/{index-CpZPMhFT.js → index-QxHfLMG_.js} +1 -1
  91. package/dist/assets/{index-B4oI4SXk.js → index-vEtoWtal.js} +1 -1
  92. package/dist/assets/{invitation-2TIhgFxI.js → invitation-DC1BX88k.js} +1 -1
  93. package/dist/assets/{invite-BpVhovN4.js → invite-DimTGuup.js} +1 -1
  94. package/dist/assets/{isURL-JpmdK601.js → isURL--iUcbnxL.js} +1 -1
  95. package/dist/assets/{issue-passport-Db3IyDmL.js → issue-passport-CbUnHQn5.js} +1 -1
  96. package/dist/assets/{item-DT6l0SVr.js → item-DAEbqEP0.js} +1 -1
  97. package/dist/assets/{ja-B5zPuvbe.js → ja-DEmGhfzG.js} +1 -1
  98. package/dist/assets/{ja-BgI9SuxS.js → ja-DuWRl1OM.js} +1 -1
  99. package/dist/assets/{ko-D1mgIh26.js → ko-CfYoSPs0.js} +1 -1
  100. package/dist/assets/{ko-DxWYUlEG.js → ko-YalU3HfD.js} +1 -1
  101. package/dist/assets/{landing-page-D7Nuam-y.js → landing-page-CGhoTPZA.js} +1 -1
  102. package/dist/assets/{layout-CkPC48Ju.js → layout-BJym8Vpj.js} +1 -1
  103. package/dist/assets/{list-Bv_zhprU.js → list-BIhcTPQv.js} +1 -1
  104. package/dist/assets/{list-dUYG3Ahk.js → list-BzwIj8-k.js} +3 -3
  105. package/dist/assets/localization-B2mzZfSM.js +1 -0
  106. package/dist/assets/log-r6X6nQtq.js +110 -0
  107. package/dist/assets/logger-fD-zoY7i.js +1 -0
  108. package/dist/assets/{login-BQTVr2Ix.js → login-dsQvG2gb.js} +1 -1
  109. package/dist/assets/{login-oauth-callback-YrBLYGL2.js → login-oauth-callback-D4bBf050.js} +1 -1
  110. package/dist/assets/{logo-uploader-hp3SBdhZ.js → logo-uploader-BUpUJeF0.js} +2 -2
  111. package/dist/assets/{lost-passport-4zNJXOm_.js → lost-passport-D8dFQVnf.js} +1 -1
  112. package/dist/assets/{open-window-Zhqej7Dc.js → open-window-Cv1GfxOS.js} +1 -1
  113. package/dist/assets/{over-due-invoice-payment-CDRcX7in.js → over-due-invoice-payment-B3xyNDNg.js} +1 -1
  114. package/dist/assets/{overview-ChSvzQtv.js → overview-DiI6CIz_.js} +1 -1
  115. package/dist/assets/{passport-item-BX4n24TJ.js → passport-item-CHk2f4Pu.js} +1 -1
  116. package/dist/assets/{permission-CcwCK5jk.js → permission-AjZwJFGT.js} +1 -1
  117. package/dist/assets/{preferences-DKHf6oxx.js → preferences-DoYoB7PA.js} +1 -1
  118. package/dist/assets/profile-embed-CgODiJDf.js +1 -0
  119. package/dist/assets/{pt-DeehC2Gk.js → pt-B3IRBzK6.js} +1 -1
  120. package/dist/assets/{pt-vo8CUdkQ.js → pt-DTd68aWZ.js} +1 -1
  121. package/dist/assets/{publish-resource-DRhFWF1H.js → publish-resource-D6W8pLDw.js} +1 -1
  122. package/dist/assets/{react-beautiful-dnd.esm-CN6lay1O.js → react-beautiful-dnd.esm-D4Hmrl1P.js} +1 -1
  123. package/dist/assets/{ru-DGlqMwrt.js → ru-BEEcST35.js} +1 -1
  124. package/dist/assets/{ru-DPcmVq5_.js → ru-BHPYrefb.js} +1 -1
  125. package/dist/assets/{runtime-DsOc3CI-.js → runtime-baG3v64u.js} +1 -1
  126. package/dist/assets/sdk-dE5DJvbC.js +1 -0
  127. package/dist/assets/{security-PrkTELzO.js → security-BSgaaEY0.js} +1 -1
  128. package/dist/assets/{session-CccpevO4.js → session-DWeKTd8B.js} +1 -1
  129. package/dist/assets/{setup-mioXTSNX.js → setup-DYaTnYGr.js} +1 -1
  130. package/dist/assets/{spaces-ccyzWtGO.js → spaces-DZ_73neu.js} +1 -1
  131. package/dist/assets/{start-CyX7g3Wc.js → start-WZ2i359x.js} +1 -1
  132. package/dist/assets/{starting-progress-Dv-PMSrV.js → starting-progress-Dt2mxWxv.js} +1 -1
  133. package/dist/assets/{status-C2dqS1Qp.js → status-B4lgq3AG.js} +1 -1
  134. package/dist/assets/{step-actions-CRPdOrrx.js → step-actions-CtR84Gv1.js} +1 -1
  135. package/dist/assets/{studio-8pwFbDz_.js → studio-nh5KrdHJ.js} +1 -1
  136. package/dist/assets/{switch-control-TkSdNEjL.js → switch-control-DxmUKBCX.js} +1 -1
  137. package/dist/assets/{table-tips-Cw939Sls.js → table-tips-DNfCLdtd.js} +1 -1
  138. package/dist/assets/{team-B6ADMIin.js → team-B7tkpjgk.js} +1 -1
  139. package/dist/assets/{th-D51PYJxx.js → th-Bk3GO_e5.js} +1 -1
  140. package/dist/assets/{th-DH3YSYWo.js → th-DYSyn_pj.js} +1 -1
  141. package/dist/assets/{traffic-B3OSPNpZ.js → traffic-Dbe5o1ZT.js} +1 -1
  142. package/dist/assets/{transfer-DovcOgtx.js → transfer-B7_-PWxX.js} +1 -1
  143. package/dist/assets/unsubscribe-LEzgAA2Z.js +1 -0
  144. package/dist/assets/{use-app-logo-oV4_Gpbf.js → use-app-logo-CAskkBvX.js} +1 -1
  145. package/dist/assets/{use-window-close-DnNlurow.js → use-window-close-B9_5KVZh.js} +1 -1
  146. package/dist/assets/{useLocalStorage-c2PGUYSe.js → useLocalStorage-Cw-tIN0T.js} +1 -1
  147. package/dist/assets/{user-center-BVU6gSvw.js → user-center-2W4tsw00.js} +4 -4
  148. package/dist/assets/{user-sessions-BMBqVzE9.js → user-sessions-CPWMtmsD.js} +1 -1
  149. package/dist/assets/{util-xGYUIoLs.js → util-Bb1ORHN3.js} +1 -1
  150. package/dist/assets/{util-P7tJ3St_.js → util-DiuDMXGx.js} +1 -1
  151. package/dist/assets/{vendor-arcblock-B6isO619.js → vendor-arcblock-BOtVH-Qa.js} +1 -1
  152. package/dist/assets/{vendor-ux-Br1Zu4eg.js → vendor-ux-CwCI0CzW.js} +17 -17
  153. package/dist/assets/{vi-B-WRpo9V.js → vi-BvKqvojn.js} +1 -1
  154. package/dist/assets/{vi-Baf2ShPI.js → vi-xPRidQ_j.js} +1 -1
  155. package/dist/assets/wait-connect-dMemTZwb.js +1 -0
  156. package/dist/assets/wizard-DkiFdKWc.js +8 -0
  157. package/dist/assets/wizard-components-DE3e05mi.js +52 -0
  158. package/dist/assets/wrap-locale-1WyGs8Eh.js +1 -0
  159. package/dist/assets/{zh-tMEgrdGe.js → zh-B7NO6y1P.js} +1 -1
  160. package/dist/assets/{zh-jdBEl5u8.js → zh-BaEjqGHy.js} +1 -1
  161. package/dist/assets/{zh-CCW_9vRO.js → zh-CmNgzDEv.js} +1 -1
  162. package/dist/assets/{zh-tw-oY6_dodA.js → zh-tw-DeWXdL1Q.js} +1 -1
  163. package/dist/assets/{zh-tw-2esms75_.js → zh-tw-xcyHbP3V.js} +1 -1
  164. package/dist/index.html +146 -4
  165. package/dist/service-worker.js +1 -1
  166. package/package.json +33 -33
  167. package/dist/assets/branding-Bu9K-aCC.js +0 -1
  168. package/dist/assets/config-CZieYCwq.js +0 -53
  169. package/dist/assets/dashboard-CvtXVg-Y.js +0 -106
  170. package/dist/assets/domain-Bv6VPlTz.js +0 -9
  171. package/dist/assets/engine-Bd6Eh0_C.js +0 -1
  172. package/dist/assets/gen-simple-access-key-DJblT-SX.js +0 -1
  173. package/dist/assets/get-safe-url-Cg-U52oI.js +0 -1
  174. package/dist/assets/index-B4vHuy5A.js +0 -55
  175. package/dist/assets/index-DiAhuObw.js +0 -4
  176. package/dist/assets/index-O8QTFET3.js +0 -1
  177. package/dist/assets/localization-DTxP-FFX.js +0 -1
  178. package/dist/assets/log-1sZ_L4eJ.css +0 -32
  179. package/dist/assets/log-BZZMcnOo.js +0 -108
  180. package/dist/assets/logger-CFfnQaY0.js +0 -1
  181. package/dist/assets/profile-embed-BTTCP7jk.js +0 -1
  182. package/dist/assets/sdk-Bskg7NCT.js +0 -1
  183. package/dist/assets/unsubscribe-OBA6L-An.js +0 -1
  184. package/dist/assets/wait-connect-B1IAhfbk.js +0 -1
  185. package/dist/assets/wizard-B9NUY_Os.js +0 -8
  186. package/dist/assets/wizard-components-DoPyyExg.js +0 -52
  187. package/dist/assets/wrap-locale-Bb9x1dCk.js +0 -1
@@ -1,53 +0,0 @@
1
- import{e as yt,r as K,f as we,p as J}from"./vendor-react-Dvs43sk9.js";import{D as _t,j as o,bb as wt,ak as V,z as bt,M as Ct,U as pr,I as ze,a6 as fe,bE as jt,aj as Et,F as St,bF as Gr,W as H,at as sr,n as Pt,Q as ir,ar as ne,T as se,am as pe,dK as kt,c1 as xe,bZ as Yr,dL as Zr,ct as Bt,A as hr,dM as At,a3 as It,dN as Ot,dO as Dt,cs as Rt,a$ as Tt}from"./vendor-mui-core-B7zoO8f5.js";import{k as zt,g as vr,b as ae,a as ye}from"./vendor-hooks-BRXKH6Nb.js";import{i as Lt}from"./isURL-JpmdK601.js";import{b4 as Ft,aG as Jr,o as Nt,b5 as qt,G as he,aa as Le,H as te}from"./vendor-ux-Br1Zu4eg.js";import{c9 as Qr,bW as Ht,ce as Mt,br as Ut,cf as Kt,c as or,Z as $t,a8 as Wt,aU as Vt,f as Gt}from"./index-Dg-fihjm.js";import{S as ge}from"./section-Dq8SB7lh.js";import{R as Yt}from"./required-CobBjKC9.js";import{F as Zt}from"./form-wrapper-CHYdE4By.js";import{I as Jt,F as _e}from"./form-text-input-y9UkSEXJ.js";import{u as Qt,d as Xt}from"./wait-connect-B1IAhfbk.js";import{B as gr,b as Xr,C as ie,D as et,J as en,n as ar}from"./vendor-utils-DtY42AM-.js";import{r as Ne}from"./index-BPy8_fa2.js";import{f as ue}from"./index-DBs9Ljax.js";import{B as rn,a as mr}from"./index-Df2pSXXR.js";var tn=null;const nn=Object.freeze(Object.defineProperty({__proto__:null,default:tn},Symbol.toStringTag,{value:"Module"})),cr=yt(nn),sn=Gr`
2
- 0%, 100% {
3
- transform: scale(1) translateX(0);
4
- }
5
- 50% {
6
- transform: scale(1.05) translateX(-3px);
7
- }
8
- 25%, 75% {
9
- transform: scale(1.1) translateX(3px);
10
- }
11
- `;function be({src:n,alt:v,size:h=20}){return o.jsx("img",{src:n,alt:v,style:{width:h,height:h,display:"block",objectFit:"contain",borderRadius:"2px",flexShrink:0},onError:c=>{c.target.style.display="none"}})}be.propTypes={src:H.string.isRequired,alt:H.string.isRequired,size:H.number};const on=48,an=8,xr={PaperProps:{style:{maxHeight:on*4.5+an,width:250}}},cn=(n,v,h)=>({fontWeight:v.indexOf(n)===-1?h.typography.fontWeightRegular:h.typography.fontWeightMedium});function rt({label:n="",disabled:v=!1,required:h=!1,initialValue:c="",onChange:S=()=>{},sx:g={},onSubmit:m=()=>{},triggers:f=[],options:a=[],formatterBeforeSubmit:r=j=>j.join(","),helperText:x="",config:b={},directEditing:y=!1,searchable:s=!0,...B}){const j=_t(),[E,O]=K.useState(y),[t,e]=K.useState(!1),[p,_]=K.useState(""),{multiple:I=!1,labelField:R="name",valueField:L="code"}=b,[F,l]=K.useState(c),[w,A]=K.useState(F),[k,z]=K.useState(!1),[N,U]=K.useState(!1),Y=K.useCallback(()=>{U(!0),setTimeout(()=>{U(!1)},500)},[]),C=async()=>{e(!0);try{await m(typeof r=="function"&&I?r(w):w)===!1?A(F):(A(w),l(w),z(!1))}catch{A(F)}finally{e(!1),O(!1)}},q=K.useCallback(()=>{y&&!v&&!t&&C(),k&&Y(),!k&&!v&&!t&&(O(!1),z(!1))},[y,v,t,k,Y]);K.useEffect(()=>{const i=c;i!==F&&(l(i),A(i),z(!1))},[c,F]);const T=a.filter(i=>{if(!p)return!0;const d=p.toLowerCase();return i[R]?.toLowerCase().includes(d)||i[L]?.toLowerCase().includes(d)}),u=i=>{let{value:d}=i.target;I&&(d=typeof d=="string"?d.split(","):d),z(d!==w),A(d),S(d)},P=E||y?o.jsxs(wt,{value:w,onChange:u,fullWidth:!0,multiple:I,variant:"outlined",margin:"dense",onBlur:q,disabled:v,renderValue:i=>{if(I)return o.jsx(V,{sx:{display:"flex",flexWrap:"wrap"},children:i.filter(M=>a.some(Q=>Q[L]===M)).map(M=>o.jsx(pr,{label:a.find(Q=>Q[L]===M)[R],style:{marginRight:8},size:"small"},M))});if(!i)return null;const d=a.find(M=>M[L]===i);return o.jsxs(V,{sx:{display:"flex",alignItems:"center",gap:1},children:[d?.logo&&o.jsx(be,{src:d.logo,alt:d[R],size:20}),o.jsx("span",{children:d?d[R]:""})]})},MenuProps:{...xr,PaperProps:{...xr.PaperProps}},error:!!x,...B,children:[s?o.jsx(V,{sx:{p:1,borderBottom:1,borderColor:"divider"},children:o.jsx(bt,{size:"small",placeholder:"Search...",value:p,onChange:i=>_(i.target.value),onClick:i=>i.stopPropagation(),onKeyDown:i=>i.stopPropagation(),fullWidth:!0,variant:"outlined"})}):null,T.map(i=>o.jsx(Ct,{value:i[L],style:cn(i[L],w,j),children:o.jsxs(V,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.logo&&o.jsx(be,{src:i.logo,alt:i[R],size:20}),o.jsx("span",{children:i[R]})]})},i[L]))]}):o.jsx(V,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},sx:{px:1},onClick:()=>{v||O(!0)},children:I?w.filter(i=>a.some(d=>d[L]===i)).map(i=>o.jsx(pr,{label:a.find(d=>d[L]===i)[R],style:{marginRight:8},size:"small"},i)):w&&a.some(i=>i[L]===w)&&o.jsxs(V,{sx:{display:"flex",alignItems:"center",gap:1},children:[(()=>{const i=a.find(d=>d[L]===w);return i?.logo?o.jsx(be,{src:i.logo,alt:i[R],size:20}):null})(),o.jsx("span",{children:a.find(i=>i[L]===w)[R]})]})});return o.jsx(Zt,{className:"form",sx:g,children:o.jsxs(V,{className:"form-item",children:[o.jsxs(V,{className:"form-item-label",children:[n,h&&o.jsx(Yt,{})]}),o.jsxs(V,{className:"form-item-body",children:[o.jsx(V,{className:"form-item-input",children:P}),o.jsx(V,{className:"form-item-action",style:!E||y?{marginLeft:0}:{},children:E&&!y?o.jsxs(o.Fragment,{children:[k?o.jsx(ze,{"data-cy":"schema-form-item-confirm",onClick:C,disabled:v||t,sx:{animation:N?`${sn} 0.5s linear`:"none"},size:"large",children:t?o.jsx(fe,{size:24}):o.jsx(jt,{})}):null,o.jsx(ze,{"data-cy":"schema-form-item-cancel",onClick:()=>{A(F),O(!1)},disabled:v||t,size:"large",children:o.jsx(Et,{})})]}):o.jsx(V,{children:f.length?o.jsx(Jt,{triggers:f,disabled:v}):null})})]}),E&&x&&o.jsx(St,{error:!0,children:x})]})})}rt.propTypes={sx:H.object,onSubmit:H.func,onChange:H.func,label:H.string,initialValue:H.string,required:H.bool,disabled:H.bool,triggers:H.array,options:H.array,helperText:H.string,formatterBeforeSubmit:H.func,config:H.object,directEditing:H.bool,searchable:H.bool};var X={},Ce={exports:{}},je={exports:{}},ln=je.exports,yr;function re(){return yr||(yr=1,function(n,v){(function(h,c){n.exports=c()})(ln,function(){var h=h||function(c,S){var g;if(typeof window<"u"&&window.crypto&&(g=window.crypto),typeof self<"u"&&self.crypto&&(g=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(g=globalThis.crypto),!g&&typeof window<"u"&&window.msCrypto&&(g=window.msCrypto),!g&&typeof we<"u"&&we.crypto&&(g=we.crypto),!g&&typeof Ft=="function")try{g=Jr()}catch{}var m=function(){if(g){if(typeof g.getRandomValues=="function")try{return g.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof g.randomBytes=="function")try{return g.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},f=Object.create||function(){function t(){}return function(e){var p;return t.prototype=e,p=new t,t.prototype=null,p}}(),a={},r=a.lib={},x=r.Base=function(){return{extend:function(t){var e=f(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),b=r.WordArray=x.extend({init:function(t,e){t=this.words=t||[],e!=S?this.sigBytes=e:this.sigBytes=t.length*4},toString:function(t){return(t||s).stringify(this)},concat:function(t){var e=this.words,p=t.words,_=this.sigBytes,I=t.sigBytes;if(this.clamp(),_%4)for(var R=0;R<I;R++){var L=p[R>>>2]>>>24-R%4*8&255;e[_+R>>>2]|=L<<24-(_+R)%4*8}else for(var F=0;F<I;F+=4)e[_+F>>>2]=p[F>>>2];return this.sigBytes+=I,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=c.ceil(e/4)},clone:function(){var t=x.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],p=0;p<t;p+=4)e.push(m());return new b.init(e,t)}}),y=a.enc={},s=y.Hex={stringify:function(t){for(var e=t.words,p=t.sigBytes,_=[],I=0;I<p;I++){var R=e[I>>>2]>>>24-I%4*8&255;_.push((R>>>4).toString(16)),_.push((R&15).toString(16))}return _.join("")},parse:function(t){for(var e=t.length,p=[],_=0;_<e;_+=2)p[_>>>3]|=parseInt(t.substr(_,2),16)<<24-_%8*4;return new b.init(p,e/2)}},B=y.Latin1={stringify:function(t){for(var e=t.words,p=t.sigBytes,_=[],I=0;I<p;I++){var R=e[I>>>2]>>>24-I%4*8&255;_.push(String.fromCharCode(R))}return _.join("")},parse:function(t){for(var e=t.length,p=[],_=0;_<e;_++)p[_>>>2]|=(t.charCodeAt(_)&255)<<24-_%4*8;return new b.init(p,e)}},j=y.Utf8={stringify:function(t){try{return decodeURIComponent(escape(B.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return B.parse(unescape(encodeURIComponent(t)))}},E=r.BufferedBlockAlgorithm=x.extend({reset:function(){this._data=new b.init,this._nDataBytes=0},_append:function(t){typeof t=="string"&&(t=j.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e,p=this._data,_=p.words,I=p.sigBytes,R=this.blockSize,L=R*4,F=I/L;t?F=c.ceil(F):F=c.max((F|0)-this._minBufferSize,0);var l=F*R,w=c.min(l*4,I);if(l){for(var A=0;A<l;A+=R)this._doProcessBlock(_,A);e=_.splice(0,l),p.sigBytes-=w}return new b.init(e,w)},clone:function(){var t=x.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});r.Hasher=E.extend({cfg:x.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){E.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,p){return new t.init(p).finalize(e)}},_createHmacHelper:function(t){return function(e,p){return new O.HMAC.init(t,p).finalize(e)}}});var O=a.algo={};return a}(Math);return h})}(je)),je.exports}var Ee={exports:{}},un=Ee.exports,_r;function tt(){return _r||(_r=1,function(n,v){(function(h,c){n.exports=c(re())})(un,function(h){return function(){var c=h,S=c.lib,g=S.WordArray,m=c.enc;m.Base64={stringify:function(a){var r=a.words,x=a.sigBytes,b=this._map;a.clamp();for(var y=[],s=0;s<x;s+=3)for(var B=r[s>>>2]>>>24-s%4*8&255,j=r[s+1>>>2]>>>24-(s+1)%4*8&255,E=r[s+2>>>2]>>>24-(s+2)%4*8&255,O=B<<16|j<<8|E,t=0;t<4&&s+t*.75<x;t++)y.push(b.charAt(O>>>6*(3-t)&63));var e=b.charAt(64);if(e)for(;y.length%4;)y.push(e);return y.join("")},parse:function(a){var r=a.length,x=this._map,b=this._reverseMap;if(!b){b=this._reverseMap=[];for(var y=0;y<x.length;y++)b[x.charCodeAt(y)]=y}var s=x.charAt(64);if(s){var B=a.indexOf(s);B!==-1&&(r=B)}return f(a,r,b)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function f(a,r,x){for(var b=[],y=0,s=0;s<r;s++)if(s%4){var B=x[a.charCodeAt(s-1)]<<s%4*2,j=x[a.charCodeAt(s)]>>>6-s%4*2,E=B|j;b[y>>>2]|=E<<24-y%4*8,y++}return g.create(b,y)}}(),h.enc.Base64})}(Ee)),Ee.exports}var Se={exports:{}},dn=Se.exports,wr;function fn(){return wr||(wr=1,function(n,v){(function(h,c){n.exports=c(re())})(dn,function(h){return function(c){var S=h,g=S.lib,m=g.WordArray,f=g.Hasher,a=S.algo,r=[];(function(){for(var j=0;j<64;j++)r[j]=c.abs(c.sin(j+1))*4294967296|0})();var x=a.MD5=f.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(j,E){for(var O=0;O<16;O++){var t=E+O,e=j[t];j[t]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}var p=this._hash.words,_=j[E+0],I=j[E+1],R=j[E+2],L=j[E+3],F=j[E+4],l=j[E+5],w=j[E+6],A=j[E+7],k=j[E+8],z=j[E+9],N=j[E+10],U=j[E+11],Y=j[E+12],C=j[E+13],q=j[E+14],T=j[E+15],u=p[0],P=p[1],i=p[2],d=p[3];u=b(u,P,i,d,_,7,r[0]),d=b(d,u,P,i,I,12,r[1]),i=b(i,d,u,P,R,17,r[2]),P=b(P,i,d,u,L,22,r[3]),u=b(u,P,i,d,F,7,r[4]),d=b(d,u,P,i,l,12,r[5]),i=b(i,d,u,P,w,17,r[6]),P=b(P,i,d,u,A,22,r[7]),u=b(u,P,i,d,k,7,r[8]),d=b(d,u,P,i,z,12,r[9]),i=b(i,d,u,P,N,17,r[10]),P=b(P,i,d,u,U,22,r[11]),u=b(u,P,i,d,Y,7,r[12]),d=b(d,u,P,i,C,12,r[13]),i=b(i,d,u,P,q,17,r[14]),P=b(P,i,d,u,T,22,r[15]),u=y(u,P,i,d,I,5,r[16]),d=y(d,u,P,i,w,9,r[17]),i=y(i,d,u,P,U,14,r[18]),P=y(P,i,d,u,_,20,r[19]),u=y(u,P,i,d,l,5,r[20]),d=y(d,u,P,i,N,9,r[21]),i=y(i,d,u,P,T,14,r[22]),P=y(P,i,d,u,F,20,r[23]),u=y(u,P,i,d,z,5,r[24]),d=y(d,u,P,i,q,9,r[25]),i=y(i,d,u,P,L,14,r[26]),P=y(P,i,d,u,k,20,r[27]),u=y(u,P,i,d,C,5,r[28]),d=y(d,u,P,i,R,9,r[29]),i=y(i,d,u,P,A,14,r[30]),P=y(P,i,d,u,Y,20,r[31]),u=s(u,P,i,d,l,4,r[32]),d=s(d,u,P,i,k,11,r[33]),i=s(i,d,u,P,U,16,r[34]),P=s(P,i,d,u,q,23,r[35]),u=s(u,P,i,d,I,4,r[36]),d=s(d,u,P,i,F,11,r[37]),i=s(i,d,u,P,A,16,r[38]),P=s(P,i,d,u,N,23,r[39]),u=s(u,P,i,d,C,4,r[40]),d=s(d,u,P,i,_,11,r[41]),i=s(i,d,u,P,L,16,r[42]),P=s(P,i,d,u,w,23,r[43]),u=s(u,P,i,d,z,4,r[44]),d=s(d,u,P,i,Y,11,r[45]),i=s(i,d,u,P,T,16,r[46]),P=s(P,i,d,u,R,23,r[47]),u=B(u,P,i,d,_,6,r[48]),d=B(d,u,P,i,A,10,r[49]),i=B(i,d,u,P,q,15,r[50]),P=B(P,i,d,u,l,21,r[51]),u=B(u,P,i,d,Y,6,r[52]),d=B(d,u,P,i,L,10,r[53]),i=B(i,d,u,P,N,15,r[54]),P=B(P,i,d,u,I,21,r[55]),u=B(u,P,i,d,k,6,r[56]),d=B(d,u,P,i,T,10,r[57]),i=B(i,d,u,P,w,15,r[58]),P=B(P,i,d,u,C,21,r[59]),u=B(u,P,i,d,F,6,r[60]),d=B(d,u,P,i,U,10,r[61]),i=B(i,d,u,P,R,15,r[62]),P=B(P,i,d,u,z,21,r[63]),p[0]=p[0]+u|0,p[1]=p[1]+P|0,p[2]=p[2]+i|0,p[3]=p[3]+d|0},_doFinalize:function(){var j=this._data,E=j.words,O=this._nDataBytes*8,t=j.sigBytes*8;E[t>>>5]|=128<<24-t%32;var e=c.floor(O/4294967296),p=O;E[(t+64>>>9<<4)+15]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360,E[(t+64>>>9<<4)+14]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,j.sigBytes=(E.length+1)*4,this._process();for(var _=this._hash,I=_.words,R=0;R<4;R++){var L=I[R];I[R]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return _},clone:function(){var j=f.clone.call(this);return j._hash=this._hash.clone(),j}});function b(j,E,O,t,e,p,_){var I=j+(E&O|~E&t)+e+_;return(I<<p|I>>>32-p)+E}function y(j,E,O,t,e,p,_){var I=j+(E&t|O&~t)+e+_;return(I<<p|I>>>32-p)+E}function s(j,E,O,t,e,p,_){var I=j+(E^O^t)+e+_;return(I<<p|I>>>32-p)+E}function B(j,E,O,t,e,p,_){var I=j+(O^(E|~t))+e+_;return(I<<p|I>>>32-p)+E}S.MD5=f._createHelper(x),S.HmacMD5=f._createHmacHelper(x)}(Math),h.MD5})}(Se)),Se.exports}var Pe={exports:{}},ke={exports:{}},pn=ke.exports,br;function hn(){return br||(br=1,function(n,v){(function(h,c){n.exports=c(re())})(pn,function(h){return function(){var c=h,S=c.lib,g=S.WordArray,m=S.Hasher,f=c.algo,a=[],r=f.SHA1=m.extend({_doReset:function(){this._hash=new g.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(x,b){for(var y=this._hash.words,s=y[0],B=y[1],j=y[2],E=y[3],O=y[4],t=0;t<80;t++){if(t<16)a[t]=x[b+t]|0;else{var e=a[t-3]^a[t-8]^a[t-14]^a[t-16];a[t]=e<<1|e>>>31}var p=(s<<5|s>>>27)+O+a[t];t<20?p+=(B&j|~B&E)+1518500249:t<40?p+=(B^j^E)+1859775393:t<60?p+=(B&j|B&E|j&E)-1894007588:p+=(B^j^E)-899497514,O=E,E=j,j=B<<30|B>>>2,B=s,s=p}y[0]=y[0]+s|0,y[1]=y[1]+B|0,y[2]=y[2]+j|0,y[3]=y[3]+E|0,y[4]=y[4]+O|0},_doFinalize:function(){var x=this._data,b=x.words,y=this._nDataBytes*8,s=x.sigBytes*8;return b[s>>>5]|=128<<24-s%32,b[(s+64>>>9<<4)+14]=Math.floor(y/4294967296),b[(s+64>>>9<<4)+15]=y,x.sigBytes=b.length*4,this._process(),this._hash},clone:function(){var x=m.clone.call(this);return x._hash=this._hash.clone(),x}});c.SHA1=m._createHelper(r),c.HmacSHA1=m._createHmacHelper(r)}(),h.SHA1})}(ke)),ke.exports}var Be={exports:{}},vn=Be.exports,Cr;function gn(){return Cr||(Cr=1,function(n,v){(function(h,c){n.exports=c(re())})(vn,function(h){(function(){var c=h,S=c.lib,g=S.Base,m=c.enc,f=m.Utf8,a=c.algo;a.HMAC=g.extend({init:function(r,x){r=this._hasher=new r.init,typeof x=="string"&&(x=f.parse(x));var b=r.blockSize,y=b*4;x.sigBytes>y&&(x=r.finalize(x)),x.clamp();for(var s=this._oKey=x.clone(),B=this._iKey=x.clone(),j=s.words,E=B.words,O=0;O<b;O++)j[O]^=1549556828,E[O]^=909522486;s.sigBytes=B.sigBytes=y,this.reset()},reset:function(){var r=this._hasher;r.reset(),r.update(this._iKey)},update:function(r){return this._hasher.update(r),this},finalize:function(r){var x=this._hasher,b=x.finalize(r);x.reset();var y=x.finalize(this._oKey.clone().concat(b));return y}})})()})}(Be)),Be.exports}var mn=Pe.exports,jr;function nt(){return jr||(jr=1,function(n,v){(function(h,c,S){n.exports=c(re(),hn(),gn())})(mn,function(h){return function(){var c=h,S=c.lib,g=S.Base,m=S.WordArray,f=c.algo,a=f.MD5,r=f.EvpKDF=g.extend({cfg:g.extend({keySize:128/32,hasher:a,iterations:1}),init:function(x){this.cfg=this.cfg.extend(x)},compute:function(x,b){for(var y,s=this.cfg,B=s.hasher.create(),j=m.create(),E=j.words,O=s.keySize,t=s.iterations;E.length<O;){y&&B.update(y),y=B.update(x).finalize(b),B.reset();for(var e=1;e<t;e++)y=B.finalize(y),B.reset();j.concat(y)}return j.sigBytes=O*4,j}});c.EvpKDF=function(x,b,y){return r.create(y).compute(x,b)}}(),h.EvpKDF})}(Pe)),Pe.exports}var Ae={exports:{}},xn=Ae.exports,Er;function yn(){return Er||(Er=1,function(n,v){(function(h,c,S){n.exports=c(re(),nt())})(xn,function(h){h.lib.Cipher||function(c){var S=h,g=S.lib,m=g.Base,f=g.WordArray,a=g.BufferedBlockAlgorithm,r=S.enc;r.Utf8;var x=r.Base64,b=S.algo,y=b.EvpKDF,s=g.Cipher=a.extend({cfg:m.extend(),createEncryptor:function(l,w){return this.create(this._ENC_XFORM_MODE,l,w)},createDecryptor:function(l,w){return this.create(this._DEC_XFORM_MODE,l,w)},init:function(l,w,A){this.cfg=this.cfg.extend(A),this._xformMode=l,this._key=w,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(l){return this._append(l),this._process()},finalize:function(l){l&&this._append(l);var w=this._doFinalize();return w},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function l(w){return typeof w=="string"?F:I}return function(w){return{encrypt:function(A,k,z){return l(k).encrypt(w,A,k,z)},decrypt:function(A,k,z){return l(k).decrypt(w,A,k,z)}}}}()});g.StreamCipher=s.extend({_doFinalize:function(){var l=this._process(!0);return l},blockSize:1});var B=S.mode={},j=g.BlockCipherMode=m.extend({createEncryptor:function(l,w){return this.Encryptor.create(l,w)},createDecryptor:function(l,w){return this.Decryptor.create(l,w)},init:function(l,w){this._cipher=l,this._iv=w}}),E=B.CBC=function(){var l=j.extend();l.Encryptor=l.extend({processBlock:function(A,k){var z=this._cipher,N=z.blockSize;w.call(this,A,k,N),z.encryptBlock(A,k),this._prevBlock=A.slice(k,k+N)}}),l.Decryptor=l.extend({processBlock:function(A,k){var z=this._cipher,N=z.blockSize,U=A.slice(k,k+N);z.decryptBlock(A,k),w.call(this,A,k,N),this._prevBlock=U}});function w(A,k,z){var N,U=this._iv;U?(N=U,this._iv=c):N=this._prevBlock;for(var Y=0;Y<z;Y++)A[k+Y]^=N[Y]}return l}(),O=S.pad={},t=O.Pkcs7={pad:function(l,w){for(var A=w*4,k=A-l.sigBytes%A,z=k<<24|k<<16|k<<8|k,N=[],U=0;U<k;U+=4)N.push(z);var Y=f.create(N,k);l.concat(Y)},unpad:function(l){var w=l.words[l.sigBytes-1>>>2]&255;l.sigBytes-=w}};g.BlockCipher=s.extend({cfg:s.cfg.extend({mode:E,padding:t}),reset:function(){var l;s.reset.call(this);var w=this.cfg,A=w.iv,k=w.mode;this._xformMode==this._ENC_XFORM_MODE?l=k.createEncryptor:(l=k.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==l?this._mode.init(this,A&&A.words):(this._mode=l.call(k,this,A&&A.words),this._mode.__creator=l)},_doProcessBlock:function(l,w){this._mode.processBlock(l,w)},_doFinalize:function(){var l,w=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(w.pad(this._data,this.blockSize),l=this._process(!0)):(l=this._process(!0),w.unpad(l)),l},blockSize:128/32});var e=g.CipherParams=m.extend({init:function(l){this.mixIn(l)},toString:function(l){return(l||this.formatter).stringify(this)}}),p=S.format={},_=p.OpenSSL={stringify:function(l){var w,A=l.ciphertext,k=l.salt;return k?w=f.create([1398893684,1701076831]).concat(k).concat(A):w=A,w.toString(x)},parse:function(l){var w,A=x.parse(l),k=A.words;return k[0]==1398893684&&k[1]==1701076831&&(w=f.create(k.slice(2,4)),k.splice(0,4),A.sigBytes-=16),e.create({ciphertext:A,salt:w})}},I=g.SerializableCipher=m.extend({cfg:m.extend({format:_}),encrypt:function(l,w,A,k){k=this.cfg.extend(k);var z=l.createEncryptor(A,k),N=z.finalize(w),U=z.cfg;return e.create({ciphertext:N,key:A,iv:U.iv,algorithm:l,mode:U.mode,padding:U.padding,blockSize:l.blockSize,formatter:k.format})},decrypt:function(l,w,A,k){k=this.cfg.extend(k),w=this._parse(w,k.format);var z=l.createDecryptor(A,k).finalize(w.ciphertext);return z},_parse:function(l,w){return typeof l=="string"?w.parse(l,this):l}}),R=S.kdf={},L=R.OpenSSL={execute:function(l,w,A,k,z){if(k||(k=f.random(64/8)),z)var N=y.create({keySize:w+A,hasher:z}).compute(l,k);else var N=y.create({keySize:w+A}).compute(l,k);var U=f.create(N.words.slice(w),A*4);return N.sigBytes=w*4,e.create({key:N,iv:U,salt:k})}},F=g.PasswordBasedCipher=I.extend({cfg:I.cfg.extend({kdf:L}),encrypt:function(l,w,A,k){k=this.cfg.extend(k);var z=k.kdf.execute(A,l.keySize,l.ivSize,k.salt,k.hasher);k.iv=z.iv;var N=I.encrypt.call(this,l,w,z.key,k);return N.mixIn(z),N},decrypt:function(l,w,A,k){k=this.cfg.extend(k),w=this._parse(w,k.format);var z=k.kdf.execute(A,l.keySize,l.ivSize,w.salt,k.hasher);k.iv=z.iv;var N=I.decrypt.call(this,l,w,z.key,k);return N}})}()})}(Ae)),Ae.exports}var _n=Ce.exports,Sr;function wn(){return Sr||(Sr=1,function(n,v){(function(h,c,S){n.exports=c(re(),tt(),fn(),nt(),yn())})(_n,function(h){return function(){var c=h,S=c.lib,g=S.BlockCipher,m=c.algo,f=[],a=[],r=[],x=[],b=[],y=[],s=[],B=[],j=[],E=[];(function(){for(var e=[],p=0;p<256;p++)p<128?e[p]=p<<1:e[p]=p<<1^283;for(var _=0,I=0,p=0;p<256;p++){var R=I^I<<1^I<<2^I<<3^I<<4;R=R>>>8^R&255^99,f[_]=R,a[R]=_;var L=e[_],F=e[L],l=e[F],w=e[R]*257^R*16843008;r[_]=w<<24|w>>>8,x[_]=w<<16|w>>>16,b[_]=w<<8|w>>>24,y[_]=w;var w=l*16843009^F*65537^L*257^_*16843008;s[R]=w<<24|w>>>8,B[R]=w<<16|w>>>16,j[R]=w<<8|w>>>24,E[R]=w,_?(_=L^e[e[e[l^L]]],I^=e[e[I]]):_=I=1}})();var O=[0,1,2,4,8,16,32,64,128,27,54],t=m.AES=g.extend({_doReset:function(){var e;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var p=this._keyPriorReset=this._key,_=p.words,I=p.sigBytes/4,R=this._nRounds=I+6,L=(R+1)*4,F=this._keySchedule=[],l=0;l<L;l++)l<I?F[l]=_[l]:(e=F[l-1],l%I?I>6&&l%I==4&&(e=f[e>>>24]<<24|f[e>>>16&255]<<16|f[e>>>8&255]<<8|f[e&255]):(e=e<<8|e>>>24,e=f[e>>>24]<<24|f[e>>>16&255]<<16|f[e>>>8&255]<<8|f[e&255],e^=O[l/I|0]<<24),F[l]=F[l-I]^e);for(var w=this._invKeySchedule=[],A=0;A<L;A++){var l=L-A;if(A%4)var e=F[l];else var e=F[l-4];A<4||l<=4?w[A]=e:w[A]=s[f[e>>>24]]^B[f[e>>>16&255]]^j[f[e>>>8&255]]^E[f[e&255]]}}},encryptBlock:function(e,p){this._doCryptBlock(e,p,this._keySchedule,r,x,b,y,f)},decryptBlock:function(e,p){var _=e[p+1];e[p+1]=e[p+3],e[p+3]=_,this._doCryptBlock(e,p,this._invKeySchedule,s,B,j,E,a);var _=e[p+1];e[p+1]=e[p+3],e[p+3]=_},_doCryptBlock:function(e,p,_,I,R,L,F,l){for(var w=this._nRounds,A=e[p]^_[0],k=e[p+1]^_[1],z=e[p+2]^_[2],N=e[p+3]^_[3],U=4,Y=1;Y<w;Y++){var C=I[A>>>24]^R[k>>>16&255]^L[z>>>8&255]^F[N&255]^_[U++],q=I[k>>>24]^R[z>>>16&255]^L[N>>>8&255]^F[A&255]^_[U++],T=I[z>>>24]^R[N>>>16&255]^L[A>>>8&255]^F[k&255]^_[U++],u=I[N>>>24]^R[A>>>16&255]^L[k>>>8&255]^F[z&255]^_[U++];A=C,k=q,z=T,N=u}var C=(l[A>>>24]<<24|l[k>>>16&255]<<16|l[z>>>8&255]<<8|l[N&255])^_[U++],q=(l[k>>>24]<<24|l[z>>>16&255]<<16|l[N>>>8&255]<<8|l[A&255])^_[U++],T=(l[z>>>24]<<24|l[N>>>16&255]<<16|l[A>>>8&255]<<8|l[k&255])^_[U++],u=(l[N>>>24]<<24|l[A>>>16&255]<<16|l[k>>>8&255]<<8|l[z&255])^_[U++];e[p]=C,e[p+1]=q,e[p+2]=T,e[p+3]=u},keySize:256/32});c.AES=g._createHelper(t)}(),h.AES})}(Ce)),Ce.exports}var Ie={exports:{}},bn=Ie.exports,Pr;function Cn(){return Pr||(Pr=1,function(n,v){(function(h,c){n.exports=c(re())})(bn,function(h){return h.enc.Latin1})}(Ie)),Ie.exports}var Oe={exports:{}},jn=Oe.exports,kr;function En(){return kr||(kr=1,function(n,v){(function(h,c){n.exports=c(re())})(jn,function(h){return h.enc.Utf8})}(Oe)),Oe.exports}var De={exports:{}},Sn=De.exports,Br;function Pn(){return Br||(Br=1,function(n,v){(function(h,c){n.exports=c(re())})(Sn,function(h){return function(){var c=h,S=c.lib,g=S.WordArray,m=c.enc;m.Utf16=m.Utf16BE={stringify:function(a){for(var r=a.words,x=a.sigBytes,b=[],y=0;y<x;y+=2){var s=r[y>>>2]>>>16-y%4*8&65535;b.push(String.fromCharCode(s))}return b.join("")},parse:function(a){for(var r=a.length,x=[],b=0;b<r;b++)x[b>>>1]|=a.charCodeAt(b)<<16-b%2*16;return g.create(x,r*2)}},m.Utf16LE={stringify:function(a){for(var r=a.words,x=a.sigBytes,b=[],y=0;y<x;y+=2){var s=f(r[y>>>2]>>>16-y%4*8&65535);b.push(String.fromCharCode(s))}return b.join("")},parse:function(a){for(var r=a.length,x=[],b=0;b<r;b++)x[b>>>1]|=f(a.charCodeAt(b)<<16-b%2*16);return g.create(x,r*2)}};function f(a){return a<<8&4278255360|a>>>8&16711935}}(),h.enc.Utf16})}(De)),De.exports}var Re={exports:{}},kn=Re.exports,Ar;function Bn(){return Ar||(Ar=1,function(n,v){(function(h,c){n.exports=c(re())})(kn,function(h){return h.enc.Hex})}(Re)),Re.exports}var ce={},Ir;function An(){if(Ir)return ce;Ir=1;var n=ce&&ce.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(ce,"__esModule",{value:!0});const v=n(Nt());return ce.default=v.default.create("encrypt","decrypt"),ce}var Or;function In(){if(Or)return X;Or=1;var n=X&&X.__createBinding||(Object.create?function(s,B,j,E){E===void 0&&(E=j);var O=Object.getOwnPropertyDescriptor(B,j);(!O||("get"in O?!B.__esModule:O.writable||O.configurable))&&(O={enumerable:!0,get:function(){return B[j]}}),Object.defineProperty(s,E,O)}:function(s,B,j,E){E===void 0&&(E=j),s[E]=B[j]}),v=X&&X.__setModuleDefault||(Object.create?function(s,B){Object.defineProperty(s,"default",{enumerable:!0,value:B})}:function(s,B){s.default=B}),h=X&&X.__importStar||function(s){if(s&&s.__esModule)return s;var B={};if(s!=null)for(var j in s)j!=="default"&&Object.prototype.hasOwnProperty.call(s,j)&&n(B,s,j);return v(B,s),B},c=X&&X.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(X,"__esModule",{value:!0}),X.AesCrypter=void 0;const S=h(wn()),g=c(Cn()),m=c(En()),f=c(Pn()),a=c(tt()),r=c(Bn()),x=c(An()),b={latin1:g.default,utf8:m.default,hex:r.default,utf16:f.default,base64:a.default};class y extends x.default{encrypt(B,j){const E=typeof B=="string"?B:JSON.stringify(B);return S.encrypt(E,j).toString()}decrypt(B,j,E="utf8"){return S.decrypt(B,j).toString(b[E])}}return X.AesCrypter=y,X.default=new y,X}const On=!0,Dn=">= 8",Rn=">= 0.5 && < 0.9.7",Tn=!0,zn=!0,Ln=">= 0.5",Fn=!0,Nn=!0,qn=!0,Hn=">= 1 && < 8",Mn="< 8",Un=!0,Kn=[">= 14.17 && < 15",">= 15.1"],$n=!0,Wn=">= 0.7.12",Vn=!0,Gn="< 6",Yn=!0,Zn=">= 0.11.1",Jn=">= 0.11.1",Qn=">= 0.11.1",Xn=">= 0.11.1",es=">= 0.11.1",rs=">= 0.11.1",ts=!0,ns=">= 8.8",ss=!0,is=">= 8",os="< 8",as=!0,cs=!0,ls=!0,us=!0,ds=">= 8.5",fs=">= 1",ps=">= 0.5",hs=!0,vs=!0,gs=!0,ms=">= 0.11.5 && < 3",xs=">= 0.9.4",ys=">= 0.9.4",_s=">= 1.4.1",ws=">= 0.9.4",bs=">= 0.9.4",Cs=">= 0.9.4",js=!0,Es=!0,Ss=[">= 0.4 && < 0.7",">= 0.8"],Ps=!0,ks=">= 0.11.13",Bs=">= 0.11.3 && < 10",As=">= 0.11.3",Is=!0,Os=">= 10",Ds=!0,Rs=!0,Ts=!0,zs=">= 1",Ls=!0,Fs=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],Ns=">= 11.7",qs=">= 0.5",Hs={assert:On,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Dn,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:Rn,buffer:Tn,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:zn,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:Ln,"node:cluster":[">= 14.18 && < 15",">= 16"],console:Fn,"node:console":[">= 14.18 && < 15",">= 16"],constants:Nn,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:qn,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Hn,_debugger:Mn,dgram:Un,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Kn,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:$n,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Wn,"node:domain":[">= 14.18 && < 15",">= 16"],events:Vn,"node:events":[">= 14.18 && < 15",">= 16"],freelist:Gn,fs:Yn,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:Zn,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:Jn,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:Qn,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:Xn,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:es,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:rs,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:ts,"node:http":[">= 14.18 && < 15",">= 16"],http2:ns,"node:http2":[">= 14.18 && < 15",">= 16"],https:ss,"node:https":[">= 14.18 && < 15",">= 16"],inspector:is,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:os,module:as,"node:module":[">= 14.18 && < 15",">= 16"],net:cs,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:ls,"node:os":[">= 14.18 && < 15",">= 16"],path:us,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:ds,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:fs,"node:process":[">= 14.18 && < 15",">= 16"],punycode:ps,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:hs,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:vs,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:gs,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:ms,_stream_duplex:xs,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:ys,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:_s,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:ws,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:bs,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:Cs,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:js,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Es,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:Ss,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Ps,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:ks,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Bs,_tls_wrap:As,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Is,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:Os,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Ds,"node:tty":[">= 14.18 && < 15",">= 16"],url:Rs,"node:url":[">= 14.18 && < 15",">= 16"],util:Ts,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:zs,"node:v8":[">= 14.18 && < 15",">= 16"],vm:Ls,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:Fs,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:Ns,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:qs,"node:zlib":[">= 14.18 && < 15",">= 16"]};var He,Dr;function Ms(){if(Dr)return He;Dr=1;var n=qt();function v(g,m){for(var f=g.split("."),a=m.split(" "),r=a.length>1?a[0]:"=",x=(a.length>1?a[1]:a[0]).split("."),b=0;b<3;++b){var y=parseInt(f[b]||0,10),s=parseInt(x[b]||0,10);if(y!==s)return r==="<"?y<s:r===">="?y>=s:!1}return r===">="}function h(g,m){var f=m.split(/ ?&& ?/);if(f.length===0)return!1;for(var a=0;a<f.length;++a)if(!v(g,f[a]))return!1;return!0}function c(g,m){if(typeof m=="boolean")return m;var f=typeof g>"u"?J.versions&&J.versions.node:g;if(typeof f!="string")throw new TypeError(typeof g>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(m&&typeof m=="object"){for(var a=0;a<m.length;++a)if(h(f,m[a]))return!0;return!1}return h(f,m)}var S=Hs;return He=function(m,f){return n(S,m)&&c(f,S[m])},He}var Me,Rr;function Us(){if(Rr)return Me;Rr=1;var n={},v=Qr();return Me=v.homedir||function(){var c=n.HOME,S=n.LOGNAME||n.USER||n.LNAME||n.USERNAME;return J.platform==="win32"?n.USERPROFILE||n.HOMEDRIVE+n.HOMEPATH||c||null:J.platform==="darwin"?c||(S?"/Users/"+S:null):J.platform==="linux"?c||(J.getuid()===0?"/root":S?"/home/"+S:null):c||null},Me}var Ue,Tr;function Ks(){return Tr||(Tr=1,Ue=function(){var n=Error.prepareStackTrace;Error.prepareStackTrace=function(h,c){return c};var v=new Error().stack;return Error.prepareStackTrace=n,v[2].getFileName()}),Ue}var le={exports:{}},zr;function $s(){if(zr)return le.exports;zr=1;var n=J.platform==="win32",v=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,h={};function c(f){return v.exec(f).slice(1)}h.parse=function(f){if(typeof f!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof f);var a=c(f);if(!a||a.length!==5)throw new TypeError("Invalid path '"+f+"'");return{root:a[1],dir:a[0]===a[1]?a[0]:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}};var S=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,g={};function m(f){return S.exec(f).slice(1)}return g.parse=function(f){if(typeof f!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof f);var a=m(f);if(!a||a.length!==5)throw new TypeError("Invalid path '"+f+"'");return{root:a[1],dir:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}},n?le.exports=h.parse:le.exports=g.parse,le.exports.posix=g.parse,le.exports.win32=h.parse,le.exports}var Ke,Lr;function Ws(){if(Lr)return Ke;Lr=1;var n=Ne(),v=n.parse||$s(),h=function(S,g){var m="/";/^([A-Za-z]:)/.test(S)?m="":/^\\\\/.test(S)&&(m="\\\\");for(var f=[S],a=v(S);a.dir!==f[f.length-1];)f.push(a.dir),a=v(a.dir);return f.reduce(function(r,x){return r.concat(g.map(function(b){return n.resolve(m,x,b)}))},[])};return Ke=function(S,g,m){var f=g&&g.moduleDirectory?[].concat(g.moduleDirectory):["node_modules"];if(g&&typeof g.paths=="function")return g.paths(m,S,function(){return h(S,f)},g);var a=h(S,f);return g&&g.paths?a.concat(g.paths):a},Ke}var $e,Fr;function Vs(){return Fr||(Fr=1,$e=function(n,v){return v||{}}),$e}var We,Nr;function Gs(){if(Nr)return We;Nr=1;var n=Ms(),v=cr,h=Ne(),c=Us(),S=Ks(),g=Ws(),m=Vs(),f=J.platform!=="win32"&&v.realpathSync&&typeof v.realpathSync.native=="function"?v.realpathSync.native:v.realpathSync,a=c(),r=function(){return[h.join(a,".node_modules"),h.join(a,".node_libraries")]},x=function(O){try{var t=v.statSync(O,{throwIfNoEntry:!1})}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR"))return!1;throw e}return!!t&&(t.isFile()||t.isFIFO())},b=function(O){try{var t=v.statSync(O,{throwIfNoEntry:!1})}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR"))return!1;throw e}return!!t&&t.isDirectory()},y=function(O){try{return f(O)}catch(t){if(t.code!=="ENOENT")throw t}return O},s=function(O,t,e){return e&&e.preserveSymlinks===!1?O(t):t},B=function(O,t){var e=O(t);try{var p=JSON.parse(e);return p}catch{}},j=function(O,t,e){for(var p=g(t,e,O),_=0;_<p.length;_++)p[_]=h.join(p[_],O);return p};return We=function(O,t){if(typeof O!="string")throw new TypeError("Path must be a string.");var e=m(O,t),p=e.isFile||x,_=e.readFileSync||v.readFileSync,I=e.isDirectory||b,R=e.realpathSync||y,L=e.readPackageSync||B;if(e.readFileSync&&e.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var F=e.packageIterator,l=e.extensions||[".js"],w=e.includeCoreModules!==!1,A=e.basedir||h.dirname(S()),k=e.filename||A;e.paths=e.paths||r();var z=s(R,h.resolve(A),e);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(O)){var N=h.resolve(z,O);(O==="."||O===".."||O.slice(-1)==="/")&&(N+="/");var U=q(N)||u(N);if(U)return s(R,U,e)}else{if(w&&n(O))return O;var Y=P(O,z);if(Y)return s(R,Y,e)}var C=new Error("Cannot find module '"+O+"' from '"+k+"'");throw C.code="MODULE_NOT_FOUND",C;function q(i){var d=T(h.dirname(i));if(d&&d.dir&&d.pkg&&e.pathFilter){var M=h.relative(d.dir,i),Q=e.pathFilter(d.pkg,i,M);Q&&(i=h.resolve(d.dir,Q))}if(p(i))return i;for(var W=0;W<l.length;W++){var G=i+l[W];if(p(G))return G}}function T(i){if(!(i===""||i==="/")&&!(J.platform==="win32"&&/^\w:[/\\]*$/.test(i))&&!/[/\\]node_modules[/\\]*$/.test(i)){var d=h.join(s(R,i,e),"package.json");if(!p(d))return T(h.dirname(i));var M=L(_,d);return M&&e.packageFilter&&(M=e.packageFilter(M,i)),{pkg:M,dir:i}}}function u(i){var d=h.join(s(R,i,e),"/package.json");if(p(d)){try{var M=L(_,d)}catch{}if(M&&e.packageFilter&&(M=e.packageFilter(M,i)),M&&M.main){if(typeof M.main!="string"){var Q=new TypeError("package “"+M.name+"” `main` must be a string");throw Q.code="INVALID_PACKAGE_MAIN",Q}(M.main==="."||M.main==="./")&&(M.main="index");try{var W=q(h.resolve(i,M.main));if(W)return W;var G=u(h.resolve(i,M.main));if(G)return G}catch{}}}return q(h.join(i,"/index"))}function P(i,d){for(var M=function(){return j(i,d,e)},Q=F?F(i,d,M,e):M(),W=0;W<Q.length;W++){var G=Q[W];if(I(h.dirname(G))){var oe=q(G);if(oe)return oe;var ve=u(G);if(ve)return ve}}}},We}var Ve,qr;function Ys(){return qr||(qr=1,Ve=Gs()),Ve}var Ge,Hr;function Zs(){if(Hr)return Ge;Hr=1;var n={};Ge=S,S.sync=g;var v=cr;function h(m,f){var a=f.pathExt!==void 0?f.pathExt:n.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var r=0;r<a.length;r++){var x=a[r].toLowerCase();if(x&&m.substr(-x.length).toLowerCase()===x)return!0}return!1}function c(m,f,a){return!m.isSymbolicLink()&&!m.isFile()?!1:h(f,a)}function S(m,f,a){v.stat(m,function(r,x){a(r,r?!1:c(x,m,f))})}function g(m,f){return c(v.statSync(m),m,f)}return Ge}var Ye,Mr;function Js(){if(Mr)return Ye;Mr=1,Ye=v,v.sync=h;var n=cr;function v(g,m,f){n.stat(g,function(a,r){f(a,a?!1:c(r,m))})}function h(g,m){return c(n.statSync(g),m)}function c(g,m){return g.isFile()&&S(g,m)}function S(g,m){var f=g.mode,a=g.uid,r=g.gid,x=m.uid!==void 0?m.uid:J.getuid&&J.getuid(),b=m.gid!==void 0?m.gid:J.getgid&&J.getgid(),y=parseInt("100",8),s=parseInt("010",8),B=parseInt("001",8),j=y|s,E=f&B||f&s&&r===b||f&y&&a===x||f&j&&x===0;return E}return Ye}var Ze,Ur;function Qs(){if(Ur)return Ze;Ur=1;var n;J.platform==="win32"||we.TESTING_WINDOWS?n=Zs():n=Js(),Ze=v,v.sync=h;function v(c,S,g){if(typeof S=="function"&&(g=S,S={}),!g){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(m,f){v(c,S||{},function(a,r){a?f(a):m(r)})})}n(c,S||{},function(m,f){m&&(m.code==="EACCES"||S&&S.ignoreErrors)&&(m=null,f=!1),g(m,f)})}function h(c,S){try{return n.sync(c,S||{})}catch(g){if(S&&S.ignoreErrors||g.code==="EACCES")return!1;throw g}}return Ze}var Je,Kr;function Xs(){if(Kr)return Je;Kr=1;var n={};const v=J.platform==="win32"||n.OSTYPE==="cygwin"||n.OSTYPE==="msys",h=Ne(),c=v?";":":",S=Qs(),g=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),m=(r,x)=>{const b=x.colon||c,y=r.match(/\//)||v&&r.match(/\\/)?[""]:[...v?[J.cwd()]:[],...(x.path||n.PATH||"").split(b)],s=v?x.pathExt||n.PATHEXT||".EXE;.CMD;.BAT;.COM":"",B=v?s.split(b):[""];return v&&r.indexOf(".")!==-1&&B[0]!==""&&B.unshift(""),{pathEnv:y,pathExt:B,pathExtExe:s}},f=(r,x,b)=>{typeof x=="function"&&(b=x,x={}),x||(x={});const{pathEnv:y,pathExt:s,pathExtExe:B}=m(r,x),j=[],E=t=>new Promise((e,p)=>{if(t===y.length)return x.all&&j.length?e(j):p(g(r));const _=y[t],I=/^".*"$/.test(_)?_.slice(1,-1):_,R=h.join(I,r),L=!I&&/^\.[\\\/]/.test(r)?r.slice(0,2)+R:R;e(O(L,t,0))}),O=(t,e,p)=>new Promise((_,I)=>{if(p===s.length)return _(E(e+1));const R=s[p];S(t+R,{pathExt:B},(L,F)=>{if(!L&&F)if(x.all)j.push(t+R);else return _(t+R);return _(O(t,e,p+1))})});return b?E(0).then(t=>b(null,t),b):E(0)},a=(r,x)=>{x=x||{};const{pathEnv:b,pathExt:y,pathExtExe:s}=m(r,x),B=[];for(let j=0;j<b.length;j++){const E=b[j],O=/^".*"$/.test(E)?E.slice(1,-1):E,t=h.join(O,r),e=!O&&/^\.[\\\/]/.test(r)?r.slice(0,2)+t:t;for(let p=0;p<y.length;p++){const _=e+y[p];try{if(S.sync(_,{pathExt:s}))if(x.all)B.push(_);else return _}catch{}}}if(x.all&&B.length)return B;if(x.nothrow)return null;throw g(r)};return Je=f,f.sync=a,Je}var Qe,$r;function ei(){if($r)return Qe;$r=1;function n(v){if(!(typeof v>"u"))return JSON.parse(JSON.stringify(v))}return Qe=n,Qe}var Xe,Wr;function ri(){if(Wr)return Xe;Wr=1;var n={};const{BLOCKLET_MODES:v}=Ht(),h=Jr(),c=In().default,S=Mt(),g=Kt,{dirname:m,join:f,sep:a}=Ne(),r=Ys(),{tmpdir:x,homedir:b}=Qr(),y=Xs(),{withHttps:s,withHttp:B}=Ut(),j=ei(),E=(C,q,T)=>c.encrypt(C,h.pbkdf2Sync(T,q,256,32,"sha512").toString("hex")),O=(C,q,T)=>c.decrypt(C,h.pbkdf2Sync(T,q,256,32,"sha512").toString("hex")),t=(C,q=!0)=>{let T=C;return Array.isArray(T)&&T.every(u=>u.originFileObj&&u.url)&&(T=T.map(u=>u.url),T.length===1&&([T]=T)),q&&T&&typeof T=="object"&&(T=JSON.stringify(T)),T&&typeof T=="string"&&(T=T.replace(/(\r\n|\n|\r)/gm," ")),T},e=C=>C.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),p=C=>e(gr.from(C).toString("base64")),_=C=>(C+"===".slice((C.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"),I=C=>new Uint8Array(gr.from(_(C),"base64")),R="v21.6.0",L=()=>S.gte(J.version,R),F=()=>{try{return r("@arcblock/pm2",{basedir:__dirname})}catch{return null}};function l(C){try{return y.sync(C)}catch{return null}}const w=(C,q=!0)=>{const T=n.NODE_OPTIONS??"";if(T.includes("--experimental-permission")||T.includes("--permission")||T.includes("--allow-fs-read")||T.includes("--allow-fs-write")||T.includes("--allow-addons")||T.includes("--allow-child-process")||T.includes("--allow-worker"))throw console.error("getSecurityNodeOptions",{nodeOptions:T}),new Error("process.env.NODE_OPTIONS should not include --experimental-permission or --permission or --allow-fs-read or --allow-fs-write or --allow-addons or --allow-child-process or --allow-worker");if(!C)throw new Error("blocklet is not defined");if(T.includes("ms-vscode.js-debug/src/bootloader.js")&&(C.mode===v.DEVELOPMENT||C.environmentObj.BLOCKLET_MODE===v.DEVELOPMENT))return T;const u=[T].filter(W=>!!W&&W!=="undefined");if(!L()||!q)return u.join(" ").trim();const P=F(),i=l("meilisearch"),d="/data/bin/meilisearch",M=l("blocklet"),Q=[n.XDG_DATA_HOME?f(n.XDG_DATA_HOME,"pnpm/global/"):"",n.PNPM_HOME?f(n.PNPM_HOME,"global/"):""];return u.push("--permission",...[C.environmentObj.BLOCKLET_DATA_DIR,C.environmentObj.BLOCKLET_APP_DIR,C.environmentObj.BLOCKLET_LOG_DIR,C.environmentObj.BLOCKLET_CACHE_DIR,C.environmentObj.BLOCKLET_APP_DATA_DIR?f(C.environmentObj.BLOCKLET_APP_DATA_DIR,".projects"):"",x()].filter(Boolean).map(W=>`--allow-fs-write=${f(W,"/*")}`),"--allow-addons","--allow-child-process"),C.mode===v.DEVELOPMENT||C.environmentObj.BLOCKLET_MODE===v.DEVELOPMENT?(u.push("--allow-worker","--allow-fs-read=*"),u.push(`--allow-fs-write=${f(b(),".npm","_logs","/*")}`)):u.push(...[C.environmentObj.BLOCKLET_LOG_DIR,C.environmentObj.BLOCKLET_CACHE_DIR,C.environmentObj.BLOCKLET_APP_DATA_DIR,m(m(C.environmentObj.BLOCKLET_APP_DIR)),P&&m(m(m(m(P)))),M,i,d,m(m(J.execPath)),J.cwd(),x(),f(b(),".cursor-server"),"/Applications/Cursor.app",...Q].filter(Boolean).filter(W=>W!==a).map(W=>`--allow-fs-read=${f(W,"/*")}`)),g(u).join(" ").trim()},A={crossOriginEmbedderPolicy:!1,crossOriginOpenerPolicy:!1,crossOriginResourcePolicy:!1,originAgentCluster:!1,strictTransportSecurity:!0,xContentTypeOptions:!0,xDnsPrefetchControl:!1,xDownloadOptions:!1,xPermittedCrossDomainPolicies:!1,contentSecurityPolicy:!1,referrerPolicy:!1,xFrameOptions:!1,xPoweredBy:!0,xXssProtection:!1};function k(C,q,T){const u=j(C[q]||[]);return u.push(...T),[...new Set(u)]}async function z(C,{node:q,blocklet:T,trustedDomains:u=[]}){if(!C?.contentSecurityPolicy?.directives)return C;const P=j(C);P.contentSecurityPolicy.directives["default-src"]=k(P.contentSecurityPolicy.directives,"default-src",["'self'"]);const i=await q.getNodeInfo({useCache:!0});let d=await q.getBlockletDomainAliases({blocklet:T,nodeInfo:i});return d=(d||[]).map(M=>M.value),P.contentSecurityPolicy.directives["connect-src"]=k(P.contentSecurityPolicy.directives,"connect-src",["'self'",...d.filter(M=>M).map(M=>`http://${M}/.well-known/ping`),"https://api.simplesvg.com","https://api.iconify.design","https://api.unisvg.com"]),P.contentSecurityPolicy.directives["script-src"]=k(P.contentSecurityPolicy.directives,"script-src",["'self'","https://js.stripe.com"]),P.contentSecurityPolicy.directives["frame-src"]=k(P.contentSecurityPolicy.directives,"frame-src",["'self'","https://js.stripe.com"]),P.contentSecurityPolicy.directives["frame-ancestors"]=k(P.contentSecurityPolicy.directives,"frame-ancestors",["'self'",...(T.settings.userSpaceHosts||[]).map(M=>`https://${M}`),...u.filter(Boolean).map(M=>`http://${M}`)]),P}async function N(C,{node:q,blocklet:T}){const u=j(C);if(u?.origin?.smart){const P=[];P.push(...u.origin?.value||[]);const i=await q.getNodeInfo({useCache:!0});let d=await q.getBlockletDomainAliases({blocklet:T,nodeInfo:i});d=(d||[]).map(G=>G.value),P.push(...d.map(G=>s(G)),...d.map(G=>B(G)));const Q=((T.settings.federated||{})?.sites||[]).filter(G=>G?.isMaster!==!1||G.status==="approved"),W=[];for(const G of Q)W.push(new URL(G.appUrl).hostname),W.push(...G.aliasDomain||[]);P.push(...W.map(G=>s(G)),...W.map(G=>B(G))),u.origin.value=[...new Set(P)]}return u}function U(C){const q=j(C);for(const T of Object.keys(q))q[T]=q[T]?.value??q[T];return q}function Y(C){const q=j(C);for(const T of Object.keys(q))q[T]=q[T]?.override??!1;return q}return Xe={encrypt:E,decrypt:O,formatEnv:t,encodeEncryptionKey:p,decodeEncryptionKey:I,canUseFileSystemIsolateApi:L,getSecurityNodeOptions:w,patchResponseHeader:z,patchCors:N,cleanConfigOverride:U,keepConfigOverride:Y,DEFAULT_HELMET_CONFIG:A,SAFE_NODE_VERSION:R},Xe}var st=ri();const er=(n,v)=>n&&st.encrypt(n,v||or.AIGNE_CONFIG_ENCRYPT_SALT,""),rr=(n,v)=>n&&st.decrypt(n,v||or.AIGNE_CONFIG_ENCRYPT_SALT,""),me=n=>n==="aigneHub",Te=n=>n==="bedrock",ti=n=>{const v=["provider","model"];if(Xr(n))return[...v,"key"];const{provider:h}=n;let c=v;return me(h)?c=[...v,"key","url"]:Te(h)?c=[...v,"accessKeyId","secretAccessKey"]:c=[...v,"key"],c.filter(S=>!n[S])},Vr=n=>{if(Xr(n)||n==="")return"0";const v=typeof n=="string"?parseFloat(n):n;if(Number.isNaN(v))return"0";if(typeof Intl<"u"&&Intl.NumberFormat)return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}).format(v);const h=v.toFixed(2).split("."),c=h[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),S=parseFloat(h[1])>0?`.${h[1]}`:"";return`${c}${S}`},ni=n=>[{provider:"aigneHub",name:"AIGNE Hub",baseURL:"https://hub.aigne.io",logo:n?.imgPrefix?ie(n.imgPrefix,"/aigne-hub.jpg"):"/aigne-hub.jpg",documentation:"https://hub.aigne.io/docs",models:[]}],Fe="z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ",si=async n=>{const v=new URL(n);if(typeof window<"u"&&v.origin===window.location.origin)return it();const h=ie(v.origin,"__blocklet__.js?type=json"),c=await et.get(h).then(m=>m.data);if((c?.componentId||"").split("/").pop()===Fe)return ie(v.origin,c.prefix||"/");const g=(c?.componentMountPoints||[]).find(m=>m?.did===Fe);return g?ie(v.origin,g.mountPoint):n},it=()=>{var n,v,h,c;if(typeof window>"u")return"";const S=((n=window.blocklet)===null||n===void 0?void 0:n.prefix)||"/",g=(v=window.location)===null||v===void 0?void 0:v.origin;if((((h=window.blocklet)===null||h===void 0?void 0:h.componentId)||"").split("/").pop()===Fe)return ie(g,S);const f=(((c=window.blocklet)===null||c===void 0?void 0:c.componentMountPoints)||[]).find(a=>a?.did===Fe);return f?ie(g,f.mountPoint):ie(g,S)};async function ii({baseUrl:n="",accessKey:v=""}){let h=it();const c=typeof window<"u";try{if(n){const S=new URL(n);(!c||c&&S.origin!==window.location.origin)&&(h=await si(n))}}catch(S){throw console.warn("Failed to parse baseUrl:",S),new Error(`Failed to parse baseUrl: ${ue(S)}`)}if(!h||!v)throw new Error("baseUrl or accessKey is not set");return et.get(ie(h,"/api/user/info"),{headers:{Authorization:`Bearer ${v}`}}).then(S=>S.data)}const qe=sr.div`
12
- min-height: ${({minHeight:n})=>n==="none"?"auto":`${n||160}px`};
13
- height: ${({height:n,minHeight:v})=>n==="none"?"auto":`${n||v||160}px`};
14
- padding: ${({theme:n})=>n.spacing(2)};
15
- border-radius: ${({theme:n})=>n.shape.borderRadius}px;
16
- border: 1px solid;
17
- border-color: ${({theme:n})=>n.palette.divider};
18
- background-color: ${({theme:n})=>n.palette.background.paper};
19
- box-shadow: ${({theme:n})=>n.shadows[1]};
20
- `,oi={loading:H.bool,authLoading:H.bool,disconnectLoading:H.bool,connecting:H.bool},nr=sr(ir)`
21
- color: ${({theme:n})=>n.palette.text.primary};
22
- font-weight: 500;
23
- border-color: ${({theme:n})=>n.palette.grey[300]};
24
- line-height: 1.5;
25
- &:hover {
26
- background-color: ${({theme:n})=>Pt(n.palette.primary.main,.1)};
27
- }
28
- `;function ot({loading:n=!1,user:v=null,switchUser:h=ar,connecting:c=!1,url:S=""}){const{t:g}=K.useContext(he);return!v&&!n?null:o.jsx(qe,{children:n?o.jsxs(V,{sx:{display:"flex",justifyContent:"center",alignItems:"flex-start",gap:2,height:"100%"},children:[o.jsx(ne,{variant:"circular",width:48,height:48}),o.jsxs(V,{sx:{display:"flex",flexDirection:"column",gap:1,width:"100%"},children:[o.jsx(ne,{variant:"rounded",sx:{width:"80%",height:20}}),o.jsx(ne,{variant:"rounded",sx:{width:"40%",height:20}}),o.jsx(ne,{variant:"rounded",sx:{width:"30%",height:20}}),o.jsx(ne,{variant:"rounded",sx:{width:"60%",height:20}})]})]}):o.jsxs(V,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%"},children:[o.jsx(rn,{size:"large",showDid:!0,showHoverCard:!0,user:v,avatarProps:{size:48},infoType:mr.Minimal,popupInfoType:mr.Basic,sx:{border:"none",p:0},onAvatarClick:()=>{S&&window.open(en(ie(S,or.WELLKNOWN_BLOCKLET_USER_PATH),{did:v.did}),"_blank")}}),o.jsx(V,{children:o.jsx(nr,{variant:"outlined",disabled:c,startIcon:c?o.jsx(fe,{size:16,sx:{mr:1}}):o.jsx(Le,{style:{fontSize:16},icon:"tabler:switch-horizontal"}),onClick:h,children:g("setting.aigne.switchUser")})})]})})}ot.propTypes={loading:H.bool,user:H.object,switchUser:H.func,url:H.string,...oi};function at({loading:n=!1,credit:v=null,connecting:h=!1,onRefresh:c=()=>{},refreshing:S=!1}){const{t:g}=K.useContext(he),m=Gr`
29
- from {
30
- transform: rotate(0deg);
31
- }
32
- to {
33
- transform: rotate(360deg);
34
- }
35
- `,f=K.useMemo(()=>!v?.enableCredit,[v]),a=K.useMemo(()=>Number(v?.creditBalance?.balance)<=0&&Number(v?.creditBalance?.pendingCredit)>0,[v]);if(!v&&!n)return null;const{creditBalance:r,profileLink:x="",paymentLink:b=""}=v||{};return o.jsx(qe,{children:n?o.jsxs(V,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",gap:2,height:"100%"},children:[o.jsxs(V,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:1},children:[o.jsx(ne,{variant:"rounded",sx:{width:"80%",height:20}}),o.jsx(ne,{variant:"rounded",sx:{width:"50%",height:20}})]}),o.jsxs(V,{sx:{width:"100%",display:"flex",justifyContent:"space-between",gap:1},children:[o.jsx(ne,{variant:"rounded",sx:{width:"100%",height:20}}),o.jsx(ne,{variant:"rounded",sx:{width:"100%",height:20}})]})]}):o.jsxs(V,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",height:"100%",width:"100%"},children:[o.jsxs(V,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[o.jsx(se,{variant:"body1",children:"AIGNE Hub Credits"}),o.jsxs(se,{variant:"h2",sx:{color:!f&&a?"error.main":"text.primary"},children:[o.jsx("span",{children:f?g("setting.aigne.infinite"):a?`- ${Vr(r?.pendingCredit)}`:Vr(r.balance)}),o.jsx(pe,{title:g("common.refresh"),children:o.jsx(kt,{sx:{fontSize:14,ml:1,cursor:"pointer",animation:S?`${m} 1s linear infinite`:"none"},onClick:c})})]})]}),f?null:o.jsxs(V,{sx:{width:"100%",display:"flex",gap:1},children:[o.jsx(nr,{fullWidth:!0,variant:"outlined",disabled:h,onClick:()=>{b&&window.open(b,"_blank")},startIcon:o.jsx(Le,{style:{fontSize:16},icon:"tabler:credit-card"}),children:g("setting.aigne.addCredits")}),o.jsx(nr,{fullWidth:!0,disabled:h,onClick:()=>{x&&window.open(x,"_blank")},variant:"outlined",startIcon:o.jsx(Le,{style:{fontSize:16},icon:"hugeicons:transaction"}),children:g("setting.aigne.transaction")})]})]})})}at.propTypes={loading:H.bool,credit:H.object,connecting:H.bool,onRefresh:H.func,refreshing:H.bool};function ct({url:n,apiKey:v,switchUser:h=ar,connecting:c=!1}){const{t:S}=K.useContext(he),[g,m]=K.useState(!1),{data:f,loading:a,error:r,refresh:x}=zt(()=>ii({baseUrl:n,accessKey:v}),{ready:!!(n&&v),refreshDeps:[n,v],onSuccess:()=>{m(!1)},onError:()=>{m(!1)}}),b=K.useCallback(()=>{a||g||(m(!0),x())},[x,a,g]);return r?null:o.jsxs(V,{children:[o.jsx(se,{variant:"h5",sx:{fontSize:18,mb:2},children:S("setting.aigne.account")}),o.jsxs(xe,{container:!0,className:"config-container",spacing:2,sx:{width:"100%"},children:[o.jsx(xe,{size:{xs:12,md:6},children:o.jsx(ot,{loading:a&&!g,user:f?.user,switchUser:h,connecting:c,url:n})}),o.jsx(xe,{size:{xs:12,md:6},children:o.jsx(at,{refreshing:g,loading:a&&!g,credit:f,connecting:c,onRefresh:b})})]})]})}ct.propTypes={url:H.string.isRequired,apiKey:H.string.isRequired,connecting:H.bool,switchUser:H.func};function lt({url:n,providerName:v,disconnect:h=ar,disabled:c=!1,loading:S=!1,validationResult:g=""}){const{t:m}=K.useContext(he),f=K.useMemo(()=>g&&g!=="success",[g]);return o.jsx(qe,{minHeight:80,height:"none",children:o.jsxs(V,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",gap:2},children:[f?o.jsx(pe,{title:g,children:o.jsx(Yr,{sx:{fontSize:24,color:"error.main",cursor:"pointer",flexShrink:0}})}):o.jsx(Zr,{sx:{fontSize:24,color:"success.main",cursor:"pointer",flexShrink:0}}),o.jsxs(V,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flex:1,flexWrap:"wrap"},children:[o.jsxs(V,{children:[o.jsx(se,{variant:"h5",sx:{fontSize:18},children:f?m("setting.aigne.testFailed"):m("setting.aigne.connected",{provider:v})}),o.jsxs(se,{variant:"body1",sx:{color:"text.secondary",fontSize:14},children:[m("setting.aigne.baseUrl",{provider:v}),": ",n]})]}),o.jsx(ir,{variant:"outlined",color:"error",startIcon:S?o.jsx(fe,{size:16,sx:{mr:1}}):o.jsx(Bt,{}),onClick:h,disabled:c||S,sx:{lineHeight:1.5},children:m("setting.aigne.disconnect")})]})]})})}lt.propTypes={url:H.string.isRequired,providerName:H.string.isRequired,disabled:H.bool,disconnect:H.func,loading:H.bool,validationResult:H.string};function de({desc:n,docLink:v=null,provider:h="",orientation:c="vertical"}){const{t:S}=K.useContext(he);return o.jsxs(se,{variant:"body2",sx:{lineHeight:1.6,color:"text.secondary",fontSize:12,...c==="vertical"&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},title:n,children:[n,v&&o.jsx(pe,{title:o.jsxs(o.Fragment,{children:[S("setting.aigne.desc.docLink"),v&&o.jsxs(o.Fragment,{children:[":"," ",o.jsx(Tt,{href:v,target:"_blank",rel:"noopener noreferrer",sx:{ml:.5},children:h||"documentation"})]})]}),arrow:!0,children:o.jsx(Rt,{fontSize:"small",sx:{ml:.25,fontSize:14,cursor:"pointer",verticalAlign:"middle"}})})]})}const tr={provider:"",model:"",url:"",key:"",accessKeyId:"",testConnection:""};de.propTypes={desc:H.string.isRequired,docLink:H.string,provider:H.string,orientation:H.oneOf(["vertical","horizontal"])};function ut({orientation:n="vertical",hideDivider:v=!1,source:h="dashboard",forceValidate:c=!1},S){const[g,m]=K.useState(!1),[f,a]=K.useState(!1),[r,x]=K.useState(!1),[b,y]=K.useState(!1),{t:s}=K.useContext(he),B=$t(),{api:j}=B,{did:E,blocklet:O,actions:t}=Wt(),[e,p]=K.useState(!1),_=vr({...tr}),I=vr({loading:!1,success:!1}),{confirmApi:R,confirmHolder:L}=Vt(),F=ni(B),l=Qt({messageType:"connect-aigne-message",onOpen:()=>m(!0),onClose:()=>m(!1)}),w=K.useMemo(()=>g||f||r||I.loading,[g,f,r,I.loading]),A=ae(D=>F.find($=>$.provider===D)),k=ae(D=>A(D)?.models||[]),z=ae(D=>{if(D)return D;const $=F[0]?.provider;return k($)[0]?.name||"auto"}),N=ae(()=>{Object.keys(tr).forEach(D=>{_[D]=tr[D]})}),U=ye(()=>{const{aigne:D={}}=O?.settings||{};return D},[O]),Y=ye(()=>{const D={...U},$=D?.provider||F[0]?.provider,Z=A($),ee=me($),fr=Te($);return{...D,url:D?.url||ee&&Z?.baseURL||"",provider:$,model:z(D?.model),key:rr(D?.key,E),accessKeyId:fr?rr(D?.accessKeyId,E):D?.accessKeyId,secretAccessKey:fr?rr(D?.secretAccessKey,E):D?.secretAccessKey}},[O,A,z]),[C,q]=K.useState(Y);K.useEffect(()=>{q(Y)},[Y]);const T=K.useMemo(()=>C?.url&&C?.key&&C?.provider==="aigneHub",[C]),u=ye(()=>A(C.provider)?.name||C.provider,[C,A]),P=K.useMemo(()=>ti(C),[C]),i=ye(()=>A(C.provider)?.documentation||"",[C,A]),d=async()=>{try{m(!0);const D=new Set(["running","error"]),$=O.children.filter(Z=>D.has(Z.status)).map(Z=>Z.meta.did);await j.restartBlocklet({input:{did:E,componentDids:$}}),t.refreshBlocklet()}catch(D){console.error("error",D),te.error(ue(D))}finally{m(!1)}},M=(D=!0)=>{if(h!=="setup")return new Promise($=>{R.open({title:s("setting.aigne.restart.title"),content:D?s("setting.aigne.restart.connectedContent",{provider:u}):s("setting.aigne.restart.notConnectedContent",{provider:u}),confirmButtonText:s("setting.aigne.restart.confirm"),cancelButtonText:s("setting.aigne.restart.cancel"),onConfirm(Z){Z(),d(),$(!0)},onCancel(){$(!1)}})})},Q=ae(()=>new Promise(D=>{R.open({title:s("setting.aigne.revokeUrlAuthTitle",{url:s("setting.aigne.baseUrl",{provider:u})}),content:s("setting.aigne.revokeUrlAuth",{url:s("setting.aigne.baseUrl",{provider:u})}),confirmButtonText:s("common.confirm"),cancelButtonText:s("common.cancel"),onConfirm($){$(),D(!0)},onCancel(){D(!1)}})})),W=async(D,$)=>{const Z={};if(q({...C,[D]:$}),D==="provider"){const ee=k($);ee.length>0&&(Z.model=ee[0].name),Z.key=""}return T&&D==="url"&&$!==C.url&&(await Q()?(Z.key="",Z.validationResult=""):Z.url=C.url),setTimeout(()=>{q({...C,[D]:$,...Z})},100),p(!0),!0},G=K.useMemo(()=>C.provider,[C.provider]),oe=ae(D=>Lt(D)?"":s("setting.aigne.invalidUrl",{provider:u})),ve=(D=[])=>{const $=P.filter(ee=>!D.includes(ee));if($.length)return $.forEach(ee=>{_[ee]="required"}),!$.includes("url")&&me(C.provider)&&(_.url=oe(C.url)),!1;const Z=me(C.provider)&&oe(C.url);return Z?(_.url=Z,!1):!0},dt=async()=>{try{x(!0),await j.disconnectToAigne({input:{did:E,url:C.url,key:C.key}}),p(!1),te.success(s("setting.aigne.disconnectSuccess")),setTimeout(()=>{M(!1)},300)}catch(D){console.error("disconnect error:",D),te.error(ue(D)||s("setting.aigne.disconnectFailed"))}finally{x(!1)}},ft=()=>{R.open({title:s("setting.aigne.disconnect"),content:s("setting.aigne.disconnectConfirm"),confirmButtonText:s("setting.aigne.disconnect"),cancelButtonText:s("common.cancel"),onConfirm(D){D(),dt()}})},lr=async()=>{if(!ve())return;N();const D={...C,model:"auto",key:er(C.key,E)};Te(D.provider)?(D.key="",C.accessKeyId&&(D.accessKeyId=er(C.accessKeyId,E)),C.secretAccessKey&&(D.secretAccessKey=er(C.secretAccessKey,E))):(D.accessKeyId="",D.secretAccessKey="");const $=await j.updateBlockletSettings({input:{did:E,aigne:D}});return t.refreshBlocklet(),$},pt=async()=>{try{if(!e&&!c)return;m(!0);const D=await lr();return D?(p(!1),te.success(s("oauth.saveSuccess")),D):void 0}catch(D){throw console.error("error",D),te.error(ue(D)||s("setting.aigne.failed")),D}finally{m(!1)}},ur=async(D=!1)=>{_.testConnection="";try{if(I.loading=!0,!D&&(await lr())?.code!=="ok")return;await j.verifyAigneConnection({input:{did:E}}),te.success(s("setting.aigne.testSuccess",{provider:u})),I.success=!0}catch($){throw console.error("error",$),_.testConnection=$.message,te.error(s("setting.aigne.testFailed")),$}finally{I.loading=!1,t.refreshBlocklet()}},ht=async()=>{try{await Xt(j,{did:E,refresh:t.refreshBlocklet,t:s,providerName:u,values:{...U}}).catch(D=>{throw console.error("waitGetConnectedAigne error",D),te.error(ue(D)),D}).then(()=>ur(!0).catch(D=>{throw console.error("onVerifyConnection error",D),D})),M(!0)}catch(D){console.error("error",D)}finally{p(!1)}},dr=()=>{ve(["key"])&&(N(),l(async(D,$)=>{try{a(!0);const Z=await j.connectToAigne({input:{did:E,baseUrl:C.url||new URL(window.location.origin).origin,provider:C.provider,model:"auto"}});if(!Z?.url){te.error("failed to connect to endpoint");return}$(Z.url),await ht(),a(!1)}catch(Z){const ee=ue(Z);te.error(ee),a(!1)}}))};K.useImperativeHandle(S,()=>({onSubmit:pt,loading:g||f||r})),k(G);const vt=G==="aigneHub",gt=()=>{y(!b)},mt=D=>{D.preventDefault()},xt=K.useMemo(()=>_.url==="required"?s("common.requiredErrorText",{name:s("setting.aigne.baseUrl",{provider:u})}):_.url?_.url:_.key==="required"?s("setting.aigne.apiKeyNotAuthorized",{provider:u}):"",[_.url,_.key,s,u]);return o.jsxs(ai,{source:h,children:[o.jsx(V,{sx:{mb:3},children:o.jsx(se,{variant:"body2",color:"text.primary",sx:{lineHeight:1.6,"& a":{color:"primary.main"}},dangerouslySetInnerHTML:{__html:s("setting.aigne.configDesc",{url:"https://store.blocklet.dev/blocklets/z8ia3xzq2tMq8CRHfaXj1BTYJyYnEcHbqP8cJ"})}})}),o.jsx(se,{variant:"h5",sx:{fontSize:18},children:s("setting.aigne.authorizeAigneHub",{name:u})}),T&&C.validationResult?o.jsx(lt,{url:C.url,providerName:u,disconnect:ft,validationResult:C.validationResult,disabled:w,loading:r}):o.jsx(qe,{height:"none",minHeight:"none",children:o.jsxs(V,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[o.jsx(ge,{orientation:n,title:s("setting.aigne.baseUrl",{provider:u}),required:me(C.provider),desc:o.jsx(de,{desc:s("setting.aigne.desc.baseUrl",{example:"https://hub.aigne.io"})}),children:o.jsx(_e,{disabled:w,initialValue:C.url||"",directEditing:!0,onSubmit:D=>{W("url",D)},autoFocus:!1,errorTips:xt,InputProps:T?{endAdornment:o.jsx(hr,{position:"end",children:I.loading||f?o.jsx(fe,{size:16}):o.jsxs(o.Fragment,{children:[C.validationResult==="success"?o.jsx(pe,{title:s("setting.aigne.testSuccess",{provider:u}),children:o.jsx(Zr,{sx:{fontSize:16,color:"success.main",cursor:"pointer"}})}):null,C.validationResult&&C.validationResult!=="success"?o.jsx(pe,{title:C.validationResult,children:o.jsx(Yr,{sx:{fontSize:16,color:"error.main",cursor:"pointer"}})}):null,C.validationResult?null:o.jsx(ze,{"aria-label":"test connection",onClick:ur,edge:"end",children:I.loading?o.jsx(fe,{size:16}):o.jsx(pe,{title:s("setting.aigne.testConnection",{provider:u}),children:o.jsx(Le,{style:{fontSize:16},icon:"tabler:location-check"})})})]})})}:{}})}),o.jsx(ir,{variant:"contained",onClick:dr,startIcon:f?o.jsx(fe,{size:16,sx:{mr:1}}):o.jsx(At,{}),disabled:w||!C.url,sx:{flexShrink:0},children:s("setting.aigne.authorizeAigneHub",{name:"AIGNE Hub"})})]})}),o.jsxs(xe,{container:!0,className:"config-container",spacing:2,sx:{display:"none"},children:[o.jsx(xe,{size:{xs:12,md:4},children:o.jsx(ge,{orientation:n,title:s("setting.aigne.modelAdapter"),required:!0,desc:o.jsx(de,{desc:s("setting.aigne.desc.modelAdapter")}),children:o.jsx(rt,{disabled:w,options:F,config:{multiple:!1,labelField:"name",valueField:"provider"},initialValue:C.provider,directEditing:!0,searchable:!1,helperText:_.provider==="required"?s("common.requiredErrorText",{name:s("setting.aigne.modelAdapter")}):_.provider,onChange:D=>W("provider",D)})})}),null,vt?null:o.jsx(o.Fragment,{children:Te(C.provider)?o.jsxs(o.Fragment,{children:[o.jsx(ge,{orientation:n,title:"Access Key ID",required:!0,desc:o.jsx(de,{desc:s("setting.aigne.desc.accessKeyId"),docLink:i,provider:u}),children:o.jsx(_e,{disabled:w,initialValue:C.accessKeyId||"",type:b?"text":"password",onChange:D=>W("accessKeyId",D),directEditing:!0,autoFocus:!1})}),!v&&o.jsx(V,{className:"config-form",component:It,sx:{my:3}}),o.jsx(ge,{orientation:n,title:"Secret Access Key",required:!0,desc:o.jsx(de,{desc:s("setting.aigne.desc.secretAccessKey"),docLink:i,provider:u}),children:o.jsx(_e,{disabled:w,initialValue:C.secretAccessKey||"",type:b?"text":"password",onChange:D=>W("secretAccessKey",D),directEditing:!0,autoFocus:!1})})]}):o.jsx(ge,{orientation:n,title:"API Key",required:!0,desc:o.jsx(de,{desc:s("setting.aigne.desc.key",{provider:u}),docLink:i,provider:u}),children:o.jsx(_e,{disabled:w,initialValue:C.key||"",type:b?"text":"password",onChange:D=>W("key",D),directEditing:!0,autoFocus:!1,InputProps:{endAdornment:o.jsx(hr,{position:"end",children:o.jsx(ze,{"aria-label":"toggle password visibility",onClick:gt,onMouseDown:mt,edge:"end",children:b?o.jsx(Dt,{}):o.jsx(Ot,{})})})}})})})]}),T&&C.validationResult==="success"?o.jsx(ct,{switchUser:dr,url:C.url||"",apiKey:C.key||"",connecting:f||r}):null,h!=="setup"&&o.jsxs(se,{sx:{fontSize:12,color:"text.secondary",mt:3,fontStyle:"italic"},children:["* ",s("setting.aigne.description",{name:Gt.getDisplayName(O,!0)})]}),L]})}ut.propTypes={orientation:H.oneOf(["vertical","horizontal"]),hideDivider:H.bool,source:H.oneOf(["dashboard","setup"]),forceValidate:H.bool};const ai=sr.div`
36
- max-width: 920px;
37
- display: flex;
38
- flex-direction: column;
39
- gap: 16px;
40
- .section-title {
41
- line-height: 1.2 !important;
42
- font-weight: ${({source:n})=>n==="setup"?"400":"500"};
43
- color: ${({theme:n,source:v})=>v==="setup"?n.palette.text.secondary:n.palette.text.primary};
44
- font-size: ${({source:n})=>n==="setup"?"14px":"16px"};
45
- }
46
- .section-left {
47
- width: 100%;
48
- }
49
- .form-item {
50
- margin-bottom: 0 !important;
51
- margin-top: 0 !important;
52
- }
53
- `,ci=K.forwardRef(ut),Ei=Object.freeze(Object.defineProperty({__proto__:null,default:ci},Symbol.toStringTag,{value:"Module"}));export{ci as A,Ei as c,cr as r};
@@ -1,106 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-BZZMcnOo.js","assets/vendor-mui-core-B7zoO8f5.js","assets/vendor-react-Dvs43sk9.js","assets/useLocalStorage-c2PGUYSe.js","assets/vendor-ux-Br1Zu4eg.js","assets/vendor-utils-DtY42AM-.js","assets/vendor-hooks-BRXKH6Nb.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/index-Dg-fihjm.js","assets/vendor-arcblock-B6isO619.js","assets/index-DrVXX4fX.css","assets/bundle-avatar-CZNhHDkE.js","assets/log-1sZ_L4eJ.css","assets/index-C0n8v4Cp.js","assets/index-Df2pSXXR.js","assets/user-sessions-BMBqVzE9.js","assets/hdkey-OYxbu68D.js","assets/did-address-ByONFwMZ.js","assets/team-B6ADMIin.js","assets/session-CccpevO4.js","assets/isURL-JpmdK601.js","assets/use-app-logo-oV4_Gpbf.js","assets/permission-CcwCK5jk.js","assets/click-to-copy-CNVY2jyw.js","assets/index-BNqNjoec.js","assets/arrow-down.svg-_z1Gr5z1.js","assets/vendor-mui-x-Qph0dQcg.js","assets/AdapterDayjs-hXG6wgqC.js","assets/index-DBs9Ljax.js","assets/useAsync-CsYRBczg.js","assets/useAsync-BrMo9m7W.js","assets/index-CpZPMhFT.js","assets/confirm-B-Pohnpi.js","assets/index-DgBUoYTd.js","assets/util-P7tJ3St_.js","assets/base32-CzDOk3cF.js","assets/sdk-Bskg7NCT.js","assets/actions-Bf4UKTeu.js","assets/shorten-label-BHlFrl9P.js","assets/get-safe-url-Cg-U52oI.js","assets/useAsyncRetry-D4-sRZN-.js","assets/useSetState-DFuQZPPV.js","assets/index-BzuF1xQu.js","assets/over-due-invoice-payment-CDRcX7in.js","assets/use-mobile-DM4d_PLd.js","assets/index-BRr23LOn.js","assets/use-mobile-C_DcJ5SZ.js","assets/index.esm-JPZAjt0x.js","assets/table-tips-Cw939Sls.js","assets/index-CPzKPZVk.js","assets/empty-spinner-BMVhld2Z.js","assets/list-header-BQx81X9X.js","assets/question-mark-circle.svg-B4stD6SS.js","assets/engine-Bd6Eh0_C.js","assets/api-IUmhrtIY.js","assets/react-beautiful-dnd.esm-CN6lay1O.js","assets/raf-schd.esm-CHNehTG3.js","assets/wait-connect-B1IAhfbk.js","assets/item-DT6l0SVr.js","assets/delete-confirm-DkSfjrm9.js","assets/index-BRP1KIY3.js","assets/index-BFQdM_lT.js","assets/index-gnjjKJuC.css","assets/index-BIfpX-Mq.js","assets/overview-ChSvzQtv.js","assets/keyboard-arrow-down-rounded-8U0_i9QO.js","assets/index-BojVbZw0.js","assets/status-C2dqS1Qp.js","assets/omit-BM-5z5qE.js","assets/spaces-ccyzWtGO.js","assets/domains-ItVUzQLa.js","assets/domain-action-card-CDmXQx1H.js","assets/util-xGYUIoLs.js","assets/index-CgNRJie5.js","assets/passport-item-BX4n24TJ.js","assets/index-BaJEVELd.js","assets/Google-CuUa2ivB.js","assets/cloneDeep-DqaMBldf.js","assets/edit.svg-DycWG9v3.js","assets/lock.svg-COUP8tyO.js","assets/appearance-Bw11KiXQ.js","assets/audit-logs-CsQOeDrk.js","assets/index-7ARWVbTs.js","assets/section-Dq8SB7lh.js","assets/required-CobBjKC9.js","assets/collapse-C-BNkgS6.js","assets/list-Bv_zhprU.js","assets/server-logo-notext.svg-CKQB0tIp.js","assets/traffic-B3OSPNpZ.js","assets/iframe-CDGyGqia.js","assets/index-C1MXs4dK.js","assets/base-chart-DZz4r8-E.js","assets/index-DT3k66ox.js","assets/config-navigation-B8lmgCq0.js","assets/index-BPy8_fa2.js","assets/createClass-Dg_VTkOQ.js","assets/simple-select-rm53gQ69.js","assets/index-z-8ML1C9.js","assets/index-DR0oTIfe.js","assets/index-CLqfXh65.js","assets/index-DRYJ0xIl.js","assets/connect-to-qV7wuVVK.js","assets/config-space-Bf7RiOeS.js","assets/switch-control-TkSdNEjL.js","assets/index-B4vHuy5A.js","assets/security-PrkTELzO.js","assets/config-BsNFHebj.js","assets/branding-DnBXFIg2.js","assets/sanitize-NVxeYIWy.js","assets/form-text-input-y9UkSEXJ.js","assets/form-wrapper-CHYdE4By.js","assets/logo-uploader-hp3SBdhZ.js","assets/advanced-B05ps9YS.js","assets/runtime-DsOc3CI-.js","assets/index-ZddejrLr.js","assets/list-dUYG3Ahk.js","assets/index-O8QTFET3.js","assets/config-CZieYCwq.js","assets/observability-F2NkCkza.js","assets/playground-CTvnZW2L.js","assets/component-LYdOEk37.js","assets/add-component-core-4uFRHIpx.js","assets/launch-result-message-BhJWVXUs.js","assets/page-header-CSMnIoYZ.js","assets/index-CkE6QgrS.js","assets/content-layout-DoBqUAz1.js","assets/search-4YYphs0l.js","assets/add-component-core-G0iZE90Q.css","assets/index-B4oI4SXk.js"])))=>i.map(i=>d[i]);
2
- import{G as tn,D as ht,H as F,T as U,aU as nn,aV as yo,ak as vo,M as on,aa as rn,E as Et,U as wo,L as So,a9 as jo,_ as T}from"./vendor-ux-Br1Zu4eg.js";import{j as i,W as S,aZ as Co,cM as ko,d3 as Eo,c9 as Io,df as _o,dg as To,cO as Lo,dh as Do,d7 as Ao,di as Po,I as Ne,aQ as Ro,aR as Mo,aX as gt,a3 as Oo,M as No,aO as Uo,a6 as V,aP as $o,bg as Bo,at as Ue,T as ee,bp as zo,b6 as It,bq as _t,ak as I,D as pe,J as oe,ah as $e,ao as Fo,dj as Vo,aj as Ho,dk as sn,dl as an,dm as cn,am as de,a$ as _e,dn as Tt,U as Q,aN as ln,Y as un,bZ as Wo,dp as qo,dq as Ko,Q as Go,dr as Qo}from"./vendor-mui-core-B7zoO8f5.js";import{r as m,L as dn,i as fn,g as Zo,k as Xo,j as Jo}from"./vendor-react-Dvs43sk9.js";import{Z as Be,f as N,X as qe,ak as Ke,c as P,Y as Lt,bF as Yo,aq as er,a8 as tr,v as nr,bG as or,bH as pn,ao as te,bI as mn,aO as rr,bJ as sr,W as ir,b5 as ar,b6 as cr,bK as lr,b7 as ur,bL as dr,bM as fr,aj as pr,bN as Ge,bO as mr,bP as hr,b4 as gr,m as me,a6 as xr,k as br,aa as yr,a as vr,n as Dt,bQ as At,i as wr,l as Sr,r as jr,p as se,o as Cr,q as kr,P as Er,I as Ir,B as _r,N as Tr,bE as Lr,$ as Dr,d as Pt,t as Ar}from"./index-Dg-fihjm.js";import{aa as Pr,C as W,J as hn,Q as Rr}from"./vendor-utils-DtY42AM-.js";import{o as Ae}from"./vendor-arcblock-B6isO619.js";import{u as Rt}from"./useLocalStorage-c2PGUYSe.js";import{f as xt}from"./index-DBs9Ljax.js";import{C as Mt}from"./confirm-B-Pohnpi.js";import{g as Ot}from"./get-safe-url-Cg-U52oI.js";import{u as gn}from"./session-CccpevO4.js";import{a as ae,l as Mr}from"./vendor-hooks-BRXKH6Nb.js";import{j as Or,b as Nr,M as Ur,a as $r,T as Br,N as zr}from"./team-B6ADMIin.js";import{D as Fr,u as xn}from"./useAsyncRetry-D4-sRZN-.js";import{u as bn}from"./useSetState-DFuQZPPV.js";import{x as Vr,d as Hr}from"./index-BzuF1xQu.js";import{O as Wr}from"./over-due-invoice-payment-CDRcX7in.js";import{u as qr}from"./use-mobile-DM4d_PLd.js";const yn=m.createContext({});function vn({children:e,type:t="blocklets"}){const[n,r]=m.useState([]),o=m.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Pr(u,n).forEach(p=>a(p))};return i.jsx(yn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:a,matchDeletingDid:c},children:e})}vn.propTypes={type:S.string,children:S.node.isRequired};function Xa(){return m.useContext(yn)}const Kr=e=>m.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})),Y={Start:Co,Stop:ko,Restart:Eo,Reload:Po,Remove:Io,Config:Ao,Log:Do,Group:Lo,Cancel:_o,Dashboard:Kr,Overview:To},Gr=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(W(n.origin,t));return o.search=r.toString(),o.toString()},Qr="internal",Zr="external";function wn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:a=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=Be(),[u,d]=m.useState(null),[p,f]=m.useState(null),[x,y]=m.useState(!1),[h,C]=m.useState(null),{t:v}=m.useContext(tn),[j]=Rt("skip-blocklet-setup",!1),{loading:g,recommendedUrl:E}=a(e),[k]=Rt("blocklet-type-filter",Qr),b=N.isInProgress(e.status),[_,R]=m.useState(!1);m.useEffect(()=>{if(!e?.controller)return;R(e?.controller?.status?.value===qe.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}R([P.LAUNCH_SESSION_STATUS.overdue,P.LAUNCH_SESSION_STATUS.canceled,P.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:M}=l,O=(w,D,K=!1)=>async()=>{const G=async Se=>{t({action:w,blocklet:e}),y(!0),f(w);let je=!1;try{if(w==="remove")await D(Se);else if(w==="start"){if(!N.hasRunnableComponent(e)){F.error(v("blocklet.noComponent"));return}if(!M&&!j&&!e.settings?.initialized&&e.mode!==qe.BLOCKLET_MODES.DEVELOPMENT){if(!E||!Lt(E)){F.error(v("blocklet.gotoVisitError"));return}const $=Yo(l.info),kt=new URL(E);kt.searchParams.set("serverUrl",$),window.open(Ot(kt.href,{allowDomains:null})),n({action:w,blocklet:e});return}const z=e.children.filter($=>!N.isInProgress($.status)&&$.status!=="running").map($=>$.meta.did),J={did:e.meta.did,componentDids:z};await D({input:J})}else if(["stop","restart","reload"].includes(w)){const z=e.children.filter($=>$.status==="running").map($=>$.meta.did),J={did:e.meta.did,componentDids:z};await D({input:J})}else{const z={did:e.meta.did};await D({input:z})}w==="remove"?je=!0:await er(1e3),w==="reload"&&F.success(v("blocklet.reloadSuccess")),C(null),n({action:w,blocklet:e})}catch(z){const J=`Blocklet ${w} failed: ${xt(z)}`;throw n({action:w,blocklet:e,error:new Error(J)}),new Error(J)}finally{je||y(!1)}},ve=()=>{y(!1),C(null)},we=N.getDisplayName(e,!0),xo=e.mode===qe.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(ee,{component:"div",children:i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Se,je)=>i.jsxs(ee,{component:"div",children:[i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),i.jsxs(zo,{name:"removeType",value:Se.removeType,onChange:z=>je({...Se,removeType:z.target.value}),children:[i.jsx(It,{value:"backup",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),i.jsx(It,{value:"complete",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},bo={stop:{title:`${v("common.stop")} ${we}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},restart:{title:`${v("common.restart")} ${we}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},remove:{title:`${v("common.remove")} ${we}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve,...xo},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:we}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve}};K?C(bo[w]):await G()},We=!!u,uo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(w.currentTarget)},fo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(null)},Ct=async(w,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof w.handler=="function")try{y(!0),f(w.action),await w.handler()}catch(K){console.error(`Blocklet ${w.name} failed: `,K)}finally{y(!1),d(null)}else d(null)},po=!M&&N.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:O("remove",async({removeType:w})=>{w==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:b}:null,mo={action:"remove",icon:({sx:w,...D})=>i.jsx(Y.Cancel,{sx:{...w,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:O("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ho=N.getAppMissingConfigs(e),go=()=>{const w=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),D=s?.({mountPoint:w,blocklet:e});if(!D||!Lt(D)){F.error(v("blocklet.gotoVisitError"));return}const K=e?.site?.domainAliases;window.open(Ot(Gr(D,`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:K?.map(G=>G.value)}))};let ye=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:O("start",l.api.startBlocklet),disabled:_||e.children.every(w=>w.status==="running")||Ke(e.status)||g||b},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:O("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:O("restart",l.api.restartBlocklet,!0),disabled:_||e.status!=="running"},Ke(e.status)?mo:po,{separator:!0},M?null:{action:"dashboard",icon:({style:w,...D})=>i.jsx(Y.Dashboard,{...D,style:{...w,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:go}].filter(Boolean);return k===Zr&&(ye=ye.filter(w=>w.inExternal)),r==="menu"?i.jsxs(Nt,{"data-cy":"blocklet-actions",children:[i.jsx(Ne,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:uo,size:"small",disabled:!o||!Ke(e.status)&&x,children:i.jsx(Ro,{})}),i.jsxs(Mo,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:We,onClose:fo,PaperProps:{},children:[ho.length>0&&i.jsxs(gt,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(dn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),ye.map((w,D)=>w.separator?i.jsx(Oo,{},`separator-${D}`):i.jsxs(No,{dense:!0,onClick:K=>Ct(w,K),disabled:x||w.disabled,"data-cy":`${w.action}-blocklet`,children:[i.jsx(Uo,{style:{minWidth:24},children:p===w.action&&x?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{fontSize:"small"})}),i.jsx($o,{primary:w.name})]},w.name))]}),h&&i.jsx(Mt,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):i.jsxs(Nt,{"data-cy":"blocklet-actions",...c,children:[i.jsx(Bo,{children:ye.filter(w=>!w.separator&&!w.onlyInMenu).map(w=>i.jsxs(ht,{title:w.name,"data-cy":`${w.action}-blocklet`,onClick:()=>Ct(w),disabled:!!w.disabled||x,children:[p===w.action&&x?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:w.name})]},w.name))}),h&&i.jsx(Mt,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}wn.propTypes={getComponentUrl:S.func,blocklet:S.object.isRequired,onStart:S.func.isRequired,onComplete:S.func.isRequired,variant:S.oneOf(["menu","group"]),hasPermission:S.bool,useBlockletUrlEvaluation:S.func};const Nt=Ue.div`
3
- display: flex;
4
- align-items: center;
5
-
6
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
7
- .MuiButton-root {
8
- padding: 4px;
9
- font-size: 10px;
10
- }
11
- }
12
- `,Ut=m.memo(wn),Xr=e=>{const t={};let n=null;return N.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=N.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},Jr=(e,t,n)=>{const{hostname:r,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;const c=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(P.DEFAULT_DID_DOMAIN))||"").replace(`.${P.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(r,`${u}-${c}.${P.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function Yr(){const{t:e}=U(),{api:t}=gn(),{blocklet:n}=tr(),{inService:r}=Be(),[o,s]=m.useState(!1),[a,c]=m.useState(5),l=n&&n.structVersion!==P.APP_STRUCT_VERSION,u=()=>{try{if(n.status==="running"){F.error(e("blocklet.migrate.tip.running"));return}const f=Xr(n);if(f){F.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}s(!0)}catch(f){F.error(xt(f))}},d=()=>{const f=Jr(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(x=>x-1)},1e3)},p=()=>s(!1);return[l&&i.jsxs(gt,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(ht,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(I,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(nr,{popup:!0,open:o,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:or(n,!0),title:N.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function es(){const e=pe();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const o=oe(e.breakpoints.up(r));return!n&&o?r:n},null)||"xs"}function ts(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function ns(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function os(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function rs(e){return i.jsx($e,{...e,children:i.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Ce={fontSize:20,marginInlineEnd:8},ss={success:i.jsx(ts,{style:Ce}),warning:i.jsx(ns,{style:Ce}),error:i.jsx(os,{style:Ce}),info:i.jsx(rs,{style:Ce})},is={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Sn({keyId:e,notification:t={},viewAllUrl:n,content:r=null},o){const s=pe(),a=ss[t.severity],{closeSnackbar:c}=nn(),l=()=>c(e),u=fn(),d=()=>{c(e),u(n)},p=ae(()=>Or(t),[t]),f=ae(()=>t?.activity,[t]),x=Nr({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:s.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),y=es();return i.jsxs(I,{component:yo,ref:o,sx:[{...s.typography.body2,display:"flex",backgroundColor:s.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)",width:is[y]},t.severity==="success"?{backgroundColor:`${Fo[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${s.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${s.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${Vo[700]} !important`}:{}],children:[i.jsxs(I,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(cs,{onClick:d,sx:{flex:1},children:i.jsx(I,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:x}),f.meta?i.jsx(Ur,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),r||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(I,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(Ne,{"aria-label":"close",color:"inherit",onClick:l,size:"large",children:i.jsx(I,{component:Ho,sx:{fontSize:20}})},"close")})]})}const as=m.forwardRef(Sn);Sn.propTypes={viewAllUrl:S.string.isRequired,keyId:S.number.isRequired,notification:S.object.isRequired,content:S.node};const cs=Ue.div`
13
- cursor: pointer;
14
- display: flex;
15
- flex-direction: column;
16
- .title {
17
- overflow: hidden;
18
- text-overflow: ellipsis;
19
- display: -webkit-box;
20
- -webkit-line-clamp: 1;
21
- -webkit-box-orient: vertical;
22
- font-weight: bold;
23
- }
24
- .desc {
25
- overflow: hidden;
26
- text-overflow: ellipsis;
27
- display: -webkit-box;
28
- -webkit-line-clamp: 3;
29
- -webkit-box-orient: vertical;
30
- word-break: break-word;
31
- }
32
- `;var L=function(t,n,r){return sn.call(n,"css")?i.jsx(an,cn(t,n),r):i.jsx(t,n,r)},ke=function(t,n,r){return sn.call(n,"css")?i.jsxs(an,cn(t,n),r):i.jsxs(t,n,r)};/**
33
- * (c) Iconify
34
- *
35
- * For the full copyright and license information, please view the license.txt or license.gpl.txt
36
- * files at https://github.com/iconify/iconify
37
- *
38
- * Licensed under MIT.
39
- *
40
- * @license MIT
41
- * @version 3.1.1
42
- */const jn=Object.freeze({left:0,top:0,width:16,height:16}),Pe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),he=Object.freeze({...jn,...Pe}),rt=Object.freeze({...he,body:"",hidden:!1});function ls(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function $t(e,t){const n=ls(e,t);for(const r in rt)r in Pe?r in e&&!(r in n)&&(n[r]=Pe[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function us(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const c=r[a]&&r[a].parent,l=c&&s(c);l&&(o[a]=[c].concat(l))}return o[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function ds(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function a(c){s=$t(r[c]||o[c],s)}return a(t),n.forEach(a),$t(e,s)}function fs(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=us(e);for(const o in r){const s=r[o];s&&(t(o,ds(e,o,s)),n.push(o))}return n}const ce=/^[a-z0-9]+(-[a-z0-9]+)*$/,re=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const c=o.pop(),l=o.pop(),u={provider:o.length>0?o[0]:r,prefix:l,name:c};return t&&!Te(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Te(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Te(c,n)?null:c}return null},Te=(e,t)=>e?!!((e.provider===""||e.provider.match(ce))&&(t&&e.prefix===""||e.prefix.match(ce))&&e.name.match(ce)):!1,ps={provider:"",aliases:{},not_found:{},...jn};function Qe(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ms(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Qe(e,ps))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(ce)||typeof s.body!="string"||!Qe(s,rt))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],a=s.parent;if(!o.match(ce)||typeof a!="string"||!n[a]&&!r[a]||!Qe(s,rt))return null}return t}const Re=Object.create(null);function hs(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function B(e,t){const n=Re[e]||(Re[e]=Object.create(null));return n[t]||(n[t]=hs(e,t))}function bt(e,t){return ms(t)?fs(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function gs(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function xs(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Re)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Re[o]||{})).forEach(a=>{const c=B(o,a);n=n.concat(Object.keys(c.icons).map(l=>(o!==""?"@"+o+":":"")+a+":"+l))})}),n}let yt=!1;function bs(e){return yt}function ge(e){const t=typeof e=="string"?re(e,!0,yt):e;if(t){const n=B(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function ys(e,t){const n=re(e,!0,yt);if(!n)return!1;const r=B(n.provider,n.prefix);return gs(r,n.name,t)}function Cn(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Te({provider:t,prefix:n,name:"a"}))return!1;const r=B(t,n);return!!bt(r,e)}function vs(e){return!!ge(e)}function ws(e){const t=ge(e);return t?{...he,...t}:null}const kn=Object.freeze({width:null,height:null}),En=Object.freeze({...kn,...Pe}),Ss=/(-?[0-9.]*[0-9]+[0-9.]*)/g,js=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function st(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Ss);if(r===null||!r.length)return e;const o=[];let s=r.shift(),a=js.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?o.push(s):o.push(Math.ceil(c*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");a=!a}}const Cs=e=>e==="unset"||e==="undefined"||e==="none";function ze(e,t){const n={...he,...e},r={...En,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(y=>{const h=[],C=y.hFlip,v=y.vFlip;let j=y.rotate;C?v?j+=2:(h.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),h.push("scale(-1 1)"),o.top=o.left=0):v&&(h.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),h.push("scale(1 -1)"),o.top=o.left=0);let g;switch(j<0&&(j-=Math.floor(j/4)*4),j=j%4,j){case 1:g=o.height/2+o.top,h.unshift("rotate(90 "+g.toString()+" "+g.toString()+")");break;case 2:h.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:g=o.width/2+o.left,h.unshift("rotate(-90 "+g.toString()+" "+g.toString()+")");break}j%2===1&&(o.left!==o.top&&(g=o.left,o.left=o.top,o.top=g),o.width!==o.height&&(g=o.width,o.width=o.height,o.height=g)),h.length&&(s='<g transform="'+h.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,l=o.width,u=o.height;let d,p;a===null?(p=c===null?"1em":c==="auto"?u:c,d=st(p,l/u)):(d=a==="auto"?l:a,p=c===null?st(d,u/l):c==="auto"?u:c);const f={},x=(y,h)=>{Cs(h)||(f[y]=h.toString())};return x("width",d),x("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:s}}const ks=/\sid="(\S+)"/g,Es="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Is=0;function In(e,t=Es){const n=[];let r;for(;r=ks.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(Is++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Z={local:!0,session:!0},_n={local:new Set,session:new Set};let vt=!1;function _s(e){vt=e}const Bt="iconify2",fe="iconify",Tn=fe+"-count",zt=fe+"-version",Ln=36e5,Ts=168;function it(e,t){try{return e.getItem(t)}catch{}}function wt(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ft(e,t){try{e.removeItem(t)}catch{}}function at(e,t){return wt(e,Tn,t.toString())}function ct(e){return parseInt(it(e,Tn))||0}let Ee=typeof window>"u"?{}:window;function Dn(e){const t=e+"Storage";try{if(Ee&&Ee[t]&&typeof Ee[t].length=="number")return Ee[t]}catch{}Z[e]=!1}function An(e,t){const n=Dn(e);if(!n)return;const r=it(n,zt);if(r!==Bt){if(r){const c=ct(n);for(let l=0;l<c;l++)Ft(n,fe+l.toString())}wt(n,zt,Bt),at(n,0);return}const o=Math.floor(Date.now()/Ln)-Ts,s=c=>{const l=fe+c.toString(),u=it(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Ft(n,l)}};let a=ct(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,at(n,a)):_n[e].add(c))}function Pn(){if(!vt){_s(!0);for(const e in Z)An(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=B(r,o);if(!bt(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Rn(e,t){switch(e){case"local":case"session":Z[e]=t;break;case"all":for(const n in Z)Z[n]=t;break}}const lt=Object.create(null);function Mn(e,t){lt[e]=t}function ut(e){return lt[e]||lt[""]}function St(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Fe=Object.create(null),ie=["https://api.simplesvg.com","https://api.unisvg.com"],Le=[];for(;ie.length>0;)ie.length===1||Math.random()>.5?Le.push(ie.shift()):Le.push(ie.pop());Fe[""]=St({resources:["https://api.iconify.design"].concat(Le)});function On(e,t){const n=St(t);return n===null?!1:(Fe[e]=n,!0)}function Ve(e){return Fe[e]}function Ls(){return Object.keys(Fe)}const Ds=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Me=Ds();function As(e){Me=e}function Ps(){return Me}function Rs(e,t){const n=Ve(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Ms(e){return e===404}const Os=(e,t,n)=>{const r=[],o=Rs(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=o&&u>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function Ns(e){if(typeof e=="string"){const t=Ve(e);if(t)return t.path}return"/"}const Us=(e,t,n)=>{if(!Me){n("abort",424);return}let r=Ns(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;Me(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Ms(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},$s={prepare:Os,send:Us};function Bs(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,a=o.prefix,c=o.name,l=n[s]||(n[s]=Object.create(null)),u=l[a]||(l[a]=B(s,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:s,prefix:a,name:c};d.push(p)}),t}function Nn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function zs(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,o=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==o)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Nn([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Fs=0;function Vs(e,t,n){const r=Fs++,o=Nn.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Hs(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?re(o,t,n):o;s&&r.push(s)}),r}var Ws={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function qs(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let b=e.resources.slice(0);for(a=[];b.length>1;){const _=Math.floor(Math.random()*b.length);a.push(b[_]),b=b.slice(0,_).concat(b.slice(_+1))}a=a.concat(b)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",u=0,d,p=null,f=[],x=[];typeof r=="function"&&x.push(r);function y(){p&&(clearTimeout(p),p=null)}function h(){l==="pending"&&(l="aborted"),y(),f.forEach(b=>{b.status==="pending"&&(b.status="aborted")}),f=[]}function C(b,_){_&&(x=[]),typeof b=="function"&&x.push(b)}function v(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:C,abort:h}}function j(){l="failed",x.forEach(b=>{b(void 0,d)})}function g(){f.forEach(b=>{b.status==="pending"&&(b.status="aborted")}),f=[]}function E(b,_,R){const M=_!=="success";switch(f=f.filter(O=>O!==b),l){case"pending":break;case"failed":if(M||!e.dataAfterTimeout)return;break;default:return}if(_==="abort"){d=R,j();return}if(M){d=R,f.length||(a.length?k():j());return}if(y(),g(),!e.random){const O=e.resources.indexOf(b.resource);O!==-1&&O!==e.index&&(e.index=O)}l="completed",x.forEach(O=>{O(R)})}function k(){if(l!=="pending")return;y();const b=a.shift();if(b===void 0){if(f.length){p=setTimeout(()=>{y(),l==="pending"&&(g(),j())},e.timeout);return}j();return}const _={status:"pending",resource:b,callback:(R,M)=>{E(_,R,M)}};f.push(_),u++,p=setTimeout(k,e.rotate),n(b,t,_.callback)}return setTimeout(k),v}function Un(e){const t={...Ws,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function o(c,l,u){const d=qs(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function s(c){return n.find(l=>c(l))||null}return{query:o,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Vt(){}const Ze=Object.create(null);function Ks(e){if(!Ze[e]){const t=Ve(e);if(!t)return;const n=Un(t),r={config:t,redundancy:n};Ze[e]=r}return Ze[e]}function $n(e,t,n){let r,o;if(typeof e=="string"){const s=ut(e);if(!s)return n(void 0,424),Vt;o=s.send;const a=Ks(e);a&&(r=a.redundancy)}else{const s=St(e);if(s){r=Un(s);const a=e.resources?e.resources[0]:"",c=ut(a);c&&(o=c.send)}}return!r||!o?(n(void 0,424),Vt):r.query(t,o,n)().abort}function Gs(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Z)An(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Qs(e,t){vt||Pn();function n(r){let o;if(!Z[r]||!(o=Dn(r)))return;const s=_n[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=ct(o),!at(o,a+1))return;const c={cached:Math.floor(Date.now()/Ln),provider:e.provider,data:t};return wt(o,fe+a.toString(),JSON.stringify(c))}t.lastModified&&!Gs(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Ht(){}function Zs(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,zs(e)}))}function Xs(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ut(n)))return;s.prepare(n,r,o).forEach(c=>{$n(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=bt(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),Qs(e,l)}catch(u){console.error(u)}Zs(e)})})}))}const Js=e=>{const n=B(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},jt=(e,t)=>{const n=Hs(e,!0,bs()),r=Bs(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Ht)}),()=>{l=!1}}const o=Object.create(null),s=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,s.push(B(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=B(u,d),x=f.pendingIcons||(f.pendingIcons=new Set);x.has(p)||(x.add(p),o[u][d].push(p))}),s.forEach(l=>{const{provider:u,prefix:d}=l;o[u][d].length&&Xs(l,o[u][d])}),t?Vs(t,r,s):Ht},Ys=e=>new Promise((t,n)=>{const r=typeof e=="string"?re(e,!0):e;if(!r){n(e);return}jt([r||e],o=>{if(o.length&&r){const s=ge(r);if(s){t({...he,...s});return}}n(e)})});function Bn(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in kn?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const He={...En,inline:!1},Xe="iconify",dt="iconify-inline",q="iconifyData"+Date.now();let X=[];function xe(e){for(let t=0;t<X.length;t++){const n=X[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function zn(e,t=!1){let n=xe(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},X.push(n),n)}function ei(){if(document.documentElement)return zn(document.documentElement);X.push({node:()=>document.documentElement})}function ti(e){X=X.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function be(){return X}function ni(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let le=null;const oi={childList:!0,subtree:!0,attributes:!0};function Fn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,le&&le(e)}))}function ri(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const o=t[r];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[q]!==void 0){n.paused||Fn(e);return}}}function Vn(e,t){e.observer.instance.observe(t,oi)}function Oe(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(ri.bind(null,e)),Vn(e,n),t.paused||Fn(e))}function Wt(){be().forEach(Oe)}function Hn(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function si(e){const t=le!==null;if(le!==e&&(le=e,t&&be().forEach(Hn)),t){Wt();return}ni(Wt)}function ft(e){(e?[e]:be()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function ii(e){if(e){const t=xe(e);t&&ft(t)}else ft()}function pt(e){(e?[e]:be()).forEach(t=>{if(!t.observer){Oe(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Vn(t,r):Oe(t);else return}})}function ai(e){if(e){const t=xe(e);t&&pt(t)}else pt()}function Wn(e,t=!1){const n=zn(e,t);return Oe(n),n}function qn(e){const t=xe(e);t&&(Hn(t),ti(e))}function ci(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const o in He)if(n[o]!==r[o])return!0;return!1}function li(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const ui=/[\s,]+/;function di(e,t){t.split(ui).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const fi=["width","height"],pi=["inline","hFlip","vFlip"];function mi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function hi(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&re(t,!0);if(!n)return null;const r={...He,inline:e.classList&&e.classList.contains(dt)};fi.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(r.rotate=li(o));const s=e.getAttribute("data-flip");typeof s=="string"&&di(r,s),pi.forEach(c=>{const l="data-"+c,u=mi(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const gi="svg."+Xe+", i."+Xe+", span."+Xe+", i."+dt+", span."+dt;function xi(e){const t=[];return e.querySelectorAll(gi).forEach(n=>{const r=n[q]||n.tagName.toLowerCase()!=="svg"?hi(n):null;r&&t.push({node:n,props:r})}),t}function Kn(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let ue;function bi(){try{ue=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ue=null}}function yi(e){return ue===void 0&&bi(),ue?ue.createHTML(e):e}function Gn(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function Qn(e,t,n,r){const o=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{o.add(c)})}const s=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&s.push(a):(o.add(a),s.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),s}function Zn(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const o=[];for(const s in t)r.getPropertyValue(s)||(o.push(s),r.setProperty(s,t[s]));return o}function Xn(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const o=t.customisations,s=ze(n,o),a=e[q],c=Kn(In(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=yi(c);const l=r.childNodes[0],u=e.attributes;for(let y=0;y<u.length;y++){const h=u.item(y),C=h.name;C!=="class"&&!l.hasAttribute(C)&&l.setAttribute(C,h.value)}const d=Gn(t.icon),p=Qn(l,d,new Set(a&&a.addedClasses),e),f=Zn(l,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),x={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[q]=x,e.parentNode&&e.parentNode.replaceChild(l,e),l}function vi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function wi(e){return"data:image/svg+xml,"+vi(e)}function Si(e){return'url("'+wi(e)+'")'}const ji={display:"inline-block"},mt={"background-color":"currentColor"},Jn={"background-color":"transparent"},qt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Kt={"-webkit-mask":mt,mask:mt,background:Jn};for(const e in Kt){const t=Kt[e];for(const n in qt)t[e+"-"+n]=qt[n]}function Gt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Ci(e,t,n,r){const o=t.customisations,s=ze(n,o),a=s.attributes,c=e[q],l=Kn(s.body,{...a,width:n.width+"",height:n.height+""}),u=Gn(t.icon),d=Qn(e,u,new Set(c&&c.addedClasses)),f={"--svg":Si(l),width:Gt(a.width),height:Gt(a.height),...ji,...r?mt:Jn};o.inline&&(f["vertical-align"]="-0.125em");const x=Zn(e,f,c&&c.addedStyles),y={...t,status:"loaded",addedClasses:d,addedStyles:x};return e[q]=y,e}let Ie=!1;function ki(){Ie||(Ie=!0,setTimeout(()=>{Ie&&(Ie=!1,ne())}))}function ne(e,t=!1){const n=Object.create(null);function r(o,s){const{provider:a,prefix:c,name:l}=o,u=B(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(s&&!Js(o)){const p=n[a]||(n[a]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:be()).forEach(o=>{const s=typeof o.node=="function"?o.node():o.node;if(!s||!s.querySelectorAll)return;let a=!1,c=!1;function l(u,d,p){if(c||(c=!0,ft(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,x=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof x=="boolean"){Ci(u,d,{...he,...p},x);return}}Xn(u,d,p)}xi(s).forEach(({node:u,props:d})=>{const p=u[q];if(!p){const{status:x,icon:y}=r(d.icon,!0);if(y){l(u,d,y);return}a=a||x==="loading",u[q]={...d,status:x};return}let f;if(ci(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){a=a||f.status==="loading",Object.assign(p,{...d,status:f.status});return}}else{if(p.status!=="loading")return;if(f=r(d.icon,!1),!f.icon){p.status=f.status;return}}l(u,d,f.icon)}),o.temporary&&!a?qn(s):t&&a?Wn(s,!0):c&&o.observer&&pt(o)});for(const o in n){const s=n[o];for(const a in s){const c=s[a];jt(Array.from(c).map(l=>({provider:o,prefix:a,name:l})),ki)}}}function Ei(e){const t=xe(e);t?ne(t):ne({node:e,temporary:!0},!0)}function Yn(e,t,n=!1){const r=ge(e);if(!r)return null;const o=re(e),s=Bn(He,t||{}),a=Xn(document.createElement("span"),{name:e,icon:o,customisations:s},r);return n?a.outerHTML:a}function Ii(){return"3.1.1"}function _i(e,t){return Yn(e,t,!1)}function Ti(e,t){return Yn(e,t,!0)}function Li(e,t){const n=ge(e);if(!n)return null;const r=Bn(He,t||{});return ze(n,r)}function Di(e){e?Ei(e):ne()}if(typeof document<"u"&&typeof window<"u"){ei();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Cn(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{si(ne),ne()})}function Ai(e,t){Rn(e,t!==!1)}function Pi(e){Rn(e,!0)}Mn("",$s);if(typeof document<"u"&&typeof window<"u"){Pn();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;On(n,o)||console.error(r)}catch{console.error(r)}}}}const Ri={getAPIConfig:Ve,setAPIModule:Mn,sendAPIQuery:$n,setFetch:As,getFetch:Ps,listAPIProviders:Ls},Mi={_api:Ri,addAPIProvider:On,loadIcons:jt,loadIcon:Ys,iconExists:vs,getIcon:ws,listIcons:xs,addIcon:ys,addCollection:Cn,replaceIDs:In,calculateSize:st,buildIcon:ze,getVersion:Ii,renderSVG:_i,renderHTML:Ti,renderIcon:Li,scan:Di,observe:Wn,stopObserving:qn,pauseObserver:ii,resumeObserver:ai,enableCache:Ai,disableCache:Pi};try{self.Iconify===void 0&&(self.Iconify=Mi)}catch{}function eo({children:e,style:t={},...n}){return i.jsx(vo,{style:t,...n,children:e})}eo.propTypes={children:S.any.isRequired,style:S.object};const A={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},De={added:A.grey,waiting:A.yellow,downloading:A.yellow,extracting:A.yellow,downloaded:A.grey,installing:A.yellow,installed:A.grey,starting:A.yellow,running:A.running,stopping:A.yellow,stopped:A.reverse,error:A.error,upgrading:A.yellow,restarting:A.yellow,corrupted:A.error,deleting:A.yellow,resource:A.primary},Oi={added:"primary",waiting:"info",downloading:"info",extracting:"info",downloaded:"primary",installing:"info",installed:"primary",starting:"info",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"info",restarting:"info",corrupted:"error",deleting:"warning",resource:"primary"};function Ni({isResource:e=!1,status:t,variant:n="tag",progress:r=0,...o}){const{t:s}=m.useContext(tn),a=N.isInProgress(t),c=e&&t==="stopped"?"resource":t,l=s(`blocklet.status.${c}`);return n==="pin"?i.jsx(de,{title:s("blocklet.statusTip",{status:l}),children:i.jsxs(I,{...o,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(o.sx)?o.sx:[o.sx]],children:[i.jsx(I,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:De[c]}}),i.jsx(I,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:De[c]}})]})}):n==="dot"?i.jsx(de,{title:s("blocklet.statusTip",{status:l}),children:i.jsx(Fr,{color:De[c],...o})}):i.jsxs(eo,{type:Oi[c],...o,children:[a&&i.jsx(V,{size:12,color:"inherit",style:{marginRight:5}}),l,c==="downloading"&&r?i.jsx("div",{style:{marginLeft:5},children:`${r} %`}):null]})}Ni.propTypes={status:S.string.isRequired,variant:S.oneOf(["dot","tag","pin"]),source:S.string,progress:S.number,isResource:S.bool};function to({infos:e=[]}){const{t}=U(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const r=e.map(o=>`* ${o.label}: ${o.value}`).join(`
43
- `);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
44
-
45
-
46
-
47
- <!--
48
- [Server Info]
49
- ${r}
50
- * Page: ${window.location.href}
51
- -->
52
- `),L(I,{sx:{mx:{xs:0,md:2}},children:L(_e,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}to.propTypes={infos:S.arrayOf(S.shape({label:S.string,value:S.string}))};var Je,Qt;function Ui(){return Qt||(Qt=1,Je={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}}),Je}var Ye,Zt;function $i(){return Zt||(Zt=1,Ye={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),Ye}var et,Xt;function no(){if(Xt)return et;Xt=1;const e=new Map;return et={registerLang:(r,o)=>{e.set(r,o)},getLang:(r="en_US")=>e.get(r)||e.get("en_US")},et}var tt,Jt;function Bi(){return Jt||(Jt=1,tt=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}}),tt}var nt,Yt;function zi(){if(Yt)return nt;Yt=1;const e=Bi(),{getLang:t}=no(),n=(o,s)=>s===1?o:`${o}s`,r=1e-7;return nt=(o,s={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const a=t(s.locale),c=[],l=(p,f)=>{const x=Math.floor(p*10**f+r);return(Math.round(x)/10**f).toFixed(f)},u=(p,f,x)=>{if((c.length===0||!s.colonNotation)&&p===0&&!(s.colonNotation&&f==="minute"))return;const{long:y}=a[f]||t("en_US")[f],{short:h}=a[f]||t("en_US")[f];let C=(x||p||"0").toString(),v,j;if(s.colonNotation){v=c.length>0?":":"",j="";const g=C.includes(".")?C.split(".")[0].length:C.length,E=c.length>0?2:1;C="0".repeat(Math.max(0,E-g))+C}else v="",s.locale==="zh_CN"?Object.values(d).filter(g=>g>0).length>1?!d.days&&!d.hours&&d.minutes&&s.compact?j=y:j=h:d.minutes?j=y:j=h:j=s.verbose?` ${n(y,p)}`:h;c.push(v+C+j)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&o<1e3)if(u(d.seconds,"second"),s.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,x=p>=1?Math.round(p):Math.ceil(p),y=f?p.toFixed(f):x;u(Number.parseFloat(y,10),"millisecond",y)}else{const p=o/1e3%60,f=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,x=l(p,f),y=s.keepDecimalsOnWholeSeconds?x:x.replace(/\.0+$/,"");u(Number.parseFloat(y,10),"second",y)}if(c.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return s.locale==="zh_CN"?`0${s.verbose?`${p}`:f}`:`0${s.verbose?` ${p}s`:f}`}if(s.compact)return c[0];if(typeof s.unitCount=="number"){const p=s.colonNotation?"":" ";return c.slice(0,Math.max(s.unitCount,1)).join(p)}return s.colonNotation?c.join(""):c.join(" ")},nt}var ot,en;function Fi(){if(en)return ot;en=1;const e=Ui(),t=$i(),{registerLang:n}=no(),r=zi();return n("en_US",e),n("zh_CN",t),r.registerLang=n,ot=r,ot}var Vi=Fi();const oo=Zo(Vi);function H({children:e}){return oe(n=>n.breakpoints.down("md"))?i.jsx(de,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(I,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Tt,{fontSize:"small"})})}):i.jsxs(I,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Tt,{fontSize:"small"}),e]})}H.propTypes={children:S.node.isRequired};const Hi="https://launcher.arcblock.io/",Wi=30*24*60*60*1e3;function ro({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",retention:o=0,sx:s={},...a}){const{t:c,locale:l}=U(),u=Be(),[d,p]=bn({safeIframeRef:null,popoverAnchorEl:null}),f=m.useRef(null),x=pe(),y=oe(b=>b.breakpoints.down("md")),h=y?"mobile":"desktop",C=xn(async()=>{const[b,_]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),pn({launcherUrl:e||Hi,nftDid:n,launcherSessionId:r,locale:l,theme:x.palette.mode})]);if(b?.error)throw new Error(b.error);return{launcherSession:b.launcherSession,subscriptionURL:_}},[l]);if(C.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!y&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...s},...a,retention:o});if(C.error)return console.error(C.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...s},...a,retention:o,onClick:()=>C.retry()});const v=b=>{p({popoverAnchorEl:b.currentTarget})},j=()=>{p({popoverAnchorEl:null})},g=C.value?.launcherSession;let E="success";[P.LAUNCH_SESSION_STATUS.overdue,P.LAUNCH_SESSION_STATUS.canceled,P.LAUNCH_SESSION_STATUS.terminated].includes(C.value?.launcherSession?.status)&&(E="error");let k=null;if(g.expirationDate&&!g.subscription){const b=te(g.expirationDate).diff(te(),"ms");k=c(`expiration.${h}.tips.${E}`,{validity:oo(b,{locale:mn(l),compact:!0,verbose:!0})}),b>0&&b<=Wi&&(E="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(Q,{label:i.jsx(H,{children:k||g?.subscription?.product?.name||c("common.subscription")}),color:E,variant:E!=="success"?"contained":"outlined",sx:{cursor:"pointer",...s},...a,retention:o,onClick:v}),i.jsx(ln,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(I,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:C.value?.subscriptionURL})})})]})}ro.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};const qi=30*24*60*60*1e3,Ki="https://launcher.arcblock.io/";function so({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",sx:o={},retention:s=0,...a}){const{t:c,locale:l}=U(),[u,d]=bn({safeIframeRef:null,popoverAnchorEl:null}),p=m.useRef(null),f=oe(b=>b.breakpoints.down("md")),x=Be(),y=f?"mobile":"desktop",h=xn(async()=>{const[b,_]=await Promise.all([x.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),pn({launcherUrl:e||Ki,nftDid:n,launcherSessionId:r,locale:l})]);if(b?.error)throw new Error(b.error);return{launcherSession:b.launcherSession,subscriptionURL:_}},[l]);if(h.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!f&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:s});if(h.error)return console.error(h.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:s,onClick:()=>h.retry()});const C=h.value?.launcherSession?.expirationDate,v=te(C).isBefore(te()),j=te(C).diff(te(),"ms");let g="success";j<=qi&&(g="warning"),v&&(g="error");const E=b=>{d({popoverAnchorEl:b.currentTarget})},k=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[h.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c("expiration.desktop.nextInvoice",{date:rr(C,l)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:E}),!h.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.tips.${g}`,{validity:oo(j,{locale:mn(l),compact:!0,verbose:!0})})}),color:g,variant:g!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:E}),i.jsx(ln,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(I,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0},src:h.value?.subscriptionURL})})})]})}so.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};function io({meta:e={},fallbackUrl:t=Ge,invalidPathFallback:n=null,headerAddons:r=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=Ge}},links:s=[],showDomainWarningDialog:a=!0,...c}){sr();const l=m.use(ir)?.session?.user,u=l?.role,{locale:d}=U()||{},p=m.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return ar(j)}catch(g){return console.error("Failed to format blocklet info",g,j),j}},[e]),{localizedNav:f,flattened:x,matchedIndex:y}=m.useMemo(()=>{let j=cr(p?.navigation?.dashboard,d)||[];j=lr(j,u),j=ur(j,k=>{let b=null;return k.icon&&(k.icon.startsWith("http")||k.icon.startsWith("data:")?b=i.jsx(on,{src:k.icon}):b=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:k.icon})),{id:k.id,title:k.title,url:k.link,icon:b,external:!0,children:k.items}},"items");const g=dr(j).filter(k=>!!k.url),E=fr(g.map(k=>k.url));return E!==-1&&(g[E].active=!0),{localizedNav:j,flattened:g,matchedIndex:E}},[p,d,u]),h=typeof s=="function"?s(f):[...f,...s],C=pr({meta:e});if(m.useLayoutEffect(()=>{l&&!x?.length&&t&&(window.location.href=t)},[t]),m.useLayoutEffect(()=>{l&&x?.length&&y===-1&&n&&n()},[n,x,y]),!p.appName)return null;const{appName:v}=p;return i.jsx(Vr,{title:v,fullWidth:!0,sidebarWidth:128,legacy:!1,links:h,...c,headerProps:{homeLink:Ge,logo:i.jsx("img",{src:C,alt:"logo"}),addons:i.jsx(mr,{formattedBlocklet:p,addons:r,sessionManagerProps:o,showDomainWarningDialog:a}),...c.headerProps}})}io.propTypes={meta:gr,fallbackUrl:S.string,invalidPathFallback:S.func,headerAddons:S.oneOfType([S.func,S.node]),sessionManagerProps:hr,links:S.oneOfType([S.array,S.func]),showDomainWarningDialog:S.bool};const Gi={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},Qi="/.well-known/service/onboard/bind-account";function ao({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:r="",defaultPath:o=Qi,...s}){const[a,c]=m.useState(t),[l,u]=m.useState(!1),[d,p]=m.useState(()=>{const g=localStorage.getItem("wizard-current-url");return g?.includes("/.well-known/service/onboard")?g:o}),f=m.useRef(e),x=m.useRef(),y=m.useRef(null),{locale:h}=U(),C=pe(),v=oe(C.breakpoints.down("sm"));if(f.current=e,x.current=()=>{if(y.current?.contentWindow)try{const g=new URL(y.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",g),p(g)}catch(g){p(o),console.warn("Failed to save wizard URL:",g)}localStorage.setItem("wizard-completed","true"),c(!1),n(!1)},m.useEffect(()=>{t!==a&&c(t)},[t]),m.useEffect(()=>{!a&&l&&u(!1)},[a]),m.useEffect(()=>{const g=E=>{if(E.origin!==window.location.origin)return;const{type:k,data:b}=E.data||{};switch(k){case"wizard.loaded":u(!0);break;case"wizard.finished":{c(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true");const _=f.current?.(b);_ instanceof Promise?_.then(R=>{R!==!1&&window.location.reload()}):_!==!1&&window.location.reload();break}case"wizard.close":{x.current();break}}};return window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}},[]),m.useEffect(()=>{localStorage.getItem("wizard-completed")||c(!0)},[]),!a)return null;const j=hn(W(window.location.origin,d),{locale:h});return i.jsxs(un,{id:"wizard-dialog",open:a,onClose:()=>x.current(),fullWidth:!0,maxWidth:v?!1:"md",fullScreen:v,...s,slotProps:Rr({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...v?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},s.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...s.sx},children:[i.jsx("iframe",{ref:y,id:"wizard-iframe",src:j,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:l?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),l?null:i.jsx(I,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(I,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(V,{}),typeof r=="string"?i.jsx(ee,{variant:"body1",children:r}):r]})})]})}ao.propTypes={onFinished:S.func,show:S.bool,onChangeVisible:S.func,loadingText:S.node,defaultPath:S.string,...un.propTypes};const Zi={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function Xi(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1),{t:o}=U(),s=m.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return i.jsxs(i.Fragment,{children:[i.jsx(de,{title:o("setup.wizardTooltip"),open:e,placement:"bottom",arrow:!0,children:i.jsx(Ne,{size:"small",onClick:()=>{r(!0),t(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...e&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(rn,{icon:Zi,height:20})})},`wizard-toggle-${e}`),i.jsx(ao,{show:n,loadingText:i.jsxs(I,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(Et,{variant:"h4",sx:{fontWeight:"bold"},children:o("setup.wizardLoading")}),!s&&i.jsx(Et,{variant:"body2",sx:{textAlign:"center"},children:o("setup.wizardSubTitle")})]}),onChangeVisible:a=>{r(a),!a&&n&&t(!0)},onFinished:()=>{r(!1),t(!1)}},"wizard-modal")]})}function Ji(){const{inFullPage:e,toggleFullPage:t}=Hr();return L(Ne,{onClick:t,children:e?L(qo,{sx:{transform:"scale(1.3)"}}):L(Ko,{sx:{transform:"scale(1.3)"}})})}function co({children:e=null,title:t=""}){const{t:n}=U(),{loading:r,error:o,actions:{refreshBlocklet:s},env:a,blocklet:c}=me(),{info:l,imgPrefix:u}=xr(),d=Xo(),p=oe(E=>E.breakpoints.down("md")),f=pe(),{appId:x,version:y}=a,h=[{label:"App ID",value:x},{label:"App Version",value:y},{label:"App Bundle Name",value:c?.meta?.bundleName},{label:"Server Id",value:l.did},{label:"Server Version",value:l.version}],C=E=>{const k=Array.isArray(E)?E:[E];if(k.unshift(L(Xi,{})),p||k.unshift(L(Ji,{})),c){const b={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};yr(c)?k.unshift(L(ro,{chainHost:c?.controller?.chainHost,nftId:c?.controller?.nftId,launcherSessionId:c?.controller?.launcherSessionId,launcherUrl:c?.controller?.launcherUrl,sx:b})):l.ownerNft&&l.launcher&&k.unshift(L(so,{chainHost:l.launcher.chainHost,launcherUrl:l.launcher.url,nftId:l.ownerNft.did,launcherSessionId:l.ownerNft.launcherSessionId,sx:b}))}return k},v=$r({blocklet:c}),j={logo:v?L("img",{src:v,alt:"logo"}):null,brandAddon:L(I,{children:c&&ke(I,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[L(de,{title:N.isRunning(c?.status)?void 0:n(`blocklet.status.${c?.status}`),children:L(I,{sx:{bgcolor:De[c?.status],width:8,height:8,borderRadius:"50%"}})}),L(I,{sx:{color:"text.secondary",maxWidth:p?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.getDisplayName(c)}),L(I,{component:rn,icon:Gi,sx:{color:"text.secondary"}})]})})};return ke(Yi,{legacy:!1,fullWidth:!0,headerAddons:C,headerProps:j,links:E=>E?.map(b=>(b.children=b.children?.map(_=>{if(_.id==="/team/aigne"){const R=u?W(u,"/aigne-hub.png"):"/aigne-hub.pg";return{..._,icon:L(on,{src:R,alt:"AIGNE Hub",style:f.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:_.icon})}}return _}),b)),title:t,footerProps:{addon:L(to,{infos:h})},children:[!c&&r&&L(Ae,{relative:"parent",children:L(V,{})}),!c&&o&&ke(Ae,{relative:"parent",children:[ke(I,{sx:{display:"flex",alignItems:"center"},children:[L(Wo,{color:"error",sx:{marginRight:1}}),xt(o)]}),L(ht,{onClick:()=>s(),children:L("span",{style:{textDecoration:"underline"},children:n("common.retry")})})]}),!!c&&L(I,{sx:{flex:1,padding:p?2:3,display:"flex",flexDirection:"column"},children:L(wo,{FallbackComponent:br,resetKeys:[d.pathname],children:e})})]})}co.propTypes={children:S.any,title:S.string};const Yi=Ue(io)`
53
- div.dashboard-content {
54
- padding: 0;
55
- }
56
- .header-addons .locales {
57
- max-height: 400px;
58
- overflow-y: auto;
59
- }
60
-
61
- .header-brand-addon {
62
- display: block;
63
- }
64
- `;function ea(){const{t:e,locale:t}=U(),{blocklet:n,launcherSession:r,refreshSubscription:o}=me(),{connectApi:s,session:a,api:c}=vr(),[l,u]=m.useState(!1),[d,p]=m.useState(""),[f,x]=Mr({subscriptionURL:"#"});if(m.useEffect(()=>{(Dt(n,r)||At(r))&&wr({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{x({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),m.useEffect(()=>{if(n.controller?.launcherUrl){const v=W(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(j=>j.json()).then(j=>{const g=j.componentMountPoints?.find(k=>k.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,E=W(n.controller.launcherUrl,g);p(E)})}},[n.controller?.launcherUrl]),!n||!r)return"";let y=null,h="",C="error";return Sr(r)?(y=jr(r)?i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(Go,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:se(r?.reservedUntil,t)})):At(r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:se((r?.subscription?.cancel_at||0)*1e3,t)}),C="warning"):Dt(n,r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:se(r?.reservedUntil,t),canceledAt:se((r?.subscription?.canceled_at||0)*1e3,t)})):Cr(n,r)&&(y=i.jsx(dn,{to:W(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:se(r?.terminatedAt,t),deadline:kr(r?.terminatedAt,t)})),h?i.jsxs(i.Fragment,{children:[i.jsxs(gt,{severity:C,sx:{mb:1},children:[h,i.jsx(ee,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:y})]}),l&&d&&r&&i.jsx(Er,{session:a,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:i.jsx(Wr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const ta=m.lazy(()=>T(()=>import("./log-BZZMcnOo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),na=m.lazy(()=>T(()=>import("./index-C0n8v4Cp.js"),__vite__mapDeps([14,2,1,5,4,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,3,40,41,42,43,44,45]))),oa=m.lazy(()=>T(()=>import("./index-BRr23LOn.js"),__vite__mapDeps([46,4,2,1,5,6,7,8,15,9,10,11,19,20,21,22,47,48,33,29,38,49]))),ra=m.lazy(()=>T(()=>import("./index-CPzKPZVk.js"),__vite__mapDeps([50,2,1,9,4,5,6,7,8,10,11,33,29,20,18,51,12,39,52,24,53,42,54,55,27,56,57,58,40,59,60,61,62,63,64]))),sa=m.lazy(()=>T(()=>import("./overview-ChSvzQtv.js"),__vite__mapDeps([65,1,2,4,5,6,7,8,66,67,9,10,11,32,41,31,19,20,21,22,18,68,69,70,55,3,29,33,40,42,43,44,45]))),ia=m.lazy(()=>T(()=>import("./domains-ItVUzQLa.js"),__vite__mapDeps([71,2,4,1,5,6,7,8,9,10,11,72,42,23,20,41,31,33,29,38,60,24,30,32,73,54]))),aa=m.lazy(()=>T(()=>import("./index-CgNRJie5.js"),__vite__mapDeps([74,2,6,5,1,4,7,8,9,10,11,18,19,20,21,22,75,15,35,36,47,76,23,77,78,79,33,29,52,42,80]))),ca=m.lazy(()=>T(()=>import("./appearance-Bw11KiXQ.js"),__vite__mapDeps([81,5,2,9,1,4,6,7,8,10,11,47]))),la=m.lazy(()=>T(()=>import("./audit-logs-CsQOeDrk.js"),__vite__mapDeps([82,4,2,1,5,6,7,8,9,10,11,35,36,3,62,63,39,64,19,20,21,22]))),ua=m.lazy(()=>T(()=>import("./index-7ARWVbTs.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,48,21,84,85,86,39,32,87,88,12,19,20,22,15,35,36,18,89,41,31,90,91,29,92,93,27,28,47]))),da=m.lazy(()=>T(()=>import("./config-navigation-B8lmgCq0.js"),__vite__mapDeps([94,2,1,4,5,6,7,8,9,10,11,69,78,95,96,48,97,19,20,21,22,55,98,56,57,90,29,3,33,40,41,31,42,43,44,45]))),fa=m.lazy(()=>T(()=>import("./index-DR0oTIfe.js"),__vite__mapDeps([99,1,2,6,5,9,4,7,8,10,11,47,100,101,67,76,55,102,103,70,29,32,93,40,104,61,52]))),pa=m.lazy(()=>T(()=>import("./index-B4vHuy5A.js"),__vite__mapDeps([105,4,2,1,5,6,7,8,9,10,11,48,104,61,84,85,66,32,36,47]))),ma=m.lazy(()=>T(()=>import("./security-PrkTELzO.js"),__vite__mapDeps([106,4,2,1,5,6,7,8,9,10,11,48,97,19,20,21,22,107,47]))),ha=m.lazy(()=>T(()=>import("./branding-DnBXFIg2.js"),__vite__mapDeps([108,2,1,4,5,6,7,8,9,10,11,109,69,95,110,85,111,79,23,20,22,112,84]))),ga=m.lazy(()=>T(()=>import("./advanced-B05ps9YS.js"),__vite__mapDeps([113,2,1,9,4,5,6,7,8,10,11,23,20,33,29,42,84,85,24,19,21,22,32,18,68,69]))),xa=m.lazy(()=>T(()=>import("./traffic-B3OSPNpZ.js").then(e=>e.t),__vite__mapDeps([89,2,9,1,4,5,6,7,8,10,11,41,31,90,91,29,92,93,27,28]))),ba=m.lazy(()=>T(()=>import("./runtime-DsOc3CI-.js"),__vite__mapDeps([114,2,1,4,5,6,7,8,9,10,11,101,92,93,12,3,29,33,40,20,19,21,22,41,31,42,43,44,45]))),ya=m.lazy(()=>T(()=>import("./index-ZddejrLr.js"),__vite__mapDeps([115,2,1,4,5,6,7,8,29,15,9,10,11,75,18,35,36,19,20,21,22,25,26,27,28,33,24,67,60,23,12,38,47,49]))),va=m.lazy(()=>T(()=>import("./list-dUYG3Ahk.js"),__vite__mapDeps([116,2,4,1,5,6,7,8,15,9,10,11,41,31,17,19,20,21,22,48,25,26,27,28,51,24,60,33,29,75,18,35,36,38,49,47]))),wa=m.lazy(()=>T(()=>import("./index-O8QTFET3.js"),__vite__mapDeps([117,2,4,1,5,6,7,8,9,10,11,55,49,47,19,20,21,22]))),Sa=m.lazy(()=>T(()=>import("./config-CZieYCwq.js").then(e=>e.c),__vite__mapDeps([118,2,1,6,5,21,9,4,7,8,10,11,84,85,111,110,79,58,40,95,29,15]))),ja=m.lazy(()=>T(()=>import("./observability-F2NkCkza.js"),__vite__mapDeps([119,1,2]))),Ca=m.lazy(()=>T(()=>import("./playground-CTvnZW2L.js"),__vite__mapDeps([120,1,2]))),ka=m.lazy(()=>T(()=>import("./component-LYdOEk37.js"),__vite__mapDeps([121,1,2,5,4,6,7,8,9,10,11,29,104,61,23,20,27,91,96,57,109,69,95,24,76,122,59,60,33,40,18,58,123,124,54,103,70,55,85,125,77,78,111,112,86,62,63,118,21,84,110,79,15,3,32,73,47,126,102,100,101,67,127,128,80,90,12,38,19,22,41,31,42,43,44,45]))),Ea=m.lazy(()=>T(()=>import("./index-B4oI4SXk.js"),__vite__mapDeps([129,1,2,4,5,6,7,8,9,10,11]))),Ia=W(P.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),_a=e=>{const{enqueueSnackbar:t}=nn(),n=m.useCallback(r=>hn(Ia,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Lr(`${e}/${P.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:a}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(a,{variant:s,autoHideDuration:c?null:5e3,content:l=>i.jsx(as,{viewAllUrl:o,keyId:l,notification:r,content:i.jsx(zr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function lo({blocklet:e,isAdmin:t}){return t?i.jsx(ua,{blocklet:e}):i.jsx(Ar,{status:403})}lo.propTypes={blocklet:S.object.isRequired,isAdmin:S.bool.isRequired};const Ta=e=>{const{t}=U(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=me(),a=n?.meta?.did,c=!n||Dr(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:i.jsx(Qo,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),labelText:t("common.components"),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],aigne:[{label:t("setup.aigne.config"),value:"aigne-config"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:n?.children?.length&&n.structVersion===P.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:sa,components:ka,members:i.jsx(na,{type:"blocklet",createPassportSvg:Pt}),passports:i.jsx(aa,{createPassportSvg:Pt}),settings:i.jsx(pa,{orientation:"vertical"}),security:i.jsx(ma,{}),"did-spaces":i.jsx(fa,{navOrientation:"horizontal"}),domains:ia,branding:i.jsx(ha,{blocklet:n,onUpdate:r}),theming:i.jsx(ca,{}),navigation:da,sitemap:i.jsx(jo,{children:t("common.comingSoon")}),notifications:i.jsx(lo,{blocklet:n,isAdmin:e}),"audit-logs":i.jsx(la,{scope:a,categories:["blocklet","team","security","certificates","gateway"]}),analytics:i.jsx(xa,{client:o,did:s}),advanced:i.jsx(ga,{blocklet:n,onUpdate:r}),webhooks:i.jsx(oa,{}),"access-keys":i.jsx(ya,{}),"mcp-servers":i.jsx(wa,{}),logs:ta,performance:i.jsx(ba,{client:o,did:s}),docs:Ea,publish:i.jsx(ra,{}),oauth:i.jsx(va,{}),"aigne-config":i.jsx(I,{sx:{maxWidth:1536},children:i.jsx(Sa,{})}),"aigne-observability":i.jsx(ja,{}),"aigne-playground":i.jsx(Ca,{})};return{tabGroups:l,renders:u}};function La(){const e=fn(),{tab:t="overview",subtab:n}=Jo(),{locale:r}=U(),{blocklet:o,refreshFlag:s}=me(),{session:a}=gn(),c=ae(()=>a?.user?.did,[a]),l=qr(),u=ae(()=>a.user?.role&&_r.includes(a.user.role),[a]);_a(c);const{tabGroups:d,renders:p}=Ta(u),f=g=>{e(`${P.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${g}`)},x=(d[t]||[]).filter(g=>g.show===void 0||g.show),y=(x||[]).find(g=>g.value===n)?.value||x?.[0]?.value||t,h=p[y]||p.overview,C=["overview"].includes(t),v=o?i.jsxs(vn,{type:"components",children:[x.length>0&&i.jsxs(I,{sx:{mb:2,display:"flex",alignItems:"center",gap:2},children:[i.jsx(So,{tabs:x,current:y,onChange:f,scrollButtons:"auto"}),C&&!l&&i.jsx(I,{sx:{flex:1,display:"flex",justifyContent:"flex-end"},children:i.jsx(I,{component:"div",className:"page-header",children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null})})]}),i.jsx(I,{className:"page-content",children:i.jsx(m.Suspense,{fallback:i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),children:m.isValidElement(h)?h:i.jsx(h,{blocklet:o})})})]}):i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),j=ae(()=>{const g=window.blocklet?.navigation?.find(M=>M.id==="/team"&&M.section==="dashboard"),E=o?.meta?.title||"";let k="";if(g){const M=W(P.WELLKNOWN_BLOCKLET_ADMIN_PATH,t,t==="publish"?n:"");k=g.items.find(We=>We.link===M)?.title?.[r]||""}const b=x.find(M=>M.value===n),R=[b?.labelText||b?.label||x?.[0]?.labelText||x?.[0]?.label||"",k].filter(Boolean).join(" - ");return E?R?`${R} | ${E}`:E:R||""},[t,n,o,r]);return i.jsx(Tr,{children:i.jsx(Br,{children:i.jsx(co,{title:j,children:i.jsxs(Aa,{children:[l&&C&&i.jsx(I,{component:"div",className:"page-header",sx:{mb:2},children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null}),i.jsx(Yr,{}),i.jsx(ea,{}),v]})},`${s}`)})})}function Da(){const{blocklet:e}=me(),t=e?.meta?.did;return m.useEffect(()=>{const n=Ir();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(La,{})}const Aa=Ue.main`
65
- .page-header {
66
- display: flex;
67
- justify-content: space-between;
68
- align-items: center;
69
- flex-wrap: wrap;
70
- gap: 16px;
71
- }
72
-
73
- .page-title {
74
- display: flex;
75
- align-items: center;
76
-
77
- .page-link {
78
- font-size: 15px;
79
- margin-top: 8px;
80
- margin-left: 8px;
81
- }
82
- }
83
-
84
- @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
85
- .page-header {
86
- flex-direction: column;
87
- align-items: flex-start;
88
- .page-actions,
89
- .MuiButtonGroup-root {
90
- width: 100%;
91
- }
92
- .MuiButtonGroup-root {
93
- .MuiButtonBase-root {
94
- flex: 1;
95
- }
96
- .blocklet-action-text {
97
- display: none;
98
- }
99
- }
100
- }
101
-
102
- .page-title {
103
- margin-bottom: 15px;
104
- }
105
- }
106
- `,Ja=Object.freeze(Object.defineProperty({__proto__:null,default:Da},Symbol.toStringTag,{value:"Module"}));export{Ni as B,io as F,eo as W,Y as b,Ja as d,oo as p,Xa as u};
@@ -1,9 +0,0 @@
1
- import{j as o,ak as i,at as k,W as u}from"./vendor-mui-core-B7zoO8f5.js";import{m as v,f as C,a9 as b,e as B}from"./index-Dg-fihjm.js";import{D as E,a as I,b as w}from"./domain-action-card-CDmXQx1H.js";import{G as T}from"./vendor-ux-Br1Zu4eg.js";import{a as W}from"./page-header-CSMnIoYZ.js";import{r,u as A}from"./vendor-react-Dvs43sk9.js";import{u as L}from"./useSetState-DFuQZPPV.js";import{S as x}from"./button-B0AX6HJx.js";import{S as $}from"./layout-CkPC48Ju.js";import{S as z}from"./step-actions-CRPdOrrx.js";import"./vendor-arcblock-B6isO619.js";import"./vendor-utils-DtY42AM-.js";import"./vendor-hooks-BRXKH6Nb.js";import"./permission-CcwCK5jk.js";import"./session-CccpevO4.js";import"./useAsyncRetry-D4-sRZN-.js";import"./useAsync-BrMo9m7W.js";import"./confirm-B-Pohnpi.js";import"./index-DBs9Ljax.js";import"./actions-Bf4UKTeu.js";import"./delete-confirm-DkSfjrm9.js";import"./click-to-copy-CNVY2jyw.js";import"./useAsync-CsYRBczg.js";import"./index-CpZPMhFT.js";import"./util-xGYUIoLs.js";import"./engine-Bd6Eh0_C.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-DoBqUAz1.js";import"./use-mobile-DM4d_PLd.js";function h({onNext:a=()=>{},onPrevious:f=()=>{}}){const{t:s}=r.useContext(T),[D,d]=r.useState(!1),{blocklet:e}=v(),[p,S]=r.useState(""),j=((e?.site||{}).domainAliases||[]).map(t=>C.replaceSlotToIp(t.value,p)),[n,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=e.environments?.find(t=>t.key==="BLOCKLET_APP_PK")?.value,y=j.find(t=>b.isDidDomain(t)),[l,P]=A();return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{S(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(H,{children:[o.jsx(i,{className:"header",children:o.jsx(W,{title:s("setup.domain.title"),subTitle:s("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem"},children:o.jsx(i,{sx:{display:"inline"},children:`${s("setup.domain.buyOrConnect")} (${s("common.optional")})`})}),o.jsx(i,{sx:{mt:1},children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:y,currentIp:p,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),d(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const g={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(g),a()},onError:d}})})]}),o.jsx(i,{children:o.jsx(w,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1},children:o.jsx(i,{sx:{display:"inline"},children:s("setup.domain.skipDescription")})})})})]}),o.jsx(z,{mt:8,disabled:!!n.addDomainState.text,blocklet:e,onStartNow:()=>a("complete"),children:n.domain?o.jsx(x,{variant:"contained",loading:!!n.addDomainState.text,disabled:D||!!n.addDomainState.text||!n.domain,onClick:()=>a(),children:n.addDomainState.text||s("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!n.addDomainState.text,onClick:()=>a(),children:s("setup.continue")})})]})}function ht(a){return o.jsx(E,{children:o.jsx(h,{...a})})}h.propTypes={onNext:u.func,onPrevious:u.func};const H=k($)`
2
- height: 100%;
3
- overflow-y: hidden;
4
-
5
- .form {
6
- width: 100%;
7
- height: 100%;
8
- }
9
- `;export{ht as default};
@@ -1 +0,0 @@
1
- import{a1 as e}from"./index-Dg-fihjm.js";var a=e();export{a as e};
@@ -1 +0,0 @@
1
- import{j as e,ak as r,T as v,a6 as E,b1 as J,Q as P,a$ as Q,D as V,aX as M,bM as O,b0 as X}from"./vendor-mui-core-B7zoO8f5.js";import{r as p,i as Y,u as Z}from"./vendor-react-Dvs43sk9.js";import{O as ee,a as ne,e as se,U as W,t as oe,at as te,c as re}from"./index-Dg-fihjm.js";import{n as S,C as R}from"./vendor-utils-DtY42AM-.js";import{g as q,b as d,n as ie,o as ae}from"./vendor-hooks-BRXKH6Nb.js";import{M as $,T as H,a4 as ce,C as F}from"./vendor-ux-Br1Zu4eg.js";import{o as le}from"./vendor-arcblock-B6isO619.js";import{K as ue}from"./landing-page-D7Nuam-y.js";import{B as de,a as pe,l as he}from"./index-Df2pSXXR.js";import{u as xe}from"./use-window-close-DnNlurow.js";import"./lottie-web-4koyQiv_.js";function fe({requestAppInfo:i,currentAppInfo:y}){return e.jsxs(r,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx($,{src:y.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(r,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"divider",mx:.5}},children:[e.jsx(r,{className:"dot"}),e.jsx(r,{className:"dot"}),e.jsx(r,{className:"dot"})]}),e.jsx($,{src:i.appLogo,alt:i.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(v,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(r,{component:"span",sx:{color:"primary.main"},children:i.appName})]})]})}const me={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function ge({session:i,requestAppInfo:y,currentAppInfo:T,children:_=null,userInfo:o=void 0,hideSwitchConnect:k=!1,hideAuthorize:n=!1,hideCancel:z=!1,hideButton:b=!1,notThisText:N=void 0,authorizeText:t=void 0,connectText:a=void 0,cancelText:L=void 0,useAnotherText:C=void 0,slotProps:l=void 0,onConnect:I=S,onAuthorize:U=S,onSwitchConnect:D=S,onCancel:x=S,ref:w}){const c=q({loading:!1}),{locale:A="en"}=H()||{},h=d((j,G={})=>ce(me,j,A,"en",G)),f=d(()=>{c.loading=!1}),s=d(()=>{c.loading=!0,I?.(f)}),u=d(()=>{c.loading=!0,D?.(f)}),m=d(()=>{c.loading=!0,U?.(f)}),B=d(()=>{x?.()});if(p.useImperativeHandle(w,()=>({closeLoading:f})),i.loading||!i.initialized)return e.jsx(le,{children:e.jsx(E,{})});const g=o??i?.user;return e.jsx(ue,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(r,{...l?.root,sx:F({width:420,maxWidth:"100%"},l?.root?.sx),children:e.jsx(ee,{hideCloseButton:!0,...l?.didConnectContainer,children:e.jsxs(r,{...l?.contentContainer,sx:F({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},l?.contentContainer?.sx),children:[e.jsx(fe,{requestAppInfo:y,currentAppInfo:T}),g?e.jsxs(e.Fragment,{children:[e.jsx(de,{user:g,showDid:!0,cardType:he.Detailed,infoType:pe.Minimal}),e.jsx(r,{})]}):null,_,b?null:e.jsxs(e.Fragment,{children:[e.jsx(r,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(J,{direction:"row",spacing:2,children:[z?null:e.jsx(P,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:B,sx:{color:"grey.500"},children:L||h("cancel")}),g&&!n?e.jsxs(P,{variant:"contained",size:"large",fullWidth:!0,onClick:m,disabled:c.loading,children:[c.loading?e.jsx(E,{size:20,sx:{mr:1}}):null,t||h("authorize")]}):e.jsxs(P,{variant:"contained",size:"large",fullWidth:!0,disabled:c.loading,onClick:s,children:[c.loading?e.jsx(E,{size:20,sx:{mr:1}}):null,a||h("connect")]})]})]}),k||!g?null:e.jsx(r,{sx:{textAlign:"center"},children:e.jsxs(v,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[N||h("notThis")," ",e.jsx(Q,{underline:"hover",onClick:u,sx:{cursor:"pointer"},children:C||h("useAnother")})]})})]})})})})}const je=R(window.location.origin,re.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),K=3e3;function Ne(){const i=p.useRef(null),[y,T]=p.useState(),[_]=ie({targetDate:y}),{session:o}=ne(),k=V(),n=q({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[z,b]=ae("currentUserInfo",{defaultValue:null}),N=Y(),{t}=H(),[a]=Z(),L=xe(),[,C]=p.useState(!0),[l,I]=p.useState({appName:a.get("cli")?a.get("appName")??t("aigne.cli"):"",appLogo:a.get("cli")?a.get("appLogo"):""}),U=async()=>{C(!0);try{const s=a.get("__url__"),u=s?W(s):null;if(!u){C(!1);return}const m="__blocklet__.js?type=json",g=new URL(u).origin,{data:j}=await te.get(R(g,m));I({appName:j?.appName,appUrl:j?.appUrl,appLogo:R(j?.appUrl,j?.appLogo)})}catch(s){console.error(s)}finally{C(!1)}},D=()=>{U(),o.user&&b(o.user);try{const s=new URL(window.location.href);if(s.hash.includes("invalid")){n.invalidSession=!0;return}const u=s.searchParams.get("__token__"),m=u?W(u):null;if(!m)throw new Error("No token");n.token=m,n.ready=!0}catch(s){n.invalidSession=!0,n.error=s.message,window.opener?.postMessage({type:"connect-aigne-message",error:s.message},"*"),N("#invalid",{replace:!0})}};p.useLayoutEffect(()=>D(),[]);const x=window.blocklet,w=a.get("source")||"Generate Access Key",c=d(async s=>{try{await se.post("/access-key/authorize",{source:w,sid:n.token}),n.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),a.has("closeOnSuccess")&&(T(Date.now()+K),setTimeout(()=>L(),K))}catch(u){console.error(u)}finally{s()}}),A=d(()=>{o.login()}),h=d(()=>{window.close()});p.useEffect(()=>{o.initialized&&(o.user||A())},[o?.user,o?.initialized,A]),p.useEffect(()=>{o.open||i.current?.closeLoading?.()},[o.open]);const f=()=>n.error?e.jsxs(M,{severity:"error",children:[e.jsx(O,{children:t("aigne.notAuthorized")}),n.error]}):n.success?e.jsx(oe,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(X,{style:{color:k.palette.success.main,fontSize:72}}),title:t("connectCli.success",{source:w}),description:`${t("connectCli.successDesc",{source:w})} ${a.has("closeOnSuccess")?t("connectCli.closeDelay",{seconds:Math.ceil(_/1e3)}):""}`}):e.jsxs(M,{severity:"info",children:[e.jsx(O,{children:t("aigne.connectTo",{appName:x.appName})}),e.jsx(v,{component:"li",variant:"body2",children:t("aigne.accessTips.tips1",{appName:l.appName,accessAppName:x.appName})}),e.jsx(v,{component:"li",variant:"body2",children:t("aigne.accessTips.tips2",{appName:l.appName})}),e.jsx(v,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("aigne.accessTips.tips3",{url:je,accessAppName:x.appName})}})]});return e.jsx(ge,{ref:i,session:o,requestAppInfo:l,currentAppInfo:x,userInfo:z,onAuthorize:c,onConnect:A,onSwitchConnect:o.switchDid,onCancel:h,hideAuthorize:!!n.error,hideSwitchConnect:n.success,hideButton:n.success,authorizeText:t("common.approve"),slotProps:{root:{sx:{width:500}}},children:f()})}export{Ne as default};
@@ -1 +0,0 @@
1
- import{R as t}from"./index-Dg-fihjm.js";import{H as e}from"./vendor-ux-Br1Zu4eg.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};