@abtnode/blocklet-services 1.16.33-beta-20241031-073543-49b1ff9b → 1.16.33-beta-20241031-130110-767ce94a

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 (208) hide show
  1. package/api/libs/connect/session.js +3 -3
  2. package/api/libs/kyc.js +5 -5
  3. package/api/services/auth/connect/invite.js +1 -1
  4. package/api/services/auth/connect/login.js +2 -1
  5. package/api/services/auth/connect/update-kyc.js +1 -1
  6. package/api/services/auth/index.js +21 -0
  7. package/dist/assets/{Add-BbT7BiIn.js → Add-w8WVX4Xk.js} +1 -1
  8. package/dist/assets/{Alert-GYW4yXwi.js → Alert-DBECv8Dk.js} +1 -1
  9. package/dist/assets/{ArrowDropDown-DxOMxGRV.js → ArrowDropDown-D8HoHnV2.js} +1 -1
  10. package/dist/assets/{Autocomplete-BGjstuR-.js → Autocomplete-CopPr5fu.js} +1 -1
  11. package/dist/assets/{Avatar-DPvi1dd4.js → Avatar-DxxyX-k_.js} +1 -1
  12. package/dist/assets/{ButtonGroup-CV6xLD7o.js → ButtonGroup-C6tThDqG.js} +1 -1
  13. package/dist/assets/{CSSTransition-CPq1SkB8.js → CSSTransition-15IKQ8tC.js} +1 -1
  14. package/dist/assets/{CheckCircle-DttNFZFt.js → CheckCircle-Dnb1dYCF.js} +1 -1
  15. package/dist/assets/{ChevronLeft-B6pg2NmZ.js → ChevronLeft-CfHfbxYR.js} +1 -1
  16. package/dist/assets/{ChevronRight-CCLOBhXi.js → ChevronRight-DfXjrDyG.js} +1 -1
  17. package/dist/assets/{Close-D6G5_99n.js → Close-CEHuSxMp.js} +1 -1
  18. package/dist/assets/{CloseOutlined-DnJ7iFbY.js → CloseOutlined-DsS_G_PJ.js} +1 -1
  19. package/dist/assets/{Delete-BDd8Y-f-.js → Delete-ZSqIrcgk.js} +1 -1
  20. package/dist/assets/{DeleteOutline-BMYl1P54.js → DeleteOutline-Csn3uTIE.js} +1 -1
  21. package/dist/assets/{DialogContentText-CGVxonSs.js → DialogContentText-vfNBMZmk.js} +1 -1
  22. package/dist/assets/{Done-CQYMvSV2.js → Done-CemlqiD_.js} +1 -1
  23. package/dist/assets/{Download-BoHGh_oI.js → Download-BsmoTH3s.js} +1 -1
  24. package/dist/assets/{EditIcon-gJSIyUhs.js → EditIcon-CT0EaMpT.js} +1 -1
  25. package/dist/assets/{Error-Dl5QWhzt.js → Error-B7k9iYaE.js} +1 -1
  26. package/dist/assets/{ExpandMore-hHdanP4V.js → ExpandMore-D9r_eS88.js} +1 -1
  27. package/dist/assets/{FormControl-BcK5E1OT.js → FormControl-BjU2NH3y.js} +1 -1
  28. package/dist/assets/{FormControlLabel-DIFTdkch.js → FormControlLabel-C2gffv1J.js} +1 -1
  29. package/dist/assets/{FormGroup-hQa_O_gn.js → FormGroup-Bd3iPgM5.js} +1 -1
  30. package/dist/assets/{Google-JhA3tPdq.js → Google-CQo1jg-a.js} +1 -1
  31. package/dist/assets/{Grid-B_SHGR2L.js → Grid-G51OChUI.js} +1 -1
  32. package/dist/assets/{HelpOutline-BxsuH4I6.js → HelpOutline-Bn776zsn.js} +1 -1
  33. package/dist/assets/{Hidden-CcJWl8RU.js → Hidden-LUQhZs-w.js} +1 -1
  34. package/dist/assets/{InfoOutlined-CCy1pD2i.js → InfoOutlined-CDz5Mhp6.js} +1 -1
  35. package/dist/assets/{InputAdornment-CyNJt_fa.js → InputAdornment-CRVgwkQ9.js} +1 -1
  36. package/dist/assets/{LastPage-CV4Keuen.js → LastPage-B8G6wH6k.js} +1 -1
  37. package/dist/assets/{Launch-CBwpqgeT.js → Launch-mty9jus0.js} +1 -1
  38. package/dist/assets/{LaunchOutlined-DsiOdG73.js → LaunchOutlined-DVo-QKmK.js} +1 -1
  39. package/dist/assets/{Link-D_CsWAfW.js → Link-BMMtX5fH.js} +1 -1
  40. package/dist/assets/{ListItemButton-KYk39rpD.js → ListItemButton-DdNCGCpQ.js} +1 -1
  41. package/dist/assets/{ListSubheader-BrKHJoML.js → ListSubheader-BhMsFVX-.js} +1 -1
  42. package/dist/assets/{LoadingButton-CVrS0YBY.js → LoadingButton-tO921QzP.js} +1 -1
  43. package/dist/assets/{LockIcon-DXUNi3b0.js → LockIcon-DTU4giTY.js} +1 -1
  44. package/dist/assets/{Loop-DySlvS0a.js → Loop-Bj3bQOI5.js} +1 -1
  45. package/dist/assets/{MarkEmailRead-CM3Qk1e1.js → MarkEmailRead-CZVFeLGG.js} +1 -1
  46. package/dist/assets/{Menu-DLtWW250.js → Menu-CXWnBcF2.js} +1 -1
  47. package/dist/assets/{MoreHoriz-B0hsGNsm.js → MoreHoriz-BwoEUpk-.js} +1 -1
  48. package/dist/assets/{MoreVert-vMGpcUpi.js → MoreVert-BnSgpwk3.js} +1 -1
  49. package/dist/assets/{OpenInNew-CcFMpufV.js → OpenInNew-I9vejj1P.js} +1 -1
  50. package/dist/assets/{Pagination-BZ_0_22E.js → Pagination-DlLEi_8o.js} +1 -1
  51. package/dist/assets/{PlayArrow-Bz9x7amJ.js → PlayArrow-7GIEwKnh.js} +1 -1
  52. package/dist/assets/{QuestionMarkCircle-B36736Ej.js → QuestionMarkCircle-CnAmHSAB.js} +1 -1
  53. package/dist/assets/{RadioGroup-DgJsEJxt.js → RadioGroup-BT3WvzXu.js} +1 -1
  54. package/dist/assets/{Search-CE2vOBwg.js → Search-DRpl0xea.js} +1 -1
  55. package/dist/assets/{Select-C2HlOyoW.js → Select-TRN3ZncP.js} +1 -1
  56. package/dist/assets/{ServerLogo-AznflSy7.js → ServerLogo-BrH_z3Pg.js} +1 -1
  57. package/dist/assets/{Skeleton-5qdbkUsc.js → Skeleton-DSmjDa3c.js} +1 -1
  58. package/dist/assets/{Slider-QUS33Kq4.js → Slider-GISyEXox.js} +1 -1
  59. package/dist/assets/{Stack-BhQ_80q-.js → Stack-4MJdxh6I.js} +1 -1
  60. package/dist/assets/{Stepper-Clj24sC3.js → Stepper-Dvn_4zS7.js} +1 -1
  61. package/dist/assets/{TextField-DqidhRm4.js → TextField-CQhkYpMM.js} +1 -1
  62. package/dist/assets/{Toolbar-C2KukkIX.js → Toolbar-kIo5eXBU.js} +1 -1
  63. package/dist/assets/{ViewColumn-92NUbhDx.js → ViewColumn-CsFjsWag.js} +1 -1
  64. package/dist/assets/{ViewList-35wYIlh1.js → ViewList-Dw3g1bEO.js} +1 -1
  65. package/dist/assets/{access-control-C1YDYzKf.js → access-control-BK21Lw2V.js} +1 -1
  66. package/dist/assets/{actions-CBVAti_q.js → actions-CFxZdzF3.js} +1 -1
  67. package/dist/assets/{add-component-core-BwkMf_I-.js → add-component-core-Bba0B_4h.js} +2 -2
  68. package/dist/assets/add-resource-DbOd4xW5.js +1 -0
  69. package/dist/assets/{addon-BaUd5Xtv.js → addon-DdejitH8.js} +1 -1
  70. package/dist/assets/{analytics-D9Uz8eMW.js → analytics-DnqUPS95.js} +1 -1
  71. package/dist/assets/api-Bl2-YSti.js +1 -0
  72. package/dist/assets/{audit-logs-DI3GXdoU.js → audit-logs-C8otdipr.js} +1 -1
  73. package/dist/assets/{base32-e163NkMc.js → base32-BBZELAoX.js} +1 -1
  74. package/dist/assets/{branding-BVp13tWo.js → branding-DU46ds73.js} +2 -2
  75. package/dist/assets/{bundle-avatar-CfarA09G.js → bundle-avatar-CbTVaQ_M.js} +1 -1
  76. package/dist/assets/{button-DkUXQFkd.js → button-n_9jfCIf.js} +1 -1
  77. package/dist/assets/{click-to-copy-BQ6-W2tV.js → click-to-copy-DptGmuUO.js} +1 -1
  78. package/dist/assets/{complete-Dkb4CamN.js → complete-BNbCNTJu.js} +1 -1
  79. package/dist/assets/{component-4U8BC0y9.js → component-DSUpigYV.js} +1 -1
  80. package/dist/assets/{config-BW9Pp8cu.js → config-77U-le3X.js} +1 -1
  81. package/dist/assets/{config-BqKiPUza.js → config-9il9cF0d.js} +1 -1
  82. package/dist/assets/{config-navigation-SRfx8eFT.js → config-navigation-DcNUxLGX.js} +1 -1
  83. package/dist/assets/{confirm-Bj44433A.js → confirm-C1rEM5YR.js} +1 -1
  84. package/dist/assets/{connect-DQIzXv2j.js → connect-3dKIAigZ.js} +1 -1
  85. package/dist/assets/{connect-D6RSbfne.js → connect-tHFesj8q.js} +1 -1
  86. package/dist/assets/{connect-to-NtgT2est.js → connect-to-4aaJxXqE.js} +1 -1
  87. package/dist/assets/{content-layout-Cm5xO87D.js → content-layout-BM5SJrue.js} +1 -1
  88. package/dist/assets/{dashboard-iCAQ-xSg.js → dashboard-CzRyzKlc.js} +3 -3
  89. package/dist/assets/{deprecate-6FbZIe1b.js → deprecate-zsgH7k5s.js} +1 -1
  90. package/dist/assets/{did-address-2wXzwKqQ.js → did-address-DwWl4S12.js} +1 -1
  91. package/dist/assets/{domain-BftMAChL.js → domain-BZTMEPUG.js} +1 -1
  92. package/dist/assets/{domain-list-LMmGssej.js → domain-list-DASDR2zI.js} +1 -1
  93. package/dist/assets/{email-C97T6-na.js → email-BHuQsqD5.js} +3 -3
  94. package/dist/assets/emotion-cache.browser.esm-DnONerVw.js +1 -0
  95. package/dist/assets/{exchange-passport-UpHKVi0x.js → exchange-passport-BJnSn4h1.js} +1 -1
  96. package/dist/assets/{fallback-Cy0VS__a.js → fallback-BpkT3yJa.js} +1 -1
  97. package/dist/assets/{form-text-input-DXwOfyUa.js → form-text-input-Dq-mYb-y.js} +1 -1
  98. package/dist/assets/format-error-Cm24Mb6K.js +2 -0
  99. package/dist/assets/{fuel-l61bf6lr.js → fuel-C5E6gyYw.js} +1 -1
  100. package/dist/assets/{fullpage-3Em5ua3-.js → fullpage-Dv48OHgB.js} +1 -1
  101. package/dist/assets/{home-BULxG73x.js → home-Be9EmoGZ.js} +1 -1
  102. package/dist/assets/{iframe-J8hWQoQE.js → iframe-Bn0BO1ke.js} +1 -1
  103. package/dist/assets/{index-Chkylq7r.js → index-64TPCNae.js} +1 -1
  104. package/dist/assets/{index-oBzophq1.js → index-BE6Ke5gn.js} +1 -1
  105. package/dist/assets/{index-C_CQlCa-.js → index-BXfEXarc.js} +2 -2
  106. package/dist/assets/{index-BI7ulVyE.js → index-BZiRGnQv.js} +1 -1
  107. package/dist/assets/{index-oXC6I0XL.js → index-Bi9C59qj.js} +4 -4
  108. package/dist/assets/{index-BHPuXpNt.js → index-BiEAq9_T.js} +1 -1
  109. package/dist/assets/{index-B9oud-xA.js → index-BoDR4F7z.js} +1 -1
  110. package/dist/assets/{index-DLGp76se.js → index-BxmbivV2.js} +1 -1
  111. package/dist/assets/{index-BdB83jqq.js → index-C5OdroAa.js} +1 -1
  112. package/dist/assets/{index-C_TKdpLp.js → index-C8MAHjVt.js} +3 -3
  113. package/dist/assets/{index-CkwdNb4P.js → index-CE6XlUwJ.js} +1 -1
  114. package/dist/assets/{index-2UUbbUJ8.js → index-CEl72yMR.js} +1 -1
  115. package/dist/assets/{index-D-JgU0vv.js → index-CcoKjcPZ.js} +1 -1
  116. package/dist/assets/{index-BnExyzXn.js → index-CmJqc_pr.js} +1 -1
  117. package/dist/assets/{index-B3o75RqE.js → index-CqcHIeW4.js} +1 -1
  118. package/dist/assets/{index-ChfVfT98.js → index-CrwNbpvE.js} +1 -1
  119. package/dist/assets/{index-koUUzwN0.js → index-CspPySnp.js} +1 -1
  120. package/dist/assets/{index-CR3-uy3A.js → index-D3Zi9XXS.js} +1 -1
  121. package/dist/assets/{index-sW3pXORW.js → index-D41Nns21.js} +1 -1
  122. package/dist/assets/{index-D5tzqp0t.js → index-D47v1fSP.js} +1 -1
  123. package/dist/assets/{index-CnGK7WUY.js → index-D6JzGLsD.js} +1 -1
  124. package/dist/assets/{index-DE2W-BW-.js → index-DCK3Y1u2.js} +1 -1
  125. package/dist/assets/{index-DWVd8w83.js → index-DKCt9nfb.js} +1 -1
  126. package/dist/assets/{index-BUog8A--.js → index-DOuJwOay.js} +1 -1
  127. package/dist/assets/{index-B4NN-ljh.js → index-DV0GJZ_u.js} +1 -1
  128. package/dist/assets/{index-DeqxO-5S.js → index-DgopjaBb.js} +1 -1
  129. package/dist/assets/{index-ehQxu-R2.js → index-DvpaD3gO.js} +1 -1
  130. package/dist/assets/{index-BIM1QwaY.js → index-E4hQM_9u.js} +1 -1
  131. package/dist/assets/{index-eYk8EHY6.js → index-K2rlHa7x.js} +1 -1
  132. package/dist/assets/{index-B92ztTjs.js → index-Lpzdluz-.js} +1 -1
  133. package/dist/assets/{index-hVdmtTGH.js → index-S4zyOh_f.js} +1 -1
  134. package/dist/assets/{index-DEkyID3O.js → index-e_suJSDw.js} +1 -1
  135. package/dist/assets/{index-DRtAqdrV.js → index-pFa-OI2-.js} +3 -3
  136. package/dist/assets/{index-CxDdR_4c.js → index-sZdRdnSY.js} +1 -1
  137. package/dist/assets/{index-DsWpf3_a.js → index-tbzY0Oht.js} +1 -1
  138. package/dist/assets/{index.es-mBp-Wl3D.js → index.es-DUZKvvbB.js} +1 -1
  139. package/dist/assets/{invitation-hncnOokv.js → invitation-_z1Xj-DN.js} +1 -1
  140. package/dist/assets/{invite-CKFbWmou.js → invite-BICcMHub.js} +1 -1
  141. package/dist/assets/{isEmail-DxV-j-Id.js → isEmail-DVQRhME2.js} +1 -1
  142. package/dist/assets/{issue-passport-CGl0wDiI.js → issue-passport-F092lKT7.js} +1 -1
  143. package/dist/assets/{item-OJ3hnlo0.js → item-58VHQKdW.js} +1 -1
  144. package/dist/assets/{jss-plugin-props-sort.esm-COgSgYwL.js → jss-plugin-props-sort.esm-DD0RfxgD.js} +1 -1
  145. package/dist/assets/{launch-result-message-MXP30DhV.js → launch-result-message-DovJkIwn.js} +1 -1
  146. package/dist/assets/{layout-l6IsVWPQ.js → layout-CX--ufXj.js} +1 -1
  147. package/dist/assets/{list-header-BBaNSpsp.js → list-header-CK7gsYNw.js} +1 -1
  148. package/dist/assets/localization-B6LrUnQq.js +1 -0
  149. package/dist/assets/{log-DrwXmRxJ.js → log-DVdMrPJd.js} +1 -1
  150. package/dist/assets/{login-CaGFS8nW.js → login-DQc63E-c.js} +1 -1
  151. package/dist/assets/{login-oauth-callback-D2-IWdVo.js → login-oauth-callback-DD7JbhiI.js} +1 -1
  152. package/dist/assets/{logo-uploader-bNnGsMWx.js → logo-uploader-BDLcfxYH.js} +3 -3
  153. package/dist/assets/{lost-passport-CWRg5ZXa.js → lost-passport-DKxLM9Ug.js} +3 -3
  154. package/dist/assets/{lottie-78xwHgZN.js → lottie-AeAuO2MQ.js} +1 -1
  155. package/dist/assets/{notifications-DT5bM8-Z.js → notifications-Bn5ZHzBu.js} +1 -1
  156. package/dist/assets/{open-window-Dbj6y-Wd.js → open-window-5NGDF8DC.js} +1 -1
  157. package/dist/assets/{overview-BPLARBLd.js → overview-DTsJPc6k.js} +1 -1
  158. package/dist/assets/{page-header-BJwXbb6p.js → page-header-COehVty5.js} +1 -1
  159. package/dist/assets/{permission-DJ4hvMdC.js → permission-Cqge6JOf.js} +1 -1
  160. package/dist/assets/{preferences-BiBLVKyo.js → preferences-DA8lJH35.js} +1 -1
  161. package/dist/assets/publish-resource-kamh1Zx5.js +1 -0
  162. package/dist/assets/{raf-schd.esm-B1kdhV0g.js → raf-schd.esm-BfaLZ_aP.js} +1 -1
  163. package/dist/assets/{react-beautiful-dnd.esm-BEwbgI-x.js → react-beautiful-dnd.esm-1g48s8ci.js} +1 -1
  164. package/dist/assets/refType-Dpwlu3pw.js +1 -0
  165. package/dist/assets/{resource-dialog-GEBYj7yn.js → resource-dialog-BHy7M0SS.js} +1 -1
  166. package/dist/assets/sdk-De7qEvqq.js +1 -0
  167. package/dist/assets/{selector-14AWGRUp.js → selector-B78wSPTM.js} +1 -1
  168. package/dist/assets/session-C7vFWF9o.js +1 -0
  169. package/dist/assets/{setup-BKQUe4wU.js → setup-GIymuFZc.js} +3 -3
  170. package/dist/assets/{shorten-label-Dbs8vIsp.js → shorten-label-DJCp0Yiv.js} +1 -1
  171. package/dist/assets/{simple-select-DLQt7Cfs.js → simple-select-b5ivFPVt.js} +1 -1
  172. package/dist/assets/{slicedToArray-BKoR2wYJ.js → slicedToArray-BApf6A7a.js} +1 -1
  173. package/dist/assets/{spaces-CAq6QeyI.js → spaces-9zBZHE2B.js} +1 -1
  174. package/dist/assets/{start-DSWYoahH.js → start-CnjLydkf.js} +1 -1
  175. package/dist/assets/{step-actions-If6iVs-K.js → step-actions-8KY-8Bex.js} +1 -1
  176. package/dist/assets/{studio-D6IxfNlE.js → studio-X7Nwx0dT.js} +1 -1
  177. package/dist/assets/{switch-control-BxeBzprT.js → switch-control-GexWf5e4.js} +1 -1
  178. package/dist/assets/{toUpper-CBkOZw1F.js → toUpper-DTfkR7-6.js} +1 -1
  179. package/dist/assets/{transfer-CKJqtAQ_.js → transfer-Bhn-x9WX.js} +1 -1
  180. package/dist/assets/{trim-C9rddK5k.js → trim-BZY-1hvK.js} +1 -1
  181. package/dist/assets/{uniqBy-Bx9vh0v2.js → uniqBy-BcDiFdXx.js} +1 -1
  182. package/dist/assets/{unsubscribe-CLEzRDDh.js → unsubscribe-D5MNNVO_.js} +1 -1
  183. package/dist/assets/{url-join-B7VUk1Nt.js → url-join-D63J6Csv.js} +1 -1
  184. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-CGl-SVl3.js → use-blocklet-info-for-connect-did-spaces-DeEGMQDm.js} +1 -1
  185. package/dist/assets/{use-mobile-4_hTnRVi.js → use-mobile-C2Zyl0Iw.js} +1 -1
  186. package/dist/assets/{useAsync-CtQ8AEdA.js → useAsync-WIvo8QcA.js} +1 -1
  187. package/dist/assets/{useFormControl-BhdUd6k-.js → useFormControl-c0TPHUQp.js} +1 -1
  188. package/dist/assets/{useLocalStorage-7JXelBjb.js → useLocalStorage-BhDOt9DJ.js} +1 -1
  189. package/dist/assets/{useSetState-Dc35Ve6D.js → useSetState-DRBw6Ay4.js} +1 -1
  190. package/dist/assets/{useSlot-CNpijWIm.js → useSlot-BtZjkxjI.js} +1 -1
  191. package/dist/assets/{useSlotProps-BfNnka02.js → useSlotProps-D77uQwOK.js} +1 -1
  192. package/dist/assets/{useThemeProps-DEARzcBK.js → useThemeProps-BoD_v9_f.js} +1 -1
  193. package/dist/assets/{user-center-ZL5G-GHd.js → user-center-DQH4PW1L.js} +1 -1
  194. package/dist/assets/{user-sessions-6KBbvmel.js → user-sessions-BjEKb9RA.js} +1 -1
  195. package/dist/assets/{util-CsETj3tT.js → util-BwLN-7fK.js} +1 -1
  196. package/dist/assets/{wrap-locale-Dun6mFZ0.js → wrap-locale-fQx_G_1w.js} +1 -1
  197. package/dist/index.html +1 -1
  198. package/dist/service-worker.js +1 -1
  199. package/package.json +18 -18
  200. package/dist/assets/add-resource-Ce35wyOm.js +0 -1
  201. package/dist/assets/api-DW3GuRPe.js +0 -1
  202. package/dist/assets/emotion-cache.browser.esm-Cb9YgVt4.js +0 -1
  203. package/dist/assets/format-error-BBbxuciS.js +0 -2
  204. package/dist/assets/localization-DY392ZUJ.js +0 -1
  205. package/dist/assets/publish-resource-CGz9xdOC.js +0 -1
  206. package/dist/assets/refType-BbAp0aUR.js +0 -1
  207. package/dist/assets/sdk-BrMczAlL.js +0 -1
  208. package/dist/assets/session-CR_tYSIR.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C_TKdpLp.js","assets/index-C_CQlCa-.js","assets/index-D8NuaJ66.css","assets/Grid-B_SHGR2L.js","assets/TextField-DqidhRm4.js","assets/FormControl-BcK5E1OT.js","assets/useFormControl-BhdUd6k-.js","assets/Select-C2HlOyoW.js","assets/RadioGroup-DgJsEJxt.js","assets/FormControlLabel-DIFTdkch.js","assets/Stack-BhQ_80q-.js","assets/FormGroup-hQa_O_gn.js","assets/Slider-QUS33Kq4.js","assets/Skeleton-5qdbkUsc.js","assets/Close-D6G5_99n.js","assets/url-join-B7VUk1Nt.js","assets/index-DE2W-BW-.js","assets/index-koUUzwN0.js","assets/index-DLGp76se.js","assets/index-Chkylq7r.js","assets/index-DeqxO-5S.js","assets/fallback-Cy0VS__a.js","assets/index-2UUbbUJ8.js","assets/Menu-DLtWW250.js","assets/Toolbar-C2KukkIX.js","assets/Hidden-CcJWl8RU.js","assets/index-BI7ulVyE.js","assets/MoreVert-vMGpcUpi.js","assets/ListItemButton-KYk39rpD.js","assets/selector-14AWGRUp.js","assets/ExpandMore-hHdanP4V.js","assets/Avatar-DPvi1dd4.js","assets/useSlot-CNpijWIm.js","assets/resource-dialog-GEBYj7yn.js","assets/index-ChfVfT98.js","assets/emotion-cache.browser.esm-Cb9YgVt4.js","assets/OpenInNew-CcFMpufV.js","assets/index-BIM1QwaY.js","assets/index-CxDdR_4c.js","assets/CloseOutlined-DnJ7iFbY.js","assets/Link-D_CsWAfW.js","assets/index-DsWpf3_a.js","assets/index-oBzophq1.js","assets/index-eYk8EHY6.js","assets/index-DEkyID3O.js","assets/useThemeProps-DEARzcBK.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-DWVd8w83.js","assets/redux-CluOqhW1.js","assets/ViewColumn-92NUbhDx.js","assets/Delete-BDd8Y-f-.js","assets/LastPage-CV4Keuen.js","assets/Search-CE2vOBwg.js","assets/deprecate-6FbZIe1b.js","assets/uniqBy-Bx9vh0v2.js","assets/toUpper-CBkOZw1F.js","assets/purify.es-Bq0E5Q3l.js"])))=>i.map(i=>d[i]);
