@abtnode/blocklet-services 1.17.6-beta-20251217-144034-62fafb94 → 1.17.6-beta-20251219-114550-06c96cf5

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 (170) hide show
  1. package/api/index.js +43 -34
  2. package/api/routes/env.js +2 -1
  3. package/api/util/attach-shared-utils.js +8 -2
  4. package/api/util/federated.js +2 -2
  5. package/dist/assets/{AdapterDayjs-DqOr9LFk.js → AdapterDayjs-BUbxoXbD.js} +1 -1
  6. package/dist/assets/{Google-CQ1n6aSx.js → Google-Cwpw9PRe.js} +1 -1
  7. package/dist/assets/{access-control-Br0Q24U5.js → access-control-BhOT85R4.js} +1 -1
  8. package/dist/assets/{add-component-core-BjIc5CSC.js → add-component-core-heDvzsX8.js} +1 -1
  9. package/dist/assets/{add-resource-Xb-x4g1C.js → add-resource-BkuSIexh.js} +1 -1
  10. package/dist/assets/{addon-Bb-IvkBm.js → addon-B_DwHOas.js} +1 -1
  11. package/dist/assets/{advanced-J7PaqOkP.js → advanced-swM31Eiv.js} +1 -1
  12. package/dist/assets/{aigne-BisxPU40.js → aigne-CQrMsm7D.js} +1 -1
  13. package/dist/assets/api-C_w0YD2j.js +1 -0
  14. package/dist/assets/{appearance-DB7npajX.js → appearance-1Y_gCbL9.js} +1 -1
  15. package/dist/assets/{audit-logs-ChUneyZT.js → audit-logs-CHjIu_sG.js} +2 -2
  16. package/dist/assets/{authorize-Y82VNxRU.js → authorize-BjNz4CIx.js} +1 -1
  17. package/dist/assets/{base-chart-CRe-9w5H.js → base-chart-Cs8rd9f2.js} +1 -1
  18. package/dist/assets/{base32-BqL5pnrU.js → base32-CXgP3JJ5.js} +1 -1
  19. package/dist/assets/{bind-account-D6v5gT9Q.js → bind-account-Cp_jRmuc.js} +1 -1
  20. package/dist/assets/branding-BkFb6cTS.js +1 -0
  21. package/dist/assets/{branding-DMSOM95n.js → branding-Cy4S7ifJ.js} +1 -1
  22. package/dist/assets/{branding-CEFq0bR-.js → branding-DclrAcmZ.js} +1 -1
  23. package/dist/assets/{bundle-avatar-B4iapkc8.js → bundle-avatar-BZ_OHQ8d.js} +1 -1
  24. package/dist/assets/{button-C2uxCAba.js → button-D6RwAFss.js} +1 -1
  25. package/dist/assets/{click-to-copy-03_3P1nz.js → click-to-copy-B2HIKJMV.js} +1 -1
  26. package/dist/assets/{cloneDeep-DqDclz1x.js → cloneDeep-BbaR0xRl.js} +1 -1
  27. package/dist/assets/{complete-8l4TIdOc.js → complete-BBxVJgzT.js} +1 -1
  28. package/dist/assets/{component-wVyJUR9k.js → component-DTec6zax.js} +2 -2
  29. package/dist/assets/{config--7XaVDtf.js → config-B6DS9_16.js} +1 -1
  30. package/dist/assets/{config-Cg-4HKDk.js → config-Bu8dI7mW.js} +1 -1
  31. package/dist/assets/{config-navigation-C25bf49D.js → config-navigation-hnPNfA90.js} +3 -3
  32. package/dist/assets/{config-space-a5CPzcRH.js → config-space-OgBdtdQ7.js} +1 -1
  33. package/dist/assets/config-uF2iao7N.js +53 -0
  34. package/dist/assets/{confirm-Bae4Q6hA.js → confirm-btfSjmnK.js} +1 -1
  35. package/dist/assets/{connect-Kqg-Hvf0.js → connect-0rgz4tLV.js} +1 -1
  36. package/dist/assets/{connect-DcNJuYMP.js → connect-C_8n2GAP.js} +1 -1
  37. package/dist/assets/{connect-to-CAxA9YCt.js → connect-to-_CNpUNET.js} +1 -1
  38. package/dist/assets/{create-passport-svg-Cs4mVLsE.js → create-passport-svg-BQhmIwWD.js} +1 -1
  39. package/dist/assets/{createClass-BRKh_6kd.js → createClass-dudiLlP7.js} +1 -1
  40. package/dist/assets/dashboard-C0oSA3oj.js +103 -0
  41. package/dist/assets/{delete-confirm-BH4us77q.js → delete-confirm-dqp-ol9_.js} +1 -1
  42. package/dist/assets/{did-address-DpdRECuJ.js → did-address-DqhneWXa.js} +1 -1
  43. package/dist/assets/{domain-A_x2C7hZ.js → domain-C8SVzMQz.js} +1 -1
  44. package/dist/assets/{domain-action-card-qfAg2FOU.js → domain-action-card-B9GypCwf.js} +2 -2
  45. package/dist/assets/domains-CiKmqXgC.js +1 -0
  46. package/dist/assets/{email-B41P48YL.js → email-Dg6hVyjU.js} +1 -1
  47. package/dist/assets/engine-0ct2xW2c.js +1 -0
  48. package/dist/assets/{exchange-passport-DmJ-ZNn7.js → exchange-passport-DBGg6mtf.js} +1 -1
  49. package/dist/assets/{form--M8l8TAR.js → form-ayzBN20_.js} +1 -1
  50. package/dist/assets/{form-text-input-CsXLsIFW.js → form-text-input-BjQKx89L.js} +1 -1
  51. package/dist/assets/{fuel-CKdRvbMh.js → fuel-Vs28WoOz.js} +1 -1
  52. package/dist/assets/{gen-access-key-DpcudUJv.js → gen-access-key-BzRnSZMg.js} +1 -1
  53. package/dist/assets/{gen-simple-access-key-bBIGQFVa.js → gen-simple-access-key-ClX05cKV.js} +1 -1
  54. package/dist/assets/get-safe-url-BW-k89rQ.js +1 -0
  55. package/dist/assets/{home-Br4wv3nM.js → home-Ds1wkYQ9.js} +1 -1
  56. package/dist/assets/{iframe-DEDZfTQS.js → iframe-CXruOREe.js} +1 -1
  57. package/dist/assets/{index-DZNC_-b1.js → index-B1BMtpDu.js} +1 -1
  58. package/dist/assets/{index-suU5cUfF.js → index-B4oHJYN3.js} +1 -1
  59. package/dist/assets/{index-ChsRYmOX.js → index-B5Fc7Exm.js} +2 -2
  60. package/dist/assets/{index-DZnXlBSX.js → index-B5vc0eG5.js} +1 -1
  61. package/dist/assets/{index-BHZ1NI4D.js → index-B88jTj-J.js} +5 -5
  62. package/dist/assets/{index-BuQB-bBx.js → index-BAO6XTWC.js} +6 -6
  63. package/dist/assets/{index-CiQKtWIW.js → index-BP_Fl0Mu.js} +1 -1
  64. package/dist/assets/{index-Du-44Mnl.js → index-Bcpfja_q.js} +2 -2
  65. package/dist/assets/{index-BMx1LEw9.js → index-Bgm1pC2t.js} +1 -1
  66. package/dist/assets/{index-CCV_gr1l.js → index-BmSuXiNh.js} +1 -1
  67. package/dist/assets/{index-B8FnxSR4.js → index-BqmdsAZZ.js} +1 -1
  68. package/dist/assets/{index-DFNR7XPL.js → index-BvsQyxi_.js} +12 -12
  69. package/dist/assets/{index-Ck7gs4Oo.js → index-Bxd7kK_i.js} +1 -1
  70. package/dist/assets/{index-t-iCgvnA.js → index-C6f1LKt3.js} +1 -1
  71. package/dist/assets/{index-B09kmneh.js → index-C8ve20rA.js} +1 -1
  72. package/dist/assets/index-CF3y44xd.js +270 -0
  73. package/dist/assets/{index-CeGNmiXz.js → index-CHuKoofS.js} +1 -1
  74. package/dist/assets/{index-DFIvDEic.js → index-Cn9-WXPN.js} +1 -1
  75. package/dist/assets/{index-ds5CY5te.js → index-D-q1dCoY.js} +1 -1
  76. package/dist/assets/{index-wfFuxfIU.js → index-DG2f1wAe.js} +1 -1
  77. package/dist/assets/{index-gb3Omoer.js → index-DQ5hcDOb.js} +1 -1
  78. package/dist/assets/{index-DzshGHRk.js → index-DQ6KmrJ_.js} +1 -1
  79. package/dist/assets/{index-B4sVJOOj.js → index-DURonUPJ.js} +1 -1
  80. package/dist/assets/{index-DDNwkWcx.js → index-DVQWYAIC.js} +1 -1
  81. package/dist/assets/{index-D-PNqbj6.js → index-DajrAixi.js} +1 -1
  82. package/dist/assets/{index-97PFSvcx.js → index-DgEP8auA.js} +1 -1
  83. package/dist/assets/{index-Dp5SQewL.js → index-DooQPBUl.js} +1 -1
  84. package/dist/assets/{index-CCp_Tje1.js → index-DwK0GIrs.js} +61 -61
  85. package/dist/assets/{index-Drd8GwRz.js → index-LIDGq9IJ.js} +1 -1
  86. package/dist/assets/{index-BTLkS2yC.js → index-jh20BesS.js} +4 -4
  87. package/dist/assets/{index-CbOKD65A.js → index-u9yYWXco.js} +2 -2
  88. package/dist/assets/{invitation-CmMAFxUf.js → invitation-BcEFpMQA.js} +1 -1
  89. package/dist/assets/{invitations-BGoj-6ca.js → invitations-DmsPff5b.js} +2 -2
  90. package/dist/assets/{invite-xCk-bD5o.js → invite-GF63A7GD.js} +1 -1
  91. package/dist/assets/{isURL-FbWmvlGY.js → isURL-CkV6bNHJ.js} +1 -1
  92. package/dist/assets/{issue-passport-ogite141.js → issue-passport-BXOKXvyV.js} +1 -1
  93. package/dist/assets/{item-DB2BQlzi.js → item-BSFssoYN.js} +1 -1
  94. package/dist/assets/{landing-page-_7E5uTzY.js → landing-page-BE08UeOH.js} +1 -1
  95. package/dist/assets/{layout-bs5efDjb.js → layout-BPsPNtH9.js} +1 -1
  96. package/dist/assets/{list-DzPoX6hE.js → list-Byc72bDA.js} +1 -1
  97. package/dist/assets/{list-CY3qo6ZZ.js → list-CLOYr71b.js} +1 -1
  98. package/dist/assets/localization-L4ZbLe_a.js +1 -0
  99. package/dist/assets/{log-YDgW4rdG.js → log-D198F7U3.js} +1 -1
  100. package/dist/assets/logger-CWnnO-wn.js +1 -0
  101. package/dist/assets/{login-oauth-callback-74_L5-PV.js → login-oauth-callback-CC9N1S9d.js} +1 -1
  102. package/dist/assets/{login-BX3PcB9B.js → login-wDtMfbHT.js} +1 -1
  103. package/dist/assets/{logo-uploader-BiccA0Y_.js → logo-uploader-BL-x4TAv.js} +1 -1
  104. package/dist/assets/{lost-passport-DQpqnLzY.js → lost-passport-CKHtQDwr.js} +1 -1
  105. package/dist/assets/{omit-5AwbF-Ja.js → omit-BgmLPtMY.js} +1 -1
  106. package/dist/assets/{open-window-DwdCOSRH.js → open-window-CU415CjG.js} +1 -1
  107. package/dist/assets/{over-due-invoice-payment-vMGDLCRH.js → over-due-invoice-payment-Bux67LFM.js} +1 -1
  108. package/dist/assets/{overview-DlaOwZTf.js → overview-DLpRsiS6.js} +3 -3
  109. package/dist/assets/{passport-item-D-26SswO.js → passport-item-regWhYCV.js} +1 -1
  110. package/dist/assets/passport-jAMdp3_i.js +1 -0
  111. package/dist/assets/{permission-DSq5t-Gl.js → permission-PnySJGEl.js} +1 -1
  112. package/dist/assets/{preferences-CU_TcWh8.js → preferences-BdtsycEO.js} +1 -1
  113. package/dist/assets/profile-embed-BjhIRlnb.js +1 -0
  114. package/dist/assets/{publish-resource-CJMQG20J.js → publish-resource-B_cHs_c_.js} +1 -1
  115. package/dist/assets/{react-beautiful-dnd.esm-By1RE6ef.js → react-beautiful-dnd.esm-89LKdt03.js} +1 -1
  116. package/dist/assets/runtime-B9zsyQJH.js +1 -0
  117. package/dist/assets/{sanitize-BOo6OPJZ.js → sanitize-DyRfEGVu.js} +1 -1
  118. package/dist/assets/sdk-CkLW4ZmH.js +1 -0
  119. package/dist/assets/{security-BtvdwO9M.js → security-DsvOVk8Y.js} +1 -1
  120. package/dist/assets/{session-BjDe0kgL.js → session-nLCSznMa.js} +1 -1
  121. package/dist/assets/{setup-Dznue6f2.js → setup-D28cEOB_.js} +1 -1
  122. package/dist/assets/{spaces-QwBC54Y6.js → spaces-B6hICxl4.js} +1 -1
  123. package/dist/assets/{start-8dFdO02W.js → start-D6x0fYx9.js} +1 -1
  124. package/dist/assets/{starting-progress-SGklUl5j.js → starting-progress-D4qoLrH0.js} +1 -1
  125. package/dist/assets/{status-BVh3qQZF.js → status-BOjZ6Vaq.js} +1 -1
  126. package/dist/assets/{step-actions-YQj43Dic.js → step-actions-Cfagh9Pk.js} +1 -1
  127. package/dist/assets/{studio-Dse7ZOUk.js → studio-D_ap2IaO.js} +1 -1
  128. package/dist/assets/{switch-wqsJ2qIA.js → switch-CO2el_yA.js} +1 -1
  129. package/dist/assets/{switch-control-BDwQ53GS.js → switch-control-Bw0oiZZh.js} +1 -1
  130. package/dist/assets/{table-tips-BEPJMiqj.js → table-tips-C-6Sm2ed.js} +1 -1
  131. package/dist/assets/{team-CMLIpBpv.js → team-BETRxUUw.js} +1 -1
  132. package/dist/assets/{traffic-CMz6_p1P.js → traffic-CYr-3G37.js} +1 -1
  133. package/dist/assets/{transfer-ZsNcWxY6.js → transfer-Cg9oSSyL.js} +1 -1
  134. package/dist/assets/{unsubscribe-C6wQSJz0.js → unsubscribe-Csiks0SI.js} +1 -1
  135. package/dist/assets/{use-app-logo-C6aWxAKK.js → use-app-logo-BgQdzlhG.js} +1 -1
  136. package/dist/assets/{use-window-close-edYntLdV.js → use-window-close-DDL8fcOm.js} +1 -1
  137. package/dist/assets/{useAsync-DOpjtrvS.js → useAsync-VEqKX7rF.js} +1 -1
  138. package/dist/assets/{useAsync-BSd-eaZO.js → useAsync-xXSiXzwr.js} +1 -1
  139. package/dist/assets/{useAsyncRetry-v1aVMcV-.js → useAsyncRetry--1T7wYe2.js} +1 -1
  140. package/dist/assets/{useLocalStorage-8LihN_xG.js → useLocalStorage-BV1BIwfo.js} +1 -1
  141. package/dist/assets/{user-center-CySi62qy.js → user-center-CGXOHu_w.js} +1 -1
  142. package/dist/assets/{user-follower-DaQ4cmnn.js → user-follower-__aq0tH0.js} +1 -1
  143. package/dist/assets/{util-CQLL-C6x.js → util-Bps9wpLH.js} +1 -1
  144. package/dist/assets/{util-LZOTlX2w.js → util-D27AtnBb.js} +1 -1
  145. package/dist/assets/{vendor-arcblock-DRfhQ9Yl.js → vendor-arcblock-CPCSE54a.js} +1 -1
  146. package/dist/assets/{vendor-hooks-DpqqC65c.js → vendor-hooks-cYMUGE4V.js} +1 -1
  147. package/dist/assets/{vendor-utils-BqKQizRf.js → vendor-utils-drLlzTVq.js} +1 -1
  148. package/dist/assets/{vendor-ux-KtPBvlG0.js → vendor-ux-DfSgTRg5.js} +3 -3
  149. package/dist/assets/{wait-connect-D-KXzGB8.js → wait-connect-AqdGAvY7.js} +1 -1
  150. package/dist/assets/{wizard-DplFy6RF.js → wizard-asHyteJr.js} +1 -1
  151. package/dist/assets/{wizard-components-D5SEvV5d.js → wizard-components-YsOxzGWe.js} +1 -1
  152. package/dist/assets/wrap-locale-Dfmt13Mn.js +1 -0
  153. package/dist/assets/{zh-BEQJoajM.js → zh-DEgV10nE.js} +1 -1
  154. package/dist/index.html +1 -1
  155. package/package.json +37 -37
  156. package/dist/assets/api-2a4FTO9k.js +0 -1
  157. package/dist/assets/branding-Beas39XM.js +0 -1
  158. package/dist/assets/config-CAG_E71y.js +0 -53
  159. package/dist/assets/dashboard-4ch_JDWe.js +0 -106
  160. package/dist/assets/domains-BdyK4uC-.js +0 -1
  161. package/dist/assets/engine-ChxMyLlO.js +0 -1
  162. package/dist/assets/get-safe-url-DhW3uplX.js +0 -1
  163. package/dist/assets/index-Csq5V3mf.js +0 -270
  164. package/dist/assets/localization-DNXKCjZt.js +0 -1
  165. package/dist/assets/logger-D3ELa8t7.js +0 -1
  166. package/dist/assets/passport-BpAOwZW1.js +0 -1
  167. package/dist/assets/profile-embed-B0Xzyt0-.js +0 -1
  168. package/dist/assets/runtime-CV7GMTXM.js +0 -1
  169. package/dist/assets/sdk-CfmFeEbO.js +0 -1
  170. package/dist/assets/wrap-locale-BkGdB3jW.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as m}from"./vendor-react-CTtPmzVP.js";import{V as n}from"./vendor-ux-DfSgTRg5.js";import{Y as p,Z as l,ag as c,q as u}from"./index-DwK0GIrs.js";import{a as x,b as d}from"./domain-action-card-B9GypCwf.js";import{j as t,ak as k,b6 as f,aZ as h}from"./vendor-mui-core-DnR6WYuU.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./useSetState-L-f8mSga.js";import"./permission-PnySJGEl.js";import"./session-nLCSznMa.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./confirm-btfSjmnK.js";import"./index-DBs9Ljax.js";import"./actions-Dfiiwkit.js";import"./delete-confirm-dqp-ol9_.js";import"./click-to-copy-B2HIKJMV.js";import"./useAsync-VEqKX7rF.js";import"./index-BP_Fl0Mu.js";import"./util-D27AtnBb.js";import"./engine-0ct2xW2c.js";function z(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{z as default};
@@ -1,4 +1,4 @@
1
- import{V as M,aa as q,_ as w,H as C,J as Q,aL as J}from"./vendor-ux-KtPBvlG0.js";import{j as t,b6 as f,bu as X,cl as Z,T as b,Q as T,bb as ee,ak as B,z as O,a6 as te,at as se}from"./vendor-mui-core-DnR6WYuU.js";import{r as n,j as ie}from"./vendor-react-CTtPmzVP.js";import{T as g}from"./vendor-utils-BqKQizRf.js";import{u as ne,m as h,o as $,c as j,H as oe,aV as re}from"./index-CCp_Tje1.js";import{l as ae}from"./vendor-arcblock-DRfhQ9Yl.js";import{K as ce}from"./landing-page-_7E5uTzY.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-DhW3uplX.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
1
+ import{V as M,aa as q,_ as w,H as C,J as Q,aL as J}from"./vendor-ux-DfSgTRg5.js";import{j as t,b6 as f,bu as X,cl as Z,T as b,Q as T,bb as ee,ak as B,z as O,a6 as te,at as se}from"./vendor-mui-core-DnR6WYuU.js";import{r as n,j as ie}from"./vendor-react-CTtPmzVP.js";import{T as g}from"./vendor-utils-drLlzTVq.js";import{u as ne,m as h,o as $,c as j,H as oe,aV as re}from"./index-DwK0GIrs.js";import{l as ae}from"./vendor-arcblock-CPCSE54a.js";import{K as ce}from"./landing-page-BE08UeOH.js";import{f as _}from"./index-DBs9Ljax.js";import{g as D}from"./get-safe-url-BW-k89rQ.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";const le=se.form`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -0,0 +1 @@
1
+ import{bS as e}from"./index-DwK0GIrs.js";var i=e();export{i as e};
@@ -1 +1 @@
1
- import{j as e,a6 as P,ak as E}from"./vendor-mui-core-DnR6WYuU.js";import{r as j,u as k}from"./vendor-react-CTtPmzVP.js";import{o as T}from"./vendor-arcblock-DRfhQ9Yl.js";import{V as C,H as d,ar as W}from"./vendor-ux-KtPBvlG0.js";import{l as I,c as R,j as S,a as v,d as U}from"./index-CCp_Tje1.js";import{K as L}from"./landing-page-_7E5uTzY.js";import{w as N}from"./wrap-locale-BkGdB3jW.js";import{g as b}from"./get-safe-url-DhW3uplX.js";import"./vendor-utils-BqKQizRf.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./index-ds5CY5te.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=j.useContext(n),{t:s,locale:h}=C(),f=k(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(r,w)=>{o(r,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=b(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=r=>{d.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(T,{children:e.jsx(P,{})}):e.jsx(L,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(I,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=N(_);function G(){const n=W(),a=(o,t)=>{o.sessionToken&&(v(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:S,webWalletUrl:n,onSuccess:a})}export{G as default};
1
+ import{j as e,a6 as P,ak as E}from"./vendor-mui-core-DnR6WYuU.js";import{r as j,u as k}from"./vendor-react-CTtPmzVP.js";import{o as T}from"./vendor-arcblock-CPCSE54a.js";import{V as C,H as d,ar as W}from"./vendor-ux-DfSgTRg5.js";import{l as I,c as R,j as S,a as v,d as U}from"./index-DwK0GIrs.js";import{K as L}from"./landing-page-BE08UeOH.js";import{w as N}from"./wrap-locale-Dfmt13Mn.js";import{g as b}from"./get-safe-url-BW-k89rQ.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./index-D-q1dCoY.js";function _({SessionContext:n,webWalletUrl:a,onSuccess:o}){const{api:t,session:i}=j.useContext(n),{t:s,locale:h}=C(),f=k(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(r,w)=>{o(r,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=b(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=r=>{d.error(r.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(T,{children:e.jsx(P,{})}):e.jsx(L,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(I,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:a,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=N(_);function G(){const n=W(),a=(o,t)=>{o.sessionToken&&(v(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:S,webWalletUrl:n,onSuccess:a})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{D as S,j as o,a6 as B,T,bm as k}from"./vendor-mui-core-DnR6WYuU.js";import{o as M}from"./vendor-arcblock-DRfhQ9Yl.js";import{V as P,aJ as F}from"./vendor-ux-KtPBvlG0.js";import{r as w}from"./vendor-react-CTtPmzVP.js";import{x as E}from"./vendor-hooks-DpqqC65c.js";import{c0 as D,ax as I}from"./index-CCp_Tje1.js";import"./vendor-utils-BqKQizRf.js";import"./lottie-web-4koyQiv_.js";const{Elements:R,PaymentElement:z,useElements:N,useStripe:O,loadStripe:V,LinkAuthenticationElement:W}=globalThis.__STRIPE_COMPONENTS__,$=k("div")`
1
+ import{D as S,j as o,a6 as B,T,bm as k}from"./vendor-mui-core-DnR6WYuU.js";import{o as M}from"./vendor-arcblock-CPCSE54a.js";import{V as P,aJ as F}from"./vendor-ux-DfSgTRg5.js";import{r as w}from"./vendor-react-CTtPmzVP.js";import{x as E}from"./vendor-hooks-cYMUGE4V.js";import{c0 as D,ax as I}from"./index-DwK0GIrs.js";import"./vendor-utils-drLlzTVq.js";import"./lottie-web-4koyQiv_.js";const{Elements:R,PaymentElement:z,useElements:N,useStripe:O,loadStripe:V,LinkAuthenticationElement:W}=globalThis.__STRIPE_COMPONENTS__,$=k("div")`
2
2
  width: 100%;
3
3
  opacity: 0;
4
4
  transition: opacity 300ms ease;
@@ -1,4 +1,4 @@
1
- import{a as L,r as l}from"./vendor-react-CTtPmzVP.js";import{j as e,I as T,bV as U,Q,cG as $,O as J,P as V,ai as Y,o as Z,M as ee,W as t,z as te,ak as d,a6 as se,by as ne,aj as ae,F as re,cH as le}from"./vendor-mui-core-DnR6WYuU.js";import{aT as oe}from"./vendor-ux-KtPBvlG0.js";import{R as ie}from"./required-BQln5OcV.js";import{F as ce}from"./form-wrapper-PT5ZzMQy.js";import{e as ue}from"./edit.svg-RRSklUg-.js";function P({triggers:o=[],onEnterEdit:n,disabled:p}){const a=L.useRef(null),[h,u]=L.useState(!1),C=r=>{u(!1),r()},I=()=>{u(r=>!r)},i=r=>{a.current&&a.current.contains(r.target)||u(!1)};return o.length===0?e.jsx(T,{"data-cy":"schema-form-item-edit",onClick:n,disabled:p,size:"large",children:e.jsx(ue,{})}):e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"outlined",ref:a,"aria-label":"split button",children:e.jsx(Q,{size:"large","aria-controls":h?"split-button-menu":void 0,"aria-expanded":h?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:I,children:e.jsx($,{})})}),e.jsx(J,{sx:{zIndex:9999},open:h,anchorEl:a.current,role:void 0,placement:"bottom-end",children:e.jsx(V,{children:e.jsx(Y,{onClickAway:i,children:e.jsx(Z,{id:"split-button-menu",autoFocusItem:!0,children:o.map(r=>e.jsx(ee,{onClick:()=>C(r.handler),children:r.title},r.key))})})})})]})}P.propTypes={triggers:t.arrayOf(t.shape({key:t.string.isRequired,title:t.string.isRequired,handler:t.func.isRequired})),onEnterEdit:t.func.isRequired,disabled:t.bool.isRequired};const B=(o,n,p)=>o===null&&n&&p?"******":o?n?"******":o:"",de=le`
1
+ import{a as L,r as l}from"./vendor-react-CTtPmzVP.js";import{j as e,I as T,bV as U,Q,cG as $,O as J,P as V,ai as Y,o as Z,M as ee,W as t,z as te,ak as d,a6 as se,by as ne,aj as ae,F as re,cH as le}from"./vendor-mui-core-DnR6WYuU.js";import{aT as oe}from"./vendor-ux-DfSgTRg5.js";import{R as ie}from"./required-BQln5OcV.js";import{F as ce}from"./form-wrapper-PT5ZzMQy.js";import{e as ue}from"./edit.svg-RRSklUg-.js";function P({triggers:o=[],onEnterEdit:n,disabled:p}){const a=L.useRef(null),[h,u]=L.useState(!1),C=r=>{u(!1),r()},I=()=>{u(r=>!r)},i=r=>{a.current&&a.current.contains(r.target)||u(!1)};return o.length===0?e.jsx(T,{"data-cy":"schema-form-item-edit",onClick:n,disabled:p,size:"large",children:e.jsx(ue,{})}):e.jsxs(e.Fragment,{children:[e.jsx(U,{variant:"outlined",ref:a,"aria-label":"split button",children:e.jsx(Q,{size:"large","aria-controls":h?"split-button-menu":void 0,"aria-expanded":h?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:I,children:e.jsx($,{})})}),e.jsx(J,{sx:{zIndex:9999},open:h,anchorEl:a.current,role:void 0,placement:"bottom-end",children:e.jsx(V,{children:e.jsx(Y,{onClickAway:i,children:e.jsx(Z,{id:"split-button-menu",autoFocusItem:!0,children:o.map(r=>e.jsx(ee,{onClick:()=>C(r.handler),children:r.title},r.key))})})})})]})}P.propTypes={triggers:t.arrayOf(t.shape({key:t.string.isRequired,title:t.string.isRequired,handler:t.func.isRequired})),onEnterEdit:t.func.isRequired,disabled:t.bool.isRequired};const B=(o,n,p)=>o===null&&n&&p?"******":o?n?"******":o:"",de=le`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,ak as s,a6 as w,bb as B,cC as N,at as I,W as d}from"./vendor-mui-core-DnR6WYuU.js";import{r as l}from"./vendor-react-CTtPmzVP.js";import{C as v}from"./vendor-utils-BqKQizRf.js";import{aT as L}from"./vendor-ux-KtPBvlG0.js";import{y as $,u as E,l as T}from"./index-CCp_Tje1.js";import{W as z}from"./did-address-DpdRECuJ.js";import{a as A}from"./page-header-CHAwrgX-.js";import{S as D}from"./layout-bs5efDjb.js";import{S as F}from"./step-actions-YQj43Dic.js";import{S as m}from"./button-C2uxCAba.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:n=()=>{},onPrevious:u=()=>{}}){const{locale:x,t}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:f,actions:h}=$(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:b,symbol:k="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(A,{title:t("setup.fuel.title"),onClickBack:u})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${k}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(z,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:v(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(T,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:x,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:b,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}P.propTypes={onNext:d.func,onPrevious:d.func};const R=I(D)`
1
+ import{j as e,ak as s,a6 as w,bb as B,cC as N,at as I,W as d}from"./vendor-mui-core-DnR6WYuU.js";import{r as l}from"./vendor-react-CTtPmzVP.js";import{C as v}from"./vendor-utils-drLlzTVq.js";import{aT as L}from"./vendor-ux-DfSgTRg5.js";import{y as $,u as E,l as T}from"./index-DwK0GIrs.js";import{W as z}from"./did-address-DqhneWXa.js";import{a as A}from"./page-header-CHAwrgX-.js";import{S as D}from"./layout-BPsPNtH9.js";import{S as F}from"./step-actions-Cfagh9Pk.js";import{S as m}from"./button-D6RwAFss.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./content-layout-DmSBGGVm.js";import"./use-mobile-D5clNlrm.js";function P({onNext:n=()=>{},onPrevious:u=()=>{}}){const{locale:x,t}=l.useContext(L),{blocklet:a,gas:c,tokenInfo:f,actions:h}=$(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:b,symbol:k="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(R,{children:[e.jsx("div",{className:"header",children:e.jsx(A,{title:t("setup.fuel.title"),onClickBack:u})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${k}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(z,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:v(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(T,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:x,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:b,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(F,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}P.propTypes={onNext:d.func,onPrevious:d.func};const R=I(D)`
2
2
  .qr-body {
3
3
  width: 580px;
4
4
  ${n=>n.theme.breakpoints.down("md")} {
@@ -1 +1 @@
1
- import{D as E,j as e,Q as S,cm as P,bu as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-DnR6WYuU.js";import{u as I,s as L,c as N,V as p,t as T,b9 as W}from"./index-CCp_Tje1.js";import{o as A}from"./vendor-arcblock-DRfhQ9Yl.js";import{aT as D}from"./vendor-ux-KtPBvlG0.js";import{g as U,b as j}from"./vendor-hooks-DpqqC65c.js";import{u as z,r as i,j as F}from"./vendor-react-CTtPmzVP.js";import{K as a}from"./landing-page-_7E5uTzY.js";import{C as K}from"./vendor-utils-BqKQizRf.js";import{u as M}from"./use-window-close-edYntLdV.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(D),{api:x,connectApi:f}=I(),[h]=F(),w=E(),k=M(),n=U({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=T(u);if(!W(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=j(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=j(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:w.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(A,{children:e.jsx(_,{})})}export{Z as default};
1
+ import{D as E,j as e,Q as S,cm as P,bu as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-DnR6WYuU.js";import{u as I,s as L,c as N,V as p,t as T,b9 as W}from"./index-DwK0GIrs.js";import{o as A}from"./vendor-arcblock-CPCSE54a.js";import{aT as D}from"./vendor-ux-DfSgTRg5.js";import{g as U,b as j}from"./vendor-hooks-cYMUGE4V.js";import{u as z,r as i,j as F}from"./vendor-react-CTtPmzVP.js";import{K as a}from"./landing-page-BE08UeOH.js";import{C as K}from"./vendor-utils-drLlzTVq.js";import{u as M}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(D),{api:x,connectApi:f}=I(),[h]=F(),w=E(),k=M(),n=U({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=T(u);if(!W(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=j(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=j(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,N.WELLKNOWN_SERVICE_PATH_PREFIX,L),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:w.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(A,{children:e.jsx(_,{})})}export{Z as default};
@@ -1 +1 @@
1
- import{j as e,ak as a,T as w,a6 as M,b6 as Y,Q as K,bb as Z,D as X,aZ as W,a_ as F,bu as ee}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,u as se,j as ne}from"./vendor-react-CTtPmzVP.js";import{b6 as te,ba as oe,bb as re,bc as ie,bd as ae,u as ce,o as le,t as H,V as ue,am as de,c as pe}from"./index-CCp_Tje1.js";import{n as S,ac as he,C as O}from"./vendor-utils-BqKQizRf.js";import{g as J,b as p,z as xe,w as fe}from"./vendor-hooks-DpqqC65c.js";import{M as $,V as Q,x as ge,K as V,P as me}from"./vendor-ux-KtPBvlG0.js";import{o as je}from"./vendor-arcblock-DRfhQ9Yl.js";import{K as we}from"./landing-page-_7E5uTzY.js";import{u as ye}from"./use-window-close-edYntLdV.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:y}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx($,{src:y.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx($,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(w,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function be({session:l,requestAppInfo:y,currentAppInfo:T,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:_=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=S,onAuthorize:f=S,onSwitchConnect:v=S,onSwitchPassport:A=S,onCancel:D=S,ref:E,disableAuthorizeButton:z=!1}){const r=J({loading:!1}),{locale:b="en"}=Q()||{},g=p((B,j={})=>ge(Ae,B,b,"en",j)),x=p(()=>{r.loading=!1}),U=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,v?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{D?.()});if(d.useImperativeHandle(E,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(we,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:V({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:V({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:y,currentAppInfo:T}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,_?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(Y,{direction:"row",spacing:2,children:[L?null:e.jsx(K,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||z,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||z,onClick:U,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(w,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Z,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const Se=O(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),G=3e3;function De(){const l=d.useRef(null),[y,T]=d.useState(),[k]=xe({targetDate:y}),{session:s}=ce(),N=X(),t=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,_]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=Q(),[c]=ne(),P=ye(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",v=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=v.join(","),D=s.user&&f?v.length>0:!0,E=async()=>{C(!0);try{const n=c.get("__url__"),i=n?H(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(O(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:O(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&_(s.user)},[s.user]);const z=()=>{E(),s.user&&_(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?H(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>z(),[]);const r=window.blocklet,b=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:b,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(T(Date.now()+G),setTimeout(()=>P(),G))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),U=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(W,{severity:"error",children:[e.jsx(F,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:b}),description:`${o("connectCli.successDesc",{source:b})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(W,{severity:"info",children:[e.jsx(F,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(w,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(w,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:Se,accessAppName:r.appName})}})]});return e.jsx(be,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:U,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!D,children:q()})}export{De as default};
1
+ import{j as e,ak as a,T as w,a6 as M,b6 as Y,Q as K,bb as Z,D as X,aZ as W,a_ as F,bu as ee}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,u as se,j as ne}from"./vendor-react-CTtPmzVP.js";import{b6 as te,ba as oe,bb as re,bc as ie,bd as ae,u as ce,o as le,t as H,V as ue,am as de,c as pe}from"./index-DwK0GIrs.js";import{n as S,ac as he,C as O}from"./vendor-utils-drLlzTVq.js";import{g as J,b as p,z as xe,w as fe}from"./vendor-hooks-cYMUGE4V.js";import{M as $,V as Q,x as ge,K as V,P as me}from"./vendor-ux-DfSgTRg5.js";import{o as je}from"./vendor-arcblock-CPCSE54a.js";import{K as we}from"./landing-page-BE08UeOH.js";import{u as ye}from"./use-window-close-DDL8fcOm.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:y}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx($,{src:y.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx($,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(w,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function be({session:l,requestAppInfo:y,currentAppInfo:T,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:_=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=S,onAuthorize:f=S,onSwitchConnect:v=S,onSwitchPassport:A=S,onCancel:D=S,ref:E,disableAuthorizeButton:z=!1}){const r=J({loading:!1}),{locale:b="en"}=Q()||{},g=p((B,j={})=>ge(Ae,B,b,"en",j)),x=p(()=>{r.loading=!1}),U=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,v?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{D?.()});if(d.useImperativeHandle(E,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(we,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:V({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:V({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:y,currentAppInfo:T}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,_?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(Y,{direction:"row",spacing:2,children:[L?null:e.jsx(K,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||z,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(K,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||z,onClick:U,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(w,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Z,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const Se=O(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),G=3e3;function De(){const l=d.useRef(null),[y,T]=d.useState(),[k]=xe({targetDate:y}),{session:s}=ce(),N=X(),t=J({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,_]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=Q(),[c]=ne(),P=ye(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",v=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=v.join(","),D=s.user&&f?v.length>0:!0,E=async()=>{C(!0);try{const n=c.get("__url__"),i=n?H(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(O(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:O(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&_(s.user)},[s.user]);const z=()=>{E(),s.user&&_(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?H(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>z(),[]);const r=window.blocklet,b=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:b,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(T(Date.now()+G),setTimeout(()=>P(),G))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),U=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(W,{severity:"error",children:[e.jsx(F,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:b}),description:`${o("connectCli.successDesc",{source:b})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(W,{severity:"info",children:[e.jsx(F,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(w,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(w,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(w,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:Se,accessAppName:r.appName})}})]});return e.jsx(be,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:U,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!D,children:q()})}export{De as default};
@@ -0,0 +1 @@
1
+ import{b8 as t}from"./index-DwK0GIrs.js";import{H as e}from"./vendor-ux-DfSgTRg5.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};
@@ -1 +1 @@
1
- import{j as o,b6 as n}from"./vendor-mui-core-DnR6WYuU.js";import{L as r}from"./vendor-react-CTtPmzVP.js";import{w as i}from"./vendor-ux-KtPBvlG0.js";import{c as t}from"./index-CCp_Tje1.js";import{S as e}from"./studio-Dse7ZOUk.js";import"./vendor-utils-BqKQizRf.js";import"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./index-Drd8GwRz.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",spacing:2,sx:{m:4},children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
1
+ import{j as o,b6 as n}from"./vendor-mui-core-DnR6WYuU.js";import{L as r}from"./vendor-react-CTtPmzVP.js";import{w as i}from"./vendor-ux-DfSgTRg5.js";import{c as t}from"./index-DwK0GIrs.js";import{S as e}from"./studio-D_ap2IaO.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./index-LIDGq9IJ.js";function L(){return o.jsx(e,{children:o.jsxs(n,{direction:"row",spacing:2,sx:{m:4},children:[o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/preferences`,size:"large",color:"primary",variant:"outlined",children:"Preference Builder"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/branding`,size:"large",color:"primary",variant:"outlined",children:"Branding Images"}),o.jsx(i,{component:r,to:`${t.WELLKNOWN_SERVICE_PATH_PREFIX}/studio/localization`,size:"large",color:"primary",variant:"outlined",children:"Localization"})]})})}export{L as default};
@@ -1 +1 @@
1
- import{a as z}from"./vendor-react-CTtPmzVP.js";import{bz as E}from"./index-CCp_Tje1.js";const R=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:m,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:P,name:v,target:A,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=E({src:q||r,target:A||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:w||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:v||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":P||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:m||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),z.createElement("iframe",Object.assign({},l))};export{R as I};
1
+ import{a as E}from"./vendor-react-CTtPmzVP.js";import{bA as L}from"./index-DwK0GIrs.js";const $=({url:r,allowFullScreen:o,position:a,display:i,height:u,width:y,overflow:c,styles:f,onLoad:p,onMouseOver:b,onMouseOut:m,scrolling:w,id:d,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:A,name:P,target:v,loading:F,importance:I,referrerpolicy:M,allowpaymentrequest:S,src:q,key:x})=>{const t=L({src:q||r,target:v||null,style:{position:a||null,display:i||"initial",overflow:c||null},scrolling:w||null,allowpaymentrequest:S||null,importance:I||null,sandbox:s&&[...s].join(" ")||null,loading:F||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:d||null,"aria-labelledby":A||null,"aria-hidden":O||null,"aria-label":k||null,width:y||null,height:u||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:m||null,key:x||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(o)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))};export{$ as I};
@@ -1 +1 @@
1
- import{V as te,H as P,w as L,aT as de,aU as me}from"./vendor-ux-KtPBvlG0.js";import{g as re,b as m,a as fe}from"./vendor-hooks-DpqqC65c.js";import{g as he,r as A}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as w,z as v,bX as J,bn as $,y as b,am as pe,e6 as xe,cZ as ve,at as ie,b6 as ne,T as Q}from"./vendor-mui-core-DnR6WYuU.js";import{A as ae,J as je,C as be}from"./vendor-utils-BqKQizRf.js";import{u as se,C as p}from"./index.esm-Co8ZxFyk.js";import{aQ as ge,Z as oe,Y as le,aD as ce,aV as B,c as ye}from"./index-CCp_Tje1.js";import{i as Z}from"./isURL-FbWmvlGY.js";import{S as x}from"./section-jXB9AxBb.js";import{A as we,a as Re,b as ke}from"./collapse-B7gUzFaX.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./required-BQln5OcV.js";var W={exports:{}},z={exports:{}},N={exports:{}},X;function Te(){return X||(X=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=t;function t(f){return f==null}d.exports=n.default,d.exports.default=n.default}(N,N.exports)),N.exports}var Y;function Ee(){return Y||(Y=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=_;var t=R(ge()),f=R(Te());function R(h){return h&&h.__esModule?h:{default:h}}var c=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,j=/^[-+]?[0-9]+$/;function _(h,l){(0,t.default)(h),l=l||{};var u=l.allow_leading_zeroes===!1?c:j,i=!l.hasOwnProperty("min")||(0,f.default)(l.min)||h>=l.min,q=!l.hasOwnProperty("max")||(0,f.default)(l.max)||h<=l.max,I=!l.hasOwnProperty("lt")||(0,f.default)(l.lt)||h<l.lt,o=!l.hasOwnProperty("gt")||(0,f.default)(l.gt)||h>l.gt;return u.test(h)&&i&&q&&I&&o}d.exports=n.default,d.exports.default=n.default}(z,z.exports)),z.exports}var G;function Se(){return G||(G=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=R;var t=f(Ee());function f(c){return c&&c.__esModule?c:{default:c}}function R(c){return(0,t.default)(c,{allow_leading_zeroes:!1,min:0,max:65535})}d.exports=n.default,d.exports.default=n.default}(W,W.exports)),W.exports}var Ce=Se();const Pe=he(Ce),V={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function _e(){const{api:d}=oe(),{blocklet:n}=le(),{t}=te(),{confirmApi:f,confirmHolder:R}=ce(),[c,j]=A.useState(!1),_=n?.meta?.did,h=Object.assign({...V},n?.settings?.notification?.email||{}),{handleSubmit:l,control:u,formState:i,watch:q,reset:I}=se({defaultValues:ae(h,Object.keys(V))}),o=re({testReceiver:"",testReceiverError:""}),a=q("enabled"),K=m(async(r,k,C=!0)=>{try{j(!0);const{blocklet:T}=await d.configNotification({input:{did:_,notification:JSON.stringify({email:r})}}),ue=Object.assign({...V},T?.settings?.notification?.email||{});I(ue),C&&P.success(t("oauth.saveSuccess"))}catch(T){if(C)P.error(T.message||t("oauth.saveFailed"));else throw T}finally{j(!1)}}),F=m(async(r,k,C)=>{try{j(!0),i.isDirty&&await K(r,k,!1),await d.sendEmail({input:{did:_,receiver:C,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),P.success(t("notification.email.testSuccess"))}catch(T){P.error(T.message||t("notification.email.testfailed"))}finally{j(!1)}}),D=m((r,k)=>{o.testReceiver=localStorage.getItem("test-receiver")||"",o.testReceiverError="",f.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(w,{sx:{width:"300px"},children:e.jsx(v,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:o.testReceiver,onChange:C=>{o.testReceiver=C.target.value},error:!!o.testReceiverError,helperText:o.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(C){const T=o.testReceiver?.trim();if(!T){o.testReceiverError=t("notification.email.receiverRequired");return}if(!B(T)){o.testReceiverError=t("notification.email.receiverInvalid");return}o.testReceiverError="",await F(r,k,T),C()},onCancel:()=>{j(!1)}})}),U=m(r=>{const k=r?.trim();return k?B(k)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),M=m(r=>{const k=r?.trim();return k?Z(k,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),s=m(r=>r?Pe(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),E=m(r=>r?.trim()?!0:t("notification.email.userRequired")),g=m(r=>r?.trim()?!0:t("notification.email.passwordRequired")),S=m(r=>r?.trim()&&!Z(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),O=m(r=>r?.trim()&&!B(r)?t("notification.email.emailInvalid"):!0),y=m(()=>!0);return e.jsxs(w,{children:[e.jsxs(qe,{component:"form",onSubmit:l(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(x,{title:t("notification.email.enable"),my:2.5,children:e.jsx(p,{name:"enabled",control:u,render:({field:r})=>e.jsx(J,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(x,{title:t("notification.email.from"),children:e.jsx(p,{name:"from",control:u,rules:{validate:a?U:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.host"),children:e.jsx(p,{name:"host",control:u,rules:{validate:a?M:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.port"),children:e.jsx(p,{name:"port",control:u,rules:{validate:a?s:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.user"),children:e.jsx(p,{name:"user",control:u,rules:{validate:a?E:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.password"),children:e.jsx(p,{name:"password",control:u,rules:{validate:a?g:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.secure"),children:e.jsx(p,{name:"secure",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(J,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(we,{children:[e.jsxs(Re,{expandIcon:e.jsx(ve,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(pe,{title:t("notification.email.signatureTooltip"),children:e.jsx(xe,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ke,{children:[e.jsx(x,{title:t("notification.email.companyName"),children:e.jsx(p,{name:"companyName",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.companyLink"),children:e.jsx(p,{name:"companyLink",control:u,rules:{validate:a?S:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.companyAddress"),children:e.jsx(p,{name:"companyAddress",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.supportEmail"),children:e.jsx(p,{name:"supportEmail",control:u,rules:{validate:a?O:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(w,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(L,{variant:"outlined",loading:c,color:"warning",onClick:l(D),disabled:!a||c,children:t("oauth.runTest")}),e.jsx(L,{type:"submit",variant:"contained",loading:c,disabled:!i.isDirty||c,children:t("oauth.save")})]})]}),R]})}const qe=ie(ne)``,H={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function Ie(){const{api:d}=oe(),{blocklet:n}=le(),{t}=te(),{confirmApi:f,confirmHolder:R}=ce(),[c,j]=A.useState(!1),_=n?.meta?.did,h=Object.assign({...H},n?.settings?.notification?.pushKit||{}),{handleSubmit:l,control:u,formState:i,watch:q,reset:I}=se({defaultValues:ae(h,Object.keys(H))}),o=re({testReceiver:"",testReceiverError:""}),a=q("enabled"),K=m(async(s,E,g=!0)=>{try{j(!0);const{blocklet:S}=await d.configNotification({input:{did:_,notification:JSON.stringify({pushKit:s})}}),O=Object.assign({...H},S?.settings?.notification?.pushKit||{});I(O),g&&P.success(t("oauth.saveSuccess"))}catch(S){if(g)P.error(S.message||t("oauth.saveFailed"));else throw S}finally{j(!1)}}),F=m(async(s,E)=>{try{j(!0),i.isDirty&&await K(s,E,!1);const g=(n?.configs||[]).find(y=>y.key==="BLOCKLET_APP_URL")?.value,S=je(be(g,ye.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:n?.meta?.version,t:new Date(n?.updatedAt||0).getTime()}),O={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:n?.appDid,fullName:n?.meta?.title,avatar:S}}}};await d.sendPush({input:{did:_,receiver:o.testReceiver,notification:JSON.stringify(O)}}),P.success(t("notification.pushKit.testSuccess"))}catch(g){P.error(g.message||t("notification.pushKit.testfailed"))}finally{j(!1)}}),D=m((s,E)=>{o.testReceiverError="",f.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(w,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(v,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:o.testReceiver,onChange:g=>{o.testReceiver=g.target.value},error:!!o.testReceiverError,helperText:o.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(g){if(!o.testReceiver?.trim()){o.testReceiverError=t("notification.pushKit.receiverRequired");return}o.testReceiverError="",await F(s,E),g()},onCancel:()=>{j(!1)}})}),U=m(s=>{const E=s?.trim();return E?Z(E)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),M=m(()=>!0);return e.jsxs(w,{children:[e.jsxs(Ke,{component:"form",onSubmit:l(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(x,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(p,{name:"enabled",control:u,render:({field:s})=>e.jsx(J,{control:e.jsx($,{checked:s.value,...s})})})}),e.jsx(x,{title:t("notification.pushKit.endpoint"),children:e.jsx(p,{name:"endpoint",control:u,rules:{validate:a?U:M},render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})})}),e.jsxs(x,{title:t("notification.pushKit.customOptions"),children:[e.jsx(p,{name:"did",control:u,render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})}),e.jsx(p,{name:"pushPath",control:u,render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})})]}),e.jsxs(w,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(L,{variant:"outlined",loading:c,color:"warning",onClick:l(D),disabled:!a||c,children:t("oauth.runTest")}),e.jsx(L,{type:"submit",variant:"contained",loading:c,disabled:!i.isDirty||c,children:t("oauth.save")})]})]}),R]})}const Ke=ie(ne)``,ee=[{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Wallet"}),value:"wallet"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Webhooks"}),value:"webhooks"}];function Je(){const[d,n]=A.useState(ee[0].value),{t}=A.useContext(de),f=fe(()=>({email:e.jsx(_e,{}),pushKit:e.jsx(Ie,{}),wallet:e.jsx(Q,{variant:"body1",children:t("notification.wallet.description")}),webhooks:e.jsx(Q,{variant:"body1",children:t("notification.webhooks.description")})}),[t]),R=A.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(w,{children:[e.jsx(me,{variant:"card",tabs:ee,current:d,onChange:n}),e.jsx(w,{style:R,children:f[d]})]})}export{Je as default};
1
+ import{V as te,H as P,w as L,aT as de,aW as me}from"./vendor-ux-DfSgTRg5.js";import{g as re,b as m,a as fe}from"./vendor-hooks-cYMUGE4V.js";import{g as he,r as W}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as w,z as v,bX as J,bn as $,y as b,am as pe,e6 as xe,cZ as ve,at as ie,b6 as ne,T as Q}from"./vendor-mui-core-DnR6WYuU.js";import{A as ae,J as je,C as be}from"./vendor-utils-drLlzTVq.js";import{u as se,C as p}from"./index.esm-Co8ZxFyk.js";import{aQ as ge,Z as oe,Y as le,aD as ce,aV as B,c as ye}from"./index-DwK0GIrs.js";import{i as Z}from"./isURL-CkV6bNHJ.js";import{S as x}from"./section-jXB9AxBb.js";import{A as we,a as Re,b as ke}from"./collapse-B7gUzFaX.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./required-BQln5OcV.js";var A={exports:{}},z={exports:{}},N={exports:{}},X;function Te(){return X||(X=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=t;function t(f){return f==null}d.exports=n.default,d.exports.default=n.default}(N,N.exports)),N.exports}var Y;function Ee(){return Y||(Y=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=_;var t=R(ge()),f=R(Te());function R(h){return h&&h.__esModule?h:{default:h}}var c=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,j=/^[-+]?[0-9]+$/;function _(h,l){(0,t.default)(h),l=l||{};var u=l.allow_leading_zeroes===!1?c:j,i=!l.hasOwnProperty("min")||(0,f.default)(l.min)||h>=l.min,q=!l.hasOwnProperty("max")||(0,f.default)(l.max)||h<=l.max,I=!l.hasOwnProperty("lt")||(0,f.default)(l.lt)||h<l.lt,o=!l.hasOwnProperty("gt")||(0,f.default)(l.gt)||h>l.gt;return u.test(h)&&i&&q&&I&&o}d.exports=n.default,d.exports.default=n.default}(z,z.exports)),z.exports}var G;function Se(){return G||(G=1,function(d,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=R;var t=f(Ee());function f(c){return c&&c.__esModule?c:{default:c}}function R(c){return(0,t.default)(c,{allow_leading_zeroes:!1,min:0,max:65535})}d.exports=n.default,d.exports.default=n.default}(A,A.exports)),A.exports}var Ce=Se();const Pe=he(Ce),V={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function _e(){const{api:d}=oe(),{blocklet:n}=le(),{t}=te(),{confirmApi:f,confirmHolder:R}=ce(),[c,j]=W.useState(!1),_=n?.meta?.did,h=Object.assign({...V},n?.settings?.notification?.email||{}),{handleSubmit:l,control:u,formState:i,watch:q,reset:I}=se({defaultValues:ae(h,Object.keys(V))}),o=re({testReceiver:"",testReceiverError:""}),a=q("enabled"),K=m(async(r,k,C=!0)=>{try{j(!0);const{blocklet:T}=await d.configNotification({input:{did:_,notification:JSON.stringify({email:r})}}),ue=Object.assign({...V},T?.settings?.notification?.email||{});I(ue),C&&P.success(t("oauth.saveSuccess"))}catch(T){if(C)P.error(T.message||t("oauth.saveFailed"));else throw T}finally{j(!1)}}),F=m(async(r,k,C)=>{try{j(!0),i.isDirty&&await K(r,k,!1),await d.sendEmail({input:{did:_,receiver:C,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),P.success(t("notification.email.testSuccess"))}catch(T){P.error(T.message||t("notification.email.testfailed"))}finally{j(!1)}}),D=m((r,k)=>{o.testReceiver=localStorage.getItem("test-receiver")||"",o.testReceiverError="",f.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(w,{sx:{width:"300px"},children:e.jsx(v,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:o.testReceiver,onChange:C=>{o.testReceiver=C.target.value},error:!!o.testReceiverError,helperText:o.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(C){const T=o.testReceiver?.trim();if(!T){o.testReceiverError=t("notification.email.receiverRequired");return}if(!B(T)){o.testReceiverError=t("notification.email.receiverInvalid");return}o.testReceiverError="",await F(r,k,T),C()},onCancel:()=>{j(!1)}})}),M=m(r=>{const k=r?.trim();return k?B(k)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),U=m(r=>{const k=r?.trim();return k?Z(k,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),s=m(r=>r?Pe(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),E=m(r=>r?.trim()?!0:t("notification.email.userRequired")),g=m(r=>r?.trim()?!0:t("notification.email.passwordRequired")),S=m(r=>r?.trim()&&!Z(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),O=m(r=>r?.trim()&&!B(r)?t("notification.email.emailInvalid"):!0),y=m(()=>!0);return e.jsxs(w,{children:[e.jsxs(qe,{component:"form",onSubmit:l(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(x,{title:t("notification.email.enable"),my:2.5,children:e.jsx(p,{name:"enabled",control:u,render:({field:r})=>e.jsx(J,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(x,{title:t("notification.email.from"),children:e.jsx(p,{name:"from",control:u,rules:{validate:a?M:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.host"),children:e.jsx(p,{name:"host",control:u,rules:{validate:a?U:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.port"),children:e.jsx(p,{name:"port",control:u,rules:{validate:a?s:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.user"),children:e.jsx(p,{name:"user",control:u,rules:{validate:a?E:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.password"),children:e.jsx(p,{name:"password",control:u,rules:{validate:a?g:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.secure"),children:e.jsx(p,{name:"secure",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(J,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(we,{children:[e.jsxs(Re,{expandIcon:e.jsx(ve,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(pe,{title:t("notification.email.signatureTooltip"),children:e.jsx(xe,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ke,{children:[e.jsx(x,{title:t("notification.email.companyName"),children:e.jsx(p,{name:"companyName",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.companyLink"),children:e.jsx(p,{name:"companyLink",control:u,rules:{validate:a?S:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.companyAddress"),children:e.jsx(p,{name:"companyAddress",control:u,rules:{validate:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(x,{title:t("notification.email.supportEmail"),children:e.jsx(p,{name:"supportEmail",control:u,rules:{validate:a?O:y},render:({field:r})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(w,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(L,{variant:"outlined",loading:c,color:"warning",onClick:l(D),disabled:!a||c,children:t("oauth.runTest")}),e.jsx(L,{type:"submit",variant:"contained",loading:c,disabled:!i.isDirty||c,children:t("oauth.save")})]})]}),R]})}const qe=ie(ne)``,H={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function Ie(){const{api:d}=oe(),{blocklet:n}=le(),{t}=te(),{confirmApi:f,confirmHolder:R}=ce(),[c,j]=W.useState(!1),_=n?.meta?.did,h=Object.assign({...H},n?.settings?.notification?.pushKit||{}),{handleSubmit:l,control:u,formState:i,watch:q,reset:I}=se({defaultValues:ae(h,Object.keys(H))}),o=re({testReceiver:"",testReceiverError:""}),a=q("enabled"),K=m(async(s,E,g=!0)=>{try{j(!0);const{blocklet:S}=await d.configNotification({input:{did:_,notification:JSON.stringify({pushKit:s})}}),O=Object.assign({...H},S?.settings?.notification?.pushKit||{});I(O),g&&P.success(t("oauth.saveSuccess"))}catch(S){if(g)P.error(S.message||t("oauth.saveFailed"));else throw S}finally{j(!1)}}),F=m(async(s,E)=>{try{j(!0),i.isDirty&&await K(s,E,!1);const g=(n?.configs||[]).find(y=>y.key==="BLOCKLET_APP_URL")?.value,S=je(be(g,ye.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:n?.meta?.version,t:new Date(n?.updatedAt||0).getTime()}),O={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:n?.appDid,fullName:n?.meta?.title,avatar:S}}}};await d.sendPush({input:{did:_,receiver:o.testReceiver,notification:JSON.stringify(O)}}),P.success(t("notification.pushKit.testSuccess"))}catch(g){P.error(g.message||t("notification.pushKit.testfailed"))}finally{j(!1)}}),D=m((s,E)=>{o.testReceiverError="",f.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(w,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(v,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:o.testReceiver,onChange:g=>{o.testReceiver=g.target.value},error:!!o.testReceiverError,helperText:o.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(g){if(!o.testReceiver?.trim()){o.testReceiverError=t("notification.pushKit.receiverRequired");return}o.testReceiverError="",await F(s,E),g()},onCancel:()=>{j(!1)}})}),M=m(s=>{const E=s?.trim();return E?Z(E)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),U=m(()=>!0);return e.jsxs(w,{children:[e.jsxs(Ke,{component:"form",onSubmit:l(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(x,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(p,{name:"enabled",control:u,render:({field:s})=>e.jsx(J,{control:e.jsx($,{checked:s.value,...s})})})}),e.jsx(x,{title:t("notification.pushKit.endpoint"),children:e.jsx(p,{name:"endpoint",control:u,rules:{validate:a?M:U},render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})})}),e.jsxs(x,{title:t("notification.pushKit.customOptions"),children:[e.jsx(p,{name:"did",control:u,render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})}),e.jsx(p,{name:"pushPath",control:u,render:({field:s})=>e.jsx(b,{fullWidth:!0,children:e.jsx(v,{...s,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[s.name],helperText:i.errors[s.name]?.message||" ",disabled:!a})})})]}),e.jsxs(w,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(L,{variant:"outlined",loading:c,color:"warning",onClick:l(D),disabled:!a||c,children:t("oauth.runTest")}),e.jsx(L,{type:"submit",variant:"contained",loading:c,disabled:!i.isDirty||c,children:t("oauth.save")})]})]}),R]})}const Ke=ie(ne)``,ee=[{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Wallet"}),value:"wallet"},{label:e.jsx(w,{sx:{textAlign:"center",width:"100%"},children:"Webhooks"}),value:"webhooks"}];function Je(){const[d,n]=W.useState(ee[0].value),{t}=W.useContext(de),f=fe(()=>({email:e.jsx(_e,{}),pushKit:e.jsx(Ie,{}),wallet:e.jsx(Q,{variant:"body1",children:t("notification.wallet.description")}),webhooks:e.jsx(Q,{variant:"body1",children:t("notification.webhooks.description")})}),[t]),R=W.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(w,{children:[e.jsx(me,{variant:"card",tabs:ee,current:d,onChange:n}),e.jsx(w,{style:R,children:f[d]})]})}export{Je as default};
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-BqKQizRf.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-KtPBvlG0.js";import{co as Or,cf as Vr}from"./index-CCp_Tje1.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-drLlzTVq.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-DfSgTRg5.js";import{co as Or,cf as Vr}from"./index-DwK0GIrs.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4