@abtnode/webapp 1.16.45-beta-20250614-101901-d1700f8d → 1.16.45-beta-20250618-073451-6e48fb62

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 (219) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-Bb5pC0CE.js → AdapterDayjs-Cf6af3xk.js} +7 -7
  4. package/dist/assets/{Add-B4ZxigzZ.js → Add-BFsFN1Gy.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-CUWlyoV4.js → ArrowDropDown-CejcJzkX.js} +1 -1
  6. package/dist/assets/{Autocomplete-CuIaboOl.js → Autocomplete-PeF181FR.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-D9KOmd_k.js → Breadcrumbs-B6YSRzTf.js} +1 -1
  8. package/dist/assets/{ButtonGroup-Djxp9GV8.js → ButtonGroup-BzAT8pGA.js} +1 -1
  9. package/dist/assets/{CSSTransition-Bd8ftQ2v.js → CSSTransition-Byi2ne4y.js} +1 -1
  10. package/dist/assets/{CallMerge-DEaNB8FX.js → CallMerge-CaTZFXVq.js} +1 -1
  11. package/dist/assets/{CardContent-B3U2Afde.js → CardContent-Dk0Md6L4.js} +1 -1
  12. package/dist/assets/{ChevronLeft-C3iioEE4.js → ChevronLeft-CDs40tmH.js} +1 -1
  13. package/dist/assets/{ChevronRight-BhM33GF3.js → ChevronRight-CFfmouwT.js} +1 -1
  14. package/dist/assets/{Clear-bgnUq6y0.js → Clear-CmPKgcDo.js} +1 -1
  15. package/dist/assets/{Close-PlsqSLh4.js → Close-C8GsrnLa.js} +1 -1
  16. package/dist/assets/{Community-Bitv2uQh.js → Community-D1NMDj2P.js} +1 -1
  17. package/dist/assets/{Delete-BEDhfjgM.js → Delete-CiU1bEBu.js} +1 -1
  18. package/dist/assets/{DeleteOutline-BnT7fsMq.js → DeleteOutline-reI_idEa.js} +1 -1
  19. package/dist/assets/{Done-C9FHJdQ0.js → Done-BFMi5HXU.js} +1 -1
  20. package/dist/assets/{Edit-Czl2eCpM.js → Edit-BvogU5l2.js} +1 -1
  21. package/dist/assets/{ErrorOutline-HeG61pGN.js → ErrorOutline-CLZmnhnI.js} +1 -1
  22. package/dist/assets/{HelpOutline-BJqbizDQ.js → HelpOutline-hZN36iob.js} +1 -1
  23. package/dist/assets/{Holiday-wnrbKvDD.js → Holiday-CVr2LMMz.js} +1 -1
  24. package/dist/assets/{Launch-CXYVNZYv.js → Launch-BVKqak_-.js} +1 -1
  25. package/dist/assets/{Link-FsEUY-zQ.js → Link-C4o8Tfyg.js} +1 -1
  26. package/dist/assets/{ListItemButton-Cq2F-p9g.js → ListItemButton-D2V2qgeT.js} +1 -1
  27. package/dist/assets/{ListSubheader-DVU9b242.js → ListSubheader-BSK-B-Hs.js} +1 -1
  28. package/dist/assets/{LoadingButton-x-yHYRV-.js → LoadingButton-VMcNYQ8q.js} +1 -1
  29. package/dist/assets/{LockIcon-BKEcgaSm.js → LockIcon-C58tNgx9.js} +1 -1
  30. package/dist/assets/{Meeting-BzSKBr5G.js → Meeting-ocx742Wk.js} +1 -1
  31. package/dist/assets/{MoreHoriz-BrmAZhbC.js → MoreHoriz-CPdB-acW.js} +1 -1
  32. package/dist/assets/{MoreVert-D4ECIeFy.js → MoreVert-BZT8paNd.js} +1 -1
  33. package/dist/assets/{OffSick-u-7KRz_z.js → OffSick-a8D-sUdt.js} +1 -1
  34. package/dist/assets/{OpenInNew-IexFTpEO.js → OpenInNew-DJsi1NWq.js} +1 -1
  35. package/dist/assets/{Public-CZtu3y_2.js → Public-DSbGTo8s.js} +1 -1
  36. package/dist/assets/{Refresh-Dbz-_IlE.js → Refresh-BK_aBn8t.js} +1 -1
  37. package/dist/assets/{SchemaReference.es-COj24FRb.js → SchemaReference.es-BYITplvj.js} +1 -1
  38. package/dist/assets/{Search-B9sPCbKU.js → Search-DGRuo7t-.js} +1 -1
  39. package/dist/assets/{Slider-DoZh9gZt.js → Slider-CS-gjd3v.js} +1 -1
  40. package/dist/assets/{Stepper-WMlGg2XY.js → Stepper-ZCO4EB3o.js} +1 -1
  41. package/dist/assets/{Switch-v96fFUVN.js → Switch-CG3jQlg3.js} +1 -1
  42. package/dist/assets/{TableRow-DMNYoxLV.js → TableRow-Cyof88VP.js} +1 -1
  43. package/dist/assets/{TableSearch-CIJv0sa5.js → TableSearch-CxutcmoF.js} +1 -1
  44. package/dist/assets/{ToggleButtonGroup-DSjHARIe.js → ToggleButtonGroup-Dldk8U9s.js} +1 -1
  45. package/dist/assets/{Verified-3rFYpz5S.js → Verified-DVQjMky2.js} +1 -1
  46. package/dist/assets/{VerifiedUser-B0TfZPGq.js → VerifiedUser-350MitWy.js} +1 -1
  47. package/dist/assets/{ViewColumn-YTkBMCPT.js → ViewColumn-BSxTQVZ-.js} +1 -1
  48. package/dist/assets/{ViewList-Cn5h6Rj3.js → ViewList-BEu0UPsS.js} +1 -1
  49. package/dist/assets/{WorkingRemotely-PcnPDMUW.js → WorkingRemotely-BEw6X98n.js} +1 -1
  50. package/dist/assets/{_createAggregator-DvDPHTGg.js → _createAggregator-Djv2-ovu.js} +1 -1
  51. package/dist/assets/{actions-DKMplt8L.js → actions-DNqu-9QQ.js} +1 -1
  52. package/dist/assets/{actions-DWmK9-Ml.js → actions-LyrEo_Cb.js} +1 -1
  53. package/dist/assets/{agreement-B8JPFy7O.js → agreement-Cc4wdZqi.js} +1 -1
  54. package/dist/assets/api-CSrxJE-w.js +1 -0
  55. package/dist/assets/{appearance-BLzT9a17.js → appearance-BkddHlmf.js} +1 -1
  56. package/dist/assets/{ar-C_PbiO-w.js → ar-DLXKKOGO.js} +1 -1
  57. package/dist/assets/{audit-logs-IXBKuhDc.js → audit-logs-EkgBhSvA.js} +1 -1
  58. package/dist/assets/{base-chart-BjMI41fT.js → base-chart-C63mtC4Z.js} +1 -1
  59. package/dist/assets/{blocklet-Dj7-7T3f.js → blocklet-BzkaFDNW.js} +1 -1
  60. package/dist/assets/{brace-fold.es-PD8yVtZP.js → brace-fold.es-CyCMNzH4.js} +1 -1
  61. package/dist/assets/{chain-BHqPLd89.js → chain-DJhIX7OW.js} +2 -2
  62. package/dist/assets/{click-to-copy-CaV3f1zY.js → click-to-copy-CYaDSQoy.js} +1 -1
  63. package/dist/assets/cloneDeep-C6XYSA9m.js +1 -0
  64. package/dist/assets/{closebrackets.es-Ojy0KXT7.js → closebrackets.es-DvIy3kAL.js} +1 -1
  65. package/dist/assets/{codemirror.es-BqP83lfI.js → codemirror.es-BtJVhvPq.js} +1 -1
  66. package/dist/assets/{collapse-CWe0kq4t.js → collapse-BhbkfN99.js} +1 -1
  67. package/dist/assets/{comment.es-BVw0Jh8C.js → comment.es-BWJma_ss.js} +1 -1
  68. package/dist/assets/{config-navigation-BmdmCPda.js → config-navigation-DfmuKS6F.js} +3 -3
  69. package/dist/assets/{connect-to-BVNgPIbZ.js → connect-to-CorUs381.js} +1 -1
  70. package/dist/assets/{de-m_nuB8Qa.js → de-CnbmrteH.js} +1 -1
  71. package/dist/assets/{delete-confirm-CyLYocY4.js → delete-confirm-D2071wW2.js} +1 -1
  72. package/dist/assets/{detail-DI40x12E.js → detail-BgptcQe2.js} +3 -3
  73. package/dist/assets/{dialog.es-kGJe5bqp.js → dialog.es-DNRuZxpL.js} +1 -1
  74. package/dist/assets/{domains-CXyEkw33.js → domains-Dw6WVrfK.js} +2 -2
  75. package/dist/assets/{download-C9GUXLGP.js → download-mU0RETFZ.js} +1 -1
  76. package/dist/assets/emotion-react.browser.esm-CSjORkdU.js +1 -0
  77. package/dist/assets/{es-BrT673RG.js → es-C7oXJBWv.js} +1 -1
  78. package/dist/assets/{foldgutter.es-BHJeM3tK.js → foldgutter.es-BfaddajE.js} +1 -1
  79. package/dist/assets/{fr-BmbyLkZB.js → fr-DzleTcLj.js} +1 -1
  80. package/dist/assets/{get-safe-url-0JvnPl3q.js → get-safe-url-COP_ZxQz.js} +1 -1
  81. package/dist/assets/{get-safe-url-C9_OIoJO.js → get-safe-url-DS1bGOO2.js} +1 -1
  82. package/dist/assets/getValidReactChildren-CxwCdnNW.js +1 -0
  83. package/dist/assets/{hi-CL8_a9An.js → hi-B24wH0bs.js} +1 -1
  84. package/dist/assets/{hint.es-k_cAqmy-.js → hint.es-DhVyUt1d.js} +1 -1
  85. package/dist/assets/{hint.es2-Li9KpSNj.js → hint.es2-uDqXrloM.js} +1 -1
  86. package/dist/assets/{id-DkcL27A7.js → id-BIjW1vW9.js} +1 -1
  87. package/dist/assets/{iframe-DcIfpfxi.js → iframe-D-LcA3MK.js} +1 -1
  88. package/dist/assets/{index-GUAc0qkG.js → index-4aFZazff.js} +1 -1
  89. package/dist/assets/{index-CmNGzNDe.js → index-5OOYkflw.js} +1 -1
  90. package/dist/assets/{index-rKYT_6qC.js → index-B-SlNWYL.js} +1 -1
  91. package/dist/assets/{index-C4MaKi4X.js → index-B0UMNJnN.js} +1 -1
  92. package/dist/assets/{index-B2VuOb4T.js → index-B8IA5mbU.js} +99 -99
  93. package/dist/assets/{index-CC7YYufc.js → index-BIgkt_q9.js} +1 -1
  94. package/dist/assets/{index-rbUoQ9gl.js → index-BJQjXoNM.js} +1 -1
  95. package/dist/assets/{index-BzVT2Nrg.js → index-BOH-YtOs.js} +1 -1
  96. package/dist/assets/{index-t1Vs8IVi.js → index-BRvaeUvs.js} +3 -3
  97. package/dist/assets/{index-DVL9-eIW.js → index-BZMWcUCX.js} +1 -1
  98. package/dist/assets/{index-CGeoqmfc.js → index-BblGFvvF.js} +1 -1
  99. package/dist/assets/{index-C7vEHTkF.js → index-BcbNijWK.js} +1 -1
  100. package/dist/assets/{index-BKWicGJw.js → index-BhAPLn1b.js} +1 -1
  101. package/dist/assets/{index-COwBBm-4.js → index-BkRO05--.js} +1 -1
  102. package/dist/assets/index-C0dOEsU4.js +345 -0
  103. package/dist/assets/{index-DtX1Yh2-.js → index-C5ZlPR3p.js} +5 -5
  104. package/dist/assets/{index-_5_Ps15_.js → index-C9buY914.js} +1 -1
  105. package/dist/assets/{index-Dks6FN1E.js → index-C9oR1oH6.js} +1 -1
  106. package/dist/assets/{index-Xier6ImM.js → index-CCINW9gm.js} +3 -3
  107. package/dist/assets/{index-DCqblcAS.js → index-CFkoE5Gw.js} +1 -1
  108. package/dist/assets/{index-BzzcpDqF.js → index-CHPEHw0Y.js} +1 -1
  109. package/dist/assets/{index-7_3PwYKM.js → index-CW7SH6ZA.js} +1 -1
  110. package/dist/assets/{index-D3lJNxw1.js → index-CZ5-hnEn.js} +1 -1
  111. package/dist/assets/{index-DjL5W4NV.js → index-Cb3Huyfb.js} +1 -1
  112. package/dist/assets/{index-BTaOViYK.js → index-CdU6oLkY.js} +1 -1
  113. package/dist/assets/{index-DqV66qpx.js → index-CeNoqA4g.js} +1 -1
  114. package/dist/assets/{index-BF4vf6id.js → index-Cy666DOY.js} +1 -1
  115. package/dist/assets/{index-Cxh7-j7t.js → index-D6ARqm6f.js} +1 -1
  116. package/dist/assets/index-DCo8_mUx.js +1 -0
  117. package/dist/assets/{index-BR_bwH6y.js → index-DNITJyFR.js} +1 -1
  118. package/dist/assets/{index-DTZE29O1.js → index-DOsDgrew.js} +3 -3
  119. package/dist/assets/{index-CZL8t7rK.js → index-DU-OQYbG.js} +1 -1
  120. package/dist/assets/{index-DDEC_Kd4.js → index-DUIS5TWY.js} +2 -2
  121. package/dist/assets/{index-BV-U1IGg.js → index-DVrUurys.js} +1 -1
  122. package/dist/assets/{index-C6uxeWL5.js → index-DbTX57bM.js} +1 -1
  123. package/dist/assets/{index-DPbR5J86.js → index-DrxRISPM.js} +3 -3
  124. package/dist/assets/index-Dyvb9fH4.js +521 -0
  125. package/dist/assets/{index-CW8V_EzA.js → index-LcQ1y9fq.js} +1 -1
  126. package/dist/assets/{index-vcSSPl4z.js → index-P1DlwKGv.js} +1 -1
  127. package/dist/assets/{index-B9KZI2SN.js → index-QU1qCf8F.js} +1 -1
  128. package/dist/assets/{index-DS43ilTD.js → index-czhxiIDF.js} +1 -1
  129. package/dist/assets/{index-Cd18MmSj.js → index-fHnSssqp.js} +2 -2
  130. package/dist/assets/{index-CQ-h8qjE.js → index-oBJqRsld.js} +1 -1
  131. package/dist/assets/{index-vaiRdcM2.js → index-oc5ucOuy.js} +1 -1
  132. package/dist/assets/{index-QorDXsuU.js → index-qfTOhIhQ.js} +1 -1
  133. package/dist/assets/{index-eb0zP4qu.js → index-rZ1SBrH_.js} +1 -1
  134. package/dist/assets/{index-Xck-gZ1a.js → index-zsz18EZU.js} +1 -1
  135. package/dist/assets/{index.esm-C-ANFUiM.js → index.esm-F8b32K2k.js} +1 -1
  136. package/dist/assets/{info-addon.es-Clfe_YEr.js → info-addon.es-CPDzNYQ-.js} +1 -1
  137. package/dist/assets/{info.es-DTVoe_8d.js → info.es-B-z85utp.js} +1 -1
  138. package/dist/assets/{install-from-url-hREB3CNT.js → install-from-url-BNqF6NV-.js} +1 -1
  139. package/dist/assets/{invitation-DH-VnVbf.js → invitation-qmFlHZV_.js} +1 -1
  140. package/dist/assets/is-path-prefix-equal-lgGkNkcR.js +1 -0
  141. package/dist/assets/{item-DUsLqUoz.js → item-DuGkpxdL.js} +1 -1
  142. package/dist/assets/{ja-BVJLb0qY.js → ja-mu0bc5Fx.js} +1 -1
  143. package/dist/assets/{javascript.es-CSk381y5.js → javascript.es-DwEw3iuE.js} +1 -1
  144. package/dist/assets/{jump-to-line.es-CX5j92XC.js → jump-to-line.es-BaO-Qct6.js} +1 -1
  145. package/dist/assets/{jump.es-BfbIZisJ.js → jump.es-DEVhkMqg.js} +1 -1
  146. package/dist/assets/{ko-Dd2Xcc8p.js → ko-CSWdQF8q.js} +1 -1
  147. package/dist/assets/{lint.es-FISSx6VT.js → lint.es-DNf7-y3f.js} +1 -1
  148. package/dist/assets/{lint.es2-CeclGLqm.js → lint.es2-CkGacl6V.js} +1 -1
  149. package/dist/assets/{lint.es3-BcqYL5Qv.js → lint.es3-ddr9rdgz.js} +1 -1
  150. package/dist/assets/{list-header-BQri46Fq.js → list-header-DL9A5VcR.js} +1 -1
  151. package/dist/assets/{log-QERiX60g.js → log-JH4lXNVE.js} +1 -1
  152. package/dist/assets/{lottie-react.esm-DapLVKwh.js → lottie-react.esm-Dr-WheMr.js} +1 -1
  153. package/dist/assets/{matchbrackets.es-COCwyBKy.js → matchbrackets.es-XuVMbpLz.js} +1 -1
  154. package/dist/assets/{memory-wfA3c894.js → memory-C_p3X92I.js} +1 -1
  155. package/dist/assets/{metric-ke_EHR4Y.js → metric-CB_GPXBA.js} +1 -1
  156. package/dist/assets/{mode.es-DYykbCE6.js → mode.es-Dqrxjy1v.js} +1 -1
  157. package/dist/assets/{mode.es2-BnJH50Gn.js → mode.es2-VNAXkQps.js} +1 -1
  158. package/dist/assets/{mode.es3-DJdTbbcR.js → mode.es3-BN6h3Bus.js} +1 -1
  159. package/dist/assets/omit-Bc4_KMtF.js +1 -0
  160. package/dist/assets/{onlineParser.es-BVyIjImU.js → onlineParser.es-D4el_PBT.js} +1 -1
  161. package/dist/assets/{overview-BtSGdVcw.js → overview-BXzzQmbs.js} +1 -1
  162. package/dist/assets/{permission-DTthelu1.js → permission-JEjDz9i9.js} +1 -1
  163. package/dist/assets/{preference-Bx-c5Q2Y.js → preference-QWJp9UJS.js} +3 -3
  164. package/dist/assets/{pt-BfbUt_Nx.js → pt-Odg8daEV.js} +1 -1
  165. package/dist/assets/{raf-schd.esm-BirpSuOr.js → raf-schd.esm-D-4-98oh.js} +3 -3
  166. package/dist/assets/refType-Dqlqmha-.js +1 -0
  167. package/dist/assets/{resource-dialog-BNbaaEXt.js → resource-dialog-BSxf3l0v.js} +17 -17
  168. package/dist/assets/{ru-uXrAFAz0.js → ru-OkiNIvy3.js} +1 -1
  169. package/dist/assets/{runtime-COg1Abce.js → runtime-DFh8uNkc.js} +1 -1
  170. package/dist/assets/sdk-DtMj7H7_.js +1 -0
  171. package/dist/assets/{search.es-DKkeTaVT.js → search.es-CvgIaw00.js} +1 -1
  172. package/dist/assets/{searchcursor.es-ByhbK73r.js → searchcursor.es-OCU4Stl-.js} +1 -1
  173. package/dist/assets/{service-DE1KFi16.js → service-C2aUE-9d.js} +1 -1
  174. package/dist/assets/{shorten-label-CWvoYJOM.js → shorten-label-DEXH98Sk.js} +1 -1
  175. package/dist/assets/{show-hint.es-CikFU7Mi.js → show-hint.es-Ddp99Kzq.js} +1 -1
  176. package/dist/assets/{simple-select-Dmiac-kN.js → simple-select-DtUilbs1.js} +1 -1
  177. package/dist/assets/{spaces-NBDzWy_B.js → spaces-C01mORkW.js} +1 -1
  178. package/dist/assets/{status-BEZ5kRKV.js → status-DaQfjPiw.js} +1 -1
  179. package/dist/assets/{status-CdtY8xKO.js → status-DwmHBBa8.js} +1 -1
  180. package/dist/assets/{sublime.es-D6CyioOW.js → sublime.es-D01aXBye.js} +1 -1
  181. package/dist/assets/{switch-control-B3dTSZzV.js → switch-control-BUF_yGeD.js} +1 -1
  182. package/dist/assets/{table-icons-DmDNBvmp.js → table-icons-C5qrNAvA.js} +1 -1
  183. package/dist/assets/{team-B2fYu72j.js → team-BcbX_cMl.js} +1 -1
  184. package/dist/assets/{th-BnT_StPj.js → th-esLoaeiE.js} +1 -1
  185. package/dist/assets/{toLower-Bj4rzzyW.js → toLower-GSZ9DJJ3.js} +1 -1
  186. package/dist/assets/toUpper-BPMwwnP-.js +1 -0
  187. package/dist/assets/{traffic-BSoP7glH.js → traffic-CTPgH40k.js} +1 -1
  188. package/dist/assets/{url-evaluation-BzcyBhf_.js → url-evaluation-DmRIkzYe.js} +1 -1
  189. package/dist/assets/{url-join-Cbra-UZX.js → url-join-BSWLYThb.js} +1 -1
  190. package/dist/assets/{use-mobile-DWCwqlKP.js → use-mobile-DU80Jj4U.js} +1 -1
  191. package/dist/assets/{use-mobile-pZqk7eRQ.js → use-mobile-DxY5BxAJ.js} +1 -1
  192. package/dist/assets/{useAsync-Ca6qreJM.js → useAsync-Ct1xKput.js} +1 -1
  193. package/dist/assets/{useAsyncRetry-HZ7iBUko.js → useAsyncRetry-Bis_hMS7.js} +1 -1
  194. package/dist/assets/{useLocalStorage-DGcI4VdJ.js → useLocalStorage-CRy7LFYG.js} +1 -1
  195. package/dist/assets/{useThemeProps-CdW8lLMN.js → useThemeProps-C3mE_-3Z.js} +1 -1
  196. package/dist/assets/{util-iDYYpKIQ.js → util-Ctz_J-u1.js} +1 -1
  197. package/dist/assets/{vi-DmitUjjk.js → vi-BF6u6-98.js} +1 -1
  198. package/dist/assets/{wait-container-2rrLmbus.js → wait-container-Der-CqPb.js} +1 -1
  199. package/dist/assets/{withStyles-eNVHMShy.js → withStyles-DWhl0Lx-.js} +1 -1
  200. package/dist/assets/{without-wallet-XldJKqJH.js → without-wallet-Bmmbgqin.js} +1 -1
  201. package/dist/assets/wrap-locale-rE7v3anU.js +1 -0
  202. package/dist/assets/{zh-syG1cNt6.js → zh-DJTjvgj8.js} +1 -1
  203. package/dist/assets/{zh-tw-DnHJQaoN.js → zh-tw-B7cFexwg.js} +1 -1
  204. package/dist/index.html +1 -1
  205. package/dist/service-worker.js +1 -1
  206. package/package.json +1 -1
  207. package/dist/assets/api-C1uJD3Ou.js +0 -1
  208. package/dist/assets/cloneDeep-D9FrtSv6.js +0 -1
  209. package/dist/assets/emotion-react.browser.esm-zhWsWQqH.js +0 -1
  210. package/dist/assets/getValidReactChildren-BK3p7HMr.js +0 -1
  211. package/dist/assets/index-5pv_o6Yt.js +0 -521
  212. package/dist/assets/index-BRRY3VLK.js +0 -1
  213. package/dist/assets/index-DRSI6DIa.js +0 -345
  214. package/dist/assets/is-path-prefix-equal-C_kpxZAH.js +0 -1
  215. package/dist/assets/omit-fcUn_miO.js +0 -1
  216. package/dist/assets/refType-Dh8-m1kl.js +0 -1
  217. package/dist/assets/sdk-BW91rmDS.js +0 -1
  218. package/dist/assets/toUpper-twB6RYx8.js +0 -1
  219. package/dist/assets/wrap-locale-Dg2PW6uW.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-DapLVKwh.js","./index-B2VuOb4T.js","./index-Cp6LwWOU.css"])))=>i.map(i=>d[i]);