2
- var vd=Object.defineProperty;var bd=(i,e,t)=>e in i?vd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xe=(i,e,t)=>bd(i,typeof e!="symbol"?e+"":e,t);import{at as yd,j as ve,iM as xd,ey as wd,f8 as _d,b7 as dt,iN as Sd,db as Ec,iO as Pd,iP as Fd,eE as Tc,e_ as Hn,eT as Nt,iQ as Rs,P as U,r as ie,co as yr,f9 as xr,n as Cd,eI as Dc,gh as kd,a3 as Oc,N as Ed,aj as Td,$ as Dd,iR as wr,O as Od,fl as _r,cD as Sr,eG as Ad,B as Us,aC as Rd,T as Ud,cs as Id,iS as Md,iT as Bd,cq as Nd}from"./index-C_CQlCa-.js";import{j as wn}from"./url-join-B7VUk1Nt.js";import{p as jd}from"./index-DE2W-BW-.js";import{u as Ld}from"./index-koUUzwN0.js";import{a as zd}from"./index-DLGp76se.js";import{c as Ee}from"./index-Chkylq7r.js";import"./index-DeqxO-5S.js";import"./index-BI7ulVyE.js";import{W as $d}from"./resource-dialog-GEBYj7yn.js";import"./index-DsWpf3_a.js";import"./index-oBzophq1.js";import"./fallback-Cy0VS__a.js";import"./index-eYk8EHY6.js";import"./index-DEkyID3O.js";import{w as qd}from"./deprecate-6FbZIe1b.js";import{u as Ac}from"./uniqBy-Bx9vh0v2.js";import{t as Hd}from"./toUpper-CBkOZw1F.js";import{p as Pr}from"./purify.es-Bq0E5Q3l.js";import"./index-2UUbbUJ8.js";import"./Menu-DLtWW250.js";import"./Toolbar-C2KukkIX.js";import"./Hidden-CcJWl8RU.js";import"./ExpandMore-hHdanP4V.js";import"./Avatar-DPvi1dd4.js";import"./useSlot-CNpijWIm.js";import"./MoreVert-vMGpcUpi.js";import"./FormControlLabel-DIFTdkch.js";import"./useFormControl-BhdUd6k-.js";import"./Stack-BhQ_80q-.js";import"./ListItemButton-KYk39rpD.js";import"./selector-14AWGRUp.js";import"./index-ChfVfT98.js";import"./emotion-cache.browser.esm-Cb9YgVt4.js";import"./OpenInNew-CcFMpufV.js";import"./index-BIM1QwaY.js";import"./index-CxDdR_4c.js";import"./CloseOutlined-DnJ7iFbY.js";import"./Link-D_CsWAfW.js";import"./useThemeProps-DEARzcBK.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-DWVd8w83.js";import"./redux-CluOqhW1.js";import"./ViewColumn-92NUbhDx.js";import"./FormControl-BcK5E1OT.js";import"./FormGroup-hQa_O_gn.js";import"./Grid-B_SHGR2L.js";import"./Select-C2HlOyoW.js";import"./Delete-BDd8Y-f-.js";import"./TextField-DqidhRm4.js";import"./LastPage-CV4Keuen.js";import"./Search-CE2vOBwg.js";const Wd=yd(ve.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Vd(i,e,t,a){for(var n=-1,s=i==null?0:i.length;++n<s;){var o=i[n];e(a,o,t(o),i)}return a}var Gd=Vd,Xd=xd;function Kd(i,e,t,a){return Xd(i,function(n,s,o){e(a,n,t(n),o)}),a}var Yd=Kd,Qd=Gd,Zd=Yd,Jd=wd,eh=_d;function th(i,e){return function(t,a){var n=eh(t)?Qd:Zd,s=e?e():{};return n(t,i,Jd(a),s)}}var ih=th,ah=Sd,nh=ih,sh=nh(function(i,e,t){ah(i,t,e)}),oh=sh;const Rc=dt(oh);function $a(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var rh=0;function Uc(i){return"__private_"+rh+++"_"+i}function lh(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C8MAHjVt.js","assets/index-BXfEXarc.js","assets/index-D8NuaJ66.css","assets/Grid-G51OChUI.js","assets/TextField-CQhkYpMM.js","assets/FormControl-BjU2NH3y.js","assets/useFormControl-c0TPHUQp.js","assets/Select-TRN3ZncP.js","assets/RadioGroup-BT3WvzXu.js","assets/FormControlLabel-C2gffv1J.js","assets/Stack-4MJdxh6I.js","assets/FormGroup-Bd3iPgM5.js","assets/Slider-GISyEXox.js","assets/Skeleton-DSmjDa3c.js","assets/Close-CEHuSxMp.js","assets/url-join-D63J6Csv.js","assets/index-DCK3Y1u2.js","assets/index-CspPySnp.js","assets/index-BxmbivV2.js","assets/index-64TPCNae.js","assets/index-DgopjaBb.js","assets/fallback-BpkT3yJa.js","assets/index-CEl72yMR.js","assets/Menu-CXWnBcF2.js","assets/Toolbar-kIo5eXBU.js","assets/Hidden-LUQhZs-w.js","assets/index-BZiRGnQv.js","assets/MoreVert-BnSgpwk3.js","assets/ListItemButton-DdNCGCpQ.js","assets/selector-B78wSPTM.js","assets/ExpandMore-D9r_eS88.js","assets/Avatar-DxxyX-k_.js","assets/useSlot-BtZjkxjI.js","assets/resource-dialog-BHy7M0SS.js","assets/index-CrwNbpvE.js","assets/emotion-cache.browser.esm-DnONerVw.js","assets/OpenInNew-I9vejj1P.js","assets/index-E4hQM_9u.js","assets/index-sZdRdnSY.js","assets/CloseOutlined-DsS_G_PJ.js","assets/Link-BMMtX5fH.js","assets/index-tbzY0Oht.js","assets/index-BE6Ke5gn.js","assets/index-K2rlHa7x.js","assets/index-e_suJSDw.js","assets/useThemeProps-BoD_v9_f.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-DKCt9nfb.js","assets/redux-CluOqhW1.js","assets/ViewColumn-CsFjsWag.js","assets/Delete-ZSqIrcgk.js","assets/LastPage-B8G6wH6k.js","assets/Search-DRpl0xea.js","assets/deprecate-zsgH7k5s.js","assets/uniqBy-BcDiFdXx.js","assets/toUpper-DTfkR7-6.js","assets/purify.es-Bq0E5Q3l.js"])))=>i.map(i=>d[i]);
2
+ var vd=Object.defineProperty;var bd=(i,e,t)=>e in i?vd(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xe=(i,e,t)=>bd(i,typeof e!="symbol"?e+"":e,t);import{at as yd,j as ve,iM as xd,ey as wd,f8 as _d,b7 as dt,iN as Sd,db as Ec,iO as Pd,iP as Fd,eE as Tc,e_ as Hn,eT as Nt,iQ as Rs,P as U,r as ie,co as yr,f9 as xr,n as Cd,eI as Dc,gh as kd,a3 as Oc,N as Ed,aj as Td,$ as Dd,iR as wr,O as Od,fl as _r,cD as Sr,eG as Ad,B as Us,aC as Rd,T as Ud,cs as Id,iS as Md,iT as Bd,cq as Nd}from"./index-BXfEXarc.js";import{j as wn}from"./url-join-D63J6Csv.js";import{p as jd}from"./index-DCK3Y1u2.js";import{u as Ld}from"./index-CspPySnp.js";import{a as zd}from"./index-BxmbivV2.js";import{c as Ee}from"./index-64TPCNae.js";import"./index-DgopjaBb.js";import"./index-BZiRGnQv.js";import{W as $d}from"./resource-dialog-BHy7M0SS.js";import"./index-tbzY0Oht.js";import"./index-BE6Ke5gn.js";import"./fallback-BpkT3yJa.js";import"./index-K2rlHa7x.js";import"./index-e_suJSDw.js";import{w as qd}from"./deprecate-zsgH7k5s.js";import{u as Ac}from"./uniqBy-BcDiFdXx.js";import{t as Hd}from"./toUpper-DTfkR7-6.js";import{p as Pr}from"./purify.es-Bq0E5Q3l.js";import"./index-CEl72yMR.js";import"./Menu-CXWnBcF2.js";import"./Toolbar-kIo5eXBU.js";import"./Hidden-LUQhZs-w.js";import"./ExpandMore-D9r_eS88.js";import"./Avatar-DxxyX-k_.js";import"./useSlot-BtZjkxjI.js";import"./MoreVert-BnSgpwk3.js";import"./FormControlLabel-C2gffv1J.js";import"./useFormControl-c0TPHUQp.js";import"./Stack-4MJdxh6I.js";import"./ListItemButton-DdNCGCpQ.js";import"./selector-B78wSPTM.js";import"./index-CrwNbpvE.js";import"./emotion-cache.browser.esm-DnONerVw.js";import"./OpenInNew-I9vejj1P.js";import"./index-E4hQM_9u.js";import"./index-sZdRdnSY.js";import"./CloseOutlined-DsS_G_PJ.js";import"./Link-BMMtX5fH.js";import"./useThemeProps-BoD_v9_f.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-DKCt9nfb.js";import"./redux-CluOqhW1.js";import"./ViewColumn-CsFjsWag.js";import"./FormControl-BjU2NH3y.js";import"./FormGroup-Bd3iPgM5.js";import"./Grid-G51OChUI.js";import"./Select-TRN3ZncP.js";import"./Delete-ZSqIrcgk.js";import"./TextField-CQhkYpMM.js";import"./LastPage-B8G6wH6k.js";import"./Search-DRpl0xea.js";const Wd=yd(ve.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 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 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Vd(i,e,t,a){for(var n=-1,s=i==null?0:i.length;++n<s;){var o=i[n];e(a,o,t(o),i)}return a}var Gd=Vd,Xd=xd;function Kd(i,e,t,a){return Xd(i,function(n,s,o){e(a,n,t(n),o)}),a}var Yd=Kd,Qd=Gd,Zd=Yd,Jd=wd,eh=_d;function th(i,e){return function(t,a){var n=eh(t)?Qd:Zd,s=e?e():{};return n(t,i,Jd(a),s)}}var ih=th,ah=Sd,nh=ih,sh=nh(function(i,e,t){ah(i,t,e)}),oh=sh;const Rc=dt(oh);function $a(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var rh=0;function Uc(i){return"__private_"+rh+++"_"+i}function lh(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
3
3
  * Takes a string with placeholder variables like `%{smart_count} file selected`
4
4
  * and replaces it with values from options `{smart_count: 5}`
5
5
  *
@@ -52,5 +52,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
52
52
  <div class="uppy-ProviderBrowserItem-inner uploaded-add-item">
53
53
  <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>
54
54
  </div>
55
- `,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));xe(this,"convertImgToObject",Rs(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(p=>p.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=W0(s.originalname),[".mp4",".webm"].find(p=>{var d;return(d=a.src)==null?void 0:d.endsWith(p)})){const p=document.createElement("video");p.src=a.src,p.width=a.width,p.height=a.height,p.autoplay=!0,p.setAttribute("playsinline","playsinline"),p.muted=!0,p.loop=!0,p.style="pointer-events: none;",o.appendChild(p)}else{const p=document.createElement("object");p.data=n,p.type=s.mimetype||"image/png",p.alt=s.originalname,p.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",p.loading="lazy",o.appendChild(p)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));xe(this,"resetState",()=>{this.uploadedAPIData={...yc},this.uploaded.setPluginState({...xc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...yc},this.addUploadItemFlag=!0,this.icon=()=>ue("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[ue("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),ue("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),ue("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),ue("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),ue("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new No(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...xc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const wc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},_c={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},sd={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},X0={...sd,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class K0 extends fe{constructor(t,a){super(t,a);xe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await La.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=Ac([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=Rn(s,0,0,Tt);return n=Rn(s,400,0,Tt),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});xe(this,"resetState",()=>{this.apiData={...wc},this.resources.setPluginState({..._c})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...wc},this.icon=()=>ue("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[ue("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),ue("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),ue("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),ue("div",{id:"resources",className:"uploaded",children:[ue("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>ue("button",{style:this.apiData.componentDid===a.did?X0:sd,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Hd(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new No(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({..._c}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("resources:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var Y0=kd();const Q0=dt(Y0);var Ae=Uint8Array,yi=Uint16Array,Z0=Int32Array,od=new Ae([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rd=new Ae([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),J0=new Ae([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ld=function(i,e){for(var t=new yi(31),a=0;a<31;++a)t[a]=e+=1<<i[a-1];for(var n=new Z0(t[30]),a=1;a<30;++a)for(var s=t[a];s<t[a+1];++s)n[s]=s-t[a]<<5|a;return{b:t,r:n}},cd=ld(od,2),pd=cd.b,e1=cd.r;pd[28]=258,e1[258]=28;var t1=ld(rd,0),i1=t1.b,ko=new yi(32768);for(var Z=0;Z<32768;++Z){var Ot=(Z&43690)>>1|(Z&21845)<<1;Ot=(Ot&52428)>>2|(Ot&13107)<<2,Ot=(Ot&61680)>>4|(Ot&3855)<<4,ko[Z]=((Ot&65280)>>8|(Ot&255)<<8)>>1}var va=function(i,e,t){for(var a=i.length,n=0,s=new yi(e);n<a;++n)i[n]&&++s[i[n]-1];var o=new yi(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new yi(1<<e);var l=15-e;for(n=0;n<a;++n)if(i[n])for(var p=n<<4|i[n],d=e-i[n],c=o[i[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)r[ko[c]>>l]=p}else for(r=new yi(a),n=0;n<a;++n)i[n]&&(r[n]=ko[o[i[n]-1]++]>>15-i[n]);return r},za=new Ae(288);for(var Z=0;Z<144;++Z)za[Z]=8;for(var Z=144;Z<256;++Z)za[Z]=9;for(var Z=256;Z<280;++Z)za[Z]=7;for(var Z=280;Z<288;++Z)za[Z]=8;var ud=new Ae(32);for(var Z=0;Z<32;++Z)ud[Z]=5;var a1=va(za,9,1),n1=va(ud,5,1),Ts=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},Xe=function(i,e,t){var a=e/8|0;return(i[a]|i[a+1]<<8)>>(e&7)&t},Ds=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},s1=function(i){return(i+7)/8|0},mr=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new Ae(i.subarray(e,t))},o1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],we=function(i,e,t){var a=new Error(e||o1[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,we),!t)throw a;return a},fr=function(i,e,t,a){var n=i.length,s=a?a.length:0;if(!n||e.f&&!e.l)return t||new Ae(0);var o=!t,r=o||e.i!=2,l=e.i;o&&(t=new Ae(n*3));var p=function(Lt){var Di=t.length;if(Lt>Di){var ht=new Ae(Math.max(Di*2,Lt));ht.set(t),t=ht}},d=e.f||0,c=e.p||0,h=e.b||0,m=e.l,v=e.d,P=e.m,f=e.n,b=n*8;do{if(!m){d=Xe(i,c,1);var S=Xe(i,c+1,3);if(c+=3,S)if(S==1)m=a1,v=n1,P=9,f=5;else if(S==2){var _=Xe(i,c,31)+257,F=Xe(i,c+10,15)+4,A=_+Xe(i,c+5,31)+1;c+=14;for(var R=new Ae(A),j=new Ae(19),N=0;N<F;++N)j[J0[N]]=Xe(i,c+N*3,7);c+=F*3;for(var X=Ts(j),W=(1<<X)-1,$=va(j,X,1),N=0;N<A;){var q=$[Xe(i,c,W)];c+=q&15;var x=q>>4;if(x<16)R[N++]=x;else{var w=0,g=0;for(x==16?(g=3+Xe(i,c,3),c+=2,w=R[N-1]):x==17?(g=3+Xe(i,c,7),c+=3):x==18&&(g=11+Xe(i,c,127),c+=7);g--;)R[N++]=w}}var y=R.subarray(0,_),C=R.subarray(_);P=Ts(y),f=Ts(C),m=va(y,P,1),v=va(C,f,1)}else we(1);else{var x=s1(c)+4,T=i[x-4]|i[x-3]<<8,E=x+T;if(E>n){l&&we(0);break}r&&p(h+T),t.set(i.subarray(x,E),h),e.b=h+=T,e.p=c=E*8,e.f=d;continue}if(c>b){l&&we(0);break}}r&&p(h+131072);for(var O=(1<<P)-1,D=(1<<f)-1,k=c;;k=c){var w=m[Ds(i,c)&O],M=w>>4;if(c+=w&15,c>b){l&&we(0);break}if(w||we(2),M<256)t[h++]=M;else if(M==256){k=c,m=null;break}else{var L=M-254;if(M>264){var N=M-257,V=od[N];L=Xe(i,c,(1<<V)-1)+pd[N],c+=V}var H=v[Ds(i,c)&D],K=H>>4;H||we(3),c+=H&15;var C=i1[K];if(K>3){var V=rd[K];C+=Ds(i,c)&(1<<V)-1,c+=V}if(c>b){l&&we(0);break}r&&p(h+131072);var Se=h+L;if(h<C){var jt=s-C,qn=Math.min(C,Se);for(jt+h<0&&we(3);h<qn;++h)t[h]=a[jt+h]}for(;h<Se;++h)t[h]=t[h-C]}}e.l=m,e.p=k,e.b=h,e.f=d,m&&(d=1,e.m=P,e.d=v,e.n=f)}while(!d);return h!=t.length&&o?mr(t,0,h):t.subarray(0,h)},r1=new Ae(0),st=function(i,e){return i[e]|i[e+1]<<8},et=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},Os=function(i,e){return et(i,e)+et(i,e+4)*4294967296},l1=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&we(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var a=(e>>3&1)+(e>>4&1);a>0;a-=!i[t++]);return t+(e&2)},c1=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},p1=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&we(6,"invalid zlib data"),(i[1]>>5&1)==+!e&&we(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function dd(i,e){return fr(i,{i:2},e&&e.out,e&&e.dictionary)}function u1(i,e){var t=l1(i);return t+8>i.length&&we(6,"invalid gzip data"),fr(i.subarray(t,-8),{i:2},e&&e.out||new Ae(c1(i)),e&&e.dictionary)}function d1(i,e){return fr(i.subarray(p1(i,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function As(i,e){return i[0]==31&&i[1]==139&&i[2]==8?u1(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?dd(i,e):d1(i,e)}var Eo=typeof TextDecoder<"u"&&new TextDecoder,h1=0;try{Eo.decode(r1,{stream:!0}),h1=1}catch{}var m1=function(i){for(var e="",t=0;;){var a=i[t++],n=(a>127)+(a>223)+(a>239);if(t+n>i.length)return{s:e,r:mr(i,t-1)};n?n==3?(a=((a&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):n&1?e+=String.fromCharCode((a&31)<<6|i[t++]&63):e+=String.fromCharCode((a&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(a)}};function f1(i,e){if(e){for(var t="",a=0;a<i.length;a+=16384)t+=String.fromCharCode.apply(null,i.subarray(a,a+16384));return t}else{if(Eo)return Eo.decode(i);var n=m1(i),s=n.s,t=n.r;return t.length&&we(8),s}}var g1=function(i,e){return e+30+st(i,e+26)+st(i,e+28)},v1=function(i,e,t){var a=st(i,e+28),n=f1(i.subarray(e+46,e+46+a),!(st(i,e+8)&2048)),s=e+46+a,o=et(i,e+20),r=t&&o==4294967295?b1(i,s):[o,et(i,e+24),et(i,e+42)],l=r[0],p=r[1],d=r[2];return[st(i,e+10),l,p,n,s+st(i,e+30)+st(i,e+32),d]},b1=function(i,e){for(;st(i,e)!=1;e+=4+st(i,e+2));return[Os(i,e+12),Os(i,e+4),Os(i,e+20)]};function y1(i,e){for(var t={},a=i.length-22;et(i,a)!=101010256;--a)(!a||i.length-a>65558)&&we(13);var n=st(i,a+8);if(!n)return{};var s=et(i,a+16),o=s==4294967295||n==65535;if(o){var r=et(i,a-12);o=et(i,r)==101075792,o&&(n=et(i,r+32),s=et(i,r+48))}for(var l=e&&e.filter,p=0;p<n;++p){var d=v1(i,s,o),c=d[0],h=d[1],m=d[2],v=d[3],P=d[4],f=d[5],b=g1(i,f);s=P,(!l||l({name:v,size:h,originalSize:m,compression:c}))&&(c?c==8?t[v]=dd(i.subarray(b,b+h),{out:new Ae(m)}):we(14,"unknown compression type "+c):t[v]=mr(i,b,b+h))}return t}const rn={zip:y1,gz:As,tgz:As,deflate:As};class x1 extends fe{constructor(t,a){super(t,{...{},...a});xe(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=Q0.createHash("md5").update(await r.text()).digest("hex"),p=fa(n),d=`${l}${p?`.${p}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});xe(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});xe(this,"preventXssAttack",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:o,meta:r}=this.uppy.getFile(a),l=Pr.sanitize(o);if(o!==l){const p=fa(n),d=l.endsWith(`.${p}`)?l:`${l}.${p}`;this.uppy.setFileState(a,{name:d,meta:{...r,name:d,filename:d}})}if((s=n.type)!=null&&s.includes("image/svg")){const{data:p,name:d,type:c}=this.uppy.getFile(a),h=await p.text(),m=Pr.sanitize(h,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["use"]});if(h!==m){const v=new Blob([m],{type:c}),P=gc(v,d);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:P})}}}});xe(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&rn[n.extension]){const{data:s}=n,o=rn[n.extension](new Uint8Array(await s.arrayBuffer()));let r=0;const l=(d,c)=>(r++,Object.entries(d instanceof Uint8Array?{[c||n.name]:d}:d).reduce((h,[m,v])=>{const P=h+v.byteLength;if(r>=5||P>n.size*100)throw console.error("Zip bomb detected, please check your file",{maxDepth:r,baseAcc:P,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const f=ot.extension(ot.lookup(m));if(rn[f]){const b=rn[f](v);return P+l(b,m)}return P},0)),p=l(o);if(console.info(n.name,{totalUnzippedSize:p,maxDepth:r,zippedSize:n.size}),p>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});xe(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var P,f,b;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((P=this.opts.cropperOptions)!=null&&P.aspectRatio)||!((f=s==null?void 0:s.type)!=null&&f.includes("image"))||(b=s.type)!=null&&b.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),p=l==null?void 0:l.naturalWidth,d=l==null?void 0:l.naturalHeight,c=Number(p/d).toFixed(2),h=Number(o).toFixed(2);if(c===h)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const v=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:h});return this.uppy.info({message:v,details:v}),new Promise((S,x)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{S()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));xe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});xe(this,"tryDownloadRemoteFile",async t=>{var T,E;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:p,isLoading:d,remote:c,meta:h,errorCount:m=0}=t,v=!d&&r,P=`uploader:${p}:downloaded`,f=fa(t),b=(T=n==null?void 0:n.split("?"))==null?void 0:T[0],x=(()=>{const _=["jpg","jpeg"];return _.includes(f)&&_.some(F=>b==null?void 0:b.endsWith(F))?!0:b==null?void 0:b.endsWith(f)})()?b:`${b}${f?`.${f}`:""}`;if(v){const _=L0(s||((E=c==null?void 0:c.body)==null?void 0:E.url));if(m>=3)throw new Error("Download remote file failure");this.uppy.setFileState(p,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await ad.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:_}}).then(F=>F==null?void 0:F.data).then(async F=>{const A=gc(F,x);this.uppy.setFileState(p,{name:x,extension:f,type:a,data:A,preview:s||fc(A),source:o,size:A.size,isDownloading:!1,isRemote:!1,meta:{...h,name:x,filename:x}}),this.uppy.getFile(p),this.uppy.emit(P,p)}).catch(async F=>{console.error("Axios download remote file error: ",F),this.uppy.setFileState(p,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(p))})}else l&&await(async()=>new Promise(F=>{this.uppy.once(P,async()=>{F()})}))()});xe(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:fc(s)})},o.indexOf("gif")>-1?1e3:0)}});xe(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}class w1 extends fe{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:ue("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[ue("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),ue("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return ue("div",{id:"ai-image",className:"ai-image",children:ue("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const _1="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",S1=ie.lazy(()=>Oc(()=>import("./index-C_TKdpLp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]))),Sc="uploader-container",ln="uploader-dashboard",Si=localStorage.getItem("uppy_debug"),P1=()=>Fo.get("x-csrf-token")?{"x-csrf-token":Fo.get("x-csrf-token")}:{},F1=i=>{var c;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o}=i,{companionUrl:r}=nd(e),l=P1(),p=async h=>(await La.post("/api/image/generations",h)).data,d={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:_u,options:{quality:1,...s},alwayUse:!0},(Si||ga()&&t.Uploaded&&!vc())&&{id:"Uploaded",plugin:G0,options:{params:a==null?void 0:a.params}},(Si||ga()&&t.Resources&&!vc())&&{id:"Resources",plugin:K0,options:{params:n==null?void 0:n.params}},ga()&&z0()&&t.AIImage&&{id:"AIImage",plugin:w1,options:{companionUrl:r,companionHeaders:l},onShowPanel:h=>{function m(){setTimeout(()=>{var P,f;const v=document.getElementById("ai-image");v?Bd(v).render(ve.jsx(S1,{theme:o,api:p,restrictions:d,i18n:(f=(P=h.current)==null?void 0:P.getUploader())==null?void 0:f.i18n,onSelect:b=>{const S=h.current.getUploader();S==null||S.emit("ai-image:selected",b),b.forEach(({src:x,alt:T},E)=>{const _=R=>(R==null?void 0:R.length)>16?`${R==null?void 0:R.slice(0,8)}...${R==null?void 0:R.slice(-4)}`:R,F=`${_(T)||_(x)}.png`,A={name:F,type:"image/png",data:j0(x,F),source:"AIImage",isRemote:!1};S==null||S.addFile(A)})}})):m()},100)}m()}},{id:"Url",plugin:Ia,options:{companionUrl:r,companionHeaders:l}},{id:"Webcam",plugin:ip,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((c=window==null?void 0:window.blocklet)!=null&&c.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:_p,options:{companionUrl:r,companionHeaders:l,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:x1,options:{companionUrl:r,companionHeaders:l,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Wo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function hd(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:p,pluginList:d,restrictions:c,onChange:h,initialFiles:m}=i,v=Rc(d,"id"),{uploaderUrl:P}=nd(r);let f=new Do({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Si||""),locale:Yu[a||"en"],onBeforeFileAdded:(x,T)=>{if(Object.hasOwn(T,x.id))return!1;const E=!!ot.extension(x.type),_=ot.lookup(x.name)||"";if(!E&&_&&_!==x.type){const F=fa(x);F&&(x.extension=F),x.type=_}return x},...o,restrictions:c}).use(Ku,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(x,T){var X,W;const{hashFileName:E,id:_,meta:F}=T,A=((X=f.getFile(_))==null?void 0:X.mockResponse)||null;x.getMethod()==="PATCH"&&A&&(x.send=()=>A);const R=fa(T);x.setHeader("x-uploader-file-name",`${E}`),x.setHeader("x-uploader-file-id",`${_}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",P),x.setHeader("x-uploader-metadata",JSON.stringify(F,($,q)=>typeof q=="string"?encodeURIComponent(q):q));const j=Fo.get("x-csrf-token");j&&x.setHeader("x-csrf-token",j);const N=(window==null?void 0:window.uploaderComponentId)||((W=window==null?void 0:window.blocklet)==null?void 0:W.componentId);N&&x.setHeader("x-component-did",(N||"").split("/").pop())},onAfterResponse:async(x,T)=>{const E={},_=x.getUnderlyingObject();try{_.response&&(E.data=JSON.parse(_.response))}catch{E.data={}}E.method=x.getMethod().toUpperCase(),E.url=x.getURL(),E.status=_.status,E.headers={...x._headers};const F=_.getAllResponseHeaders();F&&F.split(`\r
55
+ `,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));xe(this,"convertImgToObject",Rs(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(p=>p.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=W0(s.originalname),[".mp4",".webm"].find(p=>{var d;return(d=a.src)==null?void 0:d.endsWith(p)})){const p=document.createElement("video");p.src=a.src,p.width=a.width,p.height=a.height,p.autoplay=!0,p.setAttribute("playsinline","playsinline"),p.muted=!0,p.loop=!0,p.style="pointer-events: none;",o.appendChild(p)}else{const p=document.createElement("object");p.data=n,p.type=s.mimetype||"image/png",p.alt=s.originalname,p.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",p.loading="lazy",o.appendChild(p)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));xe(this,"resetState",()=>{this.uploadedAPIData={...yc},this.uploaded.setPluginState({...xc}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...yc},this.addUploadItemFlag=!0,this.icon=()=>ue("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[ue("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),ue("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),ue("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),ue("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),ue("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new No(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...xc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const wc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},_c={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},sd={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},X0={...sd,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class K0 extends fe{constructor(t,a){super(t,a);xe(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await La.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=Ac([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=Rn(s,0,0,Tt);return n=Rn(s,400,0,Tt),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});xe(this,"resetState",()=>{this.apiData={...wc},this.resources.setPluginState({..._c})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...wc},this.icon=()=>ue("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[ue("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),ue("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),ue("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),ue("div",{id:"resources",className:"uploaded",children:[ue("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>ue("button",{style:this.apiData.componentDid===a.did?X0:sd,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Hd(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new No(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({..._c}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("resources:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var Y0=kd();const Q0=dt(Y0);var Ae=Uint8Array,yi=Uint16Array,Z0=Int32Array,od=new Ae([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rd=new Ae([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),J0=new Ae([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ld=function(i,e){for(var t=new yi(31),a=0;a<31;++a)t[a]=e+=1<<i[a-1];for(var n=new Z0(t[30]),a=1;a<30;++a)for(var s=t[a];s<t[a+1];++s)n[s]=s-t[a]<<5|a;return{b:t,r:n}},cd=ld(od,2),pd=cd.b,e1=cd.r;pd[28]=258,e1[258]=28;var t1=ld(rd,0),i1=t1.b,ko=new yi(32768);for(var Z=0;Z<32768;++Z){var Ot=(Z&43690)>>1|(Z&21845)<<1;Ot=(Ot&52428)>>2|(Ot&13107)<<2,Ot=(Ot&61680)>>4|(Ot&3855)<<4,ko[Z]=((Ot&65280)>>8|(Ot&255)<<8)>>1}var va=function(i,e,t){for(var a=i.length,n=0,s=new yi(e);n<a;++n)i[n]&&++s[i[n]-1];var o=new yi(e);for(n=1;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;var r;if(t){r=new yi(1<<e);var l=15-e;for(n=0;n<a;++n)if(i[n])for(var p=n<<4|i[n],d=e-i[n],c=o[i[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)r[ko[c]>>l]=p}else for(r=new yi(a),n=0;n<a;++n)i[n]&&(r[n]=ko[o[i[n]-1]++]>>15-i[n]);return r},za=new Ae(288);for(var Z=0;Z<144;++Z)za[Z]=8;for(var Z=144;Z<256;++Z)za[Z]=9;for(var Z=256;Z<280;++Z)za[Z]=7;for(var Z=280;Z<288;++Z)za[Z]=8;var ud=new Ae(32);for(var Z=0;Z<32;++Z)ud[Z]=5;var a1=va(za,9,1),n1=va(ud,5,1),Ts=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},Xe=function(i,e,t){var a=e/8|0;return(i[a]|i[a+1]<<8)>>(e&7)&t},Ds=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},s1=function(i){return(i+7)/8|0},mr=function(i,e,t){return(e==null||e<0)&&(e=0),(t==null||t>i.length)&&(t=i.length),new Ae(i.subarray(e,t))},o1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],we=function(i,e,t){var a=new Error(e||o1[i]);if(a.code=i,Error.captureStackTrace&&Error.captureStackTrace(a,we),!t)throw a;return a},fr=function(i,e,t,a){var n=i.length,s=a?a.length:0;if(!n||e.f&&!e.l)return t||new Ae(0);var o=!t,r=o||e.i!=2,l=e.i;o&&(t=new Ae(n*3));var p=function(Lt){var Di=t.length;if(Lt>Di){var ht=new Ae(Math.max(Di*2,Lt));ht.set(t),t=ht}},d=e.f||0,c=e.p||0,h=e.b||0,m=e.l,v=e.d,P=e.m,f=e.n,b=n*8;do{if(!m){d=Xe(i,c,1);var S=Xe(i,c+1,3);if(c+=3,S)if(S==1)m=a1,v=n1,P=9,f=5;else if(S==2){var _=Xe(i,c,31)+257,F=Xe(i,c+10,15)+4,A=_+Xe(i,c+5,31)+1;c+=14;for(var R=new Ae(A),j=new Ae(19),N=0;N<F;++N)j[J0[N]]=Xe(i,c+N*3,7);c+=F*3;for(var X=Ts(j),W=(1<<X)-1,$=va(j,X,1),N=0;N<A;){var q=$[Xe(i,c,W)];c+=q&15;var x=q>>4;if(x<16)R[N++]=x;else{var w=0,g=0;for(x==16?(g=3+Xe(i,c,3),c+=2,w=R[N-1]):x==17?(g=3+Xe(i,c,7),c+=3):x==18&&(g=11+Xe(i,c,127),c+=7);g--;)R[N++]=w}}var y=R.subarray(0,_),C=R.subarray(_);P=Ts(y),f=Ts(C),m=va(y,P,1),v=va(C,f,1)}else we(1);else{var x=s1(c)+4,T=i[x-4]|i[x-3]<<8,E=x+T;if(E>n){l&&we(0);break}r&&p(h+T),t.set(i.subarray(x,E),h),e.b=h+=T,e.p=c=E*8,e.f=d;continue}if(c>b){l&&we(0);break}}r&&p(h+131072);for(var O=(1<<P)-1,D=(1<<f)-1,k=c;;k=c){var w=m[Ds(i,c)&O],M=w>>4;if(c+=w&15,c>b){l&&we(0);break}if(w||we(2),M<256)t[h++]=M;else if(M==256){k=c,m=null;break}else{var L=M-254;if(M>264){var N=M-257,V=od[N];L=Xe(i,c,(1<<V)-1)+pd[N],c+=V}var H=v[Ds(i,c)&D],K=H>>4;H||we(3),c+=H&15;var C=i1[K];if(K>3){var V=rd[K];C+=Ds(i,c)&(1<<V)-1,c+=V}if(c>b){l&&we(0);break}r&&p(h+131072);var Se=h+L;if(h<C){var jt=s-C,qn=Math.min(C,Se);for(jt+h<0&&we(3);h<qn;++h)t[h]=a[jt+h]}for(;h<Se;++h)t[h]=t[h-C]}}e.l=m,e.p=k,e.b=h,e.f=d,m&&(d=1,e.m=P,e.d=v,e.n=f)}while(!d);return h!=t.length&&o?mr(t,0,h):t.subarray(0,h)},r1=new Ae(0),st=function(i,e){return i[e]|i[e+1]<<8},et=function(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16|i[e+3]<<24)>>>0},Os=function(i,e){return et(i,e)+et(i,e+4)*4294967296},l1=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&we(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var a=(e>>3&1)+(e>>4&1);a>0;a-=!i[t++]);return t+(e&2)},c1=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},p1=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&we(6,"invalid zlib data"),(i[1]>>5&1)==+!e&&we(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function dd(i,e){return fr(i,{i:2},e&&e.out,e&&e.dictionary)}function u1(i,e){var t=l1(i);return t+8>i.length&&we(6,"invalid gzip data"),fr(i.subarray(t,-8),{i:2},e&&e.out||new Ae(c1(i)),e&&e.dictionary)}function d1(i,e){return fr(i.subarray(p1(i,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function As(i,e){return i[0]==31&&i[1]==139&&i[2]==8?u1(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?dd(i,e):d1(i,e)}var Eo=typeof TextDecoder<"u"&&new TextDecoder,h1=0;try{Eo.decode(r1,{stream:!0}),h1=1}catch{}var m1=function(i){for(var e="",t=0;;){var a=i[t++],n=(a>127)+(a>223)+(a>239);if(t+n>i.length)return{s:e,r:mr(i,t-1)};n?n==3?(a=((a&15)<<18|(i[t++]&63)<<12|(i[t++]&63)<<6|i[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):n&1?e+=String.fromCharCode((a&31)<<6|i[t++]&63):e+=String.fromCharCode((a&15)<<12|(i[t++]&63)<<6|i[t++]&63):e+=String.fromCharCode(a)}};function f1(i,e){if(e){for(var t="",a=0;a<i.length;a+=16384)t+=String.fromCharCode.apply(null,i.subarray(a,a+16384));return t}else{if(Eo)return Eo.decode(i);var n=m1(i),s=n.s,t=n.r;return t.length&&we(8),s}}var g1=function(i,e){return e+30+st(i,e+26)+st(i,e+28)},v1=function(i,e,t){var a=st(i,e+28),n=f1(i.subarray(e+46,e+46+a),!(st(i,e+8)&2048)),s=e+46+a,o=et(i,e+20),r=t&&o==4294967295?b1(i,s):[o,et(i,e+24),et(i,e+42)],l=r[0],p=r[1],d=r[2];return[st(i,e+10),l,p,n,s+st(i,e+30)+st(i,e+32),d]},b1=function(i,e){for(;st(i,e)!=1;e+=4+st(i,e+2));return[Os(i,e+12),Os(i,e+4),Os(i,e+20)]};function y1(i,e){for(var t={},a=i.length-22;et(i,a)!=101010256;--a)(!a||i.length-a>65558)&&we(13);var n=st(i,a+8);if(!n)return{};var s=et(i,a+16),o=s==4294967295||n==65535;if(o){var r=et(i,a-12);o=et(i,r)==101075792,o&&(n=et(i,r+32),s=et(i,r+48))}for(var l=e&&e.filter,p=0;p<n;++p){var d=v1(i,s,o),c=d[0],h=d[1],m=d[2],v=d[3],P=d[4],f=d[5],b=g1(i,f);s=P,(!l||l({name:v,size:h,originalSize:m,compression:c}))&&(c?c==8?t[v]=dd(i.subarray(b,b+h),{out:new Ae(m)}):we(14,"unknown compression type "+c):t[v]=mr(i,b,b+h))}return t}const rn={zip:y1,gz:As,tgz:As,deflate:As};class x1 extends fe{constructor(t,a){super(t,{...{},...a});xe(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=Q0.createHash("md5").update(await r.text()).digest("hex"),p=fa(n),d=`${l}${p?`.${p}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});xe(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});xe(this,"preventXssAttack",async t=>{var s;const{id:a}=t,n=this.uppy.getFile(a);if(n){const{name:o,meta:r}=this.uppy.getFile(a),l=Pr.sanitize(o);if(o!==l){const p=fa(n),d=l.endsWith(`.${p}`)?l:`${l}.${p}`;this.uppy.setFileState(a,{name:d,meta:{...r,name:d,filename:d}})}if((s=n.type)!=null&&s.includes("image/svg")){const{data:p,name:d,type:c}=this.uppy.getFile(a),h=await p.text(),m=Pr.sanitize(h,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["use"]});if(h!==m){const v=new Blob([m],{type:c}),P=gc(v,d);this.uppy.setFileState(a,{...this.uppy.getFile(a),data:P})}}}});xe(this,"preventZipBombAttack",async t=>{const{id:a}=t,n=this.uppy.getFile(a);try{if(n&&rn[n.extension]){const{data:s}=n,o=rn[n.extension](new Uint8Array(await s.arrayBuffer()));let r=0;const l=(d,c)=>(r++,Object.entries(d instanceof Uint8Array?{[c||n.name]:d}:d).reduce((h,[m,v])=>{const P=h+v.byteLength;if(r>=5||P>n.size*100)throw console.error("Zip bomb detected, please check your file",{maxDepth:r,baseAcc:P,fileSize:n.size}),new Error("Zip bomb detected, please check your file");const f=ot.extension(ot.lookup(m));if(rn[f]){const b=rn[f](v);return P+l(b,m)}return P},0)),p=l(o);if(console.info(n.name,{totalUnzippedSize:p,maxDepth:r,zippedSize:n.size}),p>n.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}});xe(this,"validateImagesRespectCropperOptions",async()=>this.uppy.getFiles().reduce(async(t,a)=>{var P,f,b;await t;const{id:n}=a;let s=this.uppy.getFile(n);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(n)),!((P=this.opts.cropperOptions)!=null&&P.aspectRatio)||!((f=s==null?void 0:s.type)!=null&&f.includes("image"))||(b=s.type)!=null&&b.includes("image/svg"))return Promise.resolve();const{aspectRatio:o}=this.opts.cropperOptions,r=this.uppy.getPlugin("ImageEditor"),l=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+n).querySelector("img"),p=l==null?void 0:l.naturalWidth,d=l==null?void 0:l.naturalHeight,c=Number(p/d).toFixed(2),h=Number(o).toFixed(2);if(c===h)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),r.parent.openFileEditor(s);const v=this.i18n("aspectRatioMessage",{imageAspectRatio:c,aspectRatio:h});return this.uppy.info({message:v,details:v}),new Promise((S,x)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{S()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve()));xe(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.preventXssAttack(t),await this.preventZipBombAttack(t),await this.setMetaData(t)});xe(this,"tryDownloadRemoteFile",async t=>{var T,E;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:p,isLoading:d,remote:c,meta:h,errorCount:m=0}=t,v=!d&&r,P=`uploader:${p}:downloaded`,f=fa(t),b=(T=n==null?void 0:n.split("?"))==null?void 0:T[0],x=(()=>{const _=["jpg","jpeg"];return _.includes(f)&&_.some(F=>b==null?void 0:b.endsWith(F))?!0:b==null?void 0:b.endsWith(f)})()?b:`${b}${f?`.${f}`:""}`;if(v){const _=L0(s||((E=c==null?void 0:c.body)==null?void 0:E.url));if(m>=3)throw new Error("Download remote file failure");this.uppy.setFileState(p,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await ad.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:_}}).then(F=>F==null?void 0:F.data).then(async F=>{const A=gc(F,x);this.uppy.setFileState(p,{name:x,extension:f,type:a,data:A,preview:s||fc(A),source:o,size:A.size,isDownloading:!1,isRemote:!1,meta:{...h,name:x,filename:x}}),this.uppy.getFile(p),this.uppy.emit(P,p)}).catch(async F=>{console.error("Axios download remote file error: ",F),this.uppy.setFileState(p,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(p))})}else l&&await(async()=>new Promise(F=>{this.uppy.once(P,async()=>{F()})}))()});xe(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:fc(s)})},o.indexOf("gif")>-1?1e3:0)}});xe(this,"prepareUpload",async t=>{await this.validateImagesRespectCropperOptions();const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"PrepareUpload",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}class w1 extends fe{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:ue("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[ue("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),ue("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return ue("div",{id:"ai-image",className:"ai-image",children:ue("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const _1="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",S1=ie.lazy(()=>Oc(()=>import("./index-C8MAHjVt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]))),Sc="uploader-container",ln="uploader-dashboard",Si=localStorage.getItem("uppy_debug"),P1=()=>Fo.get("x-csrf-token")?{"x-csrf-token":Fo.get("x-csrf-token")}:{},F1=i=>{var c;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a,resourcesProps:n,imageEditorProps:s={},theme:o}=i,{companionUrl:r}=nd(e),l=P1(),p=async h=>(await La.post("/api/image/generations",h)).data,d={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:_u,options:{quality:1,...s},alwayUse:!0},(Si||ga()&&t.Uploaded&&!vc())&&{id:"Uploaded",plugin:G0,options:{params:a==null?void 0:a.params}},(Si||ga()&&t.Resources&&!vc())&&{id:"Resources",plugin:K0,options:{params:n==null?void 0:n.params}},ga()&&z0()&&t.AIImage&&{id:"AIImage",plugin:w1,options:{companionUrl:r,companionHeaders:l},onShowPanel:h=>{function m(){setTimeout(()=>{var P,f;const v=document.getElementById("ai-image");v?Bd(v).render(ve.jsx(S1,{theme:o,api:p,restrictions:d,i18n:(f=(P=h.current)==null?void 0:P.getUploader())==null?void 0:f.i18n,onSelect:b=>{const S=h.current.getUploader();S==null||S.emit("ai-image:selected",b),b.forEach(({src:x,alt:T},E)=>{const _=R=>(R==null?void 0:R.length)>16?`${R==null?void 0:R.slice(0,8)}...${R==null?void 0:R.slice(-4)}`:R,F=`${_(T)||_(x)}.png`,A={name:F,type:"image/png",data:j0(x,F),source:"AIImage",isRemote:!1};S==null||S.addFile(A)})}})):m()},100)}m()}},{id:"Url",plugin:Ia,options:{companionUrl:r,companionHeaders:l}},{id:"Webcam",plugin:ip,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((c=window==null?void 0:window.blocklet)!=null&&c.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:_p,options:{companionUrl:r,companionHeaders:l,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:x1,options:{companionUrl:r,companionHeaders:l,cropperOptions:(s==null?void 0:s.cropperOptions)||null},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Wo,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function hd(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:p,pluginList:d,restrictions:c,onChange:h,initialFiles:m}=i,v=Rc(d,"id"),{uploaderUrl:P}=nd(r);let f=new Do({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Si||""),locale:Yu[a||"en"],onBeforeFileAdded:(x,T)=>{if(Object.hasOwn(T,x.id))return!1;const E=!!ot.extension(x.type),_=ot.lookup(x.name)||"";if(!E&&_&&_!==x.type){const F=fa(x);F&&(x.extension=F),x.type=_}return x},...o,restrictions:c}).use(Ku,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(x,T){var X,W;const{hashFileName:E,id:_,meta:F}=T,A=((X=f.getFile(_))==null?void 0:X.mockResponse)||null;x.getMethod()==="PATCH"&&A&&(x.send=()=>A);const R=fa(T);x.setHeader("x-uploader-file-name",`${E}`),x.setHeader("x-uploader-file-id",`${_}`),x.setHeader("x-uploader-file-ext",`${R}`),x.setHeader("x-uploader-base-url",new URL(x.getURL()).pathname),x.setHeader("x-uploader-endpoint-url",P),x.setHeader("x-uploader-metadata",JSON.stringify(F,($,q)=>typeof q=="string"?encodeURIComponent(q):q));const j=Fo.get("x-csrf-token");j&&x.setHeader("x-csrf-token",j);const N=(window==null?void 0:window.uploaderComponentId)||((W=window==null?void 0:window.blocklet)==null?void 0:W.componentId);N&&x.setHeader("x-component-did",(N||"").split("/").pop())},onAfterResponse:async(x,T)=>{const E={},_=x.getUnderlyingObject();try{_.response&&(E.data=JSON.parse(_.response))}catch{E.data={}}E.method=x.getMethod().toUpperCase(),E.url=x.getURL(),E.status=_.status,E.headers={...x._headers};const F=_.getAllResponseHeaders();F&&F.split(`\r
56
56
  `).forEach(X=>{const[W,$]=X.split(": ");W&&$&&(E.headers[W]=$)});const A=f.getFile(E.headers["x-uploader-file-id"]);if(x.getMethod()==="PATCH"&&A.mockResponse)return;if(["PATCH","POST"].includes(E.method)&&[200,500].includes(E.status)){const N=[!0,"true"].includes(E.headers["x-uploader-file-exist"]),X=q0(E.url,E.headers["x-uploader-file-name"]);E.file=A,E.uploadURL=X;const W={uploadURL:X,...E};f.setFileState(A.id,{responseResult:W}),N&&A&&(E.method==="POST"&&f.setFileState(A.id,{mockResponse:T}),f.emit("upload-success",f.getFile(A.id),{...W,body:E.data}),f.emit("postprocess-complete",f.getFile(A.id)),f.calculateTotalProgress()),E.status===200&&(await(s==null?void 0:s(E)),f.emitUploadSuccess(A,E))}n&&await(n==null?void 0:n(_));const R=f.getState().totalProgress===100,j=f.getFiles().every(N=>N.source==="DropTarget");R&&j&&f.close()},...l});const b=({fileIDs:x,id:T})=>{x.forEach(E=>{f.setFileState(E,{uploadID:T})})};f.off("upload",b),f.on("upload",b);const S=x=>{typeof h=="function"&&h(x,f.getFiles())};return f.off("file-added",S),f.on("file-added",S),f.off("file-removed-success",S),f.on("file-removed-success",S),p&&f.use(ou,{target:document.body,onDrop:x=>{var T;(T=f==null?void 0:f.open)==null||T.call(f)},...p}),t==null||t.forEach(x=>{if(x){const{plugin:T,options:E}=v[x]||{};T&&f.use(T,E)}}),H0(f),m&&(m==null?void 0:m.length)>0&&f.addFiles(m),f}const Pc=ie.forwardRef((i,e)=>{var N,X,W,$,q,w,g,y,C,O,D;const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,...i==null?void 0:i.apiPathProps},a=ie.useRef(null),n=Ed({open:!1,uppy:null,availablePluginMap:{},restrictions:{}}),s=Td(),o=F1({...i,apiPathProps:t,availablePluginMap:n.availablePluginMap,restrictions:n.restrictions,theme:s}),{plugins:r=o.map(k=>k.id),id:l="Uploader",popup:p=!1,uploadedProps:d,resourcesProps:c,onOpen:h,onClose:m,locale:v,installerProps:P}=i,f=Rc(o,"id"),b=Dd(k=>{var M;return(M=k==null?void 0:k.breakpoints)==null?void 0:M.down("md")}),S=wr([...r,...o.filter(k=>k.alwayUse).map(k=>k.id)]),{loading:x}=Od(async()=>{var M,L,V,H,K;let k=_r((M=i==null?void 0:i.coreProps)==null?void 0:M.restrictions)?{}:Sr.cloneDeep((L=i==null?void 0:i.coreProps)==null?void 0:L.restrictions);if(ga())try{await La.get("/api/uploader/status").then(({data:Se})=>{var jt;n.availablePluginMap=Se.availablePluginMap,!t.disableMediaKitPrefix&&_r((jt=i==null?void 0:i.coreProps)==null?void 0:jt.restrictions)&&(k=Se.restrictions||{})})}catch{}!((V=k==null?void 0:k.allowedFileTypes)!=null&&V.length)&&(k!=null&&k.allowedFileExts)&&(k.allowedFileTypes=wr((K=(H=(typeof(k==null?void 0:k.allowedFileExts)=="string"?k==null?void 0:k.allowedFileExts.split(","):k==null?void 0:k.allowedFileExts)||[])==null?void 0:H.map(Se=>ot.lookup((Se==null?void 0:Se.replaceAll(" ",""))||"")))==null?void 0:K.filter(Se=>Se)),delete k.allowedFileExts),k.maxFileSize&&typeof k.maxFileSize=="string"&&(k.maxFileSize=Q.parseSize(k.maxFileSize,{iec:!1})||void 0),n.restrictions=Sr.cloneDeep(k)},{refreshDeps:[JSON.stringify({apiPathProps:t,restrictionsProps:(N=i==null?void 0:i.coreProps)==null?void 0:N.restrictions})]});Ld("esc",k=>{n.open&&(k.stopPropagation(),k.preventDefault(),F())},{useCapture:!0}),ie.useEffect(()=>{$0(t),n.uppy=hd({...i,id:l,plugins:S,apiPathProps:t,pluginList:o,restrictions:n.restrictions}),n.uppy.open=_,n.uppy.close=F,n.uppy.openPlugin=T;const k=V=>{const{onShowPanel:H}=f[V];H==null||H(e)};n.uppy.off("dashboard:show-panel",k),n.uppy.on("dashboard:show-panel",k);const M=(V,H,K,Se)=>{var Lt,Di;const jt=V.map(ht=>{var gr,vr,br;const fd={name:ht.id||((br=(vr=(gr=ht.fileUrl)==null?void 0:gr.split("/"))==null?void 0:vr.slice(-1))==null?void 0:br[0]),type:ht.mimetype||ot.lookup(ht.fileUrl),data:"",preview:ht.fileUrl,source:Se,isRemote:!0},gd=H.uppy.addFile(fd);return{...ht,uppyFile:H.uppy.getFile(gd)}}),qn=`${Se.toLowerCase()}Props`;(Di=(Lt=K[qn])==null?void 0:Lt.onSelectedFiles)==null||Di.call(Lt,jt)};[{name:"Uploaded",event:"uploaded:selected"},{name:"Resources",event:"resources:selected"}].forEach(({name:V,event:H})=>{S.includes(V)&&(n.uppy.off(H),n.uppy.on(H,K=>M(K,n,i,V)))})},[JSON.stringify({id:l,plugins:S,apiPathProps:t,locale:v,restrictions:n.restrictions,theme:s})]);function T(k){var M,L,V;if(k=k.replace(/\s/g,""),["MyDevice",...S].map(H=>H.toLowerCase()).includes(k.toLowerCase())){let H=`div[data-uppy-acquirer-id="${k}"] > button`;(V=(L=(M=document==null?void 0:document.getElementById(ln))==null?void 0:M.querySelector(H))==null?void 0:L.click)==null||V.call(L)}}const E=ie.useCallback(k=>{Si&&a.current&&!a.current.contains(k.target)&&console.info("debug focus",a.current,k.target)},[]);function _(k){var L,V,H,K;n.open=!0,k&&setTimeout(()=>{T(k)},200),n.uppy.emitOpen(),h==null||h(),(V=(L=document.activeElement)==null?void 0:L.blur)==null||V.call(L);const M=n.uppy.getPlugin(ln).el;(H=M==null?void 0:M.focus)==null||H.call(M),(K=M==null?void 0:M.click)==null||K.call(M),Si&&p&&(document.addEventListener("mousedown",E),document.addEventListener("touchstart",E))}function F(){var k;(k=n.uppy.getPlugin(ln))==null||k.hideAllPanels(),n.open=!1,n.uppy.emitClose(),m==null||m(),setTimeout(()=>{n.uppy.getState().totalProgress===100&&(n.uppy.setState({files:{},currentUploads:{}}),n.uppy.calculateTotalProgress())},500),Si&&p&&(document.removeEventListener("mousedown",E),document.removeEventListener("touchstart",E))}ie.useImperativeHandle(e,()=>({getUploader:()=>n.uppy,open:_,close:F}));const A=p?Md:ie.Fragment,R=p?{sx:{zIndex:99999999999,background:"rgba(0,0,0,0.5)","& > *":{display:n.open?"block":"none"},...(X=i==null?void 0:i.wrapperProps)==null?void 0:X.sx},invisible:!0,open:n.open,onClick:k=>{document.activeElement===document.body&&(k.stopPropagation(),F())},...i.wrapperProps}:{...i.wrapperProps},j=b?"42px":"40px";return ve.jsx(A,{...R,children:ve.jsxs($d,{onClose:F,did:_1,disabled:!n.open,...P,children:[ve.jsx(Ad,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),ve.jsxs(Us,{className:"uploader-container",ref:a,id:Sc,onClick:k=>k.stopPropagation(),sx:{position:"relative",width:b?"90vw":720,".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{background:"repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px !important"},".uploaded-add-item":{background:"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:"rgba(0,0,0,0.13)"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{background:"#fff",height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}},"& .uppy-Dashboard-browse, & .uppy-DashboardContent-addMore, & .uppy-DashboardContent-back, & .uppy-StatusBar-actionBtn--done, & .uppy-DashboardContent-save, & .uppy-StatusBar-actionBtn--upload":{color:`${($=(W=s==null?void 0:s.palette)==null?void 0:W.primary)==null?void 0:$.main}`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{color:`${(w=(q=s==null?void 0:s.palette)==null?void 0:q.primary)==null?void 0:w.main}`,filter:"brightness(1.2)"}},"& .uppy-c-btn-primary":{backgroundColor:`${(y=(g=s==null?void 0:s.palette)==null?void 0:g.primary)==null?void 0:y.main} !important`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{backgroundColor:`${(O=(C=s==null?void 0:s.palette)==null?void 0:C.primary)==null?void 0:O.main} !important`,filter:"brightness(1.2)"}}},children:[p&&ve.jsx(Rd,{"aria-label":"close",onClick:F,sx:{color:"#fafafa",position:"absolute",...b?{bottom:`calc(0px - ${j} - 16px)`,left:`calc(50vw - ${j} - 8px)`}:{right:`calc(0px - ${j} - 16px)`,top:-12}},children:ve.jsx(Wd,{sx:{fontSize:j}})}),x&&ve.jsxs(Us,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:99999999999,flexDirection:"column",background:"rgba(256, 256, 256, 0.2)",backdropFilter:"blur(4px)",borderRadius:1,pointerEvents:"none"},children:[ve.jsx(B0,{size:32}),ve.jsx(Ud,{variant:"body2",color:"primary",sx:{mt:1.5,fontWeight:"bold"},children:Id(Yu,`${v}.strings.loadingStatus`)})]}),n.uppy&&ve.jsx(Yp,{inline:!0,target:`#${Sc}`,id:ln,uppy:n.uppy,plugins:S,fileManagerSelectionType:((D=n.restrictions)==null?void 0:D.maxNumberOfFiles)===1?"files":"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,note:"",doneButtonHandler:F,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),C1=Object.freeze(Object.defineProperty({__proto__:null,Uploader:Pc,default:Pc,initUploader:hd},Symbol.toStringTag,{value:"Module"})),Fc=ie.lazy(()=>Oc(()=>Promise.resolve().then(()=>C1),void 0).then(i=>({default:i.Uploader}))),md=ie.createContext(null);function k1(){const i=ie.useContext(md);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function Ow({onChange:i,children:e,...t}){const a=k1(),n=()=>{var o;const s=(o=a==null?void 0:a.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return ve.jsx(Us,{onClick:n,...t,children:e})}function Aw({children:i,popup:e,...t}){const a=ie.useRef(null),n=ie.useMemo(()=>e?Nd.createPortal(ve.jsx(Fc,{ref:a,popup:!0,...t},"uploader"),document.body):ve.jsx(Fc,{ref:a,popup:!1,...t},"uploader"),[a,e,t]);return ve.jsxs(md.Provider,{value:a,children:[i,n]})}export{Es as CLOSE,ks as OPEN,bc as UPLOADER_UPLOAD_SUCCESS,Pc as Uploader,md as UploaderContext,Aw as UploaderProvider,Ow as UploaderTrigger,ad as api,j0 as base64ToFile,gc as blobToFile,Rn as createImageUrl,z0 as getAIKitComponent,L0 as getDownloadUrl,fa as getExt,ga as getMediaKitComponent,fc as getObjectURL,nd as getUploaderEndpoint,q0 as getUrl,hd as initUploader,H0 as initUppy,N0 as isBlob,vc as isMediaKit,La as mediaKitApi,Tt as mediaKitMountPoint,W0 as parseStringToDot,pi as prefixPath,$0 as setPrefixPath,k1 as useUploaderContext};
@@ -1 +1 @@
1
- import{b7 as a}from"./index-C_CQlCa-.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
1
+ import{b7 as a}from"./index-BXfEXarc.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
@@ -1 +1 @@
1
- import{aE as ve,aF as me,aG as X,cR as $e,aH as He,aK as p,r as d,aI as Se,aJ as ae,aM as L,j as u,aN as ge,at as Ae,cM as at,cS as Oe,cT as Xe,cU as De,aL as se,aj as it,cV as fe,cW as ct,bt as dt,bE as F,P as W}from"./index-C_CQlCa-.js";let K;function _e(){if(K)return K;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),K="reverse",e.scrollLeft>0?K="default":(e.scrollLeft=1,e.scrollLeft===0&&(K="negative")),document.body.removeChild(e),K}function ut(e,t){const l=e.scrollLeft;if(t!=="rtl")return l;switch(_e()){case"negative":return e.scrollWidth-e.clientWidth+l;case"reverse":return e.scrollWidth-e.clientWidth-l;default:return l}}function bt(e){return me("MuiTab",e)}const k=ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),pt=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ft=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=e,g={root:["root",a&&v&&"labelIcon",`textColor${He(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return ge(g,bt,t)},ht=X($e,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${He(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${k.iconWrapper}`]:t.iconWrapper}]}})(({theme:e,ownerState:t})=>p({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${k.iconWrapper}`]:p({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${k.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${k.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${k.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${k.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),xe=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:j,selected:T,selectionFollowsFocus:x,textColor:D="inherit",value:R,wrapped:ie=!1}=s,_=ae(s,pt),V=p({},s,{disabled:a,disableFocusRipple:v,selected:T,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:D,wrapped:ie}),q=ft(V),$=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:L(q.iconWrapper,b.props.className)}):b,ee=E=>{!T&&m&&m(E,R),w&&w(E)},U=E=>{x&&!T&&m&&m(E,R),j&&j(E)};return u.jsxs(ht,p({focusRipple:!v,className:L(q.root,n),ref:l,role:"tab","aria-selected":T,disabled:a,onClick:ee,onFocus:U,ownerState:V,tabIndex:T?0:-1},_,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[$,y]}):u.jsxs(d.Fragment,{children:[y,$]}),B]}))}),vt=Ae(u.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),mt=Ae(u.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function St(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function gt(e,t,l,s={},n=()=>{}){const{ease:a=St,duration:v=300}=s;let h=null;const b=t[e];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const w=Math.min(1,(m-h)/v);if(t[e]=a(w)*(l-b)+b,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const xt=["onChange"],yt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Ct(e){const{onChange:t}=e,l=ae(e,xt),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return at(()=>{const v=Oe(()=>{const b=s.current;a(),b!==s.current&&t(s.current)}),h=Xe(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[t]),d.useEffect(()=>{a(),t(s.current)},[t]),u.jsx("div",p({style:yt,ref:n},l))}function Bt(e){return me("MuiTabScrollButton",e)}const wt=ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Tt=["className","slots","slotProps","direction","orientation","disabled"],Mt=e=>{const{classes:t,orientation:l,disabled:s}=e;return ge({root:["root",l,s&&"disabled"]},Bt,t)},It=X($e,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})(({ownerState:e})=>p({width:40,flexShrink:0,opacity:.8,[`&.${wt.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),Rt=d.forwardRef(function(t,l){var s,n;const a=Se({props:t,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=ae(a,Tt),y=De(),m=p({isRtl:y},a),w=Mt(m),j=(s=h.StartScrollButtonIcon)!=null?s:vt,T=(n=h.EndScrollButtonIcon)!=null?n:mt,x=se({elementType:j,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),D=se({elementType:T,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(It,p({component:"div",className:L(w.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx(j,p({},x)):u.jsx(T,p({},D))}))});function Et(e){return me("MuiTabs",e)}const he=ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),zt=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],ke=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Le=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ne=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Wt=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=e;return ge({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Et,b)},Pt=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${he.scrollButtons}`]:t.scrollButtons},{[`& .${he.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${he.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),Nt=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})(({ownerState:e})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),kt=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})(({ownerState:e})=>p({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Lt=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),Ft=X(Ct)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Fe={},ye=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTabs"}),n=it(),a=De(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:T,orientation:x="horizontal",ScrollButtonComponent:D=Rt,scrollButtons:R="auto",selectionFollowsFocus:ie,slots:_={},slotProps:V={},TabIndicatorProps:q={},TabScrollButtonProps:$={},textColor:ee="primary",value:U,variant:E="standard",visibleScrollbar:ce=!1}=s,Ke=ae(s,zt),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",te=C?"top":"left",oe=C?"bottom":"right",de=C?"clientHeight":"clientWidth",J=C?"height":"width",H=p({},s,{component:m,allowScrollButtonsMobile:w,indicatorColor:j,orientation:x,vertical:C,scrollButtons:R,textColor:ee,variant:E,visibleScrollbar:ce,fixed:!M,hideScrollbar:M&&!ce,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!w}),P=Wt(H),Ye=se({elementType:_.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:H}),Ve=se({elementType:_.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:H}),[Ce,Ge]=d.useState(!1),[A,Be]=d.useState(Fe),[we,Je]=d.useState(!1),[Te,Qe]=d.useState(!1),[Me,Ze]=d.useState(!1),[Ie,et]=d.useState({overflow:"hidden",scrollbarWidth:0}),Re=new Map,z=d.useRef(null),O=d.useRef(null),Ee=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ut(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=O.current.children;if(i.length>0){const f=i[Re.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},Q=fe(()=>{const{tabsMeta:o,tabMeta:r}=Ee();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[J]:r?r[J]:0};if(isNaN(A[i])||isNaN(A[J]))Be(f);else{const S=Math.abs(A[i]-f[i]),I=Math.abs(A[J]-f[J]);(S>=1||I>=1)&&Be(f)}}),ue=(o,{animation:r=!0}={})=>{r?gt(G,z.current,o,{duration:n.transitions.duration.standard}):z.current[G]=o},ze=o=>{let r=z.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_e()==="reverse"?-1:1),ue(r)},We=()=>{const o=z.current[de];let r=0;const c=Array.from(O.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[de]>o){i===0&&(r=o);break}r+=f[de]}return r},tt=()=>{ze(-1*We())},ot=()=>{ze(We())},lt=d.useCallback(o=>{et({overflow:null,scrollbarWidth:o})},[]),rt=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Ft,{onChange:lt,className:L(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(R==="auto"&&(we||Te)||R===!0);return o.scrollButtonStart=c?u.jsx(D,p({slots:{StartScrollButtonIcon:_.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ye},orientation:x,direction:a?"right":"left",onClick:tt,disabled:!we},$,{className:L(P.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?u.jsx(D,p({slots:{EndScrollButtonIcon:_.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ve},orientation:x,direction:a?"left":"right",onClick:ot,disabled:!Te},$,{className:L(P.scrollButtons,$.className)})):null,o},Pe=fe(o=>{const{tabsMeta:r,tabMeta:c}=Ee();if(!(!c||!r)){if(c[te]<r[te]){const i=r[G]+(c[te]-r[te]);ue(i,{animation:o})}else if(c[oe]>r[oe]){const i=r[G]+(c[oe]-r[oe]);ue(i,{animation:o})}}}),le=fe(()=>{M&&R!==!1&&Ze(!Me)});d.useEffect(()=>{const o=Oe(()=>{z.current&&Q()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var N;(N=r)==null||N.unobserve(Z)}),I.addedNodes.forEach(Z=>{var N;(N=r)==null||N.observe(Z)})}),o(),le()},i=Xe(z.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(O.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(O.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[Q,le]),d.useEffect(()=>{const o=Array.from(O.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&R!==!1){const c=o[0],i=o[r-1],f={root:z.current,threshold:.99},S=pe=>{Je(!pe[0].isIntersecting)},I=new IntersectionObserver(S,f);I.observe(c);const Z=pe=>{Qe(!pe[0].isIntersecting)},N=new IntersectionObserver(Z,f);return N.observe(i),()=>{I.disconnect(),N.disconnect()}}},[M,R,Me,B==null?void 0:B.length]),d.useEffect(()=>{Ge(!0)},[]),d.useEffect(()=>{Q()}),d.useEffect(()=>{Pe(Fe!==A)},[Pe,A]),d.useImperativeHandle(b,()=>({updateIndicator:Q,updateScrollButtons:le}),[Q,le]);const Ne=u.jsx(Lt,p({},q,{className:L(P.indicator,q.className),ownerState:H,style:p({},A,q.style)}));let re=0;const nt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?re:o.props.value;Re.set(r,re);const c=r===U;return re+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ce&&Ne,selected:c,selectionFollowsFocus:ie,onChange:T,textColor:ee,value:r},re===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),st=o=>{const r=O.current,c=ct(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ne(r,c,Le);break;case S:o.preventDefault(),ne(r,c,ke);break;case"Home":o.preventDefault(),ne(r,null,ke);break;case"End":o.preventDefault(),ne(r,null,Le);break}},be=rt();return u.jsxs(Pt,p({className:L(P.root,y),ownerState:H,ref:l,as:m},Ke,{children:[be.scrollButtonStart,be.scrollbarSizeListener,u.jsxs(Nt,{className:P.scroller,ownerState:H,style:{overflow:Ie.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ce?void 0:-Ie.scrollbarWidth},ref:z,children:[u.jsx(kt,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:H,onKeyDown:st,ref:O,role:"tablist",children:nt}),Ce&&Ne]}),be.scrollButtonEnd]}))}),je="index",Y={tabs:`${je}-tabs`,tab:`${je}-tab`},jt=dt(ye)(({theme:e})=>({[`& .${Y.tabs}`]:{},[`& .${Y.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function qe({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:F.backgroundsBgComponent,padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:F.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:F.lineBorderBase,color:F.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qe.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function Ue({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:F.strokeBorderStrong,bottom:0}},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:F.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:F.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:F.foregroundsFgBase},...s.sx},children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}Ue.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function $t({tabs:e,current:t,onChange:l,...s}){return s.variant==="card"?u.jsx(qe,{...s,tabs:e,current:t,onChange:l}):s.variant==="line"?u.jsx(Ue,{...s,tabs:e,current:t,onChange:l}):u.jsx(jt,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[Y.tabs,s.className||""].join(" "),children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}$t.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};export{mt as K,$t as T,vt as a,ye as b,xe as c,_e as d,ut as g};
1
+ import{aE as ve,aF as me,aG as X,cR as $e,aH as He,aK as p,r as d,aI as Se,aJ as ae,aM as L,j as u,aN as ge,at as Ae,cM as at,cS as Oe,cT as Xe,cU as De,aL as se,aj as it,cV as fe,cW as ct,bt as dt,bE as F,P as W}from"./index-BXfEXarc.js";let K;function _e(){if(K)return K;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),K="reverse",e.scrollLeft>0?K="default":(e.scrollLeft=1,e.scrollLeft===0&&(K="negative")),document.body.removeChild(e),K}function ut(e,t){const l=e.scrollLeft;if(t!=="rtl")return l;switch(_e()){case"negative":return e.scrollWidth-e.clientWidth+l;case"reverse":return e.scrollWidth-e.clientWidth-l;default:return l}}function bt(e){return me("MuiTab",e)}const k=ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),pt=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ft=e=>{const{classes:t,textColor:l,fullWidth:s,wrapped:n,icon:a,label:v,selected:h,disabled:b}=e,g={root:["root",a&&v&&"labelIcon",`textColor${He(l)}`,s&&"fullWidth",n&&"wrapped",h&&"selected",b&&"disabled"],iconWrapper:["iconWrapper"]};return ge(g,bt,t)},ht=X($e,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.label&&l.icon&&t.labelIcon,t[`textColor${He(l.textColor)}`],l.fullWidth&&t.fullWidth,l.wrapped&&t.wrapped,{[`& .${k.iconWrapper}`]:t.iconWrapper}]}})(({theme:e,ownerState:t})=>p({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${k.iconWrapper}`]:p({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${k.selected}`]:{opacity:1},[`&.${k.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${k.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${k.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${k.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${k.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),xe=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTab"}),{className:n,disabled:a=!1,disableFocusRipple:v=!1,fullWidth:h,icon:b,iconPosition:g="top",indicator:B,label:y,onChange:m,onClick:w,onFocus:j,selected:T,selectionFollowsFocus:x,textColor:D="inherit",value:R,wrapped:ie=!1}=s,_=ae(s,pt),V=p({},s,{disabled:a,disableFocusRipple:v,selected:T,icon:!!b,iconPosition:g,label:!!y,fullWidth:h,textColor:D,wrapped:ie}),q=ft(V),$=b&&y&&d.isValidElement(b)?d.cloneElement(b,{className:L(q.iconWrapper,b.props.className)}):b,ee=E=>{!T&&m&&m(E,R),w&&w(E)},U=E=>{x&&!T&&m&&m(E,R),j&&j(E)};return u.jsxs(ht,p({focusRipple:!v,className:L(q.root,n),ref:l,role:"tab","aria-selected":T,disabled:a,onClick:ee,onFocus:U,ownerState:V,tabIndex:T?0:-1},_,{children:[g==="top"||g==="start"?u.jsxs(d.Fragment,{children:[$,y]}):u.jsxs(d.Fragment,{children:[y,$]}),B]}))}),vt=Ae(u.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),mt=Ae(u.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function St(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function gt(e,t,l,s={},n=()=>{}){const{ease:a=St,duration:v=300}=s;let h=null;const b=t[e];let g=!1;const B=()=>{g=!0},y=m=>{if(g){n(new Error("Animation cancelled"));return}h===null&&(h=m);const w=Math.min(1,(m-h)/v);if(t[e]=a(w)*(l-b)+b,w>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return b===l?(n(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const xt=["onChange"],yt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Ct(e){const{onChange:t}=e,l=ae(e,xt),s=d.useRef(),n=d.useRef(null),a=()=>{s.current=n.current.offsetHeight-n.current.clientHeight};return at(()=>{const v=Oe(()=>{const b=s.current;a(),b!==s.current&&t(s.current)}),h=Xe(n.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[t]),d.useEffect(()=>{a(),t(s.current)},[t]),u.jsx("div",p({style:yt,ref:n},l))}function Bt(e){return me("MuiTabScrollButton",e)}const wt=ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Tt=["className","slots","slotProps","direction","orientation","disabled"],Mt=e=>{const{classes:t,orientation:l,disabled:s}=e;return ge({root:["root",l,s&&"disabled"]},Bt,t)},It=X($e,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.orientation&&t[l.orientation]]}})(({ownerState:e})=>p({width:40,flexShrink:0,opacity:.8,[`&.${wt.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),Rt=d.forwardRef(function(t,l){var s,n;const a=Se({props:t,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:b={},direction:g}=a,B=ae(a,Tt),y=De(),m=p({isRtl:y},a),w=Mt(m),j=(s=h.StartScrollButtonIcon)!=null?s:vt,T=(n=h.EndScrollButtonIcon)!=null?n:mt,x=se({elementType:j,externalSlotProps:b.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m}),D=se({elementType:T,externalSlotProps:b.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:m});return u.jsx(It,p({component:"div",className:L(w.root,v),ref:l,role:null,ownerState:m,tabIndex:null},B,{children:g==="left"?u.jsx(j,p({},x)):u.jsx(T,p({},D))}))});function Et(e){return me("MuiTabs",e)}const he=ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),zt=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],ke=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Le=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,ne=(e,t,l)=>{let s=!1,n=l(e,t);for(;n;){if(n===e.firstChild){if(s)return;s=!0}const a=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||a)n=l(e,n);else{n.focus();return}}},Wt=e=>{const{vertical:t,fixed:l,hideScrollbar:s,scrollableX:n,scrollableY:a,centered:v,scrollButtonsHideMobile:h,classes:b}=e;return ge({root:["root",t&&"vertical"],scroller:["scroller",l&&"fixed",s&&"hideScrollbar",n&&"scrollableX",a&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[s&&"hideScrollbar"]},Et,b)},Pt=X("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${he.scrollButtons}`]:t.scrollButtons},{[`& .${he.scrollButtons}`]:l.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,l.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>p({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${he.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),Nt=X("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.scroller,l.fixed&&t.fixed,l.hideScrollbar&&t.hideScrollbar,l.scrollableX&&t.scrollableX,l.scrollableY&&t.scrollableY]}})(({ownerState:e})=>p({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),kt=X("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.flexContainer,l.vertical&&t.flexContainerVertical,l.centered&&t.centered]}})(({ownerState:e})=>p({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Lt=X("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>p({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),Ft=X(Ct)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Fe={},ye=d.forwardRef(function(t,l){const s=Se({props:t,name:"MuiTabs"}),n=it(),a=De(),{"aria-label":v,"aria-labelledby":h,action:b,centered:g=!1,children:B,className:y,component:m="div",allowScrollButtonsMobile:w=!1,indicatorColor:j="primary",onChange:T,orientation:x="horizontal",ScrollButtonComponent:D=Rt,scrollButtons:R="auto",selectionFollowsFocus:ie,slots:_={},slotProps:V={},TabIndicatorProps:q={},TabScrollButtonProps:$={},textColor:ee="primary",value:U,variant:E="standard",visibleScrollbar:ce=!1}=s,Ke=ae(s,zt),M=E==="scrollable",C=x==="vertical",G=C?"scrollTop":"scrollLeft",te=C?"top":"left",oe=C?"bottom":"right",de=C?"clientHeight":"clientWidth",J=C?"height":"width",H=p({},s,{component:m,allowScrollButtonsMobile:w,indicatorColor:j,orientation:x,vertical:C,scrollButtons:R,textColor:ee,variant:E,visibleScrollbar:ce,fixed:!M,hideScrollbar:M&&!ce,scrollableX:M&&!C,scrollableY:M&&C,centered:g&&!M,scrollButtonsHideMobile:!w}),P=Wt(H),Ye=se({elementType:_.StartScrollButtonIcon,externalSlotProps:V.startScrollButtonIcon,ownerState:H}),Ve=se({elementType:_.EndScrollButtonIcon,externalSlotProps:V.endScrollButtonIcon,ownerState:H}),[Ce,Ge]=d.useState(!1),[A,Be]=d.useState(Fe),[we,Je]=d.useState(!1),[Te,Qe]=d.useState(!1),[Me,Ze]=d.useState(!1),[Ie,et]=d.useState({overflow:"hidden",scrollbarWidth:0}),Re=new Map,z=d.useRef(null),O=d.useRef(null),Ee=()=>{const o=z.current;let r;if(o){const i=o.getBoundingClientRect();r={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ut(o,a?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let c;if(o&&U!==!1){const i=O.current.children;if(i.length>0){const f=i[Re.get(U)];c=f?f.getBoundingClientRect():null}}return{tabsMeta:r,tabMeta:c}},Q=fe(()=>{const{tabsMeta:o,tabMeta:r}=Ee();let c=0,i;if(C)i="top",r&&o&&(c=r.top-o.top+o.scrollTop);else if(i=a?"right":"left",r&&o){const S=a?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;c=(a?-1:1)*(r[i]-o[i]+S)}const f={[i]:c,[J]:r?r[J]:0};if(isNaN(A[i])||isNaN(A[J]))Be(f);else{const S=Math.abs(A[i]-f[i]),I=Math.abs(A[J]-f[J]);(S>=1||I>=1)&&Be(f)}}),ue=(o,{animation:r=!0}={})=>{r?gt(G,z.current,o,{duration:n.transitions.duration.standard}):z.current[G]=o},ze=o=>{let r=z.current[G];C?r+=o:(r+=o*(a?-1:1),r*=a&&_e()==="reverse"?-1:1),ue(r)},We=()=>{const o=z.current[de];let r=0;const c=Array.from(O.current.children);for(let i=0;i<c.length;i+=1){const f=c[i];if(r+f[de]>o){i===0&&(r=o);break}r+=f[de]}return r},tt=()=>{ze(-1*We())},ot=()=>{ze(We())},lt=d.useCallback(o=>{et({overflow:null,scrollbarWidth:o})},[]),rt=()=>{const o={};o.scrollbarSizeListener=M?u.jsx(Ft,{onChange:lt,className:L(P.scrollableX,P.hideScrollbar)}):null;const c=M&&(R==="auto"&&(we||Te)||R===!0);return o.scrollButtonStart=c?u.jsx(D,p({slots:{StartScrollButtonIcon:_.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ye},orientation:x,direction:a?"right":"left",onClick:tt,disabled:!we},$,{className:L(P.scrollButtons,$.className)})):null,o.scrollButtonEnd=c?u.jsx(D,p({slots:{EndScrollButtonIcon:_.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ve},orientation:x,direction:a?"left":"right",onClick:ot,disabled:!Te},$,{className:L(P.scrollButtons,$.className)})):null,o},Pe=fe(o=>{const{tabsMeta:r,tabMeta:c}=Ee();if(!(!c||!r)){if(c[te]<r[te]){const i=r[G]+(c[te]-r[te]);ue(i,{animation:o})}else if(c[oe]>r[oe]){const i=r[G]+(c[oe]-r[oe]);ue(i,{animation:o})}}}),le=fe(()=>{M&&R!==!1&&Ze(!Me)});d.useEffect(()=>{const o=Oe(()=>{z.current&&Q()});let r;const c=S=>{S.forEach(I=>{I.removedNodes.forEach(Z=>{var N;(N=r)==null||N.unobserve(Z)}),I.addedNodes.forEach(Z=>{var N;(N=r)==null||N.observe(Z)})}),o(),le()},i=Xe(z.current);i.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(r=new ResizeObserver(o),Array.from(O.current.children).forEach(S=>{r.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(c),f.observe(O.current,{childList:!0})),()=>{var S,I;o.clear(),i.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(I=r)==null||I.disconnect()}},[Q,le]),d.useEffect(()=>{const o=Array.from(O.current.children),r=o.length;if(typeof IntersectionObserver<"u"&&r>0&&M&&R!==!1){const c=o[0],i=o[r-1],f={root:z.current,threshold:.99},S=pe=>{Je(!pe[0].isIntersecting)},I=new IntersectionObserver(S,f);I.observe(c);const Z=pe=>{Qe(!pe[0].isIntersecting)},N=new IntersectionObserver(Z,f);return N.observe(i),()=>{I.disconnect(),N.disconnect()}}},[M,R,Me,B==null?void 0:B.length]),d.useEffect(()=>{Ge(!0)},[]),d.useEffect(()=>{Q()}),d.useEffect(()=>{Pe(Fe!==A)},[Pe,A]),d.useImperativeHandle(b,()=>({updateIndicator:Q,updateScrollButtons:le}),[Q,le]);const Ne=u.jsx(Lt,p({},q,{className:L(P.indicator,q.className),ownerState:H,style:p({},A,q.style)}));let re=0;const nt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const r=o.props.value===void 0?re:o.props.value;Re.set(r,re);const c=r===U;return re+=1,d.cloneElement(o,p({fullWidth:E==="fullWidth",indicator:c&&!Ce&&Ne,selected:c,selectionFollowsFocus:ie,onChange:T,textColor:ee,value:r},re===1&&U===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),st=o=>{const r=O.current,c=ct(r).activeElement;if(c.getAttribute("role")!=="tab")return;let f=x==="horizontal"?"ArrowLeft":"ArrowUp",S=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&a&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ne(r,c,Le);break;case S:o.preventDefault(),ne(r,c,ke);break;case"Home":o.preventDefault(),ne(r,null,ke);break;case"End":o.preventDefault(),ne(r,null,Le);break}},be=rt();return u.jsxs(Pt,p({className:L(P.root,y),ownerState:H,ref:l,as:m},Ke,{children:[be.scrollButtonStart,be.scrollbarSizeListener,u.jsxs(Nt,{className:P.scroller,ownerState:H,style:{overflow:Ie.overflow,[C?`margin${a?"Left":"Right"}`:"marginBottom"]:ce?void 0:-Ie.scrollbarWidth},ref:z,children:[u.jsx(kt,{"aria-label":v,"aria-labelledby":h,"aria-orientation":x==="vertical"?"vertical":null,className:P.flexContainer,ownerState:H,onKeyDown:st,ref:O,role:"tablist",children:nt}),Ce&&Ne]}),be.scrollButtonEnd]}))}),je="index",Y={tabs:`${je}-tabs`,tab:`${je}-tab`},jt=dt(ye)(({theme:e})=>({[`& .${Y.tabs}`]:{},[`& .${Y.tab}`]:{fontSize:"0.875rem",[e.breakpoints.up("md")]:{fontSize:"1rem"}}}));function qe({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{borderRadius:"100vw"},".MuiTabs-flexContainer":{borderRadius:"100vw",backgroundColor:F.backgroundsBgComponent,padding:.5,display:"inline-flex",columnGap:.25,maxWidth:"100%",overflowX:"auto"},".MuiTab-root":{borderRadius:"100vw",border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,color:F.foregroundsFgSubtile,fontSize:"13px",fontWeight:"normal",textTransform:"capitalize",transition:"background-color 0.2s ease","&.Mui-selected, &:hover":{backgroundColor:"white",borderColor:F.lineBorderBase,color:F.foregroundsFgBase}},".MuiTabs-indicator":{display:"none"},...s.sx},children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}qe.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function Ue({tabs:e,current:t,onChange:l,...s}){return u.jsx(ye,{scrollButtons:"auto",value:t,onChange:(n,a)=>l(a),...s,variant:"scrollable",sx:{minHeight:"auto",".MuiTabs-scrollButtons.Mui-disabled":{opacity:.3,cursor:"not-allowed",pointerEvents:"auto"},".MuiTabs-scroller":{"&::after":{content:'""',display:"block",width:"100%",height:"1px",backgroundColor:F.strokeBorderStrong,bottom:0}},".MuiTabs-flexContainer":{display:"inline-flex",columnGap:2.5,px:0,pb:.5},".MuiTab-root":{border:"1px solid transparent",minHeight:"auto",lineHeight:1,py:1,px:0,color:F.foregroundsFgSubtile,fontSize:"14px",fontWeight:500,textTransform:"capitalize",minWidth:"auto","&.Mui-selected, &:hover":{color:F.foregroundsFgBase}},".MuiTabs-indicator":{height:"1px",backgroundColor:F.foregroundsFgBase},...s.sx},children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}Ue.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};function $t({tabs:e,current:t,onChange:l,...s}){return s.variant==="card"?u.jsx(qe,{...s,tabs:e,current:t,onChange:l}):s.variant==="line"?u.jsx(Ue,{...s,tabs:e,current:t,onChange:l}):u.jsx(jt,{scrollButtons:"auto",variant:"scrollable",value:t,onChange:(n,a)=>l(a),indicatorColor:"primary",...s,className:[Y.tabs,s.className||""].join(" "),children:e.map(n=>u.jsx(xe,{className:Y.tab,value:n.value,label:n.label,icon:n.icon||null},n.value))})}$t.propTypes={tabs:W.array.isRequired,current:W.string.isRequired,onChange:W.func.isRequired};export{mt as K,$t as T,vt as a,ye as b,xe as c,_e as d,ut as g};
@@ -1,3 +1,3 @@
1
- import{l as q}from"./lottie-78xwHgZN.js";import{r as D,eM as z}from"./index-C_CQlCa-.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,i,b=[],f=!0,A=!1;try{if(c=(r=r.call(t)).next,e!==0)for(;!(f=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);f=!0);}catch(g){A=!0,u=g}finally{try{if(!f&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{l as q}from"./lottie-AeAuO2MQ.js";import{r as D,eM as z}from"./index-BXfEXarc.js";function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,u,c,i,b=[],f=!0,A=!1;try{if(c=(r=r.call(t)).next,e!==0)for(;!(f=(n=c.call(r)).done)&&(b.push(n.value),b.length!==e);f=!0);}catch(g){A=!0,u=g}finally{try{if(!f&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(A)throw u}}return b}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E(Object(r),!0).forEach(function(n){J(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function J(t,e,r){return e=ae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){if(t==null)return{};var r={},n=Object.keys(t),u,c;for(c=0;c<n.length;c++)u=n[c],!(e.indexOf(u)>=0)&&(r[u]=t[u]);return r}function x(t,e){if(t==null)return{};var r=Q(t,e),n,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(u=0;u<c.length;u++)n=c[u],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Z(t,e){return ee(t)||G(t,e)||te(t,e)||ne()}function ee(t){if(Array.isArray(t))return t}function te(t,e){if(t){if(typeof t=="string")return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}}function j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function re(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(t){var e=re(t,"string");return typeof e=="symbol"?e:String(e)}var oe=["animationData","loop","autoplay","initialSegment","onComplete","onLoopComplete","onEnterFrame","onSegmentStart","onConfigReady","onDataReady","onDataFailed","onLoadedImages","onDOMLoaded","onDestroy","lottieRef","renderer","name","assetsPath","rendererSettings"],ie=function(e,r){var n=e.animationData,u=e.loop,c=e.autoplay,i=e.initialSegment,b=e.onComplete,f=e.onLoopComplete,A=e.onEnterFrame,g=e.onSegmentStart,O=e.onConfigReady,w=e.onDataReady,h=e.onDataFailed,l=e.onLoadedImages,L=e.onDOMLoaded,S=e.onDestroy;e.lottieRef,e.renderer,e.name,e.assetsPath,e.rendererSettings;var p=x(e,oe),P=D.useState(!1),s=Z(P,2),C=s[0],_=s[1],o=D.useRef(),v=D.useRef(null),M=function(){var a;(a=o.current)===null||a===void 0||a.play()},H=function(){var a;(a=o.current)===null||a===void 0||a.stop()},F=function(){var a;(a=o.current)===null||a===void 0||a.pause()},V=function(a){var d;(d=o.current)===null||d===void 0||d.setSpeed(a)},N=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndPlay(a,d)},B=function(a,d){var m;(m=o.current)===null||m===void 0||m.goToAndStop(a,d)},$=function(a){var d;(d=o.current)===null||d===void 0||d.setDirection(a)},k=function(a,d){var m;(m=o.current)===null||m===void 0||m.playSegments(a,d)},W=function(a){var d;(d=o.current)===null||d===void 0||d.setSubframe(a)},K=function(a){var d;return(d=o.current)===null||d===void 0?void 0:d.getDuration(a)},U=function(){var a;(a=o.current)===null||a===void 0||a.destroy(),o.current=void 0},X=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d;if(v.current){(d=o.current)===null||d===void 0||d.destroy();var m=I(I(I({},e),a),{},{container:v.current});return o.current=q.loadAnimation(m),_(!!o.current),function(){var R;(R=o.current)===null||R===void 0||R.destroy(),o.current=void 0}}};D.useEffect(function(){var y=X();return function(){return y==null?void 0:y()}},[n,u]),D.useEffect(function(){o.current&&(o.current.autoplay=!!c)},[c]),D.useEffect(function(){if(o.current){if(!i){o.current.resetSegments(!0);return}!Array.isArray(i)||!i.length||((o.current.currentRawFrame<i[0]||o.current.currentRawFrame>i[1])&&(o.current.currentRawFrame=i[0]),o.current.setSegment(i[0],i[1]))}},[i]),D.useEffect(function(){var y=[{name:"complete",handler:b},{name:"loopComplete",handler:f},{name:"enterFrame",handler:A},{name:"segmentStart",handler:g},{name:"config_ready",handler:O},{name:"data_ready",handler:w},{name:"data_failed",handler:h},{name:"loaded_images",handler:l},{name:"DOMLoaded",handler:L},{name:"destroy",handler:S}],a=y.filter(function(m){return m.handler!=null});if(a.length){var d=a.map(function(m){var R;return(R=o.current)===null||R===void 0||R.addEventListener(m.name,m.handler),function(){var T;(T=o.current)===null||T===void 0||T.removeEventListener(m.name,m.handler)}});return function(){d.forEach(function(m){return m()})}}},[b,f,A,g,O,w,h,l,L,S]);var Y=z.createElement("div",I({style:r,ref:v},p));return{View:Y,play:M,stop:H,pause:F,setSpeed:V,goToAndStop:B,goToAndPlay:N,setDirection:$,playSegments:k,setSubframe:W,getDuration:K,destroy:U,animationContainerRef:v,animationLoaded:C,animationItem:o.current}};function ue(t){var e=t.getBoundingClientRect(),r=e.top,n=e.height,u=window.innerHeight-r,c=window.innerHeight+n;return u/c}function le(t,e,r){var n=t.getBoundingClientRect(),u=n.top,c=n.left,i=n.width,b=n.height,f=(e-c)/i,A=(r-u)/b;return{x:f,y:A}}var se=function(e){var r=e.wrapperRef,n=e.animationItem,u=e.mode,c=e.actions;D.useEffect(function(){var i=r.current;if(!(!i||!n||!c.length)){n.stop();var b=function(){var g=null,O=function(){var h=ue(i),l=c.find(function(S){var p=S.visibility;return p&&h>=p[0]&&h<=p[1]});if(l){if(l.type==="seek"&&l.visibility&&l.frames.length===2){var L=l.frames[0]+Math.ceil((h-l.visibility[0])/(l.visibility[1]-l.visibility[0])*l.frames[1]);//! goToAndStop must be relative to the start of the current segment
3
3
  n.goToAndStop(L-n.firstFrame-1,!0)}l.type==="loop"&&(g===null||g!==l.frames||n.isPaused)&&(n.playSegments(l.frames,!0),g=l.frames),l.type==="play"&&n.isPaused&&(n.resetSegments(!0),n.play()),l.type==="stop"&&n.goToAndStop(l.frames[0]-n.firstFrame-1,!0)}};return document.addEventListener("scroll",O),function(){document.removeEventListener("scroll",O)}},f=function(){var g=function(l,L){var S=l,p=L;if(S!==-1&&p!==-1){var P=le(i,S,p);S=P.x,p=P.y}var s=c.find(function(o){var v=o.position;return v&&Array.isArray(v.x)&&Array.isArray(v.y)?S>=v.x[0]&&S<=v.x[1]&&p>=v.y[0]&&p<=v.y[1]:v&&!Number.isNaN(v.x)&&!Number.isNaN(v.y)?S===v.x&&p===v.y:!1});if(s){if(s.type==="seek"&&s.position&&Array.isArray(s.position.x)&&Array.isArray(s.position.y)&&s.frames.length===2){var C=(S-s.position.x[0])/(s.position.x[1]-s.position.x[0]),_=(p-s.position.y[0])/(s.position.y[1]-s.position.y[0]);n.playSegments(s.frames,!0),n.goToAndStop(Math.ceil((C+_)/2*(s.frames[1]-s.frames[0])),!0)}s.type==="loop"&&n.playSegments(s.frames,!0),s.type==="play"&&(n.isPaused&&n.resetSegments(!1),n.playSegments(s.frames)),s.type==="stop"&&n.goToAndStop(s.frames[0],!0)}},O=function(l){g(l.clientX,l.clientY)},w=function(){g(-1,-1)};return i.addEventListener("mousemove",O),i.addEventListener("mouseout",w),function(){i.removeEventListener("mousemove",O),i.removeEventListener("mouseout",w)}};switch(u){case"scroll":return b();case"cursor":return f()}}},[u,n])},de=function(e){var r=e.actions,n=e.mode,u=e.lottieObj,c=u.animationItem,i=u.View,b=u.animationContainerRef;return se({actions:r,animationItem:c,mode:n,wrapperRef:b}),i},fe=["style","interactivity"],ve=function(e){var r,n,u,c=e.style,i=e.interactivity,b=x(e,fe),f=ie(b,c),A=f.View,g=f.play,O=f.stop,w=f.pause,h=f.setSpeed,l=f.goToAndStop,L=f.goToAndPlay,S=f.setDirection,p=f.playSegments,P=f.setSubframe,s=f.getDuration,C=f.destroy,_=f.animationContainerRef,o=f.animationLoaded,v=f.animationItem;return D.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:g,stop:O,pause:w,setSpeed:h,goToAndPlay:L,goToAndStop:l,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v})},[(r=e.lottieRef)===null||r===void 0?void 0:r.current]),de({lottieObj:{View:A,play:g,stop:O,pause:w,setSpeed:h,goToAndStop:l,goToAndPlay:L,setDirection:S,playSegments:p,setSubframe:P,getDuration:s,destroy:C,animationContainerRef:_,animationLoaded:o,animationItem:v},actions:(n=i==null?void 0:i.actions)!==null&&n!==void 0?n:[],mode:(u=i==null?void 0:i.mode)!==null&&u!==void 0?u:"scroll"})};export{q as LottiePlayer,ve as default,ie as useLottie,de as useLottieInteractivity};
@@ -1,4 +1,4 @@
1
- import{at as T,j as s,P as r,Z as f,r as m,a0 as D,au as $,u as j,N as H,m as U,l as P,c as q,o as F,p as M,av as E,aw as S,ax as N,A as O,B as L,O as B,n as V,R as W}from"./index-C_CQlCa-.js";import{N as X}from"./index-ChfVfT98.js";import{C as z}from"./index-BdB83jqq.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as Y}from"./session-CR_tYSIR.js";import{b as Z}from"./sdk-BrMczAlL.js";import{d as G}from"./CheckCircle-DttNFZFt.js";import{w as K}from"./wrap-locale-Dun6mFZ0.js";const Q=T(s.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}),"Inbox");function b({invitation:e,createPassportSvg:a,passportColor:c}){const[p,o]=m.useState(!1),{t}=m.useContext(D),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c}),[e,l]),x=m.useCallback(()=>{o(!0)},[]),i=m.useCallback(()=>{o(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(X,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx($,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:i,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(n=>s.jsx("li",{style:{listStyle:"circle"},children:n.description},n.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(Q,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};b.defaultProps={passportColor:"auto"};const ee=f.div`
1
+ import{at as T,j as s,P as r,Z as f,r as m,a0 as D,au as $,u as j,N as H,m as U,l as P,c as q,o as F,p as M,av as E,aw as S,ax as N,A as O,B as L,O as B,n as V,R as W}from"./index-BXfEXarc.js";import{N as X}from"./index-CrwNbpvE.js";import{C as z}from"./index-C5OdroAa.js";import{u as J}from"./use-passport-id-B-b-_oYF.js";import{u as Y}from"./session-C7vFWF9o.js";import{b as Z}from"./sdk-De7qEvqq.js";import{d as G}from"./CheckCircle-Dnb1dYCF.js";import{w as K}from"./wrap-locale-fQx_G_1w.js";const Q=T(s.jsx("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2m0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19z"}),"Inbox");function b({invitation:e,createPassportSvg:a,passportColor:c}){const[p,o]=m.useState(!1),{t}=m.useContext(D),l=m.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),u=m.useMemo(()=>a({title:l,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c}),[e,l]),x=m.useCallback(()=>{o(!0)},[]),i=m.useCallback(()=>{o(!1)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"invite-passport__card",onClick:x,children:[!!e.display&&s.jsx(X,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&s.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:u}})]})}),s.jsx($,{open:p,title:t("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:i,children:e.role.permissions&&e.role.permissions.length>0?s.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(n=>s.jsx("li",{style:{listStyle:"circle"},children:n.description},n.name))}):s.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[s.jsx(Q,{style:{width:"30px",height:"30px"}}),s.jsx("div",{children:t("invite.emptyPermission")})]})})]})}b.propTypes={invitation:r.object.isRequired,createPassportSvg:r.func.isRequired,passportColor:r.string};b.defaultProps={passportColor:"auto"};const ee=f.div`
2
2
  display: flex;
3
3
  max-width: 350px;
4
4
  margin: 30px auto;
@@ -1,4 +1,4 @@
1
- import{e as w,d as x,u as f,r as g,a5 as u,l as I,j as i,H as S,Q as j,Z as k,v as E,x as P,y as R,G as T}from"./index-C_CQlCa-.js";import{I as F}from"./invitation-hncnOokv.js";import{F as C}from"./fullpage-3Em5ua3-.js";import"./index-ChfVfT98.js";import"./emotion-cache.browser.esm-Cb9YgVt4.js";import"./index-BdB83jqq.js";import"./use-passport-id-B-b-_oYF.js";import"./session-CR_tYSIR.js";import"./sdk-BrMczAlL.js";import"./CheckCircle-DttNFZFt.js";import"./wrap-locale-Dun6mFZ0.js";import"./Link-D_CsWAfW.js";function K(c){var r;const d=w(),{searchParams:o}=new URL(window.location.href),{api:p,session:m}=x(),{t:l}=f(),n=o.get("inviteId"),a=o.get("redirect"),h=g.useCallback(async()=>{const{data:t}=await u.get("invitation",{params:{inviteId:n}});return t},[n]),v=I(async(t,s=e=>e)=>{t&&(E(s(t.sessionToken)),P(s(t.refreshToken)),t.visitorId&&R(s(t.visitorId))),await m.refresh(),setTimeout(()=>{if(a){const e=decodeURIComponent(a);e.startsWith(T.WELLKNOWN_SERVICE_PATH_PREFIX)?d(e,{replace:!0}):window.location=e}else window.location=window.env.pathPrefix||"/"},50)});return i.jsxs(C,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(S,{children:i.jsx("title",{children:l("pageTitle.invite")})}),i.jsx(L,{className:"page-invite",children:i.jsx(F,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:j,onLoginSuccess:v,inService:!0})})]})}const L=k.div`
1
+ import{e as w,d as x,u as f,r as g,a5 as u,l as I,j as i,H as S,Q as j,Z as k,v as E,x as P,y as R,G as T}from"./index-BXfEXarc.js";import{I as F}from"./invitation-_z1Xj-DN.js";import{F as C}from"./fullpage-Dv48OHgB.js";import"./index-CrwNbpvE.js";import"./emotion-cache.browser.esm-DnONerVw.js";import"./index-C5OdroAa.js";import"./use-passport-id-B-b-_oYF.js";import"./session-C7vFWF9o.js";import"./sdk-De7qEvqq.js";import"./CheckCircle-Dnb1dYCF.js";import"./wrap-locale-fQx_G_1w.js";import"./Link-BMMtX5fH.js";function K(c){var r;const d=w(),{searchParams:o}=new URL(window.location.href),{api:p,session:m}=x(),{t:l}=f(),n=o.get("inviteId"),a=o.get("redirect"),h=g.useCallback(async()=>{const{data:t}=await u.get("invitation",{params:{inviteId:n}});return t},[n]),v=I(async(t,s=e=>e)=>{t&&(E(s(t.sessionToken)),P(s(t.refreshToken)),t.visitorId&&R(s(t.visitorId))),await m.refresh(),setTimeout(()=>{if(a){const e=decodeURIComponent(a);e.startsWith(T.WELLKNOWN_SERVICE_PATH_PREFIX)?d(e,{replace:!0}):window.location=e}else window.location=window.env.pathPrefix||"/"},50)});return i.jsxs(C,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(S,{children:i.jsx("title",{children:l("pageTitle.invite")})}),i.jsx(L,{className:"page-invite",children:i.jsx(F,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:j,onLoginSuccess:v,inService:!0})})]})}const L=k.div`
2
2
  width: 560px;
3
3
  max-width: 100%;
4
4
  height: 100%;
@@ -1 +1 @@
1
- import{b7 as B}from"./index-C_CQlCa-.js";var w={exports:{}},b={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;function d(l){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},d(l)}function s(l){var r=typeof l=="string"||l instanceof String;if(!r){var n=d(l);throw l===null?n="null":n==="object"&&(n=l.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}f.exports=t.default,f.exports.default=t.default})(b,b.exports);var h=b.exports,E={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var d=s(h);function s(n){return n&&n.__esModule?n:{default:n}}function l(n){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(n)}function r(n,e){(0,d.default)(n);var i,c;l(e)==="object"?(i=e.min||0,c=e.max):(i=arguments[1],c=arguments[2]);var u=encodeURI(n).split(/%..|./).length-1;return u>=i&&(typeof c>"u"||u<=c)}f.exports=t.default,f.exports.default=t.default})(E,E.exports);var W=E.exports,D={exports:{}},S={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;function d(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;for(var r in l)typeof s[r]>"u"&&(s[r]=l[r]);return s}f.exports=t.default,f.exports.default=t.default})(S,S.exports);var R=S.exports;(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var d=l(h),s=l(R);function l(e){return e&&e.__esModule?e:{default:e}}var r={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function n(e,i){(0,d.default)(e),i=(0,s.default)(i,r),i.allow_trailing_dot&&e[e.length-1]==="."&&(e=e.substring(0,e.length-1)),i.allow_wildcard===!0&&e.indexOf("*.")===0&&(e=e.substring(2));var c=e.split("."),u=c[c.length-1];return i.require_tld&&(c.length<2||!i.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(u)||/\s/.test(u))||!i.allow_numeric_tld&&/^\d+$/.test(u)?!1:c.every(function(_){return!(_.length>63&&!i.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(_)||/[\uff01-\uff5e]/.test(_)||/^-|-$/.test(_)||!i.allow_underscores&&/_/.test(_))})}f.exports=t.default,f.exports.default=t.default})(D,D.exports);var k=D.exports,P={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var d=s(h);function s(u){return u&&u.__esModule?u:{default:u}}var l="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",r="(".concat(l,"[.]){3}").concat(l),n=new RegExp("^".concat(r,"$")),e="(?:[0-9a-fA-F]{1,4})",i=new RegExp("^("+"(?:".concat(e,":){7}(?:").concat(e,"|:)|")+"(?:".concat(e,":){6}(?:").concat(r,"|:").concat(e,"|:)|")+"(?:".concat(e,":){5}(?::").concat(r,"|(:").concat(e,"){1,2}|:)|")+"(?:".concat(e,":){4}(?:(:").concat(e,"){0,1}:").concat(r,"|(:").concat(e,"){1,3}|:)|")+"(?:".concat(e,":){3}(?:(:").concat(e,"){0,2}:").concat(r,"|(:").concat(e,"){1,4}|:)|")+"(?:".concat(e,":){2}(?:(:").concat(e,"){0,3}:").concat(r,"|(:").concat(e,"){1,5}|:)|")+"(?:".concat(e,":){1}(?:(:").concat(e,"){0,4}:").concat(r,"|(:").concat(e,"){1,6}|:)|")+"(?::((?::".concat(e,"){0,5}:").concat(r,"|(?::").concat(e,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function c(u){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,d.default)(u),_=String(_),_?_==="4"?n.test(u):_==="6"?i.test(u):!1:c(u,4)||c(u,6)}f.exports=t.default,f.exports.default=t.default})(P,P.exports);var X=P.exports;(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=N;var d=e(h),s=e(W),l=e(k),r=e(X),n=e(R);function e(o){return o&&o.__esModule?o:{default:o}}var i={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},c=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,_=/^[a-z\d]+$/,U=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,z=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,C=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,L=254;function O(o){var a=o.replace(/^"(.+)"$/,"$1");if(!a.trim())return!1;var m=/[\.";<>]/.test(a);if(m){if(a===o)return!1;var x=a.split('"').length===a.split('\\"').length;if(!x)return!1}return!0}function N(o,a){if((0,d.default)(o),a=(0,n.default)(a,i),a.require_display_name||a.allow_display_name){var m=o.match(c);if(m){var x=m[1];if(o=o.replace(x,"").replace(/(^<|>$)/g,""),x.endsWith(" ")&&(x=x.slice(0,-1)),!O(x))return!1}else if(a.require_display_name)return!1}if(!a.ignore_max_length&&o.length>L)return!1;var $=o.split("@"),v=$.pop(),F=v.toLowerCase();if(a.host_blacklist.includes(F)||a.host_whitelist.length>0&&!a.host_whitelist.includes(F))return!1;var g=$.join("@");if(a.domain_specific_validation&&(F==="gmail.com"||F==="googlemail.com")){g=g.toLowerCase();var q=g.split("+")[0];if(!(0,s.default)(q.replace(/\./g,""),{min:6,max:30}))return!1;for(var A=q.split("."),p=0;p<A.length;p++)if(!_.test(A[p]))return!1}if(a.ignore_max_length===!1&&(!(0,s.default)(g,{max:64})||!(0,s.default)(v,{max:254})))return!1;if(!(0,l.default)(v,{require_tld:a.require_tld,ignore_max_length:a.ignore_max_length,allow_underscores:a.allow_underscores})){if(!a.allow_ip_domain)return!1;if(!(0,r.default)(v)){if(!v.startsWith("[")||!v.endsWith("]"))return!1;var M=v.slice(1,-1);if(M.length===0||!(0,r.default)(M))return!1}}if(g[0]==='"')return g=g.slice(1,g.length-1),a.allow_utf8_local_part?C.test(g):U.test(g);for(var Q=a.allow_utf8_local_part?z:u,I=g.split("."),y=0;y<I.length;y++)if(!Q.test(I[y]))return!1;return!(a.blacklisted_chars&&g.search(new RegExp("[".concat(a.blacklisted_chars,"]+"),"g"))!==-1)}f.exports=t.default,f.exports.default=t.default})(w,w.exports);var Z=w.exports;const H=B(Z);export{h as a,k as b,X as c,H as i,R as m};
1
+ import{b7 as B}from"./index-BXfEXarc.js";var w={exports:{}},b={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;function d(l){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},d(l)}function s(l){var r=typeof l=="string"||l instanceof String;if(!r){var n=d(l);throw l===null?n="null":n==="object"&&(n=l.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}f.exports=t.default,f.exports.default=t.default})(b,b.exports);var h=b.exports,E={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var d=s(h);function s(n){return n&&n.__esModule?n:{default:n}}function l(n){"@babel/helpers - typeof";return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(n)}function r(n,e){(0,d.default)(n);var i,c;l(e)==="object"?(i=e.min||0,c=e.max):(i=arguments[1],c=arguments[2]);var u=encodeURI(n).split(/%..|./).length-1;return u>=i&&(typeof c>"u"||u<=c)}f.exports=t.default,f.exports.default=t.default})(E,E.exports);var W=E.exports,D={exports:{}},S={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;function d(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;for(var r in l)typeof s[r]>"u"&&(s[r]=l[r]);return s}f.exports=t.default,f.exports.default=t.default})(S,S.exports);var R=S.exports;(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var d=l(h),s=l(R);function l(e){return e&&e.__esModule?e:{default:e}}var r={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function n(e,i){(0,d.default)(e),i=(0,s.default)(i,r),i.allow_trailing_dot&&e[e.length-1]==="."&&(e=e.substring(0,e.length-1)),i.allow_wildcard===!0&&e.indexOf("*.")===0&&(e=e.substring(2));var c=e.split("."),u=c[c.length-1];return i.require_tld&&(c.length<2||!i.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(u)||/\s/.test(u))||!i.allow_numeric_tld&&/^\d+$/.test(u)?!1:c.every(function(_){return!(_.length>63&&!i.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(_)||/[\uff01-\uff5e]/.test(_)||/^-|-$/.test(_)||!i.allow_underscores&&/_/.test(_))})}f.exports=t.default,f.exports.default=t.default})(D,D.exports);var k=D.exports,P={exports:{}};(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var d=s(h);function s(u){return u&&u.__esModule?u:{default:u}}var l="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",r="(".concat(l,"[.]){3}").concat(l),n=new RegExp("^".concat(r,"$")),e="(?:[0-9a-fA-F]{1,4})",i=new RegExp("^("+"(?:".concat(e,":){7}(?:").concat(e,"|:)|")+"(?:".concat(e,":){6}(?:").concat(r,"|:").concat(e,"|:)|")+"(?:".concat(e,":){5}(?::").concat(r,"|(:").concat(e,"){1,2}|:)|")+"(?:".concat(e,":){4}(?:(:").concat(e,"){0,1}:").concat(r,"|(:").concat(e,"){1,3}|:)|")+"(?:".concat(e,":){3}(?:(:").concat(e,"){0,2}:").concat(r,"|(:").concat(e,"){1,4}|:)|")+"(?:".concat(e,":){2}(?:(:").concat(e,"){0,3}:").concat(r,"|(:").concat(e,"){1,5}|:)|")+"(?:".concat(e,":){1}(?:(:").concat(e,"){0,4}:").concat(r,"|(:").concat(e,"){1,6}|:)|")+"(?::((?::".concat(e,"){0,5}:").concat(r,"|(?::").concat(e,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function c(u){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,d.default)(u),_=String(_),_?_==="4"?n.test(u):_==="6"?i.test(u):!1:c(u,4)||c(u,6)}f.exports=t.default,f.exports.default=t.default})(P,P.exports);var X=P.exports;(function(f,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=N;var d=e(h),s=e(W),l=e(k),r=e(X),n=e(R);function e(o){return o&&o.__esModule?o:{default:o}}var i={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},c=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,_=/^[a-z\d]+$/,U=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,z=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,C=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,L=254;function O(o){var a=o.replace(/^"(.+)"$/,"$1");if(!a.trim())return!1;var m=/[\.";<>]/.test(a);if(m){if(a===o)return!1;var x=a.split('"').length===a.split('\\"').length;if(!x)return!1}return!0}function N(o,a){if((0,d.default)(o),a=(0,n.default)(a,i),a.require_display_name||a.allow_display_name){var m=o.match(c);if(m){var x=m[1];if(o=o.replace(x,"").replace(/(^<|>$)/g,""),x.endsWith(" ")&&(x=x.slice(0,-1)),!O(x))return!1}else if(a.require_display_name)return!1}if(!a.ignore_max_length&&o.length>L)return!1;var $=o.split("@"),v=$.pop(),F=v.toLowerCase();if(a.host_blacklist.includes(F)||a.host_whitelist.length>0&&!a.host_whitelist.includes(F))return!1;var g=$.join("@");if(a.domain_specific_validation&&(F==="gmail.com"||F==="googlemail.com")){g=g.toLowerCase();var q=g.split("+")[0];if(!(0,s.default)(q.replace(/\./g,""),{min:6,max:30}))return!1;for(var A=q.split("."),p=0;p<A.length;p++)if(!_.test(A[p]))return!1}if(a.ignore_max_length===!1&&(!(0,s.default)(g,{max:64})||!(0,s.default)(v,{max:254})))return!1;if(!(0,l.default)(v,{require_tld:a.require_tld,ignore_max_length:a.ignore_max_length,allow_underscores:a.allow_underscores})){if(!a.allow_ip_domain)return!1;if(!(0,r.default)(v)){if(!v.startsWith("[")||!v.endsWith("]"))return!1;var M=v.slice(1,-1);if(M.length===0||!(0,r.default)(M))return!1}}if(g[0]==='"')return g=g.slice(1,g.length-1),a.allow_utf8_local_part?C.test(g):U.test(g);for(var Q=a.allow_utf8_local_part?z:u,I=g.split("."),y=0;y<I.length;y++)if(!Q.test(I[y]))return!1;return!(a.blacklisted_chars&&g.search(new RegExp("[".concat(a.blacklisted_chars,"]+"),"g"))!==-1)}f.exports=t.default,f.exports.default=t.default})(w,w.exports);var Z=w.exports;const H=B(Z);export{h as a,k as b,X as c,H as i,R as m};
@@ -1 +1 @@
1
- import{d as w,e as v,u as I,N as P,O as T,l as d,j as t,n as j,H as k,B as R,Q as S,v as E,x as F,y as C,G as L}from"./index-C_CQlCa-.js";import{I as N}from"./invitation-hncnOokv.js";import{F as W}from"./fullpage-3Em5ua3-.js";import"./index-ChfVfT98.js";import"./emotion-cache.browser.esm-Cb9YgVt4.js";import"./index-BdB83jqq.js";import"./use-passport-id-B-b-_oYF.js";import"./session-CR_tYSIR.js";import"./sdk-BrMczAlL.js";import"./CheckCircle-DttNFZFt.js";import"./wrap-locale-Dun6mFZ0.js";import"./Link-D_CsWAfW.js";function G(m){var p;const{searchParams:a}=new URL(window.location.href),{api:n,session:u}=w(),f=v(),{t:l}=I(),r=a.get("id"),c=a.get("redirect"),h=P({state:""}),e=T(async()=>{if(!r)return null;const{data:s}=await n.get("/api/invitation",{params:{inviteId:r,mode:"issue-passport"}});return s}),x=d(()=>{if(e.error)throw e.error;return e==null?void 0:e.data}),g=d(async(s,o=i=>i)=>{s&&(s.sessionToken&&E(o(s.sessionToken)),s.refreshToken&&F(o(s.refreshToken)),s.visitorId&&C(o(s.visitorId)),await u.refresh()),setTimeout(()=>{if(c){const i=decodeURIComponent(c);i.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?f(i,{replace:!0}):window.location=i}else window.location=window.env.pathPrefix||"/"},50)});return e.loading?t.jsx(j,{}):t.jsxs(W,{did:(p=window.blocklet)==null?void 0:p.appPid,children:[t.jsx(k,{children:t.jsx("title",{children:l("pageTitle.issuePassport")})}),t.jsx(R,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:t.jsx(N,{...m,action:"issue-passport",getDataFn:x,checkFn:n.get,createPassportSvg:S,onLoginSuccess:g,inService:!0,status:h.state})})]})}export{G as default};
1
+ import{d as w,e as v,u as I,N as P,O as T,l as d,j as t,n as j,H as k,B as R,Q as S,v as E,x as F,y as C,G as L}from"./index-BXfEXarc.js";import{I as N}from"./invitation-_z1Xj-DN.js";import{F as W}from"./fullpage-Dv48OHgB.js";import"./index-CrwNbpvE.js";import"./emotion-cache.browser.esm-DnONerVw.js";import"./index-C5OdroAa.js";import"./use-passport-id-B-b-_oYF.js";import"./session-C7vFWF9o.js";import"./sdk-De7qEvqq.js";import"./CheckCircle-Dnb1dYCF.js";import"./wrap-locale-fQx_G_1w.js";import"./Link-BMMtX5fH.js";function G(m){var p;const{searchParams:a}=new URL(window.location.href),{api:n,session:u}=w(),f=v(),{t:l}=I(),r=a.get("id"),c=a.get("redirect"),h=P({state:""}),e=T(async()=>{if(!r)return null;const{data:s}=await n.get("/api/invitation",{params:{inviteId:r,mode:"issue-passport"}});return s}),x=d(()=>{if(e.error)throw e.error;return e==null?void 0:e.data}),g=d(async(s,o=i=>i)=>{s&&(s.sessionToken&&E(o(s.sessionToken)),s.refreshToken&&F(o(s.refreshToken)),s.visitorId&&C(o(s.visitorId)),await u.refresh()),setTimeout(()=>{if(c){const i=decodeURIComponent(c);i.startsWith(L.WELLKNOWN_SERVICE_PATH_PREFIX)?f(i,{replace:!0}):window.location=i}else window.location=window.env.pathPrefix||"/"},50)});return e.loading?t.jsx(j,{}):t.jsxs(W,{did:(p=window.blocklet)==null?void 0:p.appPid,children:[t.jsx(k,{children:t.jsx("title",{children:l("pageTitle.issuePassport")})}),t.jsx(R,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:t.jsx(N,{...m,action:"issue-passport",getDataFn:x,checkFn:n.get,createPassportSvg:S,onLoginSuccess:g,inService:!0,status:h.state})})]})}export{G as default};
@@ -1 +1 @@
1
- import{fq as _e,aK as R,r as g,aJ as B,aH as F,dr as Z,eF as Ee,aM as ee,j as s,G as ae,aP as W,u as z,T as E,au as $e,a1 as te,n as q,fp as De,P as i,X as H,Y as V,aY as Ne,aj as Pe,b as D,t as $,aa as Ie,aR as Me,aT as ne,B as N,eT as ce,c as L,l as Le,eu as ze,a as qe}from"./index-C_CQlCa-.js";import{d as Oe}from"./Add-BbT7BiIn.js";import{L as Be,d as Ue}from"./MoreVert-vMGpcUpi.js";import{D as Ae}from"./DialogContentText-CGVxonSs.js";import{T as le}from"./TextField-DqidhRm4.js";import{A as de}from"./Alert-GYW4yXwi.js";import{f as O}from"./format-error-BBbxuciS.js";import{d as ue}from"./Launch-CBwpqgeT.js";import{d as Fe}from"./Done-CQYMvSV2.js";import{d as fe}from"./DeleteOutline-BMYl1P54.js";import{C as We}from"./click-to-copy-BQ6-W2tV.js";import{S as He}from"./shorten-label-Dbs8vIsp.js";import{u as Ve,C as pe}from"./confirm-Bj44433A.js";import{u as Ge}from"./session-CR_tYSIR.js";import{W as Je}from"./did-address-2wXzwKqQ.js";import{A as Ke}from"./Avatar-DPvi1dd4.js";import{B as se}from"./ButtonGroup-CV6xLD7o.js";import{f as Ye,j as Xe,a as Qe,c as Ze,d as et,b as tt,e as nt,g as st,h as rt}from"./jss-plugin-props-sort.esm-COgSgYwL.js";const ot=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function it(e={}){const{disableGlobal:r=!1,productionPrefix:n="jss",seed:t=""}=e,o=t===""?"":`${t}-`;let u=0;const d=()=>(u+=1,u);return(c,l)=>{const a=l.options.name;if(a&&a.indexOf("Mui")===0&&!l.options.link&&!r){if(ot.indexOf(c.key)!==-1)return`Mui-${c.key}`;const f=`${o}${a}-${c.key}`;return!l.options.theme[_e]||t!==""?f:`${f}-${d()}`}return`${o}${n}${d()}`}}function at(){return{plugins:[Ye(),Xe(),Qe(),Ze(),et(),typeof window>"u"?null:tt(),nt()]}}function me(e={}){const{baseClasses:r,newClasses:n,Component:t}=e;if(!n)return r;const o=R({},r);return Object.keys(n).forEach(u=>{n[u]&&(o[u]=`${r[u]} ${n[u]}`)}),o}const M={set:(e,r,n,t)=>{let o=e.get(r);o||(o=new Map,e.set(r,o)),o.set(n,t)},get:(e,r,n)=>{const t=e.get(r);return t?t.get(n):void 0},delete:(e,r,n)=>{e.get(r).delete(n)}},ct=st(at()),lt=it(),dt=new Map,ut={disableGeneration:!1,generateClassName:lt,jss:ct,sheetsCache:null,sheetsManager:dt,sheetsRegistry:null},ft=g.createContext(ut);let re=-1e9;function pt(){return re+=1,re}const mt=["variant"];function oe(e){return e.length===0}function ht(e){const{variant:r}=e,n=B(e,mt);let t=r||"";return Object.keys(n).sort().forEach(o=>{o==="color"?t+=oe(t)?e[o]:F(e[o]):t+=`${oe(t)?o:F(o)}${F(e[o].toString())}`}),t}const gt={};function xt(e){const r=typeof e=="function";return{create:(n,t)=>{let o;try{o=r?e(n):e}catch(l){throw l}if(!t||!n.components||!n.components[t]||!n.components[t].styleOverrides&&!n.components[t].variants)return o;const u=n.components[t].styleOverrides||{},d=n.components[t].variants||[],c=R({},o);return Object.keys(u).forEach(l=>{c[l]=Z(c[l]||{},u[l])}),d.forEach(l=>{const a=ht(l.props);c[a]=Z(c[a]||{},l.style)}),c},options:{}}}const vt=["name","classNamePrefix","Component","defaultTheme"];function yt({state:e,stylesOptions:r},n,t){if(r.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=me({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:t})),e.cacheClasses.value}function jt({state:e,theme:r,stylesOptions:n,stylesCreator:t,name:o},u){if(n.disableGeneration)return;let d=M.get(n.sheetsManager,t,r);d||(d={refs:0,staticSheet:null,dynamicStyles:null},M.set(n.sheetsManager,t,r,d));const c=R({},t.options,n,{theme:r,flip:typeof n.flip=="boolean"?n.flip:r.direction==="rtl"});c.generateId=c.serverGenerateClassName||c.generateClassName;const l=n.sheetsRegistry;if(d.refs===0){let a;n.sheetsCache&&(a=M.get(n.sheetsCache,t,r));const f=t.create(r,o);a||(a=n.jss.createStyleSheet(f,R({link:!1},c)),a.attach(),n.sheetsCache&&M.set(n.sheetsCache,t,r,a)),l&&l.add(a),d.staticSheet=a,d.dynamicStyles=rt(f)}if(d.dynamicStyles){const a=n.jss.createStyleSheet(d.dynamicStyles,R({link:!0},c));a.update(u),a.attach(),e.dynamicSheet=a,e.classes=me({baseClasses:d.staticSheet.classes,newClasses:a.classes}),l&&l.add(a)}else e.classes=d.staticSheet.classes;d.refs+=1}function St({state:e},r){e.dynamicSheet&&e.dynamicSheet.update(r)}function Ct({state:e,theme:r,stylesOptions:n,stylesCreator:t}){if(n.disableGeneration)return;const o=M.get(n.sheetsManager,t,r);o.refs-=1;const u=n.sheetsRegistry;o.refs===0&&(M.delete(n.sheetsManager,t,r),n.jss.removeStyleSheet(o.staticSheet),u&&u.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),u&&u.remove(e.dynamicSheet))}function bt(e,r){const n=g.useRef([]);let t;const o=g.useMemo(()=>({}),r);n.current!==o&&(n.current=o,t=e()),g.useEffect(()=>()=>{t&&t()},[o])}function G(e,r={}){const{name:n,classNamePrefix:t,Component:o,defaultTheme:u=gt}=r,d=B(r,vt),c=xt(e),l=n||t||"makeStyles";return c.options={index:pt(),name:n,meta:l,classNamePrefix:l},(f={})=>{const h=Ve()||u,v=R({},g.useContext(ft),d),S=g.useRef(),p=g.useRef();return bt(()=>{const C={name:n,state:{},stylesCreator:c,stylesOptions:v,theme:h};return jt(C,f),p.current=!1,S.current=C,()=>{Ct(C)}},[h,c]),g.useEffect(()=>{p.current&&St(S.current,f),p.current=!0}),yt(S.current,f.classes,o)}}const wt=["name"],Rt=["children","className","clone","component"];function kt(e,r){const n={};return Object.keys(e).forEach(t=>{r.indexOf(t)===-1&&(n[t]=e[t])}),n}function Tt(e){return(n,t={})=>{const{name:o}=t,u=B(t,wt);let d=o;const l=G(typeof n=="function"?h=>({root:v=>n(R({theme:h},v))}):{root:n},R({Component:e,name:o||e.displayName,classNamePrefix:d},u));let a;n.filterProps&&(a=n.filterProps,delete n.filterProps),n.propTypes&&(n.propTypes,delete n.propTypes);const f=g.forwardRef(function(v,S){const{children:p,className:y,clone:C,component:w}=v,j=B(v,Rt),m=l(v),b=ee(m.root,y);let k=j;if(a&&(k=kt(k,a)),C)return g.cloneElement(p,R({className:ee(p.props.className,b)},k));if(typeof p=="function")return p(R({className:b},k));const T=w||e;return s.jsx(T,R({ref:S,className:b},k,{children:p}))});return Ee(f,e),f}}const{NODE_MODES:ie}=ae,_t=({mode:e,previousMode:r}={})=>e===ie.SERVERLESS||r===ie.SERVERLESS;var Et={isInServerlessMode:_t};const $t=G(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function he({disabled:e,storeList:r,teamDid:n,onAdd:t,scope:o,hiddenChildren:u,open:d,onClose:c}){const{api:l}=W(),[a,f]=g.useState(!1),[h,v]=g.useState(!0),[S,p]=g.useState(!1),[y,C]=g.useState(""),[w,j]=g.useState(""),{t:m}=z(),b=$t(),k=async()=>{f(!0);try{const{decoded:x}=De(y,r);await l.addBlockletStore({input:{teamDid:n,url:x,scope:o}}),t(x),p(!1),c()}catch(x){const P=`${m("store.blockletRegistry.addFailed")} ${O(x)}`;j(P)}finally{f(!1)}},T=()=>{p(!1),c()};return s.jsxs(s.Fragment,{children:[!u&&s.jsxs(Be,{button:!0,disabled:e,className:b.addMenuItemRoot,onClick:()=>{p(!0)},children:[s.jsx(Oe,{font:!0}),s.jsx(E,{variant:"inherit",children:m("store.blockletRegistry.addRegistry")})]}),s.jsxs($e,{title:m("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:d||S,onClose:T,PaperProps:{style:{minHeight:"auto"}},actions:s.jsxs(s.Fragment,{children:[s.jsx(te,{onClick:x=>{x.stopPropagation(),T()},color:"inherit",children:m("common.cancel")}),s.jsxs(te,{onClick:x=>{x.stopPropagation(),k()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!y||h,variant:"contained",autoFocus:!0,children:[a&&s.jsx(q,{size:16}),m("common.confirm")]})]}),children:[s.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:s.jsx(Ae,{component:"div",children:s.jsx(E,{component:"div",children:s.jsx(le,{label:m("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:y,onChange:x=>{j(null);let P=!1;x.target.value.trim()||(P=!0),x.target.value.trim()||j(m("store.blockletRegistry.registryUrlEmpty")),C(x.target.value),v(P)},disabled:a,onKeyPress:x=>{x.key==="Enter"&&(x.preventDefault(),x.target.value.trim()?k():j(m("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!w&&s.jsx(de,{severity:"error",style:{width:"100%"},children:w})]})]})}he.propTypes={teamDid:i.string.isRequired,disabled:i.bool,storeList:i.array,onAdd:i.func,scope:i.string,hiddenChildren:i.bool,open:i.bool,onClose:i.func};he.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var J={},Dt=V;Object.defineProperty(J,"__esModule",{value:!0});var ge=J.default=void 0,Nt=Dt(H()),Pt=s;ge=J.default=(0,Nt.default)((0,Pt.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var K={},It=V;Object.defineProperty(K,"__esModule",{value:!0});var xe=K.default=void 0,Mt=It(H()),Lt=s;xe=K.default=(0,Mt.default)((0,Lt.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");function Y({title:e,description:r,confirmPlaceholder:n,cancel:t,confirm:o,params:u,onCancel:d,onConfirm:c,keyName:l}){const{t:a}=z(),f={title:()=>s.jsxs("div",{children:[e,s.jsx(He,{sx:{fontSize:"14px"},maxLength:64,children:` (${l})`})]}),description:(h,v)=>{const S=p=>{v({...p,__disableConfirm:p.__disableConfirm})};return s.jsxs("div",{children:[s.jsx(de,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),s.jsx("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:r}}),s.jsxs("div",{style:{marginBottom:24},children:[a("common.click"),":",s.jsx(We,{"data-cy":"click-copy",children:l})]}),s.jsx(E,{component:"div",children:s.jsx(le,{label:n,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:h.inputVal,onChange:p=>{S({...h,inputVal:p.target.value,__disableConfirm:l!==p.target.value})}})})]})},confirm:o,cancel:t,onConfirm:c,onCancel:d,params:{inputVal:"",__disableConfirm:!0,...u}};return s.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}Y.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};Y.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};function A({store:e,teamDid:r,onDelete:n,children:t,projectId:o="",scope:u=""}){const{api:d}=W(),{t:c}=z(),l=Ne(),[a,f]=g.useState(!1),[h,v]=g.useState(null),S=Pe(),p=()=>{f(!1),v(null)},y=async()=>{try{f(!0),await d.deleteBlockletStore({input:{teamDid:r,url:e.url,projectId:o,scope:u}}),await(l==null?void 0:l.actions.refreshBlocklet()),n&&typeof n=="function"&&n()}catch(j){$.error(`Remove Blocklet Store Error: ${O(j)}`)}finally{f(!1),v(null)}},C={keyName:e.url,title:c("store.blockletRegistry.deleteRegistry"),description:c("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:S.palette.error.main}),confirmPlaceholder:c("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:y,onCancel:p},w=j=>{e.protected||(j.stopPropagation(),v(C))};return s.jsxs(s.Fragment,{children:[t?s.jsx("span",{onClick:w,children:t}):s.jsx(D,{color:"primary",disabled:a,onClick:w,size:"small",children:s.jsx(fe,{sx:{zoom:.95}})}),h&&s.jsx(Y,{keyName:h.keyName,title:h.title,description:h.description,confirmPlaceholder:h.confirmPlaceholder,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}A.propTypes={children:i.node,teamDid:i.string.isRequired,store:i.object.isRequired,onDelete:i.func,projectId:i.string,scope:i.string};A.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var X={},zt=V;Object.defineProperty(X,"__esModule",{value:!0});var ve=X.default=void 0,qt=zt(H()),Ot=s;ve=X.default=(0,qt.default)((0,Ot.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const Bt=({store:e,userDid:r})=>{var t;const n=((t=window.blocklet)==null?void 0:t.tenantMode)!==Ie.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===r?!0:n?e.scope==="studio":!1};function Q({connectedStore:e,onDisconnect:r,onDelete:n,store:t,teamDid:o,projectId:u}){var j;const[d,c]=g.useState(null),l=!!d,{t:a}=z(),{session:f}=Ge(),[h,v]=g.useState(!1),S=m=>{if(m.stopPropagation(),e!=null&&e.developerDid){const b=ce.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${L(t.url,"developer/blocklets")}?__did-connect__=${b}`)}else window.open(`${L(t.url,"developer/blocklets")}`)},p=m=>{c(m.currentTarget)},y=()=>{c(null)},C=()=>{v(!1),r()},w=[{label:a("common.visitStore"),action:S,icon:ue},{label:a("common.disconnect"),action:()=>{y(),v(!0)},icon:ve,hidden:!e}];return s.jsxs(s.Fragment,{children:[s.jsx(D,{ref:d,color:"primary",onClick:p,size:"small",children:s.jsx(Ue,{sx:{zoom:.95}})}),s.jsxs(Me,{anchorEl:d,open:l,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[w.map(m=>m.hidden?null:s.jsxs(ne,{dense:!0,onClick:m.action,disabled:m.disabled,children:[m.icon&&s.jsx(m.icon,{color:"action",sx:{marginRight:1}}),s.jsx(N,{color:"action",children:m.label})]},m.label)),Bt({store:t,userDid:(j=f==null?void 0:f.user)==null?void 0:j.did})&&s.jsx(A,{store:t,onDelete:n,teamDid:o,projectId:u,scope:t.scope||"studio",children:s.jsxs(ne,{dense:!0,disabled:t.protected,children:[s.jsx(fe,{sx:{color:t.protected?"action":"error.main",marginRight:1}}),s.jsx(N,{color:t.protected?"action":"error.main",children:a("common.delete")})]})})]}),h&&s.jsx(pe,{displayError:!0,title:`${a("common.disconnect")} ${t.name}`,description:a("blocklet.publish.disconnectStoreTip"),confirm:a("common.confirm"),onConfirm:C,onCancel:()=>v(!1)})]})}Q.propTypes={connectedStore:i.object.isRequired,onDisconnect:i.func,onDelete:i.func,store:i.object.isRequired,teamDid:i.string.isRequired,projectId:i.string};Q.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function Ut({messageType:e,onOpen:r,onClose:n}){const t=g.useRef(null),o=g.useRef(null),u=async c=>{setTimeout(()=>{try{n==null||n()}catch{}},10*1e3),t.current&&(clearInterval(o.current),t.current.close());const l=Math.random().toString(36).slice(2);t.current=window.open(`${ae.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${l}`,"_blank"),r==null||r(t.current),o.current=setInterval(()=>{(!t.current||t.current.closed)&&(t.current=null,clearInterval(o.current),setTimeout(()=>{n==null||n()},1100))},200),await Promise.resolve(c(t.current,a=>{if(!t.current){localStorage.setItem(`open-window-url-${l}`,JSON.stringify({url:a,time:Date.now()}));return}t.current.location.href=a}))},d=Le(c=>{const{type:l,error:a}=c.data;t.current&&l===e&&a&&($.error(a),n==null||n())});return g.useEffect(()=>(window.addEventListener("message",d),()=>{window.removeEventListener("message",d)}),[d]),u}function U({connectedStore:e,sx:r,...n}){return s.jsx(Ke,{sx:{width:24,height:24,...r},src:L(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...n})}U.propTypes={connectedStore:i.object.isRequired,sx:i.object};U.defaultProps={sx:{}};function ye({storeUrl:e,storeName:r,developerDid:n,published:t}){const{t:o}=z(),u=()=>{if(n){const d=ce.from(JSON.stringify({forceConnected:n}),"utf8").toString("base64");window.open(`${L(e,"developer/blocklets")}?__did-connect__=${d}`)}else window.open(`${L(e,"developer/blocklets")}`)};return s.jsxs(N,{children:[s.jsx(E,{variant:"subtitle2",children:o(t?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:r})}),s.jsx(D,{size:"small",sx:{mt:1},onClick:u,variant:"contained",color:"success",children:o("common.visitTarget",{name:r})})]})}ye.propTypes={storeName:i.string.isRequired,storeUrl:i.string.isRequired,developerDid:i.string.isRequired,published:i.bool.isRequired};const je={CONNECT:"connect",SELECT:"select"},At=G(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),Ft=Tt(({className:e,...r})=>s.jsx(qe,{...r,classes:{popper:e}}))(({theme:e})=>({[`& .${ze.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Se({teamDid:e,projectId:r,releaseId:n,store:t,onDelete:o,kind:u,published:d,connectedStore:c,releaseType:l,onPublish:a,onOpenConnectStore:f,onSelectConnectStore:h,behavior:v,scope:S=""}){const p=At(),{t:y}=z(),{api:C,info:w,inService:j}=W(),[m,b]=g.useState(!1),k=Ut({messageType:"connect-store-message",onOpen:()=>b(!0),onClose:()=>b(!1)}),T=u==="publish",x=!!c,P=_=>{if(_.stopPropagation(),T){window.open(L(t.url,"developer/blocklets"));return}window.open(t.url)},Ce=()=>{if(v===je.SELECT){h(t);return}k(async(_,ke)=>{try{const I=await C.connectToStore({input:{did:e,storeUrl:t.url,storeId:t.id,storeName:t.name,projectId:r}});if(!(I!=null&&I.url)){$.error("failed to connect to store");return}ke(I.url),await f({did:e,projectId:r,storeId:t.id}),b(!1)}catch(I){const Te=O(I);$.error(Te),b(!1)}})},be=async()=>{try{await C.disconnectFromStore({input:{did:e,storeId:t.id,projectId:r,storeScope:S}}),o()}catch(_){$.error(O(_))}},we=()=>{b(!0),C.publishToStore({input:{did:e,storeId:t.id,storeName:t.name,projectId:r,releaseId:n,type:l}}).then(_=>{$.success(s.jsx(ye,{storeName:c.storeName,storeUrl:c.storeUrl,developerDid:c.developerDid,published:_.url==="published"}),{duration:1e4}),a==null||a(null)}).catch(_=>{$.error(O(_)),a==null||a(_)}).finally(()=>{b(!1)})};g.useEffect(()=>{x&&b(!1)},[x]);const Re=g.useMemo(()=>!(j&&Et.isInServerlessMode(w)),[j,w]);return s.jsxs("div",{className:p.box,children:[!T&&m&&s.jsx(q,{sx:{marginRight:2},size:16}),s.jsxs("div",{className:p.menuName,children:[s.jsx(N,{sx:{display:"flex",flexDirection:"row"},children:s.jsx(E,{component:"span",className:p.title,variant:"subtitle1",children:t.name})}),s.jsx(E,{className:p.url,component:"span",variant:"inherit",children:`${t.url}`})]}),s.jsxs("div",{className:p.actions,children:[c&&s.jsx(Ft,{placement:"top",title:s.jsxs(N,{children:[s.jsx(E,{component:"span",variant:"caption",sx:{opacity:.7},children:y("blocklet.publish.developerInfo")}),s.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[s.jsx(U,{connectedStore:c,sx:{width:42,height:42}}),s.jsxs(N,{sx:{flex:1},children:[s.jsx(E,{component:"span",variant:"subtitle1",children:c.developerName}),s.jsx(Je,{size:14,copyable:!0,compact:!0,responsive:!1,did:c.developerDid})]})]})]}),children:s.jsx("div",{children:s.jsx(U,{connectedStore:c,sx:{marginRight:1,cursor:"help"}})})}),T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:38},size:"small",children:[!x&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:Ce,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(ge,{sx:{marginRight:1}}),y("common.connect")]}),x&&d&&s.jsxs(D,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(Fe,{sx:{marginRight:1}}),y("common.uploaded")]}),x&&!d&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:we,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(xe,{sx:{marginRight:1,fontSize:20}}),y("common.upload")]}),s.jsx(Q,{projectId:r,connectedStore:c,store:t,onDelete:o,teamDid:e,onDisconnect:be})]}),!T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:36},size:"small",children:[s.jsx(D,{onClick:P,children:s.jsx(ue,{sx:{zoom:.9}})}),!t.protected&&Re&&s.jsx(A,{store:t,onDelete:o,teamDid:e,scope:""})]})]})]})}Se.propTypes={kind:i.string,teamDid:i.string.isRequired,published:i.bool,connectedStore:i.shape({storeName:i.string,storeId:i.string,storeUrl:i.string,developerDid:i.string,developerName:i.string}),projectId:i.string,releaseId:i.string,releaseType:i.string,store:i.shape({id:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,protected:i.bool,connected:i.bool}).isRequired,scope:i.string,onDelete:i.func,onPublish:i.func,onOpenConnectStore:i.func,behavior:i.string,onSelectConnectStore:i.func};Se.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:je.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{he as A,Y as C,Se as S,ye as U,Bt as c,G as m,Et as s,Ut as u};
1
+ import{fq as _e,aK as R,r as g,aJ as B,aH as F,dr as Z,eF as Ee,aM as ee,j as s,G as ae,aP as W,u as z,T as E,au as $e,a1 as te,n as q,fp as De,P as i,X as H,Y as V,aY as Ne,aj as Pe,b as D,t as $,aa as Ie,aR as Me,aT as ne,B as N,eT as ce,c as L,l as Le,eu as ze,a as qe}from"./index-BXfEXarc.js";import{d as Oe}from"./Add-w8WVX4Xk.js";import{L as Be,d as Ue}from"./MoreVert-BnSgpwk3.js";import{D as Ae}from"./DialogContentText-vfNBMZmk.js";import{T as le}from"./TextField-CQhkYpMM.js";import{A as de}from"./Alert-DBECv8Dk.js";import{f as O}from"./format-error-Cm24Mb6K.js";import{d as ue}from"./Launch-mty9jus0.js";import{d as Fe}from"./Done-CemlqiD_.js";import{d as fe}from"./DeleteOutline-Csn3uTIE.js";import{C as We}from"./click-to-copy-DptGmuUO.js";import{S as He}from"./shorten-label-DJCp0Yiv.js";import{u as Ve,C as pe}from"./confirm-C1rEM5YR.js";import{u as Ge}from"./session-C7vFWF9o.js";import{W as Je}from"./did-address-DwWl4S12.js";import{A as Ke}from"./Avatar-DxxyX-k_.js";import{B as se}from"./ButtonGroup-C6tThDqG.js";import{f as Ye,j as Xe,a as Qe,c as Ze,d as et,b as tt,e as nt,g as st,h as rt}from"./jss-plugin-props-sort.esm-DD0RfxgD.js";const ot=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function it(e={}){const{disableGlobal:r=!1,productionPrefix:n="jss",seed:t=""}=e,o=t===""?"":`${t}-`;let u=0;const d=()=>(u+=1,u);return(c,l)=>{const a=l.options.name;if(a&&a.indexOf("Mui")===0&&!l.options.link&&!r){if(ot.indexOf(c.key)!==-1)return`Mui-${c.key}`;const f=`${o}${a}-${c.key}`;return!l.options.theme[_e]||t!==""?f:`${f}-${d()}`}return`${o}${n}${d()}`}}function at(){return{plugins:[Ye(),Xe(),Qe(),Ze(),et(),typeof window>"u"?null:tt(),nt()]}}function me(e={}){const{baseClasses:r,newClasses:n,Component:t}=e;if(!n)return r;const o=R({},r);return Object.keys(n).forEach(u=>{n[u]&&(o[u]=`${r[u]} ${n[u]}`)}),o}const M={set:(e,r,n,t)=>{let o=e.get(r);o||(o=new Map,e.set(r,o)),o.set(n,t)},get:(e,r,n)=>{const t=e.get(r);return t?t.get(n):void 0},delete:(e,r,n)=>{e.get(r).delete(n)}},ct=st(at()),lt=it(),dt=new Map,ut={disableGeneration:!1,generateClassName:lt,jss:ct,sheetsCache:null,sheetsManager:dt,sheetsRegistry:null},ft=g.createContext(ut);let re=-1e9;function pt(){return re+=1,re}const mt=["variant"];function oe(e){return e.length===0}function ht(e){const{variant:r}=e,n=B(e,mt);let t=r||"";return Object.keys(n).sort().forEach(o=>{o==="color"?t+=oe(t)?e[o]:F(e[o]):t+=`${oe(t)?o:F(o)}${F(e[o].toString())}`}),t}const gt={};function xt(e){const r=typeof e=="function";return{create:(n,t)=>{let o;try{o=r?e(n):e}catch(l){throw l}if(!t||!n.components||!n.components[t]||!n.components[t].styleOverrides&&!n.components[t].variants)return o;const u=n.components[t].styleOverrides||{},d=n.components[t].variants||[],c=R({},o);return Object.keys(u).forEach(l=>{c[l]=Z(c[l]||{},u[l])}),d.forEach(l=>{const a=ht(l.props);c[a]=Z(c[a]||{},l.style)}),c},options:{}}}const vt=["name","classNamePrefix","Component","defaultTheme"];function yt({state:e,stylesOptions:r},n,t){if(r.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=me({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:t})),e.cacheClasses.value}function jt({state:e,theme:r,stylesOptions:n,stylesCreator:t,name:o},u){if(n.disableGeneration)return;let d=M.get(n.sheetsManager,t,r);d||(d={refs:0,staticSheet:null,dynamicStyles:null},M.set(n.sheetsManager,t,r,d));const c=R({},t.options,n,{theme:r,flip:typeof n.flip=="boolean"?n.flip:r.direction==="rtl"});c.generateId=c.serverGenerateClassName||c.generateClassName;const l=n.sheetsRegistry;if(d.refs===0){let a;n.sheetsCache&&(a=M.get(n.sheetsCache,t,r));const f=t.create(r,o);a||(a=n.jss.createStyleSheet(f,R({link:!1},c)),a.attach(),n.sheetsCache&&M.set(n.sheetsCache,t,r,a)),l&&l.add(a),d.staticSheet=a,d.dynamicStyles=rt(f)}if(d.dynamicStyles){const a=n.jss.createStyleSheet(d.dynamicStyles,R({link:!0},c));a.update(u),a.attach(),e.dynamicSheet=a,e.classes=me({baseClasses:d.staticSheet.classes,newClasses:a.classes}),l&&l.add(a)}else e.classes=d.staticSheet.classes;d.refs+=1}function St({state:e},r){e.dynamicSheet&&e.dynamicSheet.update(r)}function Ct({state:e,theme:r,stylesOptions:n,stylesCreator:t}){if(n.disableGeneration)return;const o=M.get(n.sheetsManager,t,r);o.refs-=1;const u=n.sheetsRegistry;o.refs===0&&(M.delete(n.sheetsManager,t,r),n.jss.removeStyleSheet(o.staticSheet),u&&u.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),u&&u.remove(e.dynamicSheet))}function bt(e,r){const n=g.useRef([]);let t;const o=g.useMemo(()=>({}),r);n.current!==o&&(n.current=o,t=e()),g.useEffect(()=>()=>{t&&t()},[o])}function G(e,r={}){const{name:n,classNamePrefix:t,Component:o,defaultTheme:u=gt}=r,d=B(r,vt),c=xt(e),l=n||t||"makeStyles";return c.options={index:pt(),name:n,meta:l,classNamePrefix:l},(f={})=>{const h=Ve()||u,v=R({},g.useContext(ft),d),S=g.useRef(),p=g.useRef();return bt(()=>{const C={name:n,state:{},stylesCreator:c,stylesOptions:v,theme:h};return jt(C,f),p.current=!1,S.current=C,()=>{Ct(C)}},[h,c]),g.useEffect(()=>{p.current&&St(S.current,f),p.current=!0}),yt(S.current,f.classes,o)}}const wt=["name"],Rt=["children","className","clone","component"];function kt(e,r){const n={};return Object.keys(e).forEach(t=>{r.indexOf(t)===-1&&(n[t]=e[t])}),n}function Tt(e){return(n,t={})=>{const{name:o}=t,u=B(t,wt);let d=o;const l=G(typeof n=="function"?h=>({root:v=>n(R({theme:h},v))}):{root:n},R({Component:e,name:o||e.displayName,classNamePrefix:d},u));let a;n.filterProps&&(a=n.filterProps,delete n.filterProps),n.propTypes&&(n.propTypes,delete n.propTypes);const f=g.forwardRef(function(v,S){const{children:p,className:y,clone:C,component:w}=v,j=B(v,Rt),m=l(v),b=ee(m.root,y);let k=j;if(a&&(k=kt(k,a)),C)return g.cloneElement(p,R({className:ee(p.props.className,b)},k));if(typeof p=="function")return p(R({className:b},k));const T=w||e;return s.jsx(T,R({ref:S,className:b},k,{children:p}))});return Ee(f,e),f}}const{NODE_MODES:ie}=ae,_t=({mode:e,previousMode:r}={})=>e===ie.SERVERLESS||r===ie.SERVERLESS;var Et={isInServerlessMode:_t};const $t=G(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function he({disabled:e,storeList:r,teamDid:n,onAdd:t,scope:o,hiddenChildren:u,open:d,onClose:c}){const{api:l}=W(),[a,f]=g.useState(!1),[h,v]=g.useState(!0),[S,p]=g.useState(!1),[y,C]=g.useState(""),[w,j]=g.useState(""),{t:m}=z(),b=$t(),k=async()=>{f(!0);try{const{decoded:x}=De(y,r);await l.addBlockletStore({input:{teamDid:n,url:x,scope:o}}),t(x),p(!1),c()}catch(x){const P=`${m("store.blockletRegistry.addFailed")} ${O(x)}`;j(P)}finally{f(!1)}},T=()=>{p(!1),c()};return s.jsxs(s.Fragment,{children:[!u&&s.jsxs(Be,{button:!0,disabled:e,className:b.addMenuItemRoot,onClick:()=>{p(!0)},children:[s.jsx(Oe,{font:!0}),s.jsx(E,{variant:"inherit",children:m("store.blockletRegistry.addRegistry")})]}),s.jsxs($e,{title:m("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:d||S,onClose:T,PaperProps:{style:{minHeight:"auto"}},actions:s.jsxs(s.Fragment,{children:[s.jsx(te,{onClick:x=>{x.stopPropagation(),T()},color:"inherit",children:m("common.cancel")}),s.jsxs(te,{onClick:x=>{x.stopPropagation(),k()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!y||h,variant:"contained",autoFocus:!0,children:[a&&s.jsx(q,{size:16}),m("common.confirm")]})]}),children:[s.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:s.jsx(Ae,{component:"div",children:s.jsx(E,{component:"div",children:s.jsx(le,{label:m("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:y,onChange:x=>{j(null);let P=!1;x.target.value.trim()||(P=!0),x.target.value.trim()||j(m("store.blockletRegistry.registryUrlEmpty")),C(x.target.value),v(P)},disabled:a,onKeyPress:x=>{x.key==="Enter"&&(x.preventDefault(),x.target.value.trim()?k():j(m("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!w&&s.jsx(de,{severity:"error",style:{width:"100%"},children:w})]})]})}he.propTypes={teamDid:i.string.isRequired,disabled:i.bool,storeList:i.array,onAdd:i.func,scope:i.string,hiddenChildren:i.bool,open:i.bool,onClose:i.func};he.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var J={},Dt=V;Object.defineProperty(J,"__esModule",{value:!0});var ge=J.default=void 0,Nt=Dt(H()),Pt=s;ge=J.default=(0,Nt.default)((0,Pt.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var K={},It=V;Object.defineProperty(K,"__esModule",{value:!0});var xe=K.default=void 0,Mt=It(H()),Lt=s;xe=K.default=(0,Mt.default)((0,Lt.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");function Y({title:e,description:r,confirmPlaceholder:n,cancel:t,confirm:o,params:u,onCancel:d,onConfirm:c,keyName:l}){const{t:a}=z(),f={title:()=>s.jsxs("div",{children:[e,s.jsx(He,{sx:{fontSize:"14px"},maxLength:64,children:` (${l})`})]}),description:(h,v)=>{const S=p=>{v({...p,__disableConfirm:p.__disableConfirm})};return s.jsxs("div",{children:[s.jsx(de,{severity:"warning",style:{width:"100%"},children:a("common.notice")}),s.jsx("div",{style:{marginTop:24,marginBottom:24},dangerouslySetInnerHTML:{__html:r}}),s.jsxs("div",{style:{marginBottom:24},children:[a("common.click"),":",s.jsx(We,{"data-cy":"click-copy",children:l})]}),s.jsx(E,{component:"div",children:s.jsx(le,{label:n,autoComplete:"off","data-cy":"delete-confirm-input",variant:"outlined",fullWidth:!0,autoFocus:!0,value:h.inputVal,onChange:p=>{S({...h,inputVal:p.target.value,__disableConfirm:l!==p.target.value})}})})]})},confirm:o,cancel:t,onConfirm:c,onCancel:d,params:{inputVal:"",__disableConfirm:!0,...u}};return s.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}Y.propTypes={title:i.any.isRequired,keyName:i.any.isRequired,description:i.any.isRequired,confirmPlaceholder:i.any.isRequired,cancel:i.string,confirm:i.string,params:i.object,onCancel:i.func,onConfirm:i.func.isRequired};Y.defaultProps={onCancel:()=>{},cancel:"",confirm:"Confirm",params:{}};function A({store:e,teamDid:r,onDelete:n,children:t,projectId:o="",scope:u=""}){const{api:d}=W(),{t:c}=z(),l=Ne(),[a,f]=g.useState(!1),[h,v]=g.useState(null),S=Pe(),p=()=>{f(!1),v(null)},y=async()=>{try{f(!0),await d.deleteBlockletStore({input:{teamDid:r,url:e.url,projectId:o,scope:u}}),await(l==null?void 0:l.actions.refreshBlocklet()),n&&typeof n=="function"&&n()}catch(j){$.error(`Remove Blocklet Store Error: ${O(j)}`)}finally{f(!1),v(null)}},C={keyName:e.url,title:c("store.blockletRegistry.deleteRegistry"),description:c("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:S.palette.error.main}),confirmPlaceholder:c("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:c("common.delConfirm"),cancel:c("common.cancel"),onConfirm:y,onCancel:p},w=j=>{e.protected||(j.stopPropagation(),v(C))};return s.jsxs(s.Fragment,{children:[t?s.jsx("span",{onClick:w,children:t}):s.jsx(D,{color:"primary",disabled:a,onClick:w,size:"small",children:s.jsx(fe,{sx:{zoom:.95}})}),h&&s.jsx(Y,{keyName:h.keyName,title:h.title,description:h.description,confirmPlaceholder:h.confirmPlaceholder,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}A.propTypes={children:i.node,teamDid:i.string.isRequired,store:i.object.isRequired,onDelete:i.func,projectId:i.string,scope:i.string};A.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var X={},zt=V;Object.defineProperty(X,"__esModule",{value:!0});var ve=X.default=void 0,qt=zt(H()),Ot=s;ve=X.default=(0,qt.default)((0,Ot.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const Bt=({store:e,userDid:r})=>{var t;const n=((t=window.blocklet)==null?void 0:t.tenantMode)!==Ie.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===r?!0:n?e.scope==="studio":!1};function Q({connectedStore:e,onDisconnect:r,onDelete:n,store:t,teamDid:o,projectId:u}){var j;const[d,c]=g.useState(null),l=!!d,{t:a}=z(),{session:f}=Ge(),[h,v]=g.useState(!1),S=m=>{if(m.stopPropagation(),e!=null&&e.developerDid){const b=ce.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${L(t.url,"developer/blocklets")}?__did-connect__=${b}`)}else window.open(`${L(t.url,"developer/blocklets")}`)},p=m=>{c(m.currentTarget)},y=()=>{c(null)},C=()=>{v(!1),r()},w=[{label:a("common.visitStore"),action:S,icon:ue},{label:a("common.disconnect"),action:()=>{y(),v(!0)},icon:ve,hidden:!e}];return s.jsxs(s.Fragment,{children:[s.jsx(D,{ref:d,color:"primary",onClick:p,size:"small",children:s.jsx(Ue,{sx:{zoom:.95}})}),s.jsxs(Me,{anchorEl:d,open:l,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[w.map(m=>m.hidden?null:s.jsxs(ne,{dense:!0,onClick:m.action,disabled:m.disabled,children:[m.icon&&s.jsx(m.icon,{color:"action",sx:{marginRight:1}}),s.jsx(N,{color:"action",children:m.label})]},m.label)),Bt({store:t,userDid:(j=f==null?void 0:f.user)==null?void 0:j.did})&&s.jsx(A,{store:t,onDelete:n,teamDid:o,projectId:u,scope:t.scope||"studio",children:s.jsxs(ne,{dense:!0,disabled:t.protected,children:[s.jsx(fe,{sx:{color:t.protected?"action":"error.main",marginRight:1}}),s.jsx(N,{color:t.protected?"action":"error.main",children:a("common.delete")})]})})]}),h&&s.jsx(pe,{displayError:!0,title:`${a("common.disconnect")} ${t.name}`,description:a("blocklet.publish.disconnectStoreTip"),confirm:a("common.confirm"),onConfirm:C,onCancel:()=>v(!1)})]})}Q.propTypes={connectedStore:i.object.isRequired,onDisconnect:i.func,onDelete:i.func,store:i.object.isRequired,teamDid:i.string.isRequired,projectId:i.string};Q.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function Ut({messageType:e,onOpen:r,onClose:n}){const t=g.useRef(null),o=g.useRef(null),u=async c=>{setTimeout(()=>{try{n==null||n()}catch{}},10*1e3),t.current&&(clearInterval(o.current),t.current.close());const l=Math.random().toString(36).slice(2);t.current=window.open(`${ae.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${l}`,"_blank"),r==null||r(t.current),o.current=setInterval(()=>{(!t.current||t.current.closed)&&(t.current=null,clearInterval(o.current),setTimeout(()=>{n==null||n()},1100))},200),await Promise.resolve(c(t.current,a=>{if(!t.current){localStorage.setItem(`open-window-url-${l}`,JSON.stringify({url:a,time:Date.now()}));return}t.current.location.href=a}))},d=Le(c=>{const{type:l,error:a}=c.data;t.current&&l===e&&a&&($.error(a),n==null||n())});return g.useEffect(()=>(window.addEventListener("message",d),()=>{window.removeEventListener("message",d)}),[d]),u}function U({connectedStore:e,sx:r,...n}){return s.jsx(Ke,{sx:{width:24,height:24,...r},src:L(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...n})}U.propTypes={connectedStore:i.object.isRequired,sx:i.object};U.defaultProps={sx:{}};function ye({storeUrl:e,storeName:r,developerDid:n,published:t}){const{t:o}=z(),u=()=>{if(n){const d=ce.from(JSON.stringify({forceConnected:n}),"utf8").toString("base64");window.open(`${L(e,"developer/blocklets")}?__did-connect__=${d}`)}else window.open(`${L(e,"developer/blocklets")}`)};return s.jsxs(N,{children:[s.jsx(E,{variant:"subtitle2",children:o(t?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:r})}),s.jsx(D,{size:"small",sx:{mt:1},onClick:u,variant:"contained",color:"success",children:o("common.visitTarget",{name:r})})]})}ye.propTypes={storeName:i.string.isRequired,storeUrl:i.string.isRequired,developerDid:i.string.isRequired,published:i.bool.isRequired};const je={CONNECT:"connect",SELECT:"select"},At=G(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),Ft=Tt(({className:e,...r})=>s.jsx(qe,{...r,classes:{popper:e}}))(({theme:e})=>({[`& .${ze.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Se({teamDid:e,projectId:r,releaseId:n,store:t,onDelete:o,kind:u,published:d,connectedStore:c,releaseType:l,onPublish:a,onOpenConnectStore:f,onSelectConnectStore:h,behavior:v,scope:S=""}){const p=At(),{t:y}=z(),{api:C,info:w,inService:j}=W(),[m,b]=g.useState(!1),k=Ut({messageType:"connect-store-message",onOpen:()=>b(!0),onClose:()=>b(!1)}),T=u==="publish",x=!!c,P=_=>{if(_.stopPropagation(),T){window.open(L(t.url,"developer/blocklets"));return}window.open(t.url)},Ce=()=>{if(v===je.SELECT){h(t);return}k(async(_,ke)=>{try{const I=await C.connectToStore({input:{did:e,storeUrl:t.url,storeId:t.id,storeName:t.name,projectId:r}});if(!(I!=null&&I.url)){$.error("failed to connect to store");return}ke(I.url),await f({did:e,projectId:r,storeId:t.id}),b(!1)}catch(I){const Te=O(I);$.error(Te),b(!1)}})},be=async()=>{try{await C.disconnectFromStore({input:{did:e,storeId:t.id,projectId:r,storeScope:S}}),o()}catch(_){$.error(O(_))}},we=()=>{b(!0),C.publishToStore({input:{did:e,storeId:t.id,storeName:t.name,projectId:r,releaseId:n,type:l}}).then(_=>{$.success(s.jsx(ye,{storeName:c.storeName,storeUrl:c.storeUrl,developerDid:c.developerDid,published:_.url==="published"}),{duration:1e4}),a==null||a(null)}).catch(_=>{$.error(O(_)),a==null||a(_)}).finally(()=>{b(!1)})};g.useEffect(()=>{x&&b(!1)},[x]);const Re=g.useMemo(()=>!(j&&Et.isInServerlessMode(w)),[j,w]);return s.jsxs("div",{className:p.box,children:[!T&&m&&s.jsx(q,{sx:{marginRight:2},size:16}),s.jsxs("div",{className:p.menuName,children:[s.jsx(N,{sx:{display:"flex",flexDirection:"row"},children:s.jsx(E,{component:"span",className:p.title,variant:"subtitle1",children:t.name})}),s.jsx(E,{className:p.url,component:"span",variant:"inherit",children:`${t.url}`})]}),s.jsxs("div",{className:p.actions,children:[c&&s.jsx(Ft,{placement:"top",title:s.jsxs(N,{children:[s.jsx(E,{component:"span",variant:"caption",sx:{opacity:.7},children:y("blocklet.publish.developerInfo")}),s.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[s.jsx(U,{connectedStore:c,sx:{width:42,height:42}}),s.jsxs(N,{sx:{flex:1},children:[s.jsx(E,{component:"span",variant:"subtitle1",children:c.developerName}),s.jsx(Je,{size:14,copyable:!0,compact:!0,responsive:!1,did:c.developerDid})]})]})]}),children:s.jsx("div",{children:s.jsx(U,{connectedStore:c,sx:{marginRight:1,cursor:"help"}})})}),T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:38},size:"small",children:[!x&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:Ce,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(ge,{sx:{marginRight:1}}),y("common.connect")]}),x&&d&&s.jsxs(D,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(Fe,{sx:{marginRight:1}}),y("common.uploaded")]}),x&&!d&&s.jsxs(D,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:we,children:[m?s.jsx(q,{sx:{marginRight:1},size:16}):s.jsx(xe,{sx:{marginRight:1,fontSize:20}}),y("common.upload")]}),s.jsx(Q,{projectId:r,connectedStore:c,store:t,onDelete:o,teamDid:e,onDisconnect:be})]}),!T&&s.jsxs(se,{disabled:m,variant:"outlined",sx:{height:36},size:"small",children:[s.jsx(D,{onClick:P,children:s.jsx(ue,{sx:{zoom:.9}})}),!t.protected&&Re&&s.jsx(A,{store:t,onDelete:o,teamDid:e,scope:""})]})]})]})}Se.propTypes={kind:i.string,teamDid:i.string.isRequired,published:i.bool,connectedStore:i.shape({storeName:i.string,storeId:i.string,storeUrl:i.string,developerDid:i.string,developerName:i.string}),projectId:i.string,releaseId:i.string,releaseType:i.string,store:i.shape({id:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,protected:i.bool,connected:i.bool}).isRequired,scope:i.string,onDelete:i.func,onPublish:i.func,onOpenConnectStore:i.func,behavior:i.string,onSelectConnectStore:i.func};Se.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:je.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{he as A,Y as C,Se as S,ye as U,Bt as c,G as m,Et as s,Ut as u};