2
- import{c6 as H,r as h,cx as X,bX as _,j as e,hm as q,aU as B,fX as W,N as l,G as b,k as S,t as J,aZ as K,ep as N,n as k,dx as M,dy as Y,a5 as Z,bC as L,am as Q,aV as ee,lo as te}from"./index-B2VuOb4T.js";import{R as re,a as ie}from"./url-evaluation-BzcyBhf_.js";import{S as O}from"./Slider-DoZh9gZt.js";import{k as oe,g as ae}from"./index-Xier6ImM.js";import{C as se}from"./Close-PlsqSLh4.js";import"./url-join-Cbra-UZX.js";import"./index-DCqblcAS.js";import"./_createAggregator-DvDPHTGg.js";import"./index-CGeoqmfc.js";import"./resource-dialog-BNbaaEXt.js";import"./index-BF4vf6id.js";import"./index-C6uxeWL5.js";import"./index-Cxh7-j7t.js";import"./use-mobile-DWCwqlKP.js";import"./ListItemButton-Cq2F-p9g.js";import"./index-rbUoQ9gl.js";import"./emotion-react.browser.esm-zhWsWQqH.js";import"./index-CmNGzNDe.js";import"./Switch-v96fFUVN.js";import"./index-Xck-gZ1a.js";import"./TableRow-DMNYoxLV.js";import"./useThemeProps-CdW8lLMN.js";import"./ViewColumn-YTkBMCPT.js";import"./Search-B9sPCbKU.js";import"./Clear-bgnUq6y0.js";import"./Delete-BEDhfjgM.js";import"./MoreVert-D4ECIeFy.js";import"./TableSearch-CIJv0sa5.js";import"./index-Cd18MmSj.js";import"./OpenInNew-IexFTpEO.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-BJqbizDQ.js";import"./index-BKWicGJw.js";import"./ButtonGroup-Djxp9GV8.js";import"./getValidReactChildren-BK3p7HMr.js";import"./toUpper-twB6RYx8.js";function ne(t){var c=H(h.useState(t),2),s=c[0],i=c[1],n=X(s),m=h.useCallback(function(){return n.current},[]);return[s,i,m]}const le=_([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")],"CheckCircleTwoTone"),ce=_(e.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),de=_(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked"),me=_(e.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"}),"TipsAndUpdates"),D=h.createContext({}),F=()=>h.useContext(D);function pe({children:t,restrictions:c,i18n:s,theme:i}){const[n,m]=ne({loading:!1}),p=a=>m(j=>({...j,loading:a})),f=h.useMemo(()=>({...n,onLoading:p,restrictions:c,i18n:s}),[n]);return e.jsx(q,{theme:i,children:e.jsx(D.Provider,{value:f,children:t})})}const xe=["1024x1024","1024x1792","1792x1024"],ue=["256x256","512x512","1024x1024"],he=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function fe({onSubmit:t}){const{loading:c,i18n:s}=F(),i=B({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const a=JSON.parse(JSON.stringify(i));Object.values(i).every(y=>!!y)&&t(a)},{run:m}=W(n,{wait:500}),p={width:"100%",pl:1,pr:1},f=i.model==="dall-e-2"?ue:xe;return e.jsxs(ge,{onSubmit:a=>a.preventDefault(),children:[e.jsx(l,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(b,{container:!0,gap:2.5,children:[e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:s("aiImagePrompt")}),e.jsx(J,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:i.prompt??"",onChange:a=>{a.stopPropagation(),i.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageModel")}`}),e.jsx(re,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:i.model,onChange:a=>{i.number=1,i.size="1024x1024",i.model=a.target.value},children:he.map(a=>e.jsx(K,{value:a.value,control:e.jsx(ie,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageSize")}: ${i.size}`}),e.jsx(b,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(l,{flex:1,children:e.jsx(l,{...p,children:e.jsx(O,{size:"small",min:0,max:f.length-1,step:1,value:f.findIndex(a=>a==i.size),onChange:(a,j)=>{i.size=f[j]}})})})})]}),i.model==="dall-e-2"&&e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageNumber")}: ${i.number}`}),e.jsx(l,{...p,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:i.number,onChange:(a,j)=>{a.stopPropagation(),i.number=Number(j)}})})]})]})}),e.jsx(N,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:m,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const ge=k(l)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-Dr-WheMr.js","./index-B8IA5mbU.js","./index-Cp6LwWOU.css"])))=>i.map(i=>d[i]);
2
+ import{c6 as H,r as h,cx as X,bX as _,j as e,hn as q,aU as B,fX as W,N as l,G as b,k as S,t as J,aZ as K,ep as N,n as k,dx as M,dy as Y,a5 as Z,bC as L,am as Q,aV as ee,lp as te}from"./index-B8IA5mbU.js";import{R as re,a as ie}from"./url-evaluation-DmRIkzYe.js";import{S as O}from"./Slider-CS-gjd3v.js";import{k as oe,g as ae}from"./index-CCINW9gm.js";import{C as se}from"./Close-C8GsrnLa.js";import"./url-join-BSWLYThb.js";import"./index-CFkoE5Gw.js";import"./_createAggregator-Djv2-ovu.js";import"./index-BblGFvvF.js";import"./resource-dialog-BSxf3l0v.js";import"./index-Cy666DOY.js";import"./index-DbTX57bM.js";import"./index-D6ARqm6f.js";import"./use-mobile-DU80Jj4U.js";import"./ListItemButton-D2V2qgeT.js";import"./index-BJQjXoNM.js";import"./emotion-react.browser.esm-CSjORkdU.js";import"./index-5OOYkflw.js";import"./Switch-CG3jQlg3.js";import"./index-zsz18EZU.js";import"./TableRow-Cyof88VP.js";import"./useThemeProps-C3mE_-3Z.js";import"./ViewColumn-BSxTQVZ-.js";import"./Search-DGRuo7t-.js";import"./Clear-CmPKgcDo.js";import"./Delete-CiU1bEBu.js";import"./MoreVert-BZT8paNd.js";import"./TableSearch-CxutcmoF.js";import"./index-fHnSssqp.js";import"./OpenInNew-DJsi1NWq.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-hZN36iob.js";import"./index-BhAPLn1b.js";import"./ButtonGroup-BzAT8pGA.js";import"./getValidReactChildren-CxwCdnNW.js";import"./toUpper-BPMwwnP-.js";function ne(t){var c=H(h.useState(t),2),s=c[0],i=c[1],n=X(s),m=h.useCallback(function(){return n.current},[]);return[s,i,m]}const le=_([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")],"CheckCircleTwoTone"),ce=_(e.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),de=_(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked"),me=_(e.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"}),"TipsAndUpdates"),D=h.createContext({}),F=()=>h.useContext(D);function pe({children:t,restrictions:c,i18n:s,theme:i}){const[n,m]=ne({loading:!1}),p=a=>m(j=>({...j,loading:a})),f=h.useMemo(()=>({...n,onLoading:p,restrictions:c,i18n:s}),[n]);return e.jsx(q,{theme:i,children:e.jsx(D.Provider,{value:f,children:t})})}const xe=["1024x1024","1024x1792","1792x1024"],ue=["256x256","512x512","1024x1024"],he=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function fe({onSubmit:t}){const{loading:c,i18n:s}=F(),i=B({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const a=JSON.parse(JSON.stringify(i));Object.values(i).every(y=>!!y)&&t(a)},{run:m}=W(n,{wait:500}),p={width:"100%",pl:1,pr:1},f=i.model==="dall-e-2"?ue:xe;return e.jsxs(ge,{onSubmit:a=>a.preventDefault(),children:[e.jsx(l,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(b,{container:!0,gap:2.5,children:[e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:s("aiImagePrompt")}),e.jsx(J,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:s("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:i.prompt??"",onChange:a=>{a.stopPropagation(),i.prompt=a.target.value},inputProps:{maxLength:1e3}})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageModel")}`}),e.jsx(re,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:i.model,onChange:a=>{i.number=1,i.size="1024x1024",i.model=a.target.value},children:he.map(a=>e.jsx(K,{value:a.value,control:e.jsx(ie,{size:"small"}),label:a.label},a.label))})]}),e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageSize")}: ${i.size}`}),e.jsx(b,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(l,{flex:1,children:e.jsx(l,{...p,children:e.jsx(O,{size:"small",min:0,max:f.length-1,step:1,value:f.findIndex(a=>a==i.size),onChange:(a,j)=>{i.size=f[j]}})})})})]}),i.model==="dall-e-2"&&e.jsxs(b,{item:!0,xs:12,children:[e.jsx(S,{gutterBottom:!0,className:"title label",color:"text.primary",children:`${s("aiImageNumber")}: ${i.number}`}),e.jsx(l,{...p,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:i.number,onChange:(a,j)=>{a.stopPropagation(),i.number=Number(j)}})})]})]})}),e.jsx(N,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:m,disabled:c,children:s(c?"aiImageGenerating":"aiImageGenerate")},c?"loading-submit":"submit")]})}const ge=k(l)`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  height: 100%;
@@ -93,7 +93,7 @@ import{c6 as H,r as h,cx as X,bX as _,j as e,hm as q,aU as B,fX as W,N as l,G as
93
93
  & path:last-child {
94
94
  fill: white;
95
95
  }
96
- `,ve=h.lazy(()=>L(()=>import("./lottie-react.esm-DapLVKwh.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Player})));function T({src:t}){return e.jsx(ve,{src:t,loop:!0,autoplay:!0})}function ke({options:t,handleApi:c,onSelect:s,onFinish:i,onClose:n,isMobile:m}){const{loading:p,onLoading:f,restrictions:a,i18n:j}=F(),[d,y]=h.useState([]),[x,I]=h.useState(),P=Q(),z=a==null?void 0:a.maxNumberOfFiles,[u,R]=h.useState({}),g=B({}),A=Object.keys(g).filter(r=>g[r]),E={xs:6,sm:6};h.useEffect(()=>{x&&!u.error&&L(()=>import("./lottie-error-CMOXHtBH.js"),[],import.meta.url).then(r=>{R(o=>({...o,error:r.default}))}),t&&!d.length&&!u.loading&&L(()=>import("./lottie-loading-o-GBrhM9.js"),[],import.meta.url).then(r=>{R(o=>({...o,loading:r.default}))}),!t&&!u.welcome&&L(()=>import("./lottie-welcome-C9B95FIi.js"),[],import.meta.url).then(r=>{R(o=>({...o,welcome:r.default}))})},[x,t,d.length,u]),ee(async()=>{var r;if(t){I(void 0),f(!0);try{const o=await c({...t,responseFormat:"b64_json"});if(o.data){const w=(o.data||[]).map(C=>({src:`data:image/png;base64,${C.b64Json||C.b64_json}`,width:t.size?Number((t.size||"").split("x")[0]):1024,alt:t.prompt}));y(d?[...w,...d]:w)}else I(o)}catch(o){console.error("AIImage generate error: ",o),I(((r=o==null?void 0:o.response)==null?void 0:r.data)||o)}finally{f(!1),i()}}},[t==null?void 0:t.number,t==null?void 0:t.prompt,t==null?void 0:t.size]);const $=r=>{const o=Object.keys(g).filter(w=>g[w]);if(z?o.length<z:!0)g[r]?g[r]=!1:g[r]=!0;else{const w=o.pop();w!==r&&(g[w]=!1),g[r]=!g[r]}},V=r=>{if(d){const o=d.findIndex(v=>v.src===r);o>-1&&(g[r]=!1,d.splice(o,1),y([...d]))}},U=()=>{var o,v;const r={width:((o=document.querySelector(".photo-item img"))==null?void 0:o.offsetWidth)||0,height:((v=document.querySelector(".photo-item img"))==null?void 0:v.offsetHeight)||0};return e.jsx(e.Fragment,{children:Array.from({length:(t==null?void 0:t.number)||1}).map((w,C)=>h.createElement(b,{item:!0,...E,key:C},e.jsx(M,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...r}})))})},G=()=>x?e.jsxs(l,{width:300,height:300,m:"auto",children:[u.error&&e.jsx(T,{src:u.error},"error"),e.jsx(l,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:x==null?void 0:x.message})]}):d&&Array.isArray(d)&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(l,{flexGrow:1,sx:{height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(Se,{sx:m?{p:0,border:"none !important"}:{p:2},children:e.jsxs(b,{spacing:2,container:!0,className:"photo-wrapper",children:[p&&e.jsx(U,{}),d.map((r,o)=>h.createElement(b,{item:!0,...E,key:r.src,className:"photo-item"},e.jsx(be,{...r,selected:g[r.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:g[r.src]?`2px solid ${P.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{$(r.src)},onDelete:()=>{V(r.src)}})))]})})}),e.jsxs(l,{sx:{mt:2,display:"flex",justifyContent:n?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[n&&typeof n=="function"&&e.jsx(N,{color:"primary",variant:"outlined",onClick:n,children:e.jsx(se,{})}),e.jsx(N,{color:"primary",variant:"contained",disabled:!A.length||p,onClick:()=>{const r=oe(d,"src");s(A.map(o=>r[o]))},children:A.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):t?e.jsx(l,{width:220,height:220,m:"auto",children:u.loading&&e.jsx(T,{src:u.loading},"loading")}):e.jsx(l,{width:300,height:300,m:"auto",children:u.welcome&&e.jsx(T,{src:u.welcome},"welcome")});return e.jsx(Ie,{children:G()})}const Ie=k(l)`
96
+ `,ve=h.lazy(()=>L(()=>import("./lottie-react.esm-Dr-WheMr.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Player})));function T({src:t}){return e.jsx(ve,{src:t,loop:!0,autoplay:!0})}function ke({options:t,handleApi:c,onSelect:s,onFinish:i,onClose:n,isMobile:m}){const{loading:p,onLoading:f,restrictions:a,i18n:j}=F(),[d,y]=h.useState([]),[x,I]=h.useState(),P=Q(),z=a==null?void 0:a.maxNumberOfFiles,[u,R]=h.useState({}),g=B({}),A=Object.keys(g).filter(r=>g[r]),E={xs:6,sm:6};h.useEffect(()=>{x&&!u.error&&L(()=>import("./lottie-error-CMOXHtBH.js"),[],import.meta.url).then(r=>{R(o=>({...o,error:r.default}))}),t&&!d.length&&!u.loading&&L(()=>import("./lottie-loading-o-GBrhM9.js"),[],import.meta.url).then(r=>{R(o=>({...o,loading:r.default}))}),!t&&!u.welcome&&L(()=>import("./lottie-welcome-C9B95FIi.js"),[],import.meta.url).then(r=>{R(o=>({...o,welcome:r.default}))})},[x,t,d.length,u]),ee(async()=>{var r;if(t){I(void 0),f(!0);try{const o=await c({...t,responseFormat:"b64_json"});if(o.data){const w=(o.data||[]).map(C=>({src:`data:image/png;base64,${C.b64Json||C.b64_json}`,width:t.size?Number((t.size||"").split("x")[0]):1024,alt:t.prompt}));y(d?[...w,...d]:w)}else I(o)}catch(o){console.error("AIImage generate error: ",o),I(((r=o==null?void 0:o.response)==null?void 0:r.data)||o)}finally{f(!1),i()}}},[t==null?void 0:t.number,t==null?void 0:t.prompt,t==null?void 0:t.size]);const $=r=>{const o=Object.keys(g).filter(w=>g[w]);if(z?o.length<z:!0)g[r]?g[r]=!1:g[r]=!0;else{const w=o.pop();w!==r&&(g[w]=!1),g[r]=!g[r]}},V=r=>{if(d){const o=d.findIndex(v=>v.src===r);o>-1&&(g[r]=!1,d.splice(o,1),y([...d]))}},U=()=>{var o,v;const r={width:((o=document.querySelector(".photo-item img"))==null?void 0:o.offsetWidth)||0,height:((v=document.querySelector(".photo-item img"))==null?void 0:v.offsetHeight)||0};return e.jsx(e.Fragment,{children:Array.from({length:(t==null?void 0:t.number)||1}).map((w,C)=>h.createElement(b,{item:!0,...E,key:C},e.jsx(M,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...r}})))})},G=()=>x?e.jsxs(l,{width:300,height:300,m:"auto",children:[u.error&&e.jsx(T,{src:u.error},"error"),e.jsx(l,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:x==null?void 0:x.message})]}):d&&Array.isArray(d)&&d.length>0?e.jsxs(e.Fragment,{children:[e.jsx(l,{flexGrow:1,sx:{height:0,overflowX:"hidden",overflowY:"auto"},children:e.jsx(Se,{sx:m?{p:0,border:"none !important"}:{p:2},children:e.jsxs(b,{spacing:2,container:!0,className:"photo-wrapper",children:[p&&e.jsx(U,{}),d.map((r,o)=>h.createElement(b,{item:!0,...E,key:r.src,className:"photo-item"},e.jsx(be,{...r,selected:g[r.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:g[r.src]?`2px solid ${P.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{$(r.src)},onDelete:()=>{V(r.src)}})))]})})}),e.jsxs(l,{sx:{mt:2,display:"flex",justifyContent:n?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[n&&typeof n=="function"&&e.jsx(N,{color:"primary",variant:"outlined",onClick:n,children:e.jsx(se,{})}),e.jsx(N,{color:"primary",variant:"contained",disabled:!A.length||p,onClick:()=>{const r=oe(d,"src");s(A.map(o=>r[o]))},children:A.length?j("aiImageSelectedUse"):j("aiImageSelectedTip")})]})]}):t?e.jsx(l,{width:220,height:220,m:"auto",children:u.loading&&e.jsx(T,{src:u.loading},"loading")}):e.jsx(l,{width:300,height:300,m:"auto",children:u.welcome&&e.jsx(T,{src:u.welcome},"welcome")});return e.jsx(Ie,{children:G()})}const Ie=k(l)`
97
97
  min-height: 100%;
98
98
  display: flex;
99
99
  flex-direction: column;
@@ -1 +1 @@
1
- import{cr as x,r as o,e as g,cs as r,E as u,j as s,N as m,ct as d}from"./index-B2VuOb4T.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),p=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(p)??{},t=i.get("entityId"),e=i.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};
1
+ import{cr as x,r as o,e as g,cs as r,E as u,j as s,N as m,ct as d}from"./index-B8IA5mbU.js";function P(){const a=x(),{blocklets:c,refresh:l}=a,{t:y}=o.useContext(g),p=r.generateKey(),[i]=u();return o.useEffect(()=>{const n=r.getNotificationQueryParams(p)??{},t=i.get("entityId"),e=i.get("severity"),f={...n,...e?{severity:e==="all"?[]:e.split(","),paging:{...n.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};l(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:y("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:a,filterType:"entity",type:"server"})]})}export{P as default};
@@ -1,4 +1,4 @@
1
- import{P as O,n as te,N as b,r as F,j as e,a_ as I,k as ue,kh as me,bm as fe,br as ie,m as ne,gM as se,fT as ae,aU as oe,cv as x,A as C,t as g,ki as V,kj as Q,aZ as Z,Q as y,aC as he,B as D,y as xe,x as pe,F as je,e as ge,bD as ve}from"./index-B2VuOb4T.js";import{T as ye}from"./index-BF4vf6id.js";import{u as le,C as j}from"./index.esm-C-ANFUiM.js";import{A as be,a as we,d as Re,b as Te}from"./collapse-CWe0kq4t.js";import{f as Se}from"./index-Xck-gZ1a.js";import{u as ce}from"./blocklet-Dj7-7T3f.js";import{S as X}from"./Switch-v96fFUVN.js";function p({title:u,desc:i,link:r,sectionLeftSx:f,sectionRightSx:w,children:h,...P}){const S=F.useMemo(()=>r?i?i.replace(/<b>(.*?)<\/b>/g,`<a href="${r}" target="_blank" rel="noopener noreferrer">$1</a>`):"":i,[i,r]);return e.jsx(Ee,{...P,children:e.jsxs(I,{className:"section",direction:{sm:"column",md:"row"},gap:{xs:3,md:6},children:[e.jsxs(b,{className:"section-left",sx:f,children:[e.jsx(ue,{className:"section-title",children:u}),e.jsx(b,{className:"section-desc",sx:{color:"text.secondary"},dangerouslySetInnerHTML:{__html:S}})]}),e.jsx(I,{className:"section-content",direction:"column",sx:{width:"100%",...w},children:h})]})})}p.propTypes={title:O.string.isRequired,children:O.node.isRequired,desc:O.string,sectionLeftSx:O.object,sectionRightSx:O.object,link:O.node};p.defaultProps={desc:"",sectionLeftSx:{width:"384px"},sectionRightSx:{},link:""};const Ee=te(b)`
1
+ import{P as O,n as te,N as b,r as F,j as e,a_ as I,k as ue,ki as me,bm as fe,br as ie,m as ne,gM as se,fT as ae,aU as oe,cv as x,A as C,t as g,kj as V,kk as Q,aZ as Z,Q as y,aC as he,B as D,y as xe,x as pe,F as je,e as ge,bD as ve}from"./index-B8IA5mbU.js";import{T as ye}from"./index-Cy666DOY.js";import{u as le,C as j}from"./index.esm-F8b32K2k.js";import{A as be,a as we,d as Re,b as Te}from"./collapse-BhbkfN99.js";import{f as Se}from"./index-zsz18EZU.js";import{u as ce}from"./blocklet-BzkaFDNW.js";import{S as X}from"./Switch-CG3jQlg3.js";function p({title:u,desc:i,link:r,sectionLeftSx:f,sectionRightSx:w,children:h,...P}){const S=F.useMemo(()=>r?i?i.replace(/<b>(.*?)<\/b>/g,`<a href="${r}" target="_blank" rel="noopener noreferrer">$1</a>`):"":i,[i,r]);return e.jsx(Ee,{...P,children:e.jsxs(I,{className:"section",direction:{sm:"column",md:"row"},gap:{xs:3,md:6},children:[e.jsxs(b,{className:"section-left",sx:f,children:[e.jsx(ue,{className:"section-title",children:u}),e.jsx(b,{className:"section-desc",sx:{color:"text.secondary"},dangerouslySetInnerHTML:{__html:S}})]}),e.jsx(I,{className:"section-content",direction:"column",sx:{width:"100%",...w},children:h})]})})}p.propTypes={title:O.string.isRequired,children:O.node.isRequired,desc:O.string,sectionLeftSx:O.object,sectionRightSx:O.object,link:O.node};p.defaultProps={desc:"",sectionLeftSx:{width:"384px"},sectionRightSx:{},link:""};const Ee=te(b)`
2
2
  display: flex;
3
3
  align-items: flex-start;
4
4
  width: 100%;
@@ -38,4 +38,4 @@ import{P as O,n as te,N as b,r as F,j as e,a_ as I,k as ue,kh as me,bm as fe,br
38
38
  width: 100% !important;
39
39
  }
40
40
  }
41
- `;var Y={exports:{}},G={exports:{}},ee={exports:{}};(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=r;function r(f){return f==null}u.exports=i.default,u.exports.default=i.default})(ee,ee.exports);var _e=ee.exports;(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=S;var r=w(me),f=w(_e);function w(a){return a&&a.__esModule?a:{default:a}}var h=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(a,n){(0,r.default)(a),n=n||{};var q=n.allow_leading_zeroes===!1?h:P,L=!n.hasOwnProperty("min")||(0,f.default)(n.min)||a>=n.min,c=!n.hasOwnProperty("max")||(0,f.default)(n.max)||a<=n.max,o=!n.hasOwnProperty("lt")||(0,f.default)(n.lt)||a<n.lt,K=!n.hasOwnProperty("gt")||(0,f.default)(n.gt)||a>n.gt;return q.test(a)&&L&&c&&o&&K}u.exports=i.default,u.exports.default=i.default})(G,G.exports);var Ce=G.exports;(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=w;var r=f(Ce);function f(h){return h&&h.__esModule?h:{default:h}}function w(h){return(0,r.default)(h,{allow_leading_zeroes:!1,min:0,max:65535})}u.exports=i.default,u.exports.default=i.default})(Y,Y.exports);var Pe=Y.exports;const Ke=fe(Pe),H={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ne(){var E,R,v;const{api:u}=ie(),{blocklet:i}=ce(),{t:r}=ne(),{confirmApi:f,confirmHolder:w}=se(),h=(E=i==null?void 0:i.meta)==null?void 0:E.did,P=Object.assign({...H},((v=(R=i==null?void 0:i.settings)==null?void 0:R.notification)==null?void 0:v.email)||{}),{handleSubmit:S,control:a,formState:n,watch:q,reset:L}=le({defaultValues:ae(P,Object.keys(H))}),c=oe({testReceiver:"",testReceiverError:""}),o=q("enabled"),K=x(async(t,s,T=!0)=>{var _,k;try{const{blocklet:N}=await u.configNotification({input:{did:h,notification:JSON.stringify({email:t})}}),de=Object.assign({...H},((k=(_=N==null?void 0:N.settings)==null?void 0:_.notification)==null?void 0:k.email)||{});L(de),T&&C.success(r("oauth.saveSuccess"))}catch(N){if(T)C.error(N.message||r("oauth.saveFailed"));else throw N}}),M=x(async(t,s,T)=>{try{n.isDirty&&await K(t,s,!1),await u.sendEmail({input:{did:h,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),C.success(r("notification.email.testSuccess"))}catch(_){C.error(_.message||r("notification.email.testfailed"))}}),B=x((t,s)=>{c.testReceiver="",c.testReceiverError="",f.open({title:r("notification.email.testSendEmail"),content:()=>e.jsx(b,{sx:{width:"300px"},children:e.jsx(g,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:r("notification.email.inputTestReceiver"),value:c.testReceiver,onChange:T=>{c.testReceiver=T.target.value},error:!!c.testReceiverError,helperText:c.testReceiverError||" "})}),confirmButtonText:r("common.confirm"),cancelButtonText:r("common.cancel"),async onConfirm(T){var k;const _=(k=c.testReceiver)==null?void 0:k.trim();if(!_){c.testReceiverError=r("notification.email.receiverRequired");return}if(!V(_)){c.testReceiverError=r("notification.email.receiverInvalid");return}c.testReceiverError="",await M(t,s,_),T()}})}),U=x(t=>{const s=t==null?void 0:t.trim();return s?V(s)?!0:r("notification.email.fromInvalid"):r("notification.email.fromRequired")}),$=x(t=>{const s=t==null?void 0:t.trim();return s?Q(s,{require_host:!1,protocols:[]})?!0:r("notification.email.hostInvalid"):r("notification.email.hostRequired")}),z=x(t=>t?Ke(t)?!0:r("notification.email.portInvalid"):r("notification.email.portRequired")),W=x(t=>t!=null&&t.trim()?!0:r("notification.email.userRequired")),A=x(t=>t!=null&&t.trim()?!0:r("notification.email.passwordRequired")),l=x(t=>t!=null&&t.trim()&&!Q(t,{protocols:["http","https"],require_protocol:!0})?r("notification.email.linkInvalid"):!0),m=x(t=>t!=null&&t.trim()&&!V(t)?r("notification.email.emailInvalid"):!0),d=x(()=>!0);return e.jsxs(b,{children:[e.jsxs(Oe,{component:"form",onSubmit:S(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(p,{title:r("notification.email.enable"),my:2.5,children:e.jsx(j,{name:"enabled",control:a,render:({field:t})=>e.jsx(Z,{control:e.jsx(X,{checked:t.value,...t})})})}),e.jsx(p,{title:r("notification.email.from"),children:e.jsx(j,{name:"from",control:a,rules:{validate:o?U:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,label:r("notification.email.from"),error:!!n.errors[t.name],helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.host"),children:e.jsx(j,{name:"host",control:a,rules:{validate:o?$:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,error:!!n.errors[t.name],label:r("notification.email.host"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.port"),children:e.jsx(j,{name:"port",control:a,rules:{validate:o?z:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,type:"number",error:!!n.errors[t.name],label:r("notification.email.port"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.user"),children:e.jsx(j,{name:"user",control:a,rules:{validate:o?W:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,error:!!n.errors[t.name],label:r("notification.email.user"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.password"),children:e.jsx(j,{name:"password",control:a,rules:{validate:o?A:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,type:"password",error:!!n.errors[t.name],label:r("notification.email.password"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.secure"),children:e.jsx(j,{name:"secure",control:a,rules:{validate:d},render:({field:t})=>e.jsx(y,{fullWidth:!0,children:e.jsx(Z,{control:e.jsx(X,{checked:t.value,...t,disabled:!o})})})})}),e.jsxs(be,{children:[e.jsxs(we,{expandIcon:e.jsx(Re,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[r("notification.email.signature"),e.jsx(he,{title:r("notification.email.signatureTooltip"),children:e.jsx(Se,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(Te,{children:[e.jsx(p,{title:r("notification.email.companyName"),children:e.jsx(j,{name:"companyName",control:a,rules:{validate:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyName"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.companyLink"),children:e.jsx(j,{name:"companyLink",control:a,rules:{validate:o?l:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyLink"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.companyAddress"),children:e.jsx(j,{name:"companyAddress",control:a,rules:{validate:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyAddress"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.supportEmail"),children:e.jsx(j,{name:"supportEmail",control:a,rules:{validate:o?m:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",type:"email",error:!!n.errors[t.name],label:r("notification.email.supportEmail"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})})]})]}),e.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(D,{variant:"outlined",color:"warning",onClick:S(B),disabled:!o,children:r("oauth.runTest")}),e.jsx(D,{type:"submit",variant:"contained",disabled:!n.isDirty,children:r("oauth.save")})]})]}),w]})}const Oe=te(I)``,J={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function qe(){var z,W,A;const{api:u}=ie(),{blocklet:i}=ce(),{t:r}=ne(),{confirmApi:f,confirmHolder:w}=se(),h=(z=i==null?void 0:i.meta)==null?void 0:z.did,P=Object.assign({...J},((A=(W=i==null?void 0:i.settings)==null?void 0:W.notification)==null?void 0:A.pushKit)||{}),{handleSubmit:S,control:a,formState:n,watch:q,reset:L}=le({defaultValues:ae(P,Object.keys(J))}),c=oe({testReceiver:"",testReceiverError:""}),o=q("enabled"),K=x(async(l,m,d=!0)=>{var E,R;try{const{blocklet:v}=await u.configNotification({input:{did:h,notification:JSON.stringify({pushKit:l})}}),t=Object.assign({...J},((R=(E=v==null?void 0:v.settings)==null?void 0:E.notification)==null?void 0:R.pushKit)||{});L(t),d&&C.success(r("oauth.saveSuccess"))}catch(v){if(d)C.error(v.message||r("oauth.saveFailed"));else throw v}}),M=x(async(l,m)=>{var d,E,R;try{n.isDirty&&await K(l,m,!1);const v=(d=((i==null?void 0:i.configs)||[]).find(T=>T.key==="BLOCKLET_APP_URL"))==null?void 0:d.value,t=xe(pe(v,je.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:(E=i==null?void 0:i.meta)==null?void 0:E.version,t:new Date((i==null?void 0:i.updatedAt)||0).getTime()}),s={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:i==null?void 0:i.appDid,fullName:(R=i==null?void 0:i.meta)==null?void 0:R.title,avatar:t}}}};await u.sendPush({input:{did:h,receiver:c.testReceiver,notification:JSON.stringify(s)}}),C.success(r("notification.pushKit.testSuccess"))}catch(v){C.error(v.message||r("notification.pushKit.testfailed"))}}),B=x((l,m)=>{c.testReceiverError="",f.open({title:r("notification.pushKit.testSend"),content:()=>e.jsx(b,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(g,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:r("notification.pushKit.inputTestReceiver"),value:c.testReceiver,onChange:d=>{c.testReceiver=d.target.value},error:!!c.testReceiverError,helperText:c.testReceiverError||" "})}),confirmButtonText:r("common.confirm"),cancelButtonText:r("common.cancel"),async onConfirm(d){var R;if(!((R=c.testReceiver)==null?void 0:R.trim())){c.testReceiverError=r("notification.pushKit.receiverRequired");return}c.testReceiverError="",await M(l,m),d()}})}),U=x(l=>{const m=l==null?void 0:l.trim();return m?Q(m)?!0:r("notification.pushKit.endpointInvalid"):r("notification.pushKit.endpointRequired")}),$=x(()=>!0);return e.jsxs(b,{children:[e.jsxs(Le,{component:"form",onSubmit:S(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(p,{title:r("notification.pushKit.enable"),my:2.5,children:e.jsx(j,{name:"enabled",control:a,render:({field:l})=>e.jsx(Z,{control:e.jsx(X,{checked:l.value,...l})})})}),e.jsx(p,{title:r("notification.pushKit.endpoint"),children:e.jsx(j,{name:"endpoint",control:a,rules:{validate:o?U:$},render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",required:!0,label:r("notification.pushKit.endpoint"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}})}),e.jsxs(p,{title:r("notification.pushKit.customOptions"),children:[e.jsx(j,{name:"did",control:a,render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",label:r("notification.pushKit.did"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}}),e.jsx(j,{name:"pushPath",control:a,render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",label:r("notification.pushKit.pushPath"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}})]}),e.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(D,{variant:"outlined",color:"warning",onClick:S(B),disabled:!o,children:r("oauth.runTest")}),e.jsx(D,{type:"submit",variant:"contained",disabled:!n.isDirty,children:r("oauth.save")})]})]}),w]})}const Le=te(I)``,re=[{label:e.jsx(b,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:e.jsx(b,{textAlign:"center",width:"100%",children:"Push Kit"}),value:"pushKit"}];function Me(){const[u,i]=F.useState(re[0].value),{locale:r}=F.useContext(ge),f=ve(()=>({email:e.jsx(Ne,{}),pushKit:e.jsx(qe,{})}),[r]),w=F.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(b,{children:[e.jsx(ye,{tabs:re,current:u,onChange:i}),e.jsx(b,{style:w,children:f[u]})]})}export{Me as B,p as S};
41
+ `;var Y={exports:{}},G={exports:{}},ee={exports:{}};(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=r;function r(f){return f==null}u.exports=i.default,u.exports.default=i.default})(ee,ee.exports);var _e=ee.exports;(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=S;var r=w(me),f=w(_e);function w(a){return a&&a.__esModule?a:{default:a}}var h=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function S(a,n){(0,r.default)(a),n=n||{};var q=n.allow_leading_zeroes===!1?h:P,k=!n.hasOwnProperty("min")||(0,f.default)(n.min)||a>=n.min,c=!n.hasOwnProperty("max")||(0,f.default)(n.max)||a<=n.max,o=!n.hasOwnProperty("lt")||(0,f.default)(n.lt)||a<n.lt,K=!n.hasOwnProperty("gt")||(0,f.default)(n.gt)||a>n.gt;return q.test(a)&&k&&c&&o&&K}u.exports=i.default,u.exports.default=i.default})(G,G.exports);var Ce=G.exports;(function(u,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=w;var r=f(Ce);function f(h){return h&&h.__esModule?h:{default:h}}function w(h){return(0,r.default)(h,{allow_leading_zeroes:!1,min:0,max:65535})}u.exports=i.default,u.exports.default=i.default})(Y,Y.exports);var Pe=Y.exports;const Ke=fe(Pe),H={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ne(){var E,R,v;const{api:u}=ie(),{blocklet:i}=ce(),{t:r}=ne(),{confirmApi:f,confirmHolder:w}=se(),h=(E=i==null?void 0:i.meta)==null?void 0:E.did,P=Object.assign({...H},((v=(R=i==null?void 0:i.settings)==null?void 0:R.notification)==null?void 0:v.email)||{}),{handleSubmit:S,control:a,formState:n,watch:q,reset:k}=le({defaultValues:ae(P,Object.keys(H))}),c=oe({testReceiver:"",testReceiverError:""}),o=q("enabled"),K=x(async(t,s,T=!0)=>{var _,L;try{const{blocklet:N}=await u.configNotification({input:{did:h,notification:JSON.stringify({email:t})}}),de=Object.assign({...H},((L=(_=N==null?void 0:N.settings)==null?void 0:_.notification)==null?void 0:L.email)||{});k(de),T&&C.success(r("oauth.saveSuccess"))}catch(N){if(T)C.error(N.message||r("oauth.saveFailed"));else throw N}}),M=x(async(t,s,T)=>{try{n.isDirty&&await K(t,s,!1),await u.sendEmail({input:{did:h,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification"})}}),C.success(r("notification.email.testSuccess"))}catch(_){C.error(_.message||r("notification.email.testfailed"))}}),B=x((t,s)=>{c.testReceiver="",c.testReceiverError="",f.open({title:r("notification.email.testSendEmail"),content:()=>e.jsx(b,{sx:{width:"300px"},children:e.jsx(g,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:r("notification.email.inputTestReceiver"),value:c.testReceiver,onChange:T=>{c.testReceiver=T.target.value},error:!!c.testReceiverError,helperText:c.testReceiverError||" "})}),confirmButtonText:r("common.confirm"),cancelButtonText:r("common.cancel"),async onConfirm(T){var L;const _=(L=c.testReceiver)==null?void 0:L.trim();if(!_){c.testReceiverError=r("notification.email.receiverRequired");return}if(!V(_)){c.testReceiverError=r("notification.email.receiverInvalid");return}c.testReceiverError="",await M(t,s,_),T()}})}),U=x(t=>{const s=t==null?void 0:t.trim();return s?V(s)?!0:r("notification.email.fromInvalid"):r("notification.email.fromRequired")}),$=x(t=>{const s=t==null?void 0:t.trim();return s?Q(s,{require_host:!1,protocols:[]})?!0:r("notification.email.hostInvalid"):r("notification.email.hostRequired")}),z=x(t=>t?Ke(t)?!0:r("notification.email.portInvalid"):r("notification.email.portRequired")),W=x(t=>t!=null&&t.trim()?!0:r("notification.email.userRequired")),A=x(t=>t!=null&&t.trim()?!0:r("notification.email.passwordRequired")),l=x(t=>t!=null&&t.trim()&&!Q(t,{protocols:["http","https"],require_protocol:!0})?r("notification.email.linkInvalid"):!0),m=x(t=>t!=null&&t.trim()&&!V(t)?r("notification.email.emailInvalid"):!0),d=x(()=>!0);return e.jsxs(b,{children:[e.jsxs(Oe,{component:"form",onSubmit:S(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(p,{title:r("notification.email.enable"),my:2.5,children:e.jsx(j,{name:"enabled",control:a,render:({field:t})=>e.jsx(Z,{control:e.jsx(X,{checked:t.value,...t})})})}),e.jsx(p,{title:r("notification.email.from"),children:e.jsx(j,{name:"from",control:a,rules:{validate:o?U:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,label:r("notification.email.from"),error:!!n.errors[t.name],helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.host"),children:e.jsx(j,{name:"host",control:a,rules:{validate:o?$:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,error:!!n.errors[t.name],label:r("notification.email.host"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.port"),children:e.jsx(j,{name:"port",control:a,rules:{validate:o?z:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,type:"number",error:!!n.errors[t.name],label:r("notification.email.port"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.user"),children:e.jsx(j,{name:"user",control:a,rules:{validate:o?W:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,error:!!n.errors[t.name],label:r("notification.email.user"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.password"),children:e.jsx(j,{name:"password",control:a,rules:{validate:o?A:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",required:!0,type:"password",error:!!n.errors[t.name],label:r("notification.email.password"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.secure"),children:e.jsx(j,{name:"secure",control:a,rules:{validate:d},render:({field:t})=>e.jsx(y,{fullWidth:!0,children:e.jsx(Z,{control:e.jsx(X,{checked:t.value,...t,disabled:!o})})})})}),e.jsxs(be,{children:[e.jsxs(we,{expandIcon:e.jsx(Re,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[r("notification.email.signature"),e.jsx(he,{title:r("notification.email.signatureTooltip"),children:e.jsx(Se,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(Te,{children:[e.jsx(p,{title:r("notification.email.companyName"),children:e.jsx(j,{name:"companyName",control:a,rules:{validate:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyName"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.companyLink"),children:e.jsx(j,{name:"companyLink",control:a,rules:{validate:o?l:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyLink"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.companyAddress"),children:e.jsx(j,{name:"companyAddress",control:a,rules:{validate:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",error:!!n.errors[t.name],label:r("notification.email.companyAddress"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})}),e.jsx(p,{title:r("notification.email.supportEmail"),children:e.jsx(j,{name:"supportEmail",control:a,rules:{validate:o?m:d},render:({field:t})=>{var s;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...t,size:"small",type:"email",error:!!n.errors[t.name],label:r("notification.email.supportEmail"),helperText:((s=n.errors[t.name])==null?void 0:s.message)||" ",disabled:!o})})}})})]})]}),e.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(D,{variant:"outlined",color:"warning",onClick:S(B),disabled:!o,children:r("oauth.runTest")}),e.jsx(D,{type:"submit",variant:"contained",disabled:!n.isDirty,children:r("oauth.save")})]})]}),w]})}const Oe=te(I)``,J={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function qe(){var z,W,A;const{api:u}=ie(),{blocklet:i}=ce(),{t:r}=ne(),{confirmApi:f,confirmHolder:w}=se(),h=(z=i==null?void 0:i.meta)==null?void 0:z.did,P=Object.assign({...J},((A=(W=i==null?void 0:i.settings)==null?void 0:W.notification)==null?void 0:A.pushKit)||{}),{handleSubmit:S,control:a,formState:n,watch:q,reset:k}=le({defaultValues:ae(P,Object.keys(J))}),c=oe({testReceiver:"",testReceiverError:""}),o=q("enabled"),K=x(async(l,m,d=!0)=>{var E,R;try{const{blocklet:v}=await u.configNotification({input:{did:h,notification:JSON.stringify({pushKit:l})}}),t=Object.assign({...J},((R=(E=v==null?void 0:v.settings)==null?void 0:E.notification)==null?void 0:R.pushKit)||{});k(t),d&&C.success(r("oauth.saveSuccess"))}catch(v){if(d)C.error(v.message||r("oauth.saveFailed"));else throw v}}),M=x(async(l,m)=>{var d,E,R;try{n.isDirty&&await K(l,m,!1);const v=(d=((i==null?void 0:i.configs)||[]).find(T=>T.key==="BLOCKLET_APP_URL"))==null?void 0:d.value,t=xe(pe(v,je.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:(E=i==null?void 0:i.meta)==null?void 0:E.version,t:new Date((i==null?void 0:i.updatedAt)||0).getTime()}),s={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:i==null?void 0:i.appDid,fullName:(R=i==null?void 0:i.meta)==null?void 0:R.title,avatar:t}}}};await u.sendPush({input:{did:h,receiver:c.testReceiver,notification:JSON.stringify(s)}}),C.success(r("notification.pushKit.testSuccess"))}catch(v){C.error(v.message||r("notification.pushKit.testfailed"))}}),B=x((l,m)=>{c.testReceiverError="",f.open({title:r("notification.pushKit.testSend"),content:()=>e.jsx(b,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(g,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:r("notification.pushKit.inputTestReceiver"),value:c.testReceiver,onChange:d=>{c.testReceiver=d.target.value},error:!!c.testReceiverError,helperText:c.testReceiverError||" "})}),confirmButtonText:r("common.confirm"),cancelButtonText:r("common.cancel"),async onConfirm(d){var R;if(!((R=c.testReceiver)==null?void 0:R.trim())){c.testReceiverError=r("notification.pushKit.receiverRequired");return}c.testReceiverError="",await M(l,m),d()}})}),U=x(l=>{const m=l==null?void 0:l.trim();return m?Q(m)?!0:r("notification.pushKit.endpointInvalid"):r("notification.pushKit.endpointRequired")}),$=x(()=>!0);return e.jsxs(b,{children:[e.jsxs(ke,{component:"form",onSubmit:S(K),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(p,{title:r("notification.pushKit.enable"),my:2.5,children:e.jsx(j,{name:"enabled",control:a,render:({field:l})=>e.jsx(Z,{control:e.jsx(X,{checked:l.value,...l})})})}),e.jsx(p,{title:r("notification.pushKit.endpoint"),children:e.jsx(j,{name:"endpoint",control:a,rules:{validate:o?U:$},render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",required:!0,label:r("notification.pushKit.endpoint"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}})}),e.jsxs(p,{title:r("notification.pushKit.customOptions"),children:[e.jsx(j,{name:"did",control:a,render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",label:r("notification.pushKit.did"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}}),e.jsx(j,{name:"pushPath",control:a,render:({field:l})=>{var m;return e.jsx(y,{fullWidth:!0,children:e.jsx(g,{...l,size:"small",label:r("notification.pushKit.pushPath"),error:!!n.errors[l.name],helperText:((m=n.errors[l.name])==null?void 0:m.message)||" ",disabled:!o})})}})]}),e.jsxs(b,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(D,{variant:"outlined",color:"warning",onClick:S(B),disabled:!o,children:r("oauth.runTest")}),e.jsx(D,{type:"submit",variant:"contained",disabled:!n.isDirty,children:r("oauth.save")})]})]}),w]})}const ke=te(I)``,re=[{label:e.jsx(b,{textAlign:"center",width:"100%",children:"Email"}),value:"email"},{label:e.jsx(b,{textAlign:"center",width:"100%",children:"Push Kit"}),value:"pushKit"}];function Me(){const[u,i]=F.useState(re[0].value),{locale:r}=F.useContext(ge),f=ve(()=>({email:e.jsx(Ne,{}),pushKit:e.jsx(qe,{})}),[r]),w=F.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(b,{children:[e.jsx(ye,{tabs:re,current:u,onChange:i}),e.jsx(b,{style:w,children:f[u]})]})}export{Me as B,p as S};
@@ -1,4 +1,4 @@
1
- import{c1 as Ge,c0 as et,b9 as te,cf as ee,r as y,c2 as tt,b$ as ot,bZ as Oe,j as e,c4 as st,c5 as nt,O as Q,br as M,cu as rt,A as w,Z as X,bj as T,gh as Me,aV as Ue,b as _,le as at,m as E,P as g,hG as it,w as ct,aA as Ne,x as ge,ao as lt,n as dt,k as C,e as ut,C as z,i as pt,am as mt,lf as J,h5 as G,lg as ft,N as j,a_ as W,aC as ye,F as R,g as ht,T as V,du as gt,aQ as je,aR as be,V as q,aJ as Y,ab as H,a6 as xt,ep as St,b4 as yt,B as me,v as jt,G as Le,$ as We,bD as xe,E as bt}from"./index-B2VuOb4T.js";import{T as Ct}from"./index-BF4vf6id.js";import{u as A}from"./blocklet-Dj7-7T3f.js";import{u as kt}from"./use-mobile-pZqk7eRQ.js";import{b as Dt,u as wt,D as Bt,c as fe,a as Tt}from"./index-Cd18MmSj.js";import"./index-BKWicGJw.js";import"./index-BojVbZw0.js";import"./api-C1uJD3Ou.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-BVNgPIbZ.js";import{d as At,a as Ot,g as Lt,i as Pt,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-NBDzWy_B.js";import{I as Nt}from"./index-eb0zP4qu.js";import{R as Wt}from"./index-DjL5W4NV.js";import{d as $t}from"./HelpOutline-BJqbizDQ.js";import{D as Ft}from"./index-Xck-gZ1a.js";import{x as Kt}from"./index-BJHGOv7L.js";import{d as qt}from"./MoreHoriz-BrmAZhbC.js";import{f as Yt}from"./actions-DKMplt8L.js";import{d as Ht}from"./DeleteOutline-BnT7fsMq.js";import{g as Pe}from"./get-safe-url-0JvnPl3q.js";import{S as Vt}from"./switch-control-B3dTSZzV.js";import{L as _e}from"./list-header-BQri46Fq.js";import"./OpenInNew-IexFTpEO.js";import"./ButtonGroup-Djxp9GV8.js";import"./getValidReactChildren-BK3p7HMr.js";import"./TableRow-DMNYoxLV.js";import"./useThemeProps-CdW8lLMN.js";import"./emotion-react.browser.esm-zhWsWQqH.js";import"./ViewColumn-YTkBMCPT.js";import"./Search-B9sPCbKU.js";import"./Clear-bgnUq6y0.js";import"./Delete-BEDhfjgM.js";import"./index-C6uxeWL5.js";import"./MoreVert-D4ECIeFy.js";import"./TableSearch-CIJv0sa5.js";import"./useLocalStorage-DGcI4VdJ.js";import"./url-evaluation-BzcyBhf_.js";import"./permission-DTthelu1.js";import"./index-CmNGzNDe.js";import"./Switch-v96fFUVN.js";function Qt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Qt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Oe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Oe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!Q(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),w.error(X(r)))}})}function Fe({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),w.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Fe(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),w.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Ke=y.createContext({}),{Provider:so,Consumer:is}=Ke;function ke({children:t}){var F;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Ot(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Fe({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(F=o==null?void 0:o.settings)==null?void 0:F.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(B=>{const P=[...B];return P.push({...m,loading:!0}),P}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(B){throw console.error(B),f(P=>[...P].filter(pe=>pe.did!==m.did)),B}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const B=[...N];return B.splice(B.indexOf(m),1),B}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function O(){return y.useContext(Ke)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=O(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Pt(b)){w.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){w.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),w.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function qe({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=O(),o=wt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
1
+ import{c1 as Ge,c0 as et,b9 as te,cf as ee,r as y,c2 as tt,b$ as ot,bZ as Oe,j as e,c4 as st,c5 as nt,O as Q,br as M,cu as rt,A as w,Z as X,bj as T,gh as Me,aV as Ue,b as _,lf as at,m as E,P as g,hH as it,w as ct,aA as Ne,x as ge,ao as lt,n as dt,k as C,e as ut,C as z,i as pt,am as mt,lg as J,h6 as G,lh as ft,N as j,a_ as W,aC as ye,F as R,g as ht,T as V,du as gt,aQ as je,aR as be,V as q,aJ as Y,ab as H,a6 as xt,ep as St,b4 as yt,B as me,v as jt,G as Le,$ as We,bD as xe,E as bt}from"./index-B8IA5mbU.js";import{T as Ct}from"./index-Cy666DOY.js";import{u as A}from"./blocklet-BzkaFDNW.js";import{u as kt}from"./use-mobile-DxY5BxAJ.js";import{b as Dt,u as wt,D as Bt,c as fe,a as Tt}from"./index-fHnSssqp.js";import"./index-BhAPLn1b.js";import"./index-BojVbZw0.js";import"./api-CSrxJE-w.js";import{c as $e,b as Et,u as It,C as Rt,D as vt,a as zt}from"./connect-to-CorUs381.js";import{d as At,a as Ot,g as Lt,i as Pt,e as Se,f as _t,h as Mt,j as Ut}from"./spaces-C01mORkW.js";import{I as Nt}from"./index-rZ1SBrH_.js";import{R as Wt}from"./index-Cb3Huyfb.js";import{d as $t}from"./HelpOutline-hZN36iob.js";import{D as Ft}from"./index-zsz18EZU.js";import{x as Kt}from"./index-BJHGOv7L.js";import{d as qt}from"./MoreHoriz-CPdB-acW.js";import{f as Yt}from"./actions-DNqu-9QQ.js";import{d as Ht}from"./DeleteOutline-reI_idEa.js";import{g as Pe}from"./get-safe-url-COP_ZxQz.js";import{S as Vt}from"./switch-control-BUF_yGeD.js";import{L as _e}from"./list-header-DL9A5VcR.js";import"./OpenInNew-DJsi1NWq.js";import"./ButtonGroup-BzAT8pGA.js";import"./getValidReactChildren-CxwCdnNW.js";import"./TableRow-Cyof88VP.js";import"./useThemeProps-C3mE_-3Z.js";import"./emotion-react.browser.esm-CSjORkdU.js";import"./ViewColumn-BSxTQVZ-.js";import"./Search-DGRuo7t-.js";import"./Clear-CmPKgcDo.js";import"./Delete-CiU1bEBu.js";import"./index-DbTX57bM.js";import"./MoreVert-BZT8paNd.js";import"./TableSearch-CxutcmoF.js";import"./useLocalStorage-CRy7LFYG.js";import"./url-evaluation-DmRIkzYe.js";import"./permission-JEjDz9i9.js";import"./index-5OOYkflw.js";import"./Switch-CG3jQlg3.js";function Qt(t){return Ge("MuiIcon",t)}et("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Xt=["baseClassName","className","color","component","fontSize"],Zt=t=>{const{color:s,fontSize:n,classes:o}=t,a={root:["root",s!=="inherit"&&`color${ee(s)}`,`fontSize${ee(n)}`]};return nt(a,Qt,o)},Jt=te("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${ee(n.color)}`],s[`fontSize${ee(n.fontSize)}`]]}})(({theme:t,ownerState:s})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,fontSize:{inherit:"inherit",small:t.typography.pxToRem(20),medium:t.typography.pxToRem(24),large:t.typography.pxToRem(36)}[s.fontSize],color:{primary:(t.vars||t).palette.primary.main,secondary:(t.vars||t).palette.secondary.main,info:(t.vars||t).palette.info.main,success:(t.vars||t).palette.success.main,warning:(t.vars||t).palette.warning.main,action:(t.vars||t).palette.action.active,error:(t.vars||t).palette.error.main,disabled:(t.vars||t).palette.action.disabled,inherit:void 0}[s.color]})),Ce=y.forwardRef(function(s,n){const o=tt({props:s,name:"MuiIcon"}),{baseClassName:a="material-icons",className:r,color:i="inherit",component:l="span",fontSize:u="medium"}=o,c=ot(o,Xt),f=Oe({},o,{baseClassName:a,color:i,component:l,fontSize:u}),p=Zt(f);return e.jsx(Jt,Oe({as:l,className:st(a,"notranslate",p.root,r),ownerState:f,"aria-hidden":!0,ref:n},c))});Ce.muiName="Icon";async function Gt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const a=await Promise.all(n.map(async r=>{let{name:i}=r;const l=await At(r.endpoint);return!Q(l)&&l!==i&&(i=l,o=!0),{...r,name:i}}));return o&&await Promise.all(a.filter(r=>r.did).map(r=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:r.did},spaceGateway:{...r}}}))),a}function eo({refresh:t}={}){var a;const{blocklet:s}=A(),n=(a=s==null?void 0:s.meta)==null?void 0:a.did,{api:o}=M();return rt(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Gt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){var i;(i=r==null?void 0:r.message)!=null&&i.includes("not logged")?console.warn(r):(console.error(r),w.error(X(r)))}})}function Fe({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){var f;const{blocklet:o}=A(),[a,r]=y.useState([]),{api:i}=M(),[l,u]=y.useMemo(()=>n?[T(n).startOf("day").toISOString(),T(n).endOf("day").toISOString()]:[T().startOf("year").toISOString(),T().endOf("day").toISOString()],[n]),c=Me(async()=>{try{if(s(!0),!o){r([]);return}const{backups:p}=await i.getBlockletBackups({input:{did:o.meta.did,startTime:l,endTime:u}});r(p??[])}catch(p){console.error(p),w.error(X(p))}finally{s(!1)}},1e3);return Ue(async()=>{c()},[(f=o==null?void 0:o.meta)==null?void 0:f.did].concat(t)),{backups:a}}function to({appDid:t}){const{backups:s}=Fe(),[n,o]=y.useState({message:"",progress:0,completed:!1}),a=M(),{ws:{useSubscription:r}}=a;return r(_.BlockletEvents.backupProgress,i=>{t===(i==null?void 0:i.appDid)&&o(()=>({...i}))},[t]),y.useEffect(()=>{var i;if(s!=null&&s.length&&at((i=s[0])==null?void 0:i.status)){const[l]=s;o(()=>({message:l.message,progress:l.progress,completed:l.progress>=100}))}},[s]),n}function oo({deps:t=[],setLoading:s=()=>{}}={}){var l;const{blocklet:n}=A(),[o,a]=y.useState([]),{api:r}=M(),i=y.useCallback(Me(async()=>{var u;if(!r||!((u=n==null?void 0:n.meta)!=null&&u.did)){a([]);return}try{s(!0);const c=T(),f=c.subtract(1,"year"),{summary:p}=await r.getBlockletBackupSummary({input:{did:n.meta.did,startTime:f.toISOString(),endTime:c.toISOString()}});a(Array.isArray(p)?p:[])}catch(c){console.error("Failed to fetch backup summary:",c),w.error(X(c)),a([])}finally{s(!1)}},1e3),[]);return Ue(async()=>(await i(),()=>{i.cancel()}),[(l=n==null?void 0:n.meta)==null?void 0:l.did].concat(t)),{backupSummary:o}}const Ke=y.createContext({}),{Provider:so,Consumer:is}=Ke;function ke({children:t}){var F;const{t:s}=E(),{api:n}=M(),{blocklet:o}=A(),[a,r]=y.useState(null),[i,l]=y.useState(!1),{data:u,loading:c,mutate:f}=eo({refresh:i}),p=it(u),x=to({appDid:o==null?void 0:o.appDid}),h=y.useMemo(()=>Ot(o==null?void 0:o.environments),[o==null?void 0:o.environments]),[b,D]=y.useState(!1),[S,d]=y.useState(!1),{backups:se}=Fe({deps:[S,a],setLoading:D,backupDate:a}),[ne,re]=y.useState(!1),{backupSummary:ae}=oo({deps:[ne]}),[U,L]=y.useState(u==null?void 0:u.find(m=>m.endpoint===h)),I=(F=o==null?void 0:o.settings)==null?void 0:F.autoBackup,v=()=>{l(m=>!m)},ie=()=>{re(m=>!m)},ce=()=>{d(m=>!m)},$=async m=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:m}})},Z=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},le=async(m,N)=>{try{f(B=>{const P=[...B];return P.push({...m,loading:!0}),P}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:m}}),h!==N&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:N}]}}),L(m),v(),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"}))}catch(B){throw console.error(B),f(P=>[...P].filter(pe=>pe.did!==m.did)),B}},de=async m=>{m&&(m.endpoint===h&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I!=null&&I.enabled&&await $({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:m==null?void 0:m.did}}),f(N=>{const B=[...N];return B.splice(B.indexOf(m),1),B}),L(m),v())},ue=async m=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:m.did},spaceGateway:m}}),h!==m.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:m.endpoint}]}})]),w.success(s("storage.spaces.connectedWithName",{name:(m==null?void 0:m.name)??"DID Spaces"})),v()},k=m=>(m==null?void 0:m.endpoint)===h;return e.jsx(so,{value:{spaceGateways:u||[],selectedSpaceGateway:U,addSpaceGateway:le,deleteSpaceGateway:de,updateSpaceGateway:ue,refreshSpaceGateways:v,spaceGatewaysLoading:c,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:k,updateAutoBackup:$,abortBlockletBackup:Z,backupEndpoint:h,backupProgress:x,backups:se,backupSummary:ae,refreshBackupSummary:ie,refreshBackups:ce,setBackupDate:r,backupsLoading:b,autoBackup:I},children:t})}ke.propTypes={children:g.any.isRequired};ke.defaultProps={};function O(){return y.useContext(Ke)}function oe({...t}){const{blocklet:s}=A(),{info:n}=M(),{t:o}=E(),a=$e({blocklet:s}),r=ct(n),{spaceGateways:i,addSpaceGateway:l}=O(),u={checkFn:Ne.create({baseURL:ge(window.location.origin,lt())}).get,webWalletUrl:r,extraParams:{appPid:s.appPid,appDid:a.appDid,appName:a.appName,appDescription:a.appDescription,appUrl:a.appUrl,referrer:a.referrer,scopes:a.scopes,nodeDid:n.did}},c=async({endpoint:p,name:x,did:h})=>{const b=await Lt(p);if(!await Pt(b)){w.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(i.some(d=>d.endpoint===p)){w.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await l({name:x,did:h,url:b,endpoint:p},p)},f=async({spaceGateway:p})=>{try{await c(p)}catch(x){console.error(x),w.error(X(x))}};return e.jsx(Dt,{...t,connectScope:"app",options:u,onSuccess:f})}oe.propTypes={};oe.defaultProps={};function qe({...t}){const{t:s}=y.useContext(ut),{blocklet:n,loadingDiskInfo:o,actions:a}=A();if(y.useEffect(()=>{a==null||a.refreshBlocklet({showError:!1,attachDiskInfo:!0})},[]),n.diskInfo){const r=(u,c,f)=>e.jsxs(C,{children:[u," ",e.jsx("strong",{children:c?pt(c):"empty"})]}),i=n.environments.reduce((u,c)=>(u[c.key]=c.value,u),{}),l=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(i.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(i.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(i.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(i.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(no,{component:"div",...t,children:l.map(u=>e.jsx(Nt,{valueComponent:"div",nameWidth:120,name:u.name,children:u.value},u.key))})}return o?e.jsx(z,{}):e.jsx(C,{children:s("blocklet.diskInfo.empty")})}const no=dt(C)``;function De(){const{t}=E(),{setBackupDate:s,backupSummary:n}=O(),o=wt({key:"lg"}),a=y.useRef(null),r=mt(),i=y.useCallback(c=>{s(c)},[s]),l=y.useMemo(()=>{const c=T().add(1,"day"),f=T().subtract(11,"month").startOf("month"),p=new Map(n.map(h=>[h.date,{date:h.date,successCount:h.successCount,errorCount:h.errorCount}])),x=[];for(let h=f.clone();T(h).isBefore(c);h=h.add(1,"day")){const b=h.format("YYYY-MM-DD");x.push(p.get(b)||{date:b,successCount:0,errorCount:0})}return x},[n]),u=y.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:b=>{const{date:D,successCount:S,errorCount:d}=l[b.dataIndex]||{date:b.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${D}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${d}</div>`].join(`
2
2
  `)},backgroundColor:r.palette.background.paper,borderColor:r.palette.divider,textStyle:{color:r.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${r.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:J[600]},{min:-9,max:-6,color:J[500]},{min:-6,max:-3,color:J[400]},{min:-3,max:-1,color:J[300]},{min:0,max:0,color:r.palette.grey[200]},{min:1,max:3,color:G[300]},{min:3,max:6,color:G[400]},{min:6,max:9,color:G[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:G[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:r.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,color:r.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:r.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:r.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[T().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),T().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:l.map(b=>[b.date,b.errorCount?-b.errorCount:b.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:r.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ft[200],color:"inherit"}}}}),[l,t,r]);return e.jsxs(e.Fragment,{children:[e.jsx(j,{ref:a,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(j,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Wt,{option:u,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:c=>{c.componentType==="series"&&c.data&&i(c.data[0])}}})})}),e.jsx(j,{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2,children:e.jsxs(W,{direction:o?"column":"row",spacing:o?2:1,width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center",children:[e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.failed")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.without")})]}),e.jsxs(W,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(j,{width:32,height:12,borderRadius:.5,sx:{background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(C,{variant:"body2",color:"text.secondary",children:t("storage.spaces.backup.succeeded")})]})]})})]})}De.propTypes={};const ro=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function we({status:t,message:s,createdAt:n}){const{t:o}=E(),a=t===R.BACKUPS.STATUS.PROGRESS&&T().diff(n,"hours")>=R.BACKUPS.TIMEOUT_HOURS,r=a&&o("common.timeoutError"),i=t===R.BACKUPS.STATUS.PROGRESS&&!a,l=t===R.BACKUPS.STATUS.SUCCEEDED&&!a;return i?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):l?e.jsx(V,{type:"success",children:o("common.succeeded")}):e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"error",children:o("common.failed")}),"  ",e.jsx(ye,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||r,children:e.jsx(Ce,{children:e.jsx($t,{style:{width:"24px",height:"24px"},color:"error"})})})]})}we.propTypes={status:g.string.isRequired,message:g.string,createdAt:g.string.isRequired};we.defaultProps={message:""};function Be({metadata:t}){const{t:s}=E();if(Q(t))return e.jsx(V,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,a=Kt(o,{iec:!0}),r=e.jsxs(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:[e.jsxs(C,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(C,{variant:"body2",children:[s("common.fileSize"),": ",a]})]});return e.jsxs(j,{display:"inline-flex",alignItems:"center",children:[e.jsx(V,{type:"success",children:s("common.succeeded")})," ",e.jsx(ro,{title:r,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(Ce,{children:e.jsx(gt,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Be.propTypes={metadata:g.object};Be.defaultProps={metadata:{}};function Te(){const{t,locale:s}=E(),{spaceGateways:n,backups:o,backupsLoading:a}=O(),r=y.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:l=>{var D;const{targetUrl:u,targetName:c,status:f,createdAt:p}=o[l],x=f===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,h=f===R.BACKUPS.STATUS.SUCCEEDED&&!x,b=c||((D=n.find(S=>u==null?void 0:u.includes(Se(S==null?void 0:S.endpoint))))==null?void 0:D.name)||"Unknown DID Space";return h?e.jsx(ht,{fontSize:"16px",href:u,target:"_blank",children:b}):e.jsx(C,{variant:"body1",fontSize:"16px",children:b})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:l=>{const u=t(l===0?"common.auto":"common.manual");return e.jsx(V,{children:u})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:l=>T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:l=>Q(l)?"":T(l).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:l=>{const u=(o==null?void 0:o[l])??{},{status:c,message:f,createdAt:p,metadata:x}=u,h=c===R.BACKUPS.STATUS.PROGRESS&&T().diff(p,"hours")>=R.BACKUPS.TIMEOUT_HOURS,b=c===R.BACKUPS.STATUS.PROGRESS&&!h,D=c===R.BACKUPS.STATUS.SUCCEEDED&&!h;return b?e.jsxs(C,{display:"inline-flex",alignItems:"center",fontSize:"14px",children:[e.jsx(z,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):D?e.jsx(Be,{metadata:x}):e.jsx(we,{status:c,message:f,createdAt:p})}}}],[o,n,t]),i=y.useMemo(()=>!(o!=null&&o.length),[o]);return e.jsx(e.Fragment,{children:i?e.jsx(j,{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px",children:t("storage.spaces.record.emptyData")}):e.jsx(Ft,{title:"",loading:a,data:o,columns:r,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}Te.propTypes={};function Ye(){const{t}=E();return e.jsxs(j,{children:[e.jsxs(j,{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"},children:[e.jsxs(j,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240,children:[e.jsx(Bt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(C,{my:2,sx:{textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(oe,{})]}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.backup.records")})}),e.jsx(De,{})]})]}),e.jsx(Te,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2,children:t("common.dataStorage")}),e.jsx(qe,{})]})}Ye.propTypes={};var Ee={},ao=be;Object.defineProperty(Ee,"__esModule",{value:!0});var He=Ee.default=void 0,io=ao(je()),co=e;He=Ee.default=(0,io.default)((0,co.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");var Ie={},lo=be;Object.defineProperty(Ie,"__esModule",{value:!0});var Ve=Ie.default=void 0,uo=lo(je()),po=e;Ve=Ie.default=(0,uo.default)((0,po.jsx)("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"}),"ElectricBoltOutlined");var Re={},mo=be;Object.defineProperty(Re,"__esModule",{value:!0});var Qe=Re.default=void 0,fo=mo(je()),ho=e;Qe=Re.default=(0,fo.default)((0,ho.jsx)("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"FolderOutlined");function ve({spaceGateway:t,onConfirm:s,onCancel:n}){const{t:o}=E(),[a,r]=y.useState(!1),[i,l]=y.useState(!1),u=(p,x)=>{p==null||p.preventDefault(),p==null||p.stopPropagation(),r(x)},c=async p=>{try{p==null||p.stopPropagation(),l(!0),await(s==null?void 0:s(t)),r(!1)}catch(x){console.error(x),w.error(`${o("storage.space.gateway.delete.failed")}: ${X(x)}`)}finally{r(!1),l(!1)}},f=p=>{u(p,!1),n==null||n(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(q,{color:"red",onClick:p=>u(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ht,{fontSize:"small"})}),e.jsx(H,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(xt,{title:o("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:i}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:i}},onConfirm:c,onCancel:f,children:e.jsx(C,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t==null?void 0:t.name}`})})})]})}ve.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool}).isRequired,onConfirm:g.func,onCancel:g.func};ve.defaultProps={onConfirm:()=>{},onCancel:()=>{}};function ze({spaceGateway:t,selected:s,onDelete:n,onConnect:o,enableSwitchToSpace:a,backupInProgress:r,...i}){const{abortBlockletBackup:l}=O(),[u,c]=y.useState(null),{t:f}=E(),[p,x]=y.useState(!1),h=(S,d)=>{S.stopPropagation(),S.preventDefault(),c(d&&S.currentTarget)},b=async S=>{try{x(!0),h(S,!1),await o(t)}catch(d){console.error(d),w.error(d.message)}finally{x(!1)}},D=async S=>{try{x(!0),h(S,!1),await l()}catch(d){console.error(d),w.error(d.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[p||t!=null&&t.loading?e.jsx(z,{sx:{ml:1},size:"24px"}):e.jsx(St,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>h(S,!0),...i,children:e.jsx(qt,{})}),e.jsxs(yt,{id:"simple-menu",anchorEl:u,keepMounted:!0,open:!!u,onClose:S=>h(S,!1),children:[e.jsxs(q,{onClick:S=>{h(S,!1),window.open(Pe(t.endpoint?_t(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(He,{fontSize:"small"})}),e.jsx(H,{children:f("common.open")})]}),e.jsxs(q,{onClick:S=>{h(S,!1),window.open(Pe(Mt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Qe,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.strategy.viewBackupFiles")})]}),!s&&a&&e.jsxs(q,{onClick:b,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.switchToSpace")})]}),r&&e.jsxs(q,{onClick:D,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Yt,{fontSize:"small"})}),e.jsx(H,{children:f("storage.spaces.connect.abortBlockletBackup")})]}),!r&&e.jsx(ve,{spaceGateway:t,onConfirm:async()=>{c(null),await(n==null?void 0:n(t))},onCancel:()=>c(null)})]})]})}ze.propTypes={spaceGateway:g.shape({name:g.string.isRequired,url:g.string.isRequired,protected:g.bool,endpoint:g.string.isRequired,loading:g.bool}).isRequired,selected:g.bool.isRequired,enableSwitchToSpace:g.bool,onDelete:g.func,onConnect:g.func,backupInProgress:g.bool};ze.defaultProps={onDelete:()=>{},onConnect:()=>{},enableSwitchToSpace:!0,backupInProgress:!1};const go=te(({className:t,...s})=>e.jsx(ye,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o,onDeleted:a,onBackedUp:r}){const{t:i,locale:l}=E(),{blocklet:u}=A(),{api:c,info:{did:f}}=M(),{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S}=$e({blocklet:u}),{backupProgress:d,updateSpaceGateway:se,deleteSpaceGateway:ne,refreshBackupSummary:re,refreshBackups:ae}=O(),[U,L]=y.useState(!1),[I,v]=y.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:i("storage.spaces.authorize.title",{appName:x},l),scan:i("storage.spaces.authorize.scan",{appName:x},l),confirm:"",success:e.jsx(C,{gutterBottom:!0,children:i("storage.spaces.authorize.success")})},onClose:()=>{v(k=>({...k,open:!1}))}}),ie=n&&!U&&s===fe.DISCONNECTED,ce=n&&!U&&!t.loading&&s===fe.CONNECTED,$=n&&U&&s===fe.CONNECTED&&(d==null?void 0:d.progress)>=0,Z=async()=>{try{if(await Ut(t==null?void 0:t.endpoint)){await c.configBlocklet({input:{did:[u.meta.did],configs:[{key:_.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),w.success(i("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o==null||o(null,t);return}}catch(k){console.error(k),o==null||o(k,t);return}v(k=>({...k,open:!0,prefix:ge(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ne.create({baseURL:ge(t.url,"space")}).get,extraParams:{appDid:p,appName:x,appDescription:h,scopes:b,appUrl:D,referrer:S,nodeDid:f,spaceDid:t.did}}))},le=async(k,F)=>{const m=F(k.endpoint),N=Se(m),B=k.space?F(k.space):{};if(t.did&&N!==t.did){v(pe=>({...pe,open:!1}));const K=i("storage.spaces.gateway.switch.failedForMismatchSpace",{name:B!=null&&B.name?B.name:""});w.error(K),o==null||o(new Error(K),t);return}const P={...t,name:B.name??"DID Space",did:B.did??Se(m),endpoint:m};await se(P),v(K=>({...K,open:!1})),o==null||o(null,P)},de=async()=>{try{if(U)return;L(!0),await c.backupBlocklet({input:{appDid:u.appDid,to:"spaces"}})}catch(k){console.error(k),w.error(k.message),r==null||r(k,t)}finally{L(!0)}},ue=async()=>{try{await ne(t),w.success(i("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),a==null||a(null,t)}catch(k){console.error(k),a==null||a(k,t)}};return y.useEffect(()=>{d!=null&&d.completed?(n&&((d==null?void 0:d.progress)===100?(w.success(i("storage.spaces.backupSuccessfully")),r==null||r(null,t)):d.message&&(r==null||r(new Error(d==null?void 0:d.message),t)),d.progress=0,d.message=""),L(!1),setTimeout(()=>{re(),ae()},1e3)):d.progress&&L(!0)},[d]),e.jsxs(e.Fragment,{children:[e.jsxs(j,{sx:{".action-btn":{borderRadius:1,marginLeft:1}},display:"flex",alignItems:"center",children:[ce&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:de,children:i("storage.spaces.strategy.backupNow")}),ie&&e.jsx(me,{className:"action-btn",variant:"outlined",size:"small",onClick:Z,children:i("storage.spaces.disconnected.reconnectNow")}),$&&e.jsx(go,{title:(d==null?void 0:d.message)&&e.jsx(j,{p:1,sx:{color:"black",backgroundColor:"white"},borderRadius:1,boxShadow:2,children:e.jsx(C,{variant:"body2",children:d.message})}),children:e.jsxs(me,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(z,{variant:"determinate",value:d==null?void 0:d.progress,size:14,sx:{mr:1}}),d==null?void 0:d.progress,"%"]})}),e.jsx(jt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:le,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:l},"get-endpoint")]}),e.jsx(ze,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:ue,onConnect:Z,enableSwitchToSpace:(d==null?void 0:d.completed)||Q(d==null?void 0:d.message),backupInProgress:$})]})}Ae.propTypes={spaceGateway:g.shape({did:g.string.isRequired,name:g.string.isRequired,url:g.string.isRequired,endpoint:g.string.isRequired,protected:g.bool,loading:g.bool}).isRequired,spaceStatus:g.string.isRequired,selected:g.bool.isRequired,onConnected:g.func,onDeleted:g.func,onBackedUp:g.func};Ae.defaultProps={onConnected:()=>{},onDeleted:()=>{},onBackedUp:()=>{}};function Xe({...t}){const{t:s}=E();return e.jsxs(j,{...t,children:[e.jsx(j,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3,children:e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:s("storage.spaces.backup.records")})}),e.jsx(De,{}),e.jsx(Te,{})]})}Xe.propTypes={};function Ze({...t}){const{t:s}=E(),{autoBackup:n,updateAutoBackup:o}=O(),a=async()=>{try{const r=!(n!=null&&n.enabled);await o({enabled:r}),w.success(s(r?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(r){w.error(r.message)}};return e.jsx(Vt,{checked:!!(n!=null&&n.enabled),onChange:a,name:"enableWelcomePage",labelProps:{label:e.jsx(C,{marginRight:"8px",children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}Ze.propTypes={};function xo(){const{t}=E(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),a=n&&!(s!=null&&s.length),r=({spaceGateway:i,spaceStatus:l,selected:u,refresh:c})=>e.jsx(Ae,{spaceGateway:i,spaceStatus:l,selected:u,onConnected:()=>c(),onBackedUp:f=>f&&c()});return e.jsxs(j,{display:"flex",flexDirection:"column",children:[e.jsxs(j,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1,children:t("storage.spaces.connected.title")}),e.jsx(Ze,{}),e.jsx(oe,{})]}),e.jsx(j,{mt:2,children:a?e.jsx(j,{display:"flex",justifyContent:"center",children:e.jsx(z,{})}):e.jsx(Le,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(i=>e.jsx(Le,{item:!0,xs:12,md:6,children:e.jsx(Tt,{endpoint:i.endpoint,selected:o(i),action:r},i.endpoint)},i.endpoint))})})}),e.jsx(Xe,{sx:{marginTop:"24px"}}),e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",mb:2,children:t("common.dataStorage")}),e.jsx(qe,{})]})}function So(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):Q(s)?e.jsx(Ye,{}):e.jsx(xo,{})}function yo(){return e.jsx(ke,{children:e.jsx(So,{})})}function jo(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:a,storageEndpoint:r}=It(),i=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return a?e.jsx(We,{relative:"parent",children:e.jsx(z,{})}):e.jsxs(j,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(Rt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(vt,{}),e.jsx(j,{sx:i,children:e.jsx(zt,{onConnect:n,storageEndpoint:r})})]})}function bo(){const{t}=E();return e.jsxs(Et,{children:[e.jsxs(W,{spacing:1,marginBottom:2,children:[e.jsx(C,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.appLevel.title")}),e.jsx(C,{color:"text.secondary",children:t("storage.appLevel.description")})]}),e.jsx(jo,{})]})}function Je({navOrientation:t,...s}){const{t:n,locale:o}=E(),{blocklet:a}=A(),r=kt({key:"md"}),[i,l]=bt(),u=i.get("tab")||"backup",c=r?"horizontal":t,f=xe(()=>{var d;const D=[{label:n("common.backup"),value:"backup"}],S=(d=a==null?void 0:a.capabilities)==null?void 0:d.didSpace;return(S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===_.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&D.push({label:n("common.storage"),value:"storage"}),D},[o,c]),x=xe(()=>({backup:e.jsx(yo,{}),storage:e.jsx(bo,{})}))[u],h=D=>{l(S=>(D==="backup"?S.delete("tab"):S.set("tab",D),S))};if(f.length<=1)return e.jsx(he,{children:x});const b=e.jsx(Ct,{tabs:f,current:u,orientation:c,onChange:h,sx:[{borderRight:1,height:"100%",borderColor:"divider"},c==="horizontal"&&{borderRight:0}]});if(c==="vertical")return e.jsx(j,{...s,children:e.jsxs(W,{direction:{md:"column",lg:"row"},gap:2,children:[e.jsx(j,{sx:{flexShrink:0},children:e.jsx(_e,{left:b})}),e.jsx(j,{sx:{flexGrow:1,minWidth:0},children:e.jsx(he,{sx:{mt:1},children:x})})]})});if(c==="horizontal")return e.jsxs(j,{...s,children:[e.jsx(_e,{left:b}),e.jsx(he,{sx:{mt:2},children:x})]})}Je.propTypes={navOrientation:g.oneOf(["vertical","horizontal"])};Je.defaultProps={navOrientation:"vertical"};const he=te(j)`
3
3
  position: relative;
4
4
  min-height: 66vh;
@@ -1,4 +1,4 @@
1
- import{j as e,dq as c,N as l,P as n}from"./index-B2VuOb4T.js";var i=function(t){return e.jsx("svg",{...t,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})})};i.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};i.displayName="empty";const a=c(l)`
1
+ import{j as e,dq as c,N as l,P as n}from"./index-B8IA5mbU.js";var i=function(t){return e.jsx("svg",{...t,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.36096 2.3999C7.04725 2.3999 6.76249 2.58326 6.63267 2.86886L0.872671 15.5409C0.825415 15.6448 0.800964 15.7577 0.800964 15.8719V15.9999V27.3919C0.800964 27.8337 1.15914 28.1919 1.60096 28.1919H30.401C30.8428 28.1919 31.201 27.8337 31.201 27.3919V15.8719C31.201 15.7577 31.1765 15.6448 31.1293 15.5409L25.3693 2.86886C25.2394 2.58326 24.9547 2.3999 24.641 2.3999H7.36096ZM2.40096 16.7999V26.5919H29.601V16.7932C29.5669 16.7976 29.5321 16.7999 29.4968 16.7999H22.3993L20.3328 19.8997C20.1845 20.1222 19.9347 20.2559 19.6672 20.2559H11.6032C11.3357 20.2559 11.0859 20.1222 10.9375 19.8997L8.87104 16.7999H2.40096ZM29.2167 15.1999H21.9712C21.7037 15.1999 21.4539 15.3336 21.3056 15.5561L19.239 18.6559H12.0313L9.96483 15.5561C9.81645 15.3336 9.56667 15.1999 9.29919 15.1999H2.78519L7.8761 3.9999H24.1258L29.2167 15.1999Z",fill:"currentColor"})})};i.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};i.displayName="empty";const a=c(l)`
2
2
  display: flex;
3
3
  justify-content: center;
4
4
  align-items: center;
@@ -1,4 +1,4 @@
1
- import{m as D,j as e,R as $,P as u,r as C,Q as G,S as Q,U as Z,V as J,N as p,F as z,br as _,bs as Ke,a_ as Y,t as M,B as F,C as Ae,af as ue,e as we,D as xe,aZ as Se,X as De,n as B,A as Re,ax as H,l as Ie,W as $e,bt as de,bu as fe,bv as he,bw as ye,bx as Be,J as Pe,k as I,by as _e,aC as E,a5 as pe,aW as me,bz as Le,Y as Ne,Z as ze,z as Ee,u as We,bq as qe,d as Ue,bA as Me}from"./index-B2VuOb4T.js";import{T as Fe}from"./index-BF4vf6id.js";import He from"./audit-logs-IXBKuhDc.js";import{T as ge,M as Oe}from"./index-DRSI6DIa.js";import{r as be,P as Ve}from"./index-BzVT2Nrg.js";import{u as L,T as Xe}from"./team-B2fYu72j.js";import{g as Ge,D as Qe}from"./index-Xck-gZ1a.js";import{d as Ze}from"./Delete-BEDhfjgM.js";import{d as Je}from"./Edit-Czl2eCpM.js";import{E as Ye}from"./index-C6uxeWL5.js";import{d as et}from"./Add-B4ZxigzZ.js";import{C as O}from"./index-rKYT_6qC.js";import{C as V}from"./click-to-copy-CaV3f1zY.js";import{f as tt}from"./index-BojVbZw0.js";import{D as st}from"./delete-confirm-CyLYocY4.js";import{P as ot}from"./permission-DTthelu1.js";import{u as nt}from"./blocklet-Dj7-7T3f.js";import{A as at}from"./actions-DWmK9-Ml.js";import{u as je}from"./use-mobile-pZqk7eRQ.js";import{u as it}from"./useAsyncRetry-HZ7iBUko.js";import"./TableSearch-CIJv0sa5.js";import"./Search-B9sPCbKU.js";import"./Clear-bgnUq6y0.js";import"./useLocalStorage-DGcI4VdJ.js";import"./index-B9KZI2SN.js";import"./shorten-label-CWvoYJOM.js";import"./ViewList-Cn5h6Rj3.js";import"./resource-dialog-BNbaaEXt.js";import"./index-Cxh7-j7t.js";import"./use-mobile-DWCwqlKP.js";import"./ListItemButton-Cq2F-p9g.js";import"./index-rbUoQ9gl.js";import"./emotion-react.browser.esm-zhWsWQqH.js";import"./index-CmNGzNDe.js";import"./Switch-v96fFUVN.js";import"./url-evaluation-BzcyBhf_.js";import"./index-Cd18MmSj.js";import"./OpenInNew-IexFTpEO.js";import"./index-BJHGOv7L.js";import"./HelpOutline-BJqbizDQ.js";import"./index-BKWicGJw.js";import"./ButtonGroup-Djxp9GV8.js";import"./getValidReactChildren-BK3p7HMr.js";import"./AdapterDayjs-Bb5pC0CE.js";import"./useThemeProps-CdW8lLMN.js";import"./CSSTransition-Bd8ftQ2v.js";import"./refType-Dh8-m1kl.js";import"./index-eb0zP4qu.js";import"./Verified-3rFYpz5S.js";import"./DeleteOutline-BnT7fsMq.js";import"./ErrorOutline-HeG61pGN.js";import"./sdk-BW91rmDS.js";import"./LockIcon-BKEcgaSm.js";import"./cloneDeep-D9FrtSv6.js";import"./chain-BHqPLd89.js";import"./list-header-BQri46Fq.js";import"./ToggleButtonGroup-DSjHARIe.js";import"./TableRow-DMNYoxLV.js";import"./ViewColumn-YTkBMCPT.js";import"./MoreVert-D4ECIeFy.js";import"./MoreHoriz-BrmAZhbC.js";import"./useAsync-Ca6qreJM.js";function ee({value:t}){const{t:s,locale:c}=D(),r=new Date;return new Date(t)<r?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:t,locale:c}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{value:t,locale:c,type:"all"})}ee.propTypes={value:u.string.isRequired};function te({value:t,onChange:s,...c}){const{t:r}=D(),l=C.useMemo(()=>[{value:"signature",title:r("setting.accessKey.signature"),description:r("setting.accessKey.signatureDesc")},{value:"simple",title:r("setting.accessKey.simple"),description:r("setting.accessKey.simpleDesc")}],[r]);return e.jsxs(G,{style:{width:"100%"},variant:"outlined",...c,children:[e.jsx(Q,{children:r("setting.accessKey.authType")}),e.jsx(Z,{value:t,onChange:s,fullWidth:!0,label:r("setting.accessKey.authType"),children:l.map(o=>e.jsx(J,{value:o.value,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title}),e.jsx(p,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:o.description})]})},o.value))})]})}te.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const W=()=>{const t=z.RBAC_CONFIG.roles.filter(l=>l.passport),{inService:s}=_(),{roles:c}=L(),r=[...t,...s?c:[]];return Ke(r,"name").filter(l=>l.name!==z.ROLES.OWNER)};function se(t){const{remark:s,onCreate:c}=t,{api:r}=_(),{teamDid:l}=L(),{t:o}=D(),[k,g]=C.useState(!1),[d,v]=C.useState(null),x=W(),b=()=>{g(!1),v(null)},y=async a=>{const{remark:j,passport:f,authType:n}=a;g(!0);const h=await r.createAccessKey({input:{teamDid:l,remark:j.trim(),passport:f,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:n}}),{data:S}=h;c(S),v(null),g(!1)},T={title:`${o("common.create")} ${o("accessKey")}`,description:(a,j,f)=>e.jsxs(Y,{gap:3,children:[e.jsx(M,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:n=>{j({...a,remark:n.target.value,__disableConfirm:!a.passport||!n.target.value.trim()}),n.target.value.trim()?f(""):f(o("setting.accessKey.remarkInvalid"))}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:o("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:n=>{const h=n.target.value;f(null),j({...a,passport:h,__disableConfirm:!a.remark||!h})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:k,children:x.map(n=>e.jsx(J,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(p,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(te,{value:a.authType,onChange:n=>{j({...a,authType:n.target.value})}}),e.jsx(ge,{placeholder:o("setting.accessKey.expireTime"),value:a.expireAt,onChange:n=>{j({...a,expireAt:n,__disableConfirm:!a.passport||!a.remark||!n})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:y,onCancel:b};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(T),className:"rule-action",children:[k?e.jsx(Ae,{size:16}):e.jsx(et,{style:{fontSize:16}}),o("common.create")]}),d&&e.jsx(ue,{title:d.title,description:d.description,confirm:d.confirm,color:d.color,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}se.propTypes={remark:u.string,onCreate:u.func};se.defaultProps={onCreate:()=>{},remark:""};function oe(t){const{onConfirm:s,accessKeyId:c,accessKeySecret:r,hideSecret:l}=t,{t:o}=C.useContext(we),[k,g]=C.useState(!1),[d,v]=C.useState(()=>l),x=()=>{v(!d)},b=a=>{g(a.target.checked)},y=C.useMemo(()=>{var a,j,f,n;return l?`const Client = require('@abtnode/client');
1
+ import{m as D,j as e,R as $,P as u,r as C,Q as G,S as Q,U as Z,V as J,N as p,F as z,br as _,bs as Ke,a_ as Y,t as M,B as F,C as Ae,af as ue,e as we,D as xe,aZ as Se,X as De,n as B,A as Re,ax as H,l as Ie,W as $e,bt as de,bu as fe,bv as he,bw as ye,bx as Be,J as Pe,k as I,by as _e,aC as E,a5 as pe,aW as me,bz as Le,Y as Ne,Z as ze,z as Ee,u as We,bq as qe,d as Ue,bA as Me}from"./index-B8IA5mbU.js";import{T as Fe}from"./index-Cy666DOY.js";import He from"./audit-logs-EkgBhSvA.js";import{T as ge,M as Oe}from"./index-C0dOEsU4.js";import{r as be,P as Ve}from"./index-BOH-YtOs.js";import{u as L,T as Xe}from"./team-BcbX_cMl.js";import{g as Ge,D as Qe}from"./index-zsz18EZU.js";import{d as Ze}from"./Delete-CiU1bEBu.js";import{d as Je}from"./Edit-BvogU5l2.js";import{E as Ye}from"./index-DbTX57bM.js";import{d as et}from"./Add-BFsFN1Gy.js";import{C as O}from"./index-B-SlNWYL.js";import{C as V}from"./click-to-copy-CYaDSQoy.js";import{f as tt}from"./index-BojVbZw0.js";import{D as st}from"./delete-confirm-D2071wW2.js";import{P as ot}from"./permission-JEjDz9i9.js";import{u as nt}from"./blocklet-BzkaFDNW.js";import{A as at}from"./actions-LyrEo_Cb.js";import{u as je}from"./use-mobile-DxY5BxAJ.js";import{u as it}from"./useAsyncRetry-Bis_hMS7.js";import"./TableSearch-CxutcmoF.js";import"./Search-DGRuo7t-.js";import"./Clear-CmPKgcDo.js";import"./useLocalStorage-CRy7LFYG.js";import"./index-QU1qCf8F.js";import"./shorten-label-DEXH98Sk.js";import"./ViewList-BEu0UPsS.js";import"./resource-dialog-BSxf3l0v.js";import"./index-D6ARqm6f.js";import"./use-mobile-DU80Jj4U.js";import"./ListItemButton-D2V2qgeT.js";import"./index-BJQjXoNM.js";import"./emotion-react.browser.esm-CSjORkdU.js";import"./index-5OOYkflw.js";import"./Switch-CG3jQlg3.js";import"./url-evaluation-DmRIkzYe.js";import"./index-fHnSssqp.js";import"./OpenInNew-DJsi1NWq.js";import"./index-BJHGOv7L.js";import"./HelpOutline-hZN36iob.js";import"./index-BhAPLn1b.js";import"./ButtonGroup-BzAT8pGA.js";import"./getValidReactChildren-CxwCdnNW.js";import"./AdapterDayjs-Cf6af3xk.js";import"./useThemeProps-C3mE_-3Z.js";import"./CSSTransition-Byi2ne4y.js";import"./refType-Dqlqmha-.js";import"./index-rZ1SBrH_.js";import"./Verified-DVQjMky2.js";import"./DeleteOutline-reI_idEa.js";import"./ErrorOutline-CLZmnhnI.js";import"./sdk-DtMj7H7_.js";import"./LockIcon-C58tNgx9.js";import"./cloneDeep-C6XYSA9m.js";import"./chain-DJhIX7OW.js";import"./list-header-DL9A5VcR.js";import"./ToggleButtonGroup-Dldk8U9s.js";import"./TableRow-Cyof88VP.js";import"./ViewColumn-BSxTQVZ-.js";import"./MoreVert-BZT8paNd.js";import"./MoreHoriz-CPdB-acW.js";import"./useAsync-Ct1xKput.js";function ee({value:t}){const{t:s,locale:c}=D(),r=new Date;return new Date(t)<r?e.jsxs("span",{style:{color:"red"},children:[e.jsx($,{value:t,locale:c}),`${s("setting.accessKey.expired",{time:""})}`]}):e.jsx($,{value:t,locale:c,type:"all"})}ee.propTypes={value:u.string.isRequired};function te({value:t,onChange:s,...c}){const{t:r}=D(),l=C.useMemo(()=>[{value:"signature",title:r("setting.accessKey.signature"),description:r("setting.accessKey.signatureDesc")},{value:"simple",title:r("setting.accessKey.simple"),description:r("setting.accessKey.simpleDesc")}],[r]);return e.jsxs(G,{style:{width:"100%"},variant:"outlined",...c,children:[e.jsx(Q,{children:r("setting.accessKey.authType")}),e.jsx(Z,{value:t,onChange:s,fullWidth:!0,label:r("setting.accessKey.authType"),children:l.map(o=>e.jsx(J,{value:o.value,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title}),e.jsx(p,{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal",children:o.description})]})},o.value))})]})}te.propTypes={value:u.string.isRequired,onChange:u.func.isRequired};const W=()=>{const t=z.RBAC_CONFIG.roles.filter(l=>l.passport),{inService:s}=_(),{roles:c}=L(),r=[...t,...s?c:[]];return Ke(r,"name").filter(l=>l.name!==z.ROLES.OWNER)};function se(t){const{remark:s,onCreate:c}=t,{api:r}=_(),{teamDid:l}=L(),{t:o}=D(),[k,g]=C.useState(!1),[d,v]=C.useState(null),x=W(),b=()=>{g(!1),v(null)},y=async a=>{const{remark:j,passport:f,authType:n}=a;g(!0);const h=await r.createAccessKey({input:{teamDid:l,remark:j.trim(),passport:f,expireAt:a.expireAt?new Date(a.expireAt).getTime():null,authType:n}}),{data:S}=h;c(S),v(null),g(!1)},T={title:`${o("common.create")} ${o("accessKey")}`,description:(a,j,f)=>e.jsxs(Y,{gap:3,children:[e.jsx(M,{label:o("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",inputProps:{"data-cy":"remark-input"},fullWidth:!0,autoFocus:!0,margin:"dense",value:a.remark,onChange:n=>{j({...a,remark:n.target.value,__disableConfirm:!a.passport||!n.target.value.trim()}),n.target.value.trim()?f(""):f(o("setting.accessKey.remarkInvalid"))}}),e.jsxs(G,{style:{width:"100%"},variant:"outlined",children:[e.jsx(Q,{children:o("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"create-access-key-select-passport",value:a.passport,onChange:n=>{const h=n.target.value;f(null),j({...a,passport:h,__disableConfirm:!a.remark||!h})},fullWidth:!0,label:o("setting.accessKey.passport"),disabled:k,children:x.map(n=>e.jsx(J,{value:n.name,"data-cy":`create-access-key-passport-option-${n.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:n.title||n.name}),e.jsx(p,{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify",children:n.description})]})},n.name))})]}),e.jsx(te,{value:a.authType,onChange:n=>{j({...a,authType:n.target.value})}}),e.jsx(ge,{placeholder:o("setting.accessKey.expireTime"),value:a.expireAt,onChange:n=>{j({...a,expireAt:n,__disableConfirm:!a.passport||!a.remark||!n})}})]}),confirm:o("common.confirm"),cancel:o("common.cancel"),color:"primary",params:{remark:s,authType:"signature",__disableConfirm:!s.trim()},onConfirm:y,onCancel:b};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>v(T),className:"rule-action",children:[k?e.jsx(Ae,{size:16}):e.jsx(et,{style:{fontSize:16}}),o("common.create")]}),d&&e.jsx(ue,{title:d.title,description:d.description,confirm:d.confirm,color:d.color,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}se.propTypes={remark:u.string,onCreate:u.func};se.defaultProps={onCreate:()=>{},remark:""};function oe(t){const{onConfirm:s,accessKeyId:c,accessKeySecret:r,hideSecret:l}=t,{t:o}=C.useContext(we),[k,g]=C.useState(!1),[d,v]=C.useState(()=>l),x=()=>{v(!d)},b=a=>{g(a.target.checked)},y=C.useMemo(()=>{var a,j,f,n;return l?`const Client = require('@abtnode/client');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
16
16
  { input: { did: rootDid, attachRuntimeInfo: false } },
17
17
  { headers: { 'x-access-blocklet': rootDid } }
18
18
  );
19
- `:`curl -H "Authorization: Bearer ${r}" "${(a=window.blocklet)==null?void 0:a.appUrl}${z.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did/session"`},[l,c,r]),T=C.useMemo(()=>{var a;return l?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${c} --access-secret ${r} {blockletPath}/.blocklet/bundle;`:null},[l,c,r]);return e.jsxs(xe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:l?!k:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(rt,{children:o(l?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(U,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(V,{children:c})]}),e.jsxs(U,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),d?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:x,children:o("setting.accessKey.showSecret")}):e.jsx(V,{children:r})]}),!d&&e.jsxs(U,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(O,{code:y,language:"javascript"}),T&&e.jsx(O,{code:T,language:"bash"})]}),l&&e.jsx("div",{children:e.jsx(Se,{value:"end",disabled:d,control:e.jsx(De,{checked:k,onChange:b}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}oe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};oe.defaultProps={onConfirm:()=>{},hideSecret:!0};const q=B.div`
19
+ `:`curl -H "Authorization: Bearer ${r}" "${(a=window.blocklet)==null?void 0:a.appUrl}${z.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did/session"`},[l,c,r]),T=C.useMemo(()=>{var a;return l?`blocklet deploy --endpoint ${(a=window.blocklet)==null?void 0:a.appUrl} --access-key ${c} --access-secret ${r} {blockletPath}/.blocklet/bundle;`:null},[l,c,r]);return e.jsxs(xe,{title:o("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:s,showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:l?!k:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:o("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(rt,{children:o(l?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(U,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeyId")}),e.jsx(V,{children:c})]}),e.jsxs(U,{children:[e.jsx(q,{children:o("setting.accessKey.accessKeySecret")}),d?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:x,children:o("setting.accessKey.showSecret")}):e.jsx(V,{children:r})]}),!d&&e.jsxs(U,{children:[e.jsx(q,{children:`Access Key ${o("setting.accessKey.usage")}`}),e.jsx(O,{code:y,language:"shell"}),T&&e.jsx(O,{code:T,language:"shell"})]}),l&&e.jsx("div",{children:e.jsx(Se,{value:"end",disabled:d,control:e.jsx(De,{checked:k,onChange:b}),label:o("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}oe.propTypes={accessKeyId:u.string.isRequired,accessKeySecret:u.string.isRequired,onConfirm:u.func,hideSecret:u.bool};oe.defaultProps={onConfirm:()=>{},hideSecret:!0};const q=B.div`
20
20
  display: flex;
21
21
  justify-content: space-between;
22
22
  align-items: center;
@@ -34,7 +34,7 @@ const result = await client.getBlocklet(
34
34
  margin-left: 0;
35
35
  margin-right: 0;
36
36
  }
37
- `;function Ce({accessKey:t}){var v,x;const{t:s,locale:c}=D(),{blocklet:r}=nt(),l=W(),o=((r==null?void 0:r.children)||[]).find(b=>{var y;return((y=b==null?void 0:b.meta)==null?void 0:y.did)===t.componentDid}),k=l.find(b=>b.name===t.passport),g=k?k.title:t.passport,d=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx($e,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${de.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(p,{children:be(g,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:t.createdBy?e.jsx(fe,{showDid:!0,did:t.createdBy,cardType:he.Detailed,infoType:ye.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?e.jsx($,{value:t.createdAt,type:"all",locale:c}):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?e.jsx($,{value:t.lastUsedAt,type:"all",locale:c}):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(ee,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...o?[{label:s("setting.accessKey.component"),content:e.jsxs(p,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Be,{blocklet:o,ancestors:[r]}),e.jsx(p,{ml:"16px",sx:{minWidth:0},children:e.jsxs(p,{className:"component-header",children:[e.jsx(p,{className:"component-name",children:Pe.getDisplayName(o,!0)}),e.jsx(p,{className:"component-version",children:(v=o==null?void 0:o.meta)==null?void 0:v.version})]})})]},o)}]:[],t.authType!=="signature"?{label:s("setting.accessKey.usage"),content:e.jsx(O,{code:`curl -H "Authorization: Bearer blocklet-${de.toBase58(t.accessKeyPublic)}" "${(x=window.blocklet)==null?void 0:x.appUrl}${z.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did/session"`,language:"javascript"})}:null].filter(Boolean)}];return e.jsx(lt,{gap:3,children:e.jsx(p,{className:"info-area",children:d.map(b=>e.jsxs(p,{mb:3,children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:b.title}),e.jsx(p,{className:"info-grid",children:b.items.map(y=>e.jsxs(p,{className:"info-item",children:[e.jsx(p,{className:"info-label",children:e.jsx(I,{variant:"subtitle2",color:"textSecondary",children:y.label})}),e.jsx(p,{sx:{flex:1,minWidth:0},children:y.content})]},y.label))})]},b.title))})})}Ce.propTypes={accessKey:u.object.isRequired};const lt=B(Y)`
37
+ `;function Ce({accessKey:t}){var v,x;const{t:s,locale:c}=D(),{blocklet:r}=nt(),l=W(),o=((r==null?void 0:r.children)||[]).find(b=>{var y;return((y=b==null?void 0:b.meta)==null?void 0:y.did)===t.componentDid}),k=l.find(b=>b.name===t.passport),g=k?k.title:t.passport,d=[{title:s("common.baseInfo"),items:[{label:s("setting.accessKey.accessKeyId"),content:e.jsx($e,{did:t.accessKeyId,showQrcode:!0})},...t.authType==="simple"?[{label:s("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${de.toBase58(t.accessKeyPublic)}`})}]:[],{label:s("common.role"),content:e.jsx(p,{children:be(g,t.passport)})},{label:s("common.createdVia"),content:t.createdVia},{label:s("common.createdBy"),content:t.createdBy?e.jsx(fe,{showDid:!0,did:t.createdBy,cardType:he.Detailed,infoType:ye.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:s("common.timeInfo"),items:[{label:s("common.createdAt"),content:t.createdAt?e.jsx($,{value:t.createdAt,type:"all",locale:c}):"-"},{label:s("common.lastUsedAt"),content:t.lastUsedAt?e.jsx($,{value:t.lastUsedAt,type:"all",locale:c}):"-"},{label:s("common.expiredAt"),content:t.expireAt?e.jsx(ee,{value:t.expireAt}):s("common.neverExpired")}]},{title:s("common.otherInfo"),items:[{label:s("setting.accessKey.authType"),content:t.authType},{label:s("common.remark"),content:t.remark},...t.authType!=="signature"?[{label:s("setting.accessKey.resourceType"),content:t.resourceType||"-"},{label:s("setting.accessKey.resourceId"),content:t.resourceId||"-"}]:[],...o?[{label:s("setting.accessKey.component"),content:e.jsxs(p,{width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(Be,{blocklet:o,ancestors:[r]}),e.jsx(p,{ml:"16px",sx:{minWidth:0},children:e.jsxs(p,{className:"component-header",children:[e.jsx(p,{className:"component-name",children:Pe.getDisplayName(o,!0)}),e.jsx(p,{className:"component-version",children:(v=o==null?void 0:o.meta)==null?void 0:v.version})]})})]},o)}]:[],t.authType!=="signature"?{label:s("setting.accessKey.usage"),content:e.jsx(O,{code:`curl -H "Authorization: Bearer blocklet-${de.toBase58(t.accessKeyPublic)}" "${(x=window.blocklet)==null?void 0:x.appUrl}${z.WELLKNOWN_SERVICE_PATH_PREFIX}/api/did/session"`,language:"shell"})}:null].filter(Boolean)}];return e.jsx(lt,{gap:3,children:e.jsx(p,{className:"info-area",children:d.map(b=>e.jsxs(p,{mb:3,children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:b.title}),e.jsx(p,{className:"info-grid",children:b.items.map(y=>e.jsxs(p,{className:"info-item",children:[e.jsx(p,{className:"info-label",children:e.jsx(I,{variant:"subtitle2",color:"textSecondary",children:y.label})}),e.jsx(p,{sx:{flex:1,minWidth:0},children:y.content})]},y.label))})]},b.title))})})}Ce.propTypes={accessKey:u.object.isRequired};const lt=B(Y)`
38
38
  .info-card {
39
39
  margin-bottom: 24px;
40
40
  overflow: hidden;