@abtnode/blocklet-services 1.17.3-beta-20251123-232619-53258789 → 1.17.3-beta-20251126-121502-d0926972

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 (218) hide show
  1. package/api/libs/connect/session.js +9 -3
  2. package/api/middlewares/verify-sig.js +5 -2
  3. package/api/routes/user-session.js +17 -3
  4. package/api/services/auth/session.js +65 -6
  5. package/dist/assets/{AdapterDayjs-BlYfODzx.js → AdapterDayjs-B2uxdBcK.js} +1 -1
  6. package/dist/assets/{Google-BOjQI1aW.js → Google-mmkrFmA4.js} +1 -1
  7. package/dist/assets/{access-control-nEfPjX9L.js → access-control-BsrYt8sR.js} +1 -1
  8. package/dist/assets/{actions-DlChK31K.js → actions-BQZmpgjH.js} +1 -1
  9. package/dist/assets/{add-component-core-CvN1A_dW.js → add-component-core-DdA5-pKs.js} +35 -35
  10. package/dist/assets/add-resource-BwJJ0aia.js +1 -0
  11. package/dist/assets/{addon-VQ1uddFd.js → addon-DMnO8VZk.js} +2 -2
  12. package/dist/assets/{advanced-DrQgmCdX.js → advanced-D4bpKYrU.js} +2 -2
  13. package/dist/assets/{aigne-Bnseq7nJ.js → aigne-BKYy4lDi.js} +1 -1
  14. package/dist/assets/api-C1vNuLNj.js +1 -0
  15. package/dist/assets/{appearance-B-5PmK14.js → appearance-CoZeiSDb.js} +1 -1
  16. package/dist/assets/{arrow-down.svg-CpfG-t7r.js → arrow-down.svg-arX2hS9A.js} +1 -1
  17. package/dist/assets/{audit-logs-DZUc-RBS.js → audit-logs-Tol8dkkk.js} +2 -2
  18. package/dist/assets/{authorize-CHAjiVSh.js → authorize-Bma44S9y.js} +1 -1
  19. package/dist/assets/{base-chart-DkkGeB5D.js → base-chart-Gh7OtL-d.js} +1 -1
  20. package/dist/assets/{base32-DJEJY-PH.js → base32-HmSqZ9zU.js} +1 -1
  21. package/dist/assets/bind-account-BHZb-y1l.js +1 -0
  22. package/dist/assets/{branding-C9cXITVH.js → branding-CnmWjFbu.js} +1 -1
  23. package/dist/assets/branding-DhsDum88.js +1 -0
  24. package/dist/assets/{branding-CmgULIp-.js → branding-Fj3LseIw.js} +5 -5
  25. package/dist/assets/{bundle-avatar-Dtrtu9tJ.js → bundle-avatar-CeDsDt5-.js} +1 -1
  26. package/dist/assets/button-M1tE0EM6.js +1 -0
  27. package/dist/assets/click-to-copy-COEss4SB.js +1 -0
  28. package/dist/assets/{cloneDeep-C11iVb3m.js → cloneDeep-D_9o-MDF.js} +1 -1
  29. package/dist/assets/{collapse-Cqxx6nMG.js → collapse-BlkBpbz3.js} +1 -1
  30. package/dist/assets/{complete-Bb4ybro9.js → complete-DetpIm2X.js} +2 -2
  31. package/dist/assets/{component-DaJPU9PG.js → component-Br_A0gxQ.js} +2 -2
  32. package/dist/assets/{config-DCVvdigc.js → config-BZ68qemi.js} +5 -5
  33. package/dist/assets/{config-DV7G62tB.js → config-DaTqZM7S.js} +1 -1
  34. package/dist/assets/{config-BU9M-TDw.js → config-hHQ1dQ0r.js} +1 -1
  35. package/dist/assets/{config-navigation-CesehlHG.js → config-navigation-CIiX_S1E.js} +2 -2
  36. package/dist/assets/{config-space-CNnFak18.js → config-space-DcxPvrsQ.js} +1 -1
  37. package/dist/assets/{confirm-CvbX7Jj-.js → confirm-CQifLVQz.js} +1 -1
  38. package/dist/assets/connect-BYne4RoU.js +1 -0
  39. package/dist/assets/{connect-Nix-snxX.js → connect-DCXdY6aM.js} +1 -1
  40. package/dist/assets/connect-to-Dp0mJeqn.js +1 -0
  41. package/dist/assets/{content-layout-DpoiOm37.js → content-layout-CpbYUNJ8.js} +1 -1
  42. package/dist/assets/{create-passport-svg-k1mCsufD.js → create-passport-svg-hAgKE5uX.js} +1 -1
  43. package/dist/assets/createClass-D1NoiqdO.js +1 -0
  44. package/dist/assets/{dashboard-BahbXvzp.js → dashboard-PCrwcW_N.js} +2 -2
  45. package/dist/assets/{delete-confirm-ByS6hl26.js → delete-confirm-DP77Lldw.js} +1 -1
  46. package/dist/assets/{did-address-BKqL0vbP.js → did-address-CLsSdiw3.js} +1 -1
  47. package/dist/assets/domain-DptzkTFQ.js +9 -0
  48. package/dist/assets/domain-action-card-DmLVoK6X.js +28 -0
  49. package/dist/assets/domains-Cj55weM5.js +1 -0
  50. package/dist/assets/{email-BMJdUyBy.js → email-zUlL8Ooc.js} +1 -1
  51. package/dist/assets/{empty-spinner-CveVktQP.js → empty-spinner-DiVQXbse.js} +1 -1
  52. package/dist/assets/engine-Br5kqWzP.js +1 -0
  53. package/dist/assets/{exchange-passport-DHKedqAo.js → exchange-passport-4jMKVLBc.js} +1 -1
  54. package/dist/assets/{form-D4lC8hNg.js → form-BhkklUts.js} +3 -3
  55. package/dist/assets/{form-text-input-gTokKFc6.js → form-text-input-BFhD3mCK.js} +1 -1
  56. package/dist/assets/{form-wrapper-BxqO_YSO.js → form-wrapper-B9XdbV9a.js} +1 -1
  57. package/dist/assets/{fuel-D2QywWA1.js → fuel-_LHEMXNX.js} +1 -1
  58. package/dist/assets/{gen-access-key-CsAuE1ey.js → gen-access-key-Cuu-iyxE.js} +1 -1
  59. package/dist/assets/{gen-simple-access-key-BOAC0Yfv.js → gen-simple-access-key-ud5DXiqY.js} +1 -1
  60. package/dist/assets/get-safe-url-baxNHkAA.js +1 -0
  61. package/dist/assets/{home-sZAuweUB.js → home-D-jA_4Lm.js} +1 -1
  62. package/dist/assets/{iframe-NYFbYzoQ.js → iframe-DwMwGxmX.js} +1 -1
  63. package/dist/assets/{index-DDc9u4Rr.js → index-B1hEtoFm.js} +1 -1
  64. package/dist/assets/{index-BiLP0QV2.js → index-B3nY7xOz.js} +13 -13
  65. package/dist/assets/{index-DYUtJWG8.js → index-B65qJcbt.js} +1 -1
  66. package/dist/assets/{index-Cl9r3uEV.js → index-BLT40lDy.js} +8 -8
  67. package/dist/assets/{index-vI-j8RJ2.js → index-BNBVWXSX.js} +2 -2
  68. package/dist/assets/{index-Ba6mPf9I.js → index-BO3UQZPi.js} +1 -1
  69. package/dist/assets/{index-DHkYqLAY.js → index-BQyVf1E3.js} +1 -1
  70. package/dist/assets/{index-B7KG9373.js → index-BWgjTPxl.js} +1 -1
  71. package/dist/assets/{index-BEkcjGoQ.js → index-BcssdfWc.js} +1 -1
  72. package/dist/assets/{index-C3V_Ak74.js → index-ByEQy1Lz.js} +11 -11
  73. package/dist/assets/index-C3PPGtfI.js +6 -0
  74. package/dist/assets/{index-Cc_JDDUW.js → index-CR-yimk0.js} +4 -4
  75. package/dist/assets/index-ClXqfbDZ.js +1 -0
  76. package/dist/assets/{index-CdVfZKvV.js → index-CoJqP_N2.js} +1 -1
  77. package/dist/assets/index-CozzYt0Z.js +7 -0
  78. package/dist/assets/{index-9P0uzLew.js → index-Cpsil-_J.js} +5 -5
  79. package/dist/assets/{index-JqMHvzVF.js → index-Cvr1OSm0.js} +1 -1
  80. package/dist/assets/{index-0wVxGFHL.js → index-D0XVz0dc.js} +1 -1
  81. package/dist/assets/{index-Dh70orck.js → index-D45cjNSM.js} +1 -1
  82. package/dist/assets/{index-CWtUSVIH.js → index-DBBPnrYI.js} +1 -1
  83. package/dist/assets/{index--7-DPN_c.js → index-DDNvzM4M.js} +7 -7
  84. package/dist/assets/{index-BDvewqjE.js → index-DYMBrhSA.js} +1 -1
  85. package/dist/assets/{index-CyU0h18X.js → index-D_l_jjH3.js} +2 -2
  86. package/dist/assets/{index-Ch3guul5.js → index-DjE2GQIM.js} +2 -2
  87. package/dist/assets/index-Dr1AOLd_.js +30 -0
  88. package/dist/assets/index-DxlME7t_.js +120 -0
  89. package/dist/assets/{index-BOoBQ7dY.js → index-KzZiqY9D.js} +5 -5
  90. package/dist/assets/index-N6YyFqDu.js +1 -0
  91. package/dist/assets/{index-DO0bEcmC.js → index-auhzedGi.js} +1 -1
  92. package/dist/assets/index-kD1YmpMU.js +55 -0
  93. package/dist/assets/{index-sEUo7wfw.js → index-kzb9GjyJ.js} +1 -1
  94. package/dist/assets/{index-DZXHhkOt.js → index-s6v6fZUe.js} +4 -4
  95. package/dist/assets/index-xERuGIw0.js +1041 -0
  96. package/dist/assets/{invitation-DTvxpx-M.js → invitation-gK2vIEsH.js} +2 -2
  97. package/dist/assets/{invitations-DaZ82lJz.js → invitations-lfws_T2N.js} +1 -1
  98. package/dist/assets/{invite-B9UmiQDw.js → invite-CGloPprm.js} +1 -1
  99. package/dist/assets/{isURL-DI8OpvEf.js → isURL-CDvz38EO.js} +2 -2
  100. package/dist/assets/{issue-passport-D5GApp70.js → issue-passport-Dl3X8TTW.js} +1 -1
  101. package/dist/assets/{item-D1yR_MDv.js → item-CTQ1F-Dd.js} +1 -1
  102. package/dist/assets/{landing-page-BIWKEZD_.js → landing-page-DKcKat1r.js} +1 -1
  103. package/dist/assets/{launch-result-message-5HOBRYMn.js → launch-result-message--rgseiAA.js} +1 -1
  104. package/dist/assets/{layout-BLkdV05j.js → layout-D1wjW1Oy.js} +1 -1
  105. package/dist/assets/list-DPsX8TMn.js +103 -0
  106. package/dist/assets/{list-Cyphcnxa.js → list-MeDKce8j.js} +1 -1
  107. package/dist/assets/{list-header-Q-5QUSB8.js → list-header-DOS7AnGs.js} +1 -1
  108. package/dist/assets/localization-CASCfNj1.js +1 -0
  109. package/dist/assets/{log-CJ_iyIlL.js → log-B9KcwZD3.js} +1 -1
  110. package/dist/assets/logger-6-51jSsQ.js +1 -0
  111. package/dist/assets/login-Cbb7F6Mu.js +1 -0
  112. package/dist/assets/{login-oauth-callback-BYfBr2PG.js → login-oauth-callback-f64z-iJf.js} +1 -1
  113. package/dist/assets/{logo-uploader-JGejQIFw.js → logo-uploader-D6c2iUqg.js} +1 -1
  114. package/dist/assets/{lost-passport-BNK7HPbD.js → lost-passport-CSoln1QB.js} +2 -2
  115. package/dist/assets/{observability-BrLAcYkS.js → observability-D1A-1uvj.js} +1 -1
  116. package/dist/assets/{omit-CPVfFmp-.js → omit-BSwpPhgW.js} +1 -1
  117. package/dist/assets/{open-window-C3jjCeaT.js → open-window-7JDNMA9V.js} +1 -1
  118. package/dist/assets/over-due-invoice-payment-CljuJ4kk.js +1 -0
  119. package/dist/assets/{overview-BXpe9azn.js → overview-CI-TDe1L.js} +2 -2
  120. package/dist/assets/{page-header-bY0dwe6y.js → page-header-Dh_UA7fa.js} +1 -1
  121. package/dist/assets/passport-0dxK_pTH.js +1 -0
  122. package/dist/assets/{passport-item-DouM676j.js → passport-item-DwumTPQv.js} +1 -1
  123. package/dist/assets/{permission-CFZyPM8U.js → permission-Blt9Onuq.js} +1 -1
  124. package/dist/assets/{playground-QvTAmNqS.js → playground-kZ9J2CEx.js} +1 -1
  125. package/dist/assets/preferences-OylPiHSa.js +1 -0
  126. package/dist/assets/profile-embed-CCdzwTKi.js +1 -0
  127. package/dist/assets/publish-resource-Adc4901F.js +1 -0
  128. package/dist/assets/{react-beautiful-dnd.esm-DQ9oGom7.js → react-beautiful-dnd.esm-CbCp5m8Z.js} +1 -1
  129. package/dist/assets/{react-stripe.esm-CT6ZhpE7.js → react-stripe.esm-C8Keba5n.js} +1 -1
  130. package/dist/assets/{required-BuZo1JHj.js → required-CgSsIuqu.js} +1 -1
  131. package/dist/assets/runtime-OGDYw4nO.js +1 -0
  132. package/dist/assets/{sanitize-C43KM91h.js → sanitize-aIE75FMz.js} +1 -1
  133. package/dist/assets/sdk-CxQIQdbk.js +1 -0
  134. package/dist/assets/{section-DDyoFT-o.js → section-tQK-hwwW.js} +1 -1
  135. package/dist/assets/{security-D5ayNbch.js → security-DEVrQWpZ.js} +3 -3
  136. package/dist/assets/{session-DkvXxWtg.js → session-CAj-TcUY.js} +1 -1
  137. package/dist/assets/{setup-DvZls4Lo.js → setup-BT6-74rK.js} +1 -1
  138. package/dist/assets/{shorten-label-BiZLRE-N.js → shorten-label-JstixX67.js} +1 -1
  139. package/dist/assets/{simple-select-BP2aEPA1.js → simple-select-_qsehgaA.js} +1 -1
  140. package/dist/assets/{spaces-Crb6xNg_.js → spaces-B6flHcN-.js} +1 -1
  141. package/dist/assets/{start-DEanO3ch.js → start-BMKAy5mb.js} +1 -1
  142. package/dist/assets/{starting-progress-CZvfzqkC.js → starting-progress-SNgrsu02.js} +1 -1
  143. package/dist/assets/status-GY7lihPg.js +1 -0
  144. package/dist/assets/{step-actions-B3C_rdx7.js → step-actions-BcFE8m2n.js} +1 -1
  145. package/dist/assets/{studio-BqxKVD_H.js → studio-BkTwhFSX.js} +1 -1
  146. package/dist/assets/{switch-control-DwAlFBVc.js → switch-control-DVE8MCqI.js} +1 -1
  147. package/dist/assets/{table-tips-Ccm9jBpV.js → table-tips-DMkRZoRQ.js} +1 -1
  148. package/dist/assets/team-DANl8A6y.js +146 -0
  149. package/dist/assets/traffic-D_pUHfvx.js +1 -0
  150. package/dist/assets/{transfer-vhH8WqET.js → transfer-3jaJ_59b.js} +1 -1
  151. package/dist/assets/{unsubscribe-D400O_ym.js → unsubscribe-zGPKbsNi.js} +1 -1
  152. package/dist/assets/{use-app-logo-RgeQYsuM.js → use-app-logo-mH-ZWGvv.js} +1 -1
  153. package/dist/assets/{use-mobile-BGG7EyYb.js → use-mobile-BdZU3Qy2.js} +1 -1
  154. package/dist/assets/{use-mobile-yOnqxyr6.js → use-mobile-nqweJXIG.js} +1 -1
  155. package/dist/assets/{use-server-logo-CTR2UZFf.js → use-server-logo-YhCrW0Nr.js} +1 -1
  156. package/dist/assets/{use-window-close-dG-tZxWF.js → use-window-close-B1fcc1UV.js} +1 -1
  157. package/dist/assets/{useAsync-5gLXHIip.js → useAsync-CuuTq_2R.js} +1 -1
  158. package/dist/assets/{useAsync-tRHUJQgE.js → useAsync-Di_jotad.js} +1 -1
  159. package/dist/assets/{useAsyncRetry-MDM8jCoS.js → useAsyncRetry-DhVFzdPo.js} +1 -1
  160. package/dist/assets/{useLocalStorage-CbmitI3m.js → useLocalStorage-BCYIznDQ.js} +1 -1
  161. package/dist/assets/user-center-gH0CVETg.js +126 -0
  162. package/dist/assets/{user-follower-DoonDjSz.js → user-follower-DYsXrJ7n.js} +1 -1
  163. package/dist/assets/{util-Dcv5G2iK.js → util-BN6NLUU2.js} +1 -1
  164. package/dist/assets/{util-BIClPSUX.js → util-wCHwyw_F.js} +1 -1
  165. package/dist/assets/{vendor-arcblock-DBEMYjVA.js → vendor-arcblock-BRRIrPlW.js} +115 -114
  166. package/dist/assets/{vendor-hooks-L8kZVRUL.js → vendor-hooks-BeI8hpF9.js} +1 -1
  167. package/dist/assets/{vendor-mui-core-___CiWHn.js → vendor-mui-core-B62p29u8.js} +1 -1
  168. package/dist/assets/{vendor-mui-x-CYSdP1E1.js → vendor-mui-x-vSVDqxyB.js} +1 -1
  169. package/dist/assets/vendor-utils-DZwtp8ph.js +213 -0
  170. package/dist/assets/vendor-ux-k_TkMNDV.js +1563 -0
  171. package/dist/assets/{wait-connect-DUwp6hVe.js → wait-connect-Df9uvB6x.js} +1 -1
  172. package/dist/assets/{wizard-CXL7I23B.js → wizard-GCfJ08HB.js} +1 -1
  173. package/dist/assets/{wizard-components-CZc8F6Ff.js → wizard-components-D_w2hIhz.js} +1 -1
  174. package/dist/assets/wrap-locale-Dgf6KVHX.js +1 -0
  175. package/dist/assets/{zh-BvhUUizT.js → zh-QBR-GmxX.js} +1 -1
  176. package/dist/index.html +1 -1
  177. package/dist/service-worker.js +1 -1
  178. package/package.json +49 -49
  179. package/dist/assets/add-resource-B9_aO4fk.js +0 -1
  180. package/dist/assets/api-DcGGeMWE.js +0 -1
  181. package/dist/assets/bind-account-NDZClqum.js +0 -1
  182. package/dist/assets/branding-CO4Sr13R.js +0 -1
  183. package/dist/assets/button-CjoOMC5b.js +0 -1
  184. package/dist/assets/click-to-copy-BiDS_MtA.js +0 -1
  185. package/dist/assets/connect-B1N-w3eV.js +0 -1
  186. package/dist/assets/connect-to-DBGTL_TU.js +0 -1
  187. package/dist/assets/createClass-Bp8GWzB3.js +0 -1
  188. package/dist/assets/domain-BpamjKaC.js +0 -9
  189. package/dist/assets/domain-action-card-Cp48mNnX.js +0 -28
  190. package/dist/assets/domains-Dh12Syq6.js +0 -1
  191. package/dist/assets/engine-B0uUUVPG.js +0 -1
  192. package/dist/assets/get-safe-url-D0cItynk.js +0 -1
  193. package/dist/assets/index-BH-HC7Ph.js +0 -120
  194. package/dist/assets/index-BWJVW6O0.js +0 -29
  195. package/dist/assets/index-B_fIpHt1.js +0 -1
  196. package/dist/assets/index-CK2ZwMoB.js +0 -1039
  197. package/dist/assets/index-Cfrh8736.js +0 -55
  198. package/dist/assets/index-Ch20_Gn6.js +0 -6
  199. package/dist/assets/index-DtgymkwS.js +0 -7
  200. package/dist/assets/index-kx2x1q2N.js +0 -1
  201. package/dist/assets/list-rzFnsBFB.js +0 -103
  202. package/dist/assets/localization-DorjASD7.js +0 -1
  203. package/dist/assets/logger-QD2VS2Mb.js +0 -1
  204. package/dist/assets/login-DGJOwn5p.js +0 -1
  205. package/dist/assets/over-due-invoice-payment-Db3XRUjV.js +0 -1
  206. package/dist/assets/passport-D9DnlXMQ.js +0 -1
  207. package/dist/assets/preferences-DfiBTjAd.js +0 -1
  208. package/dist/assets/profile-embed-Dt_zuZJQ.js +0 -1
  209. package/dist/assets/publish-resource-CO34lIX9.js +0 -1
  210. package/dist/assets/runtime-C2bubBwk.js +0 -1
  211. package/dist/assets/sdk-lNpIX04q.js +0 -1
  212. package/dist/assets/status-De4_OTsm.js +0 -1
  213. package/dist/assets/team-zaYl7mkh.js +0 -146
  214. package/dist/assets/traffic-ZVRPMYlF.js +0 -1
  215. package/dist/assets/user-center-Dyu4ORgh.js +0 -126
  216. package/dist/assets/vendor-utils-Doa0RxLS.js +0 -213
  217. package/dist/assets/vendor-ux-pxYpYMxD.js +0 -1563
  218. package/dist/assets/wrap-locale-D5BJMkAL.js +0 -1
@@ -1,4 +1,4 @@
1
- import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei,a5 as ti,I as No,bV as Ao,S as Do,bb as va,dR as ya,aP as Mo,F as ba,z as Hn,bP as xa,bQ as wa,bR as Sa,bD as Ea,aX as Bo,V as ka,aO as Ta,cY as ja,cZ as Oa,bB as Ca,bE as Ia,M as ni,am as Fo,aq as Ra,b1 as lt,b7 as Pa,dM as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as jn,Y as Na,bw as Wo,o as zo,aU as Aa,ar as Xt,c7 as Da,c6 as Ma,c2 as ki,U as Ti,ah as Ba,dO as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,dJ as Va}from"./vendor-mui-core-___CiWHn.js";import{r as q,g as ri,u as Ka,i as Ga,p as Ha,e as Xa,a as $t,d as Ya,f as Rn,j as Ja}from"./vendor-react-CUXIiAnY.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-D1yR_MDv.js";import{n as vt,b as oi,e as Go,V as xt,U as yt,a6 as el,r as tl,O as Xn,H as Yn,aE as Oi,l as Qt,o as Ho,$ as Vn,w as Xo,d as nl,i as rl,A as Fr,aX as il}from"./vendor-ux-pxYpYMxD.js";import{_ as dn,e as Ft,c as ol,c5 as sl,b6 as al,bS as Yo,c6 as ll,c7 as cl,c8 as ul,c9 as dl,a8 as hl,Y as Mt,bB as fl,v as Jo,aP as pl,ca as ml,G as gl,cb as vl,ac as Jn,cc as Qo,bi as Zo,k as Qn,V as Ci,cd as yl,aq as bl,ce as xl,cf as wl,cg as Pn,ch as Ii,b7 as Sl}from"./index-CK2ZwMoB.js";import{j as Ri,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-DBEMYjVA.js";import{u as Pi}from"./launch-result-message-5HOBRYMn.js";import{a as $r}from"./page-header-bY0dwe6y.js";import{e as gt,B as Ol,C as rn,J as Zn,D as Li,R as es,Q as Cl,a8 as Il,A as Rl,o as sr,V as Pl,al as Ll,am as _l,an as Nl,a as xn,S as Al,b as Dl}from"./vendor-utils-Doa0RxLS.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-B0uUUVPG.js";import{u as Bl,C as Fl}from"./config-space-CNnFak18.js";import{R as Ln}from"./required-BuZo1JHj.js";import{S as $l}from"./index-sEUo7wfw.js";import{a as ts,h as Ul,w as ql,f as Wl,b as zl,d as Vl,e as Kl,M as Gl}from"./index-DO0bEcmC.js";import{k as On,a as Hl,b as Xl,u as ns,g as Yl,q as Jl}from"./vendor-hooks-L8kZVRUL.js";import{g as Ql}from"./get-safe-url-D0cItynk.js";import{r as rs,A as Zl}from"./config-DCVvdigc.js";import{r as ec}from"./index-BsA1v5Kx.js";import{r as tc}from"./cloneDeep-C11iVb3m.js";import{u as si}from"./useLocalStorage-CbmitI3m.js";import{v as _i}from"./index-0wVxGFHL.js";import{u as nc}from"./session-DkvXxWtg.js";import{W as rc}from"./did-address-BKqL0vbP.js";import{a as Ni}from"./api-DcGGeMWE.js";import{v as ic,e as oc}from"./util-BIClPSUX.js";import{u as is}from"./use-mobile-BGG7EyYb.js";import{C as sc}from"./content-layout-DpoiOm37.js";import{C as ac,D as lc,a as cc}from"./connect-to-DBGTL_TU.js";import{d as ar}from"./search-4YYphs0l.js";const _f="blocklet-add-component-registry",Nf="server-add-registry",Af=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=dn();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:B.bool,children:B.any.isRequired,onConfirm:B.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(uc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const uc=tt.div`
1
+ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ti,a5 as ni,I as Mo,bV as Bo,S as Fo,bb as xa,dR as wa,aP as $o,F as Sa,z as Hn,bP as Ea,bQ as ka,bR as Ta,bD as ja,aX as Uo,V as Oa,aO as Ca,cY as Ia,cZ as Ra,bB as Pa,bE as La,M as ri,am as qo,aq as _a,b1 as lt,b7 as Na,dM as Aa,a8 as Wo,ad as zo,aV as Da,aj as Vo,Q as jn,Y as Ma,bw as Ko,o as Go,aU as Ba,ar as Xt,c7 as Fa,c6 as $a,c2 as Ti,U as ji,ah as Ua,dO as qa,O as Wa,K as za,P as Va,ai as Ka,an as Ho,A as Oi,aI as Ga,dJ as Ha}from"./vendor-mui-core-B62p29u8.js";import{r as U,g as ii,u as Xa,i as Ya,p as Ja,e as Qa,a as $t,d as Za,f as Rn,j as el}from"./vendor-react-CUXIiAnY.js";import{r as oi,S as tl,s as Xo,A as nl}from"./item-CTQ1F-Dd.js";import{n as vt,q as si,v as Yo,V as xt,a3 as yt,r as rl,H as Xn,aJ as Ci,l as Qt,o as Jo,$ as Vn,b2 as il,G as Qo,z as ol,K as $r,b3 as sl}from"./vendor-ux-k_TkMNDV.js";import{_ as dn,e as Ft,c as al,c9 as ll,bd as cl,aH as Yn,b9 as ul,bW as Zo,ca as dl,cb as hl,cc as fl,cd as pl,a8 as ml,Y as Mt,bD as gl,v as es,aR as vl,ce as yl,G as bl,cf as xl,ac as Jn,cg as ts,bm as ns,k as Qn,V as Ii,ch as wl,aq as Sl,ci as El,cj as kl,ck as Pn,cl as Ri,ba as Tl}from"./index-xERuGIw0.js";import{j as Pi,o as jl,T as Ol,L as Cl,P as Il}from"./vendor-arcblock-BRRIrPlW.js";import{u as Li}from"./launch-result-message--rgseiAA.js";import{a as Ur}from"./page-header-Dh_UA7fa.js";import{e as gt,B as Rl,C as rn,J as Zn,D as _i,R as rs,Q as Pl,a8 as Ll,A as _l,o as sr,V as Nl,al as Al,am as Dl,an as Ml,a as xn,S as Bl,b as Fl}from"./vendor-utils-DZwtp8ph.js";import{f as qr}from"./index-DBs9Ljax.js";import{e as $l}from"./engine-Br5kqWzP.js";import{u as Ul,C as ql}from"./config-space-DcxPvrsQ.js";import{R as Ln}from"./required-CgSsIuqu.js";import{S as Wl}from"./index-kzb9GjyJ.js";import{a as is,h as zl,w as Vl,f as Kl,b as Gl,d as Hl,e as Xl,M as Yl}from"./index-auhzedGi.js";import{k as On,a as Jl,b as Ql,u as os,g as Zl,q as ec}from"./vendor-hooks-BeI8hpF9.js";import{g as tc}from"./get-safe-url-baxNHkAA.js";import{r as ss,A as nc}from"./config-BZ68qemi.js";import{r as rc}from"./index-BsA1v5Kx.js";import{r as ic}from"./cloneDeep-D_9o-MDF.js";import{u as ai}from"./useLocalStorage-BCYIznDQ.js";import{v as Ni}from"./index-D0XVz0dc.js";import{u as oc}from"./session-CAj-TcUY.js";import{W as sc}from"./did-address-CLsSdiw3.js";import{a as Ai}from"./api-C1vNuLNj.js";import{v as ac,e as lc}from"./util-wCHwyw_F.js";import{u as as}from"./use-mobile-nqweJXIG.js";import{C as cc}from"./content-layout-CpbYUNJ8.js";import{C as uc,D as dc,a as hc}from"./connect-to-Dp0mJeqn.js";import{d as ar}from"./search-4YYphs0l.js";const Mf="blocklet-add-component-registry",Bf="server-add-registry",Ff=e=>`resource-${e}-add-registry`;function ls(e){const{info:t}=dn();return U.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function cs({disabled:e=!1,children:t,onConfirm:r}){return U.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}cs.propTypes={disabled:B.bool,children:B.any.isRequired,onConfirm:B.func.isRequired};function us({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=U.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(fc,{children:l.jsxs(cs,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(vt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(si,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}us.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const fc=tt.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -27,18 +27,18 @@ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei
27
27
  .next-button {
28
28
  min-width: 200px;
29
29
  }
30
- `;var _n={exports:{}},lr,Ai;function dc(){if(Ai)return lr;Ai=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,n=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,d=`
31
- `,h="/",u="*",f="",j="comment",m="declaration";lr=function(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var c=1,N=1;function $(H){var A=H.match(t);A&&(c+=A.length);var J=H.lastIndexOf(d);N=~J?H.length-J:N+H.length}function O(){var H={line:c,column:N};return function(A){return A.position=new w(H),D(),A}}function w(H){this.start=H,this.end={line:c,column:N},this.source=C.source}w.prototype.content=E;function R(H){var A=new Error(C.source+":"+c+":"+N+": "+H);if(A.reason=H,A.filename=C.source,A.line=c,A.column=N,A.source=E,!C.silent)throw A}function F(H){var A=H.exec(E);if(A){var J=A[0];return $(J),E=E.slice(J.length),A}}function D(){F(r)}function ne(H){var A;for(H=H||[];A=Y();)A!==!1&&H.push(A);return H}function Y(){var H=O();if(!(h!=E.charAt(0)||u!=E.charAt(1))){for(var A=2;f!=E.charAt(A)&&(u!=E.charAt(A)||h!=E.charAt(A+1));)++A;if(A+=2,f===E.charAt(A-1))return R("End of comment missing");var J=E.slice(2,A-2);return N+=2,$(J),E=E.slice(A),N+=2,H({type:j,comment:J})}}function W(){var H=O(),A=F(i);if(A){if(Y(),!F(s))return R("property missing ':'");var J=F(n),M=H({type:m,property:S(A[0].replace(e,f)),value:J?S(J[0].replace(e,f)):f});return F(o),M}}function U(){var H=[];ne(H);for(var A;A=W();)A!==!1&&(H.push(A),ne(H));return H}return D(),U()};function S(E){return E?E.replace(a,f):f}return lr}var Di;function hc(){if(Di)return _n.exports;Di=1;var e=dc();function t(r,i){var s=null;if(!r||typeof r!="string")return s;for(var n,o=e(r),a=typeof i=="function",d,h,u=0,f=o.length;u<f;u++)n=o[u],d=n.property,h=n.value,a?i(d,h,n):h&&(s||(s={}),s[d]=h);return s}return _n.exports=t,_n.exports.default=t,_n.exports}var fc=hc();const pc=ri(fc),mc={}.hasOwnProperty;function gc(e,t,r){if(typeof e!="function")throw new TypeError("h is not a function");const i=yc(e),s=wc(e),n=xc(e);let o,a;if(typeof r=="string"||typeof r=="boolean"?(o=r,r={}):(r||(r={}),o=r.prefix),t&&t.type==="root"){const d=t.children[0];a=t.children.length===1&&d.type==="element"?d:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")a=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ls(e,a,{schema:r.space==="svg"?ts:Ul,prefix:o==null?i||s||n?"h-":void 0:typeof o=="string"?o:o?"h-":void 0,key:0,react:i,vue:s,vdom:n,hyperscript:bc(e)})}function ls(e,t,r){const i=r.schema;let s=i,n=t.tagName;const o={},a=[];let d=-1,h;i.space==="html"&&n.toLowerCase()==="svg"&&(s=ts,r.schema=s);for(h in t.properties)t.properties&&mc.call(t.properties,h)&&vc(o,h,t.properties[h],r,n);if(r.vdom&&(s.space==="html"?n=n.toUpperCase():s.space&&(o.namespace=ql[s.space])),r.prefix&&(r.key++,o.key=r.prefix+r.key),t.children)for(;++d<t.children.length;){const u=t.children[d];u.type==="element"?a.push(ls(e,u,r)):u.type==="text"&&a.push(u.value)}return r.schema=i,a.length>0?e.call(t,n,o,a):e.call(t,n,o)}function vc(e,t,r,i,s){const n=Wl(i.schema,t);let o;r==null||typeof r=="number"&&Number.isNaN(r)||r===!1&&(i.vue||i.vdom||i.hyperscript)||!r&&n.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(r)&&(r=n.commaSeparated?zl(r):Vl(r)),n.boolean&&i.hyperscript&&(r=""),n.property==="style"&&typeof r=="string"&&(i.react||i.vue||i.vdom)&&(r=Sc(r,s)),i.vue?n.property!=="style"&&(o="attrs"):n.mustUseProperty||(i.vdom?n.property!=="style"&&(o="attributes"):i.hyperscript&&(o="attrs")),o?e[o]=Object.assign(e[o]||{},{[n.attribute]:r}):n.space&&i.react?e[Kl[n.property]||n.property]=r:e[n.attribute]=r)}function yc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function bc(e){return"context"in e&&"cleanup"in e}function xc(e){return e("div",{}).type==="VirtualNode"}function wc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Sc(e,t){const r={};try{pc(e,(i,s)=>{i.slice(0,4)==="-ms-"&&(i="ms-"+i.slice(4)),r[i.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]=s})}catch(i){const s=i;throw s.message=t+"[style]"+s.message.slice(9),s}return r}var cr,Mi;function Ec(){if(Mi)return cr;Mi=1,cr=e;function e(o){if(typeof o=="string")return s(o);if(o==null)return n;if(typeof o=="object")return("length"in o?i:r)(o);if(typeof o=="function")return o;throw new Error("Expected function, string, or object as test")}function t(o){for(var a=[],d=o.length,h=-1;++h<d;)a[h]=e(o[h]);return a}function r(o){return a;function a(d){var h;for(h in o)if(d[h]!==o[h])return!1;return!0}}function i(o){var a=t(o),d=a.length;return h;function h(){for(var u=-1;++u<d;)if(a[u].apply(this,arguments))return!0;return!1}}function s(o){return a;function a(d){return!!(d&&d.type===o)}}function n(){return!0}return cr}var ur,Bi;function kc(){if(Bi)return ur;Bi=1,ur=s;var e=Ec(),t=!0,r="skip",i=!1;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(o,a,d,h){var u;typeof a=="function"&&typeof d!="function"&&(h=d,d=a,a=null),u=e(a),f(o,null,[]);function f(m,S,E){var C=[],c;return(!a||u(m,S,E[E.length-1]||null))&&(C=n(d(m,E)),C[0]===i)?C:m.children&&C[0]!==r?(c=n(j(m.children,E.concat(m))),c[0]===i?c:C):C}function j(m,S){for(var E=-1,C=h?-1:1,c=(h?m.length:E)+C,N;c>E&&c<m.length;){if(N=f(m[c],c,S),N[0]===i)return N;c=typeof N[1]=="number"?N[1]:c+C}}}function n(o){return o!==null&&typeof o=="object"&&"length"in o?o:typeof o=="number"?[t,o]:[o]}return ur}var dr,Fi;function Tc(){if(Fi)return dr;Fi=1,dr=s;var e=kc(),t=e.CONTINUE,r=e.SKIP,i=e.EXIT;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(n,o,a,d){typeof o=="function"&&typeof a!="function"&&(d=a,a=o,o=null),e(n,o,h,d);function h(u,f){var j=f[f.length-1],m=j?j.children.indexOf(u):null;return a(u,m,j)}}return dr}var hr,$i;function jc(){if($i)return hr;$i=1;var e=Tc(),t=Object.prototype.hasOwnProperty,r={align:"text-align",valign:"vertical-align",height:"height",width:"width"};hr=function(o){return e(o,"element",i),o};function i(n){if(!(n.tagName!=="tr"&&n.tagName!=="td"&&n.tagName!=="th")){var o,a;for(o in r)!t.call(r,o)||n.properties[o]===void 0||(a=r[o],s(n,a,n.properties[o]),delete n.properties[o])}}function s(n,o,a){var d=(n.properties.style||"").trim();d&&!/;\s*/.test(d)&&(d+=";"),d&&(d+=" ");var h=d+o+": "+a+";";n.properties.style=h}return hr}var Oc=jc();const Cc=ri(Oc);function Ic(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const Rc={}.hasOwnProperty,Pc=new Set(["table","thead","tbody","tfoot","tr"]);function Lc(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,r=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:i});function i(n){let o=gc(s,r?Cc(n):n,e.prefix);return n.type==="root"?(o=o&&typeof o=="object"&&"type"in o&&"props"in o&&o.type==="div"&&(n.children.length!==1||n.children[0].type!=="element")?o.props.children:[o],t(e.Fragment||"div",{},o)):o}function s(n,o,a){if(a&&Pc.has(n)&&(a=a.filter(d=>!Ic(d))),e.components&&Rc.call(e.components,n)){const d=e.components[n];return e.passNode&&typeof d=="function"&&(o=Object.assign({node:this},o)),t(d,o,a)}return t(n,o,a)}}function cs({children:e}){return l.jsx(_c,{children:e})}const Ui="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",_c=tt(te)`
30
+ `;var _n={exports:{}},lr,Di;function pc(){if(Di)return lr;Di=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,n=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,d=`
31
+ `,h="/",u="*",f="",j="comment",m="declaration";lr=function(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var c=1,N=1;function $(H){var A=H.match(t);A&&(c+=A.length);var J=H.lastIndexOf(d);N=~J?H.length-J:N+H.length}function O(){var H={line:c,column:N};return function(A){return A.position=new w(H),D(),A}}function w(H){this.start=H,this.end={line:c,column:N},this.source=C.source}w.prototype.content=E;function R(H){var A=new Error(C.source+":"+c+":"+N+": "+H);if(A.reason=H,A.filename=C.source,A.line=c,A.column=N,A.source=E,!C.silent)throw A}function F(H){var A=H.exec(E);if(A){var J=A[0];return $(J),E=E.slice(J.length),A}}function D(){F(r)}function ne(H){var A;for(H=H||[];A=Y();)A!==!1&&H.push(A);return H}function Y(){var H=O();if(!(h!=E.charAt(0)||u!=E.charAt(1))){for(var A=2;f!=E.charAt(A)&&(u!=E.charAt(A)||h!=E.charAt(A+1));)++A;if(A+=2,f===E.charAt(A-1))return R("End of comment missing");var J=E.slice(2,A-2);return N+=2,$(J),E=E.slice(A),N+=2,H({type:j,comment:J})}}function W(){var H=O(),A=F(i);if(A){if(Y(),!F(s))return R("property missing ':'");var J=F(n),M=H({type:m,property:S(A[0].replace(e,f)),value:J?S(J[0].replace(e,f)):f});return F(o),M}}function q(){var H=[];ne(H);for(var A;A=W();)A!==!1&&(H.push(A),ne(H));return H}return D(),q()};function S(E){return E?E.replace(a,f):f}return lr}var Mi;function mc(){if(Mi)return _n.exports;Mi=1;var e=pc();function t(r,i){var s=null;if(!r||typeof r!="string")return s;for(var n,o=e(r),a=typeof i=="function",d,h,u=0,f=o.length;u<f;u++)n=o[u],d=n.property,h=n.value,a?i(d,h,n):h&&(s||(s={}),s[d]=h);return s}return _n.exports=t,_n.exports.default=t,_n.exports}var gc=mc();const vc=ii(gc),yc={}.hasOwnProperty;function bc(e,t,r){if(typeof e!="function")throw new TypeError("h is not a function");const i=wc(e),s=kc(e),n=Ec(e);let o,a;if(typeof r=="string"||typeof r=="boolean"?(o=r,r={}):(r||(r={}),o=r.prefix),t&&t.type==="root"){const d=t.children[0];a=t.children.length===1&&d.type==="element"?d:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")a=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ds(e,a,{schema:r.space==="svg"?is:zl,prefix:o==null?i||s||n?"h-":void 0:typeof o=="string"?o:o?"h-":void 0,key:0,react:i,vue:s,vdom:n,hyperscript:Sc(e)})}function ds(e,t,r){const i=r.schema;let s=i,n=t.tagName;const o={},a=[];let d=-1,h;i.space==="html"&&n.toLowerCase()==="svg"&&(s=is,r.schema=s);for(h in t.properties)t.properties&&yc.call(t.properties,h)&&xc(o,h,t.properties[h],r,n);if(r.vdom&&(s.space==="html"?n=n.toUpperCase():s.space&&(o.namespace=Vl[s.space])),r.prefix&&(r.key++,o.key=r.prefix+r.key),t.children)for(;++d<t.children.length;){const u=t.children[d];u.type==="element"?a.push(ds(e,u,r)):u.type==="text"&&a.push(u.value)}return r.schema=i,a.length>0?e.call(t,n,o,a):e.call(t,n,o)}function xc(e,t,r,i,s){const n=Kl(i.schema,t);let o;r==null||typeof r=="number"&&Number.isNaN(r)||r===!1&&(i.vue||i.vdom||i.hyperscript)||!r&&n.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(r)&&(r=n.commaSeparated?Gl(r):Hl(r)),n.boolean&&i.hyperscript&&(r=""),n.property==="style"&&typeof r=="string"&&(i.react||i.vue||i.vdom)&&(r=Tc(r,s)),i.vue?n.property!=="style"&&(o="attrs"):n.mustUseProperty||(i.vdom?n.property!=="style"&&(o="attributes"):i.hyperscript&&(o="attrs")),o?e[o]=Object.assign(e[o]||{},{[n.attribute]:r}):n.space&&i.react?e[Xl[n.property]||n.property]=r:e[n.attribute]=r)}function wc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Sc(e){return"context"in e&&"cleanup"in e}function Ec(e){return e("div",{}).type==="VirtualNode"}function kc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Tc(e,t){const r={};try{vc(e,(i,s)=>{i.slice(0,4)==="-ms-"&&(i="ms-"+i.slice(4)),r[i.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]=s})}catch(i){const s=i;throw s.message=t+"[style]"+s.message.slice(9),s}return r}var cr,Bi;function jc(){if(Bi)return cr;Bi=1,cr=e;function e(o){if(typeof o=="string")return s(o);if(o==null)return n;if(typeof o=="object")return("length"in o?i:r)(o);if(typeof o=="function")return o;throw new Error("Expected function, string, or object as test")}function t(o){for(var a=[],d=o.length,h=-1;++h<d;)a[h]=e(o[h]);return a}function r(o){return a;function a(d){var h;for(h in o)if(d[h]!==o[h])return!1;return!0}}function i(o){var a=t(o),d=a.length;return h;function h(){for(var u=-1;++u<d;)if(a[u].apply(this,arguments))return!0;return!1}}function s(o){return a;function a(d){return!!(d&&d.type===o)}}function n(){return!0}return cr}var ur,Fi;function Oc(){if(Fi)return ur;Fi=1,ur=s;var e=jc(),t=!0,r="skip",i=!1;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(o,a,d,h){var u;typeof a=="function"&&typeof d!="function"&&(h=d,d=a,a=null),u=e(a),f(o,null,[]);function f(m,S,E){var C=[],c;return(!a||u(m,S,E[E.length-1]||null))&&(C=n(d(m,E)),C[0]===i)?C:m.children&&C[0]!==r?(c=n(j(m.children,E.concat(m))),c[0]===i?c:C):C}function j(m,S){for(var E=-1,C=h?-1:1,c=(h?m.length:E)+C,N;c>E&&c<m.length;){if(N=f(m[c],c,S),N[0]===i)return N;c=typeof N[1]=="number"?N[1]:c+C}}}function n(o){return o!==null&&typeof o=="object"&&"length"in o?o:typeof o=="number"?[t,o]:[o]}return ur}var dr,$i;function Cc(){if($i)return dr;$i=1,dr=s;var e=Oc(),t=e.CONTINUE,r=e.SKIP,i=e.EXIT;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(n,o,a,d){typeof o=="function"&&typeof a!="function"&&(d=a,a=o,o=null),e(n,o,h,d);function h(u,f){var j=f[f.length-1],m=j?j.children.indexOf(u):null;return a(u,m,j)}}return dr}var hr,Ui;function Ic(){if(Ui)return hr;Ui=1;var e=Cc(),t=Object.prototype.hasOwnProperty,r={align:"text-align",valign:"vertical-align",height:"height",width:"width"};hr=function(o){return e(o,"element",i),o};function i(n){if(!(n.tagName!=="tr"&&n.tagName!=="td"&&n.tagName!=="th")){var o,a;for(o in r)!t.call(r,o)||n.properties[o]===void 0||(a=r[o],s(n,a,n.properties[o]),delete n.properties[o])}}function s(n,o,a){var d=(n.properties.style||"").trim();d&&!/;\s*/.test(d)&&(d+=";"),d&&(d+=" ");var h=d+o+": "+a+";";n.properties.style=h}return hr}var Rc=Ic();const Pc=ii(Rc);function Lc(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const _c={}.hasOwnProperty,Nc=new Set(["table","thead","tbody","tfoot","tr"]);function Ac(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,r=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:i});function i(n){let o=bc(s,r?Pc(n):n,e.prefix);return n.type==="root"?(o=o&&typeof o=="object"&&"type"in o&&"props"in o&&o.type==="div"&&(n.children.length!==1||n.children[0].type!=="element")?o.props.children:[o],t(e.Fragment||"div",{},o)):o}function s(n,o,a){if(a&&Nc.has(n)&&(a=a.filter(d=>!Lc(d))),e.components&&_c.call(e.components,n)){const d=e.components[n];return e.passNode&&typeof d=="function"&&(o=Object.assign({node:this},o)),t(d,o,a)}return t(n,o,a)}}function hs({children:e}){return l.jsx(Dc,{children:e})}const qi="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",Dc=tt(te)`
32
32
  .highlight pre,
33
33
  pre {
34
34
  border-radius: 5px;
35
35
  }
36
36
  code {
37
- font-family: ${Ui};
37
+ font-family: ${qi};
38
38
  }
39
39
  pre code {
40
40
  font-size: 14px;
41
- font-family: ${Ui};
41
+ font-family: ${qi};
42
42
  }
43
43
 
44
44
  h1,
@@ -62,7 +62,7 @@ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei
62
62
  .anchor {
63
63
  display: none;
64
64
  }
65
- `;cs.propTypes={children:B.any.isRequired};function us({infoList:e=[]}){return l.jsx(te,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>l.jsxs(l.Fragment,{children:[l.jsx(te,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),l.jsx(te,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}us.propTypes={infoList:B.arrayOf(B.shape({key:B.string,value:B.string}))};const Nc=e=>e.payment?(e.payment.price||[]).map(t=>t.value||0).every(t=>t===0):!0,Ac=new Lc({createElement:q.createElement}).Compiler,_t={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ds({blockletMeta:e,locale:t,handleDescEle:r=""}){const{data:i}=e,s=Ut(),{registryUrl:n,did:o}=i,a=Ft.getDisplayName({meta:i}),d=On(()=>n&&o?fetch(Ri(n,"/api/blocklets",o,"readme")).then(E=>E.json()):null,{refreshDeps:[n,o]}),h=Hl(()=>d.data?d.data[t]||d.data.en||d.data[Object.keys(d.data)[0]]:"",[d]),u=i&&i.htmlAst?Ac(i.htmlAst):"",f=Nc(i);let j=gt(i,"owner.fullName");if(j){const E=gt(i,"owner.did");E&&(j=l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[j,l.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:E,compact:!0,size:14,locale:t})]}))}else j=gt(i,"author.name");const m=[{key:gt(_t[t],"appinfo.name"),value:Ft.getDisplayName({meta:i})},{key:gt(_t[t],"appinfo.version"),value:i.version},{key:gt(_t[t],"appinfo.author"),value:j},{type:"description",key:gt(_t[t],"appinfo.description"),value:i.description}];i.requirements&&m.push({key:gt(_t[t],"appinfo.requirements"),value:i.requirements.server}),i.community&&m.push({key:gt(_t[t],"appinfo.community"),value:l.jsx("a",{href:i.community,target:"_blank",rel:"noreferrer",children:i.community})}),i.documentation&&m.push({key:gt(_t[t],"appinfo.documentation"),value:l.jsx("a",{href:i.documentation,target:"_blank",rel:"noreferrer",children:i.documentation})}),i.support&&m.push({key:gt(_t[t],"appinfo.support"),value:l.jsx("a",{href:`mailto:${i.support}`,target:"_blank",rel:"noreferrer",children:i.support})}),u&&m.push({key:gt(_t[t],"appinfo.overview"),value:""});let S;return t==="zh"?S=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["您可以免费使用 ",l.jsx("b",{children:a}),";"]}):l.jsxs("p",{children:["您需要购买才能使用 ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),l.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),l.jsx("p",{children:"下面为该应用的信息:"})]}):S=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["You can use ",l.jsx("b",{children:a})," for free;"]}):l.jsxs("p",{children:["You need to purchase before launch ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),l.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),l.jsx("p",{children:"Below is the information for the blocklet: "})]}),l.jsxs(Mc,{children:[r||S,l.jsx(us,{infoList:m}),h?l.jsxs("div",{className:"app-overview",children:[l.jsx(je,{variant:"h5",gutterBottom:!0,children:gt(_t[t],"appinfo.overview")}),l.jsx(cs,{children:l.jsx(Dc,{component:"div",className:"content-wrapper post-content",children:l.jsx(Gl,{source:h,wrapperElement:{"data-color-mode":s.palette.mode},urlTransform:(E,C,c)=>E.startsWith("/")?Ri(n,E):E})})})]}):u?l.jsx("div",{className:"app-overview",children:u}):null]})}const Dc=tt(je)`
65
+ `;hs.propTypes={children:B.any.isRequired};function fs({infoList:e=[]}){return l.jsx(te,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>l.jsxs(l.Fragment,{children:[l.jsx(te,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),l.jsx(te,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}fs.propTypes={infoList:B.arrayOf(B.shape({key:B.string,value:B.string}))};const Mc=e=>e.payment?(e.payment.price||[]).map(t=>t.value||0).every(t=>t===0):!0,Bc=new Ac({createElement:U.createElement}).Compiler,_t={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ps({blockletMeta:e,locale:t,handleDescEle:r=""}){const{data:i}=e,s=Ut(),{registryUrl:n,did:o}=i,a=Ft.getDisplayName({meta:i}),d=On(()=>n&&o?fetch(Pi(n,"/api/blocklets",o,"readme")).then(E=>E.json()):null,{refreshDeps:[n,o]}),h=Jl(()=>d.data?d.data[t]||d.data.en||d.data[Object.keys(d.data)[0]]:"",[d]),u=i&&i.htmlAst?Bc(i.htmlAst):"",f=Mc(i);let j=gt(i,"owner.fullName");if(j){const E=gt(i,"owner.did");E&&(j=l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[j,l.jsx(Yo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:E,compact:!0,size:14,locale:t})]}))}else j=gt(i,"author.name");const m=[{key:gt(_t[t],"appinfo.name"),value:Ft.getDisplayName({meta:i})},{key:gt(_t[t],"appinfo.version"),value:i.version},{key:gt(_t[t],"appinfo.author"),value:j},{type:"description",key:gt(_t[t],"appinfo.description"),value:i.description}];i.requirements&&m.push({key:gt(_t[t],"appinfo.requirements"),value:i.requirements.server}),i.community&&m.push({key:gt(_t[t],"appinfo.community"),value:l.jsx("a",{href:i.community,target:"_blank",rel:"noreferrer",children:i.community})}),i.documentation&&m.push({key:gt(_t[t],"appinfo.documentation"),value:l.jsx("a",{href:i.documentation,target:"_blank",rel:"noreferrer",children:i.documentation})}),i.support&&m.push({key:gt(_t[t],"appinfo.support"),value:l.jsx("a",{href:`mailto:${i.support}`,target:"_blank",rel:"noreferrer",children:i.support})}),u&&m.push({key:gt(_t[t],"appinfo.overview"),value:""});let S;return t==="zh"?S=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["您可以免费使用 ",l.jsx("b",{children:a}),";"]}):l.jsxs("p",{children:["您需要购买才能使用 ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),l.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),l.jsx("p",{children:"下面为该应用的信息:"})]}):S=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["You can use ",l.jsx("b",{children:a})," for free;"]}):l.jsxs("p",{children:["You need to purchase before launch ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),l.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),l.jsx("p",{children:"Below is the information for the blocklet: "})]}),l.jsxs($c,{children:[r||S,l.jsx(fs,{infoList:m}),h?l.jsxs("div",{className:"app-overview",children:[l.jsx(je,{variant:"h5",gutterBottom:!0,children:gt(_t[t],"appinfo.overview")}),l.jsx(hs,{children:l.jsx(Fc,{component:"div",className:"content-wrapper post-content",children:l.jsx(Yl,{source:h,wrapperElement:{"data-color-mode":s.palette.mode},urlTransform:(E,C,c)=>E.startsWith("/")?Pi(n,E):E})})})]}):u?l.jsx("div",{className:"app-overview",children:u}):null]})}const Fc=tt(je)`
66
66
  width: 100%;
67
67
  word-wrap: break-word;
68
68
  word-break: break-word;
@@ -80,7 +80,7 @@ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei
80
80
  iframe {
81
81
  width: 100% !important;
82
82
  }
83
- `,Mc=tt.div`
83
+ `,$c=tt.div`
84
84
  .info-table {
85
85
  a {
86
86
  word-break: break-all;
@@ -113,7 +113,7 @@ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei
113
113
  .wmde-markdown[data-color-mode='dark'] {
114
114
  background: transparent;
115
115
  }
116
- `;ds.propTypes={blockletMeta:B.object.isRequired,locale:B.string.isRequired,handleDescEle:B.node};function Bc({...e}){return l.jsxs("div",{...e,style:{width:"100%"},children:[l.jsx("h3",{children:"End User License Agreement for Application"}),l.jsxs("p",{children:["Blocklet Server License Agreement ",ol.COPYRIGHT_OWNER," version 2020-08-28"]}),l.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),l.jsx("p",{children:"暂无"})]})}function Fc(e){return`${e.bundleSource?.store||e.meta.homepage}/assets/${e.meta?.did}/${e.meta?.logo||"logo.png"}?v=${e.meta?.version}`}function hs({installRelated:e=!1,meta:t=null,show:r=!1,onClose:i,components:s,loading:n}){const{t:o}=xt(),a=Yt(f=>f.breakpoints.down("md"));if(!r)return null;const d=!n&&s.length===0,h=!n&&s.length!==0,u=40;return l.jsxs(oi,{title:o("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(f,j)=>{j!=="backdropClick"&&i(!1)},PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[n&&l.jsx(te,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:l.jsx(te,{component:yt,icon:"line-md:loading-loop",sx:{color:"primary.main",fontSize:32}})}),d&&l.jsx(te,{sx:{textAlign:"center"},children:o("blocklet.component.noDependencies",{name:t.title})}),h&&l.jsx(te,{sx:{marginBottom:2},children:s.map(f=>{if(!f.meta)return null;const{required:j}=f;let m;return e||j?m=1:m=.5,l.jsxs(te,{sx:{opacity:m,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[l.jsx("img",{style:{width:u,height:u,minWidth:u,minHeight:u},src:Fc(f),alt:f.meta.title}),l.jsxs(te,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[l.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{window.open(Ql(`${f.bundleSource?.store||f.meta.homepage}/blocklets/${f.meta.did}`,{allowDomains:null}),"_blank")},children:[f.meta.title,l.jsx(te,{sx:{display:j?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:o("blocklet.component.required")}),l.jsxs(te,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[f.meta.version,l.jsx(te,{className:"link-icon",icon:"fluent:open-20-filled",component:yt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),l.jsx(te,{sx:{marginTop:0,opacity:.7},children:f.meta.description})]})]},f.meta.did)})})]})}hs.propTypes={meta:B.object,show:B.bool,onClose:B.func.isRequired,installRelated:B.func,components:B.array.isRequired,loading:B.bool.isRequired};function $c(e){return e&&e.registryUrl&&e.did?`${e.registryUrl}/api/blocklets/${e?.did}/blocklet.json`:""}function Uc(e){const{api:t}=dn(),[r]=Ka(),i=r.get("blocklet_meta_url")||$c(e),[s,n]=q.useState([]),[o,a]=q.useState(!1);return q.useEffect(()=>{!i||e?.inputUrl||(a(!0),t.getDynamicComponents({input:{url:i}}).then(d=>{n(d.components)}).finally(()=>{a(!1)}))},[i]),{components:s,loading:o}}function fs({installRelated:e=!0,onChangeInstallRelated:t=null,meta:r,onClickNext:i=null,handleDescEle:s=""}){const n=Ga(),{t:o,locale:a}=xt(),[d,h]=q.useState(!1),{components:u,loading:f}=Uc(r),j=os(r),m=i||(()=>{n(`/launch-blocklet/install${window.location.search}`)}),S=()=>{h(!0)},E=()=>{h(!1)};return l.jsxs(qc,{children:[l.jsx("div",{className:"app-content",children:l.jsx("div",{className:"agreement",children:l.jsx("div",{className:"agreement-content",children:j?l.jsx(ds,{blockletMeta:{data:r},locale:a,handleDescEle:s}):l.jsx(te,{sx:{p:3},children:l.jsx(je,{children:o("launchBlocklet.dockerBlockletCantInstall")})})})})}),l.jsxs(te,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[f?l.jsx(yt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,j&&t&&u?.length?l.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[l.jsx(ei,{sx:{mr:.5},checked:e,onChange:C=>t(C.currentTarget.checked),control:l.jsx(ti,{}),label:l.jsx("span",{children:o("launchBlocklet.installRelatedComponents")})}),l.jsx(te,{sx:{"> button svg":{color:"primary.main"}},children:l.jsx(No,{size:"small",onClick:S,children:l.jsx(yt,{icon:"octicon:package-dependencies-16"})})})]}):null,l.jsx("div",{className:"button-container","data-cy":"agree-all",children:j?l.jsx(as,{onContinue:m,description:l.jsx(Bc,{}),texts:{listenName:o("launchBlocklet.license"),buttonNext:o("launchBlocklet.next")}}):null})]}),l.jsx(hs,{installRelated:e,meta:r,show:d,onClose:E,components:u,loading:f})]})}fs.propTypes={meta:B.object.isRequired,onClickNext:B.func,handleDescEle:B.node,installRelated:B.bool,onChangeInstallRelated:B.func};const qc=tt.div`
116
+ `;ps.propTypes={blockletMeta:B.object.isRequired,locale:B.string.isRequired,handleDescEle:B.node};function Uc({...e}){return l.jsxs("div",{...e,style:{width:"100%"},children:[l.jsx("h3",{children:"End User License Agreement for Application"}),l.jsxs("p",{children:["Blocklet Server License Agreement ",al.COPYRIGHT_OWNER," version 2020-08-28"]}),l.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),l.jsx("p",{children:"暂无"})]})}function qc(e){return`${e.bundleSource?.store||e.meta.homepage}/assets/${e.meta?.did}/${e.meta?.logo||"logo.png"}?v=${e.meta?.version}`}function ms({installRelated:e=!1,meta:t=null,show:r=!1,onClose:i,components:s,loading:n}){const{t:o}=xt(),a=Yt(f=>f.breakpoints.down("md"));if(!r)return null;const d=!n&&s.length===0,h=!n&&s.length!==0,u=40;return l.jsxs(si,{title:o("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(f,j)=>{j!=="backdropClick"&&i(!1)},PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[n&&l.jsx(te,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:l.jsx(te,{component:yt,icon:"line-md:loading-loop",sx:{color:"primary.main",fontSize:32}})}),d&&l.jsx(te,{sx:{textAlign:"center"},children:o("blocklet.component.noDependencies",{name:t.title})}),h&&l.jsx(te,{sx:{marginBottom:2},children:s.map(f=>{if(!f.meta)return null;const{required:j}=f;let m;return e||j?m=1:m=.5,l.jsxs(te,{sx:{opacity:m,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[l.jsx("img",{style:{width:u,height:u,minWidth:u,minHeight:u},src:qc(f),alt:f.meta.title}),l.jsxs(te,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[l.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{window.open(tc(`${f.bundleSource?.store||f.meta.homepage}/blocklets/${f.meta.did}`,{allowDomains:null}),"_blank")},children:[f.meta.title,l.jsx(te,{sx:{display:j?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:o("blocklet.component.required")}),l.jsxs(te,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[f.meta.version,l.jsx(te,{className:"link-icon",icon:"fluent:open-20-filled",component:yt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),l.jsx(te,{sx:{marginTop:0,opacity:.7},children:f.meta.description})]})]},f.meta.did)})})]})}ms.propTypes={meta:B.object,show:B.bool,onClose:B.func.isRequired,installRelated:B.func,components:B.array.isRequired,loading:B.bool.isRequired};function Wc(e){return e&&e.registryUrl&&e.did?`${e.registryUrl}/api/blocklets/${e?.did}/blocklet.json`:""}function zc(e){const{api:t}=dn(),[r]=Xa(),i=r.get("blocklet_meta_url")||Wc(e),[s,n]=U.useState([]),[o,a]=U.useState(!1);return U.useEffect(()=>{!i||e?.inputUrl||(a(!0),t.getDynamicComponents({input:{url:i}}).then(d=>{n(d.components)}).finally(()=>{a(!1)}))},[i]),{components:s,loading:o}}function gs({installRelated:e=!0,onChangeInstallRelated:t=null,meta:r,onClickNext:i=null,handleDescEle:s=""}){const n=Ya(),{t:o,locale:a}=xt(),[d,h]=U.useState(!1),{components:u,loading:f}=zc(r),j=ls(r),m=i||(()=>{n(`/launch-blocklet/install${window.location.search}`)}),S=()=>{h(!0)},E=()=>{h(!1)};return l.jsxs(Vc,{children:[l.jsx("div",{className:"app-content",children:l.jsx("div",{className:"agreement",children:l.jsx("div",{className:"agreement-content",children:j?l.jsx(ps,{blockletMeta:{data:r},locale:a,handleDescEle:s}):l.jsx(te,{sx:{p:3},children:l.jsx(je,{children:o("launchBlocklet.dockerBlockletCantInstall")})})})})}),l.jsxs(te,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[f?l.jsx(yt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,j&&t&&u?.length?l.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[l.jsx(ti,{sx:{mr:.5},checked:e,onChange:C=>t(C.currentTarget.checked),control:l.jsx(ni,{}),label:l.jsx("span",{children:o("launchBlocklet.installRelatedComponents")})}),l.jsx(te,{sx:{"> button svg":{color:"primary.main"}},children:l.jsx(Mo,{size:"small",onClick:S,children:l.jsx(yt,{icon:"octicon:package-dependencies-16"})})})]}):null,l.jsx("div",{className:"button-container","data-cy":"agree-all",children:j?l.jsx(us,{onContinue:m,description:l.jsx(Uc,{}),texts:{listenName:o("launchBlocklet.license"),buttonNext:o("launchBlocklet.next")}}):null})]}),l.jsx(ms,{installRelated:e,meta:r,show:d,onClose:E,components:u,loading:f})]})}gs.propTypes={meta:B.object.isRequired,onClickNext:B.func,handleDescEle:B.node,installRelated:B.bool,onChangeInstallRelated:B.func};const Vc=tt.div`
117
117
  display: flex;
118
118
  flex-direction: column;
119
119
  align-items: center;
@@ -189,21 +189,21 @@ import{W as B,j as l,a6 as Tt,at as tt,ak as te,D as Ut,T as je,J as Yt,b6 as ei
189
189
  padding-bottom: 16px;
190
190
  }
191
191
  }
192
- `;var kt={},Nn={exports:{}},fr={exports:{}},qi;function ps(){if(qi)return fr.exports;qi=1;var e=fr.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(i){return"file-"+r(i)}}},t={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:r};Object.keys(e).forEach(function(i){Object.keys(t).forEach(function(s){e[i][s]||(e[i][s]=t[s])}),e[i].protocols_re=RegExp("^("+e[i].protocols.map(function(s){return s.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function r(i){return i.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return fr.exports}var pr,Wi;function Wc(){if(Wi)return pr;Wi=1;var e=ps(),t=Object.assign||function(s,n){if(n===null||typeof n!="object")return s;const o=Object.keys(n);let a=o.length;for(;a--;)s[o[a]]=n[o[a]];return s};pr=r;function r(i,s,n,o,a,d,h){var u=this;u.type=i,Object.keys(e[i]).forEach(function(f){u[f]=e[i][f]}),u.user=s,u.auth=n,u.project=o,u.committish=a,u.default=d,u.opts=h||{}}return r.prototype.hash=function(){return this.committish?"#"+this.committish:""},r.prototype._fill=function(i,s){if(i){var n=t({},s);n.path=n.path?n.path.replace(/^[/]+/g,""):"",s=t(t({},this.opts),s);var o=this;Object.keys(this).forEach(function(m){o[m]!=null&&n[m]==null&&(n[m]=o[m])});var a=n.auth,d=n.committish,h=n.fragment,u=n.path,f=n.project;Object.keys(n).forEach(function(m){var S=n[m];(m==="path"||m==="project")&&typeof S=="string"?n[m]=S.split("/").map(function(E){return encodeURIComponent(E)}).join("/"):m!=="domain"&&(n[m]=encodeURIComponent(S))}),n["auth@"]=a?a+"@":"",n["#fragment"]=h?"#"+this.hashformat(h):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=u?"#"+this.hashformat(u):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),s.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=d?"#"+d:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var j=i;return Object.keys(n).forEach(function(m){j=j.replace(new RegExp("[{]"+m+"[}]","g"),n[m])}),s.noGitPlus?j.replace(/^git[+]/,""):j}},r.prototype.ssh=function(i){return this._fill(this.sshtemplate,i)},r.prototype.sshurl=function(i){return this._fill(this.sshurltemplate,i)},r.prototype.browse=function(i,s,n){return typeof i=="string"?(typeof s!="string"&&(n=s,s=null),this._fill(this.browsefiletemplate,t({fragment:s,path:i},n))):this._fill(this.browsetemplate,i)},r.prototype.docs=function(i){return this._fill(this.docstemplate,i)},r.prototype.bugs=function(i){return this._fill(this.bugstemplate,i)},r.prototype.https=function(i){return this._fill(this.httpstemplate,i)},r.prototype.git=function(i){return this._fill(this.gittemplate,i)},r.prototype.shortcut=function(i){return this._fill(this.shortcuttemplate,i)},r.prototype.path=function(i){return this._fill(this.pathtemplate,i)},r.prototype.tarball=function(i){var s=t({},i,{noCommittish:!1});return this._fill(this.tarballtemplate,s)},r.prototype.file=function(i,s){return this._fill(this.filetemplate,t({path:i},s))},r.prototype.getDefaultRepresentation=function(){return this.default},r.prototype.toString=function(i){return this.default&&typeof this[this.default]=="function"?this[this.default](i):this.sshurl(i)},pr}var mr,zi;function zc(){return zi||(zi=1,mr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),mr}var gr,Vi;function Vc(){if(Vi)return gr;Vi=1,gr=e,e.Node=s,e.create=e;function e(n){var o=this;if(o instanceof e||(o=new e),o.tail=null,o.head=null,o.length=0,n&&typeof n.forEach=="function")n.forEach(function(h){o.push(h)});else if(arguments.length>0)for(var a=0,d=arguments.length;a<d;a++)o.push(arguments[a]);return o}e.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var o=n.next,a=n.prev;return o&&(o.prev=a),a&&(a.next=o),n===this.head&&(this.head=o),n===this.tail&&(this.tail=a),n.list.length--,n.next=null,n.prev=null,n.list=null,o},e.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var o=this.head;n.list=this,n.next=o,o&&(o.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},e.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var o=this.tail;n.list=this,n.prev=o,o&&(o.next=n),this.tail=n,this.head||(this.head=n),this.length++}},e.prototype.push=function(){for(var n=0,o=arguments.length;n<o;n++)r(this,arguments[n]);return this.length},e.prototype.unshift=function(){for(var n=0,o=arguments.length;n<o;n++)i(this,arguments[n]);return this.length},e.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},e.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},e.prototype.forEach=function(n,o){o=o||this;for(var a=this.head,d=0;a!==null;d++)n.call(o,a.value,d,this),a=a.next},e.prototype.forEachReverse=function(n,o){o=o||this;for(var a=this.tail,d=this.length-1;a!==null;d--)n.call(o,a.value,d,this),a=a.prev},e.prototype.get=function(n){for(var o=0,a=this.head;a!==null&&o<n;o++)a=a.next;if(o===n&&a!==null)return a.value},e.prototype.getReverse=function(n){for(var o=0,a=this.tail;a!==null&&o<n;o++)a=a.prev;if(o===n&&a!==null)return a.value},e.prototype.map=function(n,o){o=o||this;for(var a=new e,d=this.head;d!==null;)a.push(n.call(o,d.value,this)),d=d.next;return a},e.prototype.mapReverse=function(n,o){o=o||this;for(var a=new e,d=this.tail;d!==null;)a.push(n.call(o,d.value,this)),d=d.prev;return a},e.prototype.reduce=function(n,o){var a,d=this.head;if(arguments.length>1)a=o;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;d!==null;h++)a=n(a,d.value,h),d=d.next;return a},e.prototype.reduceReverse=function(n,o){var a,d=this.tail;if(arguments.length>1)a=o;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;d!==null;h--)a=n(a,d.value,h),d=d.prev;return a},e.prototype.toArray=function(){for(var n=new Array(this.length),o=0,a=this.head;a!==null;o++)n[o]=a.value,a=a.next;return n},e.prototype.toArrayReverse=function(){for(var n=new Array(this.length),o=0,a=this.tail;a!==null;o++)n[o]=a.value,a=a.prev;return n},e.prototype.slice=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(;h!==null&&d<o;d++,h=h.next)a.push(h.value);return a},e.prototype.sliceReverse=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=this.length,h=this.tail;h!==null&&d>o;d--)h=h.prev;for(;h!==null&&d>n;d--,h=h.prev)a.push(h.value);return a},e.prototype.splice=function(n,o,...a){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(var u=[],d=0;h&&d<o;d++)u.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var d=0;d<a.length;d++)h=t(this,h,a[d]);return u},e.prototype.reverse=function(){for(var n=this.head,o=this.tail,a=n;a!==null;a=a.prev){var d=a.prev;a.prev=a.next,a.next=d}return this.head=o,this.tail=n,this};function t(n,o,a){var d=o===n.head?new s(a,null,o,n):new s(a,o,o.next,n);return d.next===null&&(n.tail=d),d.prev===null&&(n.head=d),n.length++,d}function r(n,o){n.tail=new s(o,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function i(n,o){n.head=new s(o,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function s(n,o,a,d){if(!(this instanceof s))return new s(n,o,a,d);this.list=d,this.value=n,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{zc()(e)}catch{}return gr}var vr,Ki;function Kc(){if(Ki)return vr;Ki=1;const e=Vc(),t=Symbol("max"),r=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),n=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),u=Symbol("updateAgeOnGet"),f=()=>1;class j{constructor(O){if(typeof O=="number"&&(O={max:O}),O||(O={}),O.max&&(typeof O.max!="number"||O.max<0))throw new TypeError("max must be a non-negative number");this[t]=O.max||1/0;const w=O.length||f;if(this[i]=typeof w!="function"?f:w,this[s]=O.stale||!1,O.maxAge&&typeof O.maxAge!="number")throw new TypeError("maxAge must be a number");this[n]=O.maxAge||0,this[o]=O.dispose,this[a]=O.noDisposeOnSet||!1,this[u]=O.updateAgeOnGet||!1,this.reset()}set max(O){if(typeof O!="number"||O<0)throw new TypeError("max must be a non-negative number");this[t]=O||1/0,E(this)}get max(){return this[t]}set allowStale(O){this[s]=!!O}get allowStale(){return this[s]}set maxAge(O){if(typeof O!="number")throw new TypeError("maxAge must be a non-negative number");this[n]=O,E(this)}get maxAge(){return this[n]}set lengthCalculator(O){typeof O!="function"&&(O=f),O!==this[i]&&(this[i]=O,this[r]=0,this[d].forEach(w=>{w.length=this[i](w.value,w.key),this[r]+=w.length})),E(this)}get lengthCalculator(){return this[i]}get length(){return this[r]}get itemCount(){return this[d].length}rforEach(O,w){w=w||this;for(let R=this[d].tail;R!==null;){const F=R.prev;N(this,O,R,w),R=F}}forEach(O,w){w=w||this;for(let R=this[d].head;R!==null;){const F=R.next;N(this,O,R,w),R=F}}keys(){return this[d].toArray().map(O=>O.key)}values(){return this[d].toArray().map(O=>O.value)}reset(){this[o]&&this[d]&&this[d].length&&this[d].forEach(O=>this[o](O.key,O.value)),this[h]=new Map,this[d]=new e,this[r]=0}dump(){return this[d].map(O=>S(this,O)?!1:{k:O.key,v:O.value,e:O.now+(O.maxAge||0)}).toArray().filter(O=>O)}dumpLru(){return this[d]}set(O,w,R){if(R=R||this[n],R&&typeof R!="number")throw new TypeError("maxAge must be a number");const F=R?Date.now():0,D=this[i](w,O);if(this[h].has(O)){if(D>this[t])return C(this,this[h].get(O)),!1;const W=this[h].get(O).value;return this[o]&&(this[a]||this[o](O,W.value)),W.now=F,W.maxAge=R,W.value=w,this[r]+=D-W.length,W.length=D,this.get(O),E(this),!0}const ne=new c(O,w,D,F,R);return ne.length>this[t]?(this[o]&&this[o](O,w),!1):(this[r]+=ne.length,this[d].unshift(ne),this[h].set(O,this[d].head),E(this),!0)}has(O){if(!this[h].has(O))return!1;const w=this[h].get(O).value;return!S(this,w)}get(O){return m(this,O,!0)}peek(O){return m(this,O,!1)}pop(){const O=this[d].tail;return O?(C(this,O),O.value):null}del(O){C(this,this[h].get(O))}load(O){this.reset();const w=Date.now();for(let R=O.length-1;R>=0;R--){const F=O[R],D=F.e||0;if(D===0)this.set(F.k,F.v);else{const ne=D-w;ne>0&&this.set(F.k,F.v,ne)}}}prune(){this[h].forEach((O,w)=>m(this,w,!1))}}const m=($,O,w)=>{const R=$[h].get(O);if(R){const F=R.value;if(S($,F)){if(C($,R),!$[s])return}else w&&($[u]&&(R.value.now=Date.now()),$[d].unshiftNode(R));return F.value}},S=($,O)=>{if(!O||!O.maxAge&&!$[n])return!1;const w=Date.now()-O.now;return O.maxAge?w>O.maxAge:$[n]&&w>$[n]},E=$=>{if($[r]>$[t])for(let O=$[d].tail;$[r]>$[t]&&O!==null;){const w=O.prev;C($,O),O=w}},C=($,O)=>{if(O){const w=O.value;$[o]&&$[o](w.key,w.value),$[r]-=w.length,$[h].delete(w.key),$[d].removeNode(O)}};class c{constructor(O,w,R,F,D){this.key=O,this.value=w,this.length=R,this.now=F,this.maxAge=D||0}}const N=($,O,w,R)=>{let F=w.value;S($,F)&&(C($,w),$[s]||(F=void 0)),F&&O.call(R,F.value,F.key,$)};return vr=j,vr}var Gi;function Gc(){if(Gi)return Nn.exports;Gi=1;var e=sl,t=ps(),r=Nn.exports=Wc(),i=Kc(),s=new i({max:1e3}),n={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function o(j){return n[j]||j.slice(0,-1)}var a={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Nn.exports.fromUrl=function(j,m){if(typeof j=="string"){var S=j+JSON.stringify(m||{});return s.has(S)||s.set(S,d(j,m)),s.get(S)}};function d(j,m){if(!(j==null||j==="")){var S=u(h(j)?"github:"+j:j),E=f(S),C=S.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(t).map(function(N){try{var $=t[N],O=null;E.auth&&a[E.protocol]&&(O=E.auth);var w=E.hash?decodeURIComponent(E.hash.substr(1)):null,R=null,F=null,D=null;if(C&&C[1]===N)R=C[2]&&decodeURIComponent(C[2]),F=decodeURIComponent(C[3].replace(/\.git$/,"")),D="shortcut";else{if(E.host&&E.host!==$.domain&&E.host.replace(/^www[.]/,"")!==$.domain||!$.protocols_re.test(E.protocol)||!E.path)return;var ne=$.pathmatch,Y=E.path.match(ne);if(!Y)return;Y[1]!==null&&Y[1]!==void 0&&(R=decodeURIComponent(Y[1].replace(/^:/,""))),F=decodeURIComponent(Y[2]),D=o(E.protocol)}return new r(N,R,O,F,w,D,m)}catch(W){if(!(W instanceof URIError))throw W}}).filter(function(N){return N});if(c.length===1)return c[0]}}function h(j){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(j)}function u(j){var m=e.parse(j);return m.protocol==="gist:"&&m.host&&!m.path?m.protocol+"/"+m.host:j}function f(j){var m=j.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!m){var S=e.parse(j);if(S.auth){const C=j.match(/[^@]+@[^:/]+/);if(C){var E=new e.URL(C[0]);S.auth=E.username||"",E.password&&(S.auth+=":"+E.password)}}return S}return{protocol:"git+ssh:",slashes:!0,auth:m[1],host:m[2],port:null,hostname:m[2],hash:m[4],search:null,query:null,pathname:"/"+m[3],path:"/"+m[3],href:"git+ssh://"+m[1]+"@"+m[2]+"/"+m[3]+(m[4]||"")}}return Nn.exports}var Gt={},ae={},yr,Hi;function Hc(){return Hi||(Hi=1,yr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),yr}var br,Xi;function Xc(){if(Xi)return br;Xi=1;const{charsWide:e,charsFullWidth:t}=Hc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return br={default:s=>s.replace(r,"xx").length,charsRegex:r},br}/*!
192
+ `;var kt={},Nn={exports:{}},fr={exports:{}},Wi;function vs(){if(Wi)return fr.exports;Wi=1;var e=fr.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(i){return"file-"+r(i)}}},t={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:r};Object.keys(e).forEach(function(i){Object.keys(t).forEach(function(s){e[i][s]||(e[i][s]=t[s])}),e[i].protocols_re=RegExp("^("+e[i].protocols.map(function(s){return s.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function r(i){return i.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return fr.exports}var pr,zi;function Kc(){if(zi)return pr;zi=1;var e=vs(),t=Object.assign||function(s,n){if(n===null||typeof n!="object")return s;const o=Object.keys(n);let a=o.length;for(;a--;)s[o[a]]=n[o[a]];return s};pr=r;function r(i,s,n,o,a,d,h){var u=this;u.type=i,Object.keys(e[i]).forEach(function(f){u[f]=e[i][f]}),u.user=s,u.auth=n,u.project=o,u.committish=a,u.default=d,u.opts=h||{}}return r.prototype.hash=function(){return this.committish?"#"+this.committish:""},r.prototype._fill=function(i,s){if(i){var n=t({},s);n.path=n.path?n.path.replace(/^[/]+/g,""):"",s=t(t({},this.opts),s);var o=this;Object.keys(this).forEach(function(m){o[m]!=null&&n[m]==null&&(n[m]=o[m])});var a=n.auth,d=n.committish,h=n.fragment,u=n.path,f=n.project;Object.keys(n).forEach(function(m){var S=n[m];(m==="path"||m==="project")&&typeof S=="string"?n[m]=S.split("/").map(function(E){return encodeURIComponent(E)}).join("/"):m!=="domain"&&(n[m]=encodeURIComponent(S))}),n["auth@"]=a?a+"@":"",n["#fragment"]=h?"#"+this.hashformat(h):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=u?"#"+this.hashformat(u):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),s.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=d?"#"+d:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var j=i;return Object.keys(n).forEach(function(m){j=j.replace(new RegExp("[{]"+m+"[}]","g"),n[m])}),s.noGitPlus?j.replace(/^git[+]/,""):j}},r.prototype.ssh=function(i){return this._fill(this.sshtemplate,i)},r.prototype.sshurl=function(i){return this._fill(this.sshurltemplate,i)},r.prototype.browse=function(i,s,n){return typeof i=="string"?(typeof s!="string"&&(n=s,s=null),this._fill(this.browsefiletemplate,t({fragment:s,path:i},n))):this._fill(this.browsetemplate,i)},r.prototype.docs=function(i){return this._fill(this.docstemplate,i)},r.prototype.bugs=function(i){return this._fill(this.bugstemplate,i)},r.prototype.https=function(i){return this._fill(this.httpstemplate,i)},r.prototype.git=function(i){return this._fill(this.gittemplate,i)},r.prototype.shortcut=function(i){return this._fill(this.shortcuttemplate,i)},r.prototype.path=function(i){return this._fill(this.pathtemplate,i)},r.prototype.tarball=function(i){var s=t({},i,{noCommittish:!1});return this._fill(this.tarballtemplate,s)},r.prototype.file=function(i,s){return this._fill(this.filetemplate,t({path:i},s))},r.prototype.getDefaultRepresentation=function(){return this.default},r.prototype.toString=function(i){return this.default&&typeof this[this.default]=="function"?this[this.default](i):this.sshurl(i)},pr}var mr,Vi;function Gc(){return Vi||(Vi=1,mr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),mr}var gr,Ki;function Hc(){if(Ki)return gr;Ki=1,gr=e,e.Node=s,e.create=e;function e(n){var o=this;if(o instanceof e||(o=new e),o.tail=null,o.head=null,o.length=0,n&&typeof n.forEach=="function")n.forEach(function(h){o.push(h)});else if(arguments.length>0)for(var a=0,d=arguments.length;a<d;a++)o.push(arguments[a]);return o}e.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var o=n.next,a=n.prev;return o&&(o.prev=a),a&&(a.next=o),n===this.head&&(this.head=o),n===this.tail&&(this.tail=a),n.list.length--,n.next=null,n.prev=null,n.list=null,o},e.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var o=this.head;n.list=this,n.next=o,o&&(o.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},e.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var o=this.tail;n.list=this,n.prev=o,o&&(o.next=n),this.tail=n,this.head||(this.head=n),this.length++}},e.prototype.push=function(){for(var n=0,o=arguments.length;n<o;n++)r(this,arguments[n]);return this.length},e.prototype.unshift=function(){for(var n=0,o=arguments.length;n<o;n++)i(this,arguments[n]);return this.length},e.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},e.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},e.prototype.forEach=function(n,o){o=o||this;for(var a=this.head,d=0;a!==null;d++)n.call(o,a.value,d,this),a=a.next},e.prototype.forEachReverse=function(n,o){o=o||this;for(var a=this.tail,d=this.length-1;a!==null;d--)n.call(o,a.value,d,this),a=a.prev},e.prototype.get=function(n){for(var o=0,a=this.head;a!==null&&o<n;o++)a=a.next;if(o===n&&a!==null)return a.value},e.prototype.getReverse=function(n){for(var o=0,a=this.tail;a!==null&&o<n;o++)a=a.prev;if(o===n&&a!==null)return a.value},e.prototype.map=function(n,o){o=o||this;for(var a=new e,d=this.head;d!==null;)a.push(n.call(o,d.value,this)),d=d.next;return a},e.prototype.mapReverse=function(n,o){o=o||this;for(var a=new e,d=this.tail;d!==null;)a.push(n.call(o,d.value,this)),d=d.prev;return a},e.prototype.reduce=function(n,o){var a,d=this.head;if(arguments.length>1)a=o;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;d!==null;h++)a=n(a,d.value,h),d=d.next;return a},e.prototype.reduceReverse=function(n,o){var a,d=this.tail;if(arguments.length>1)a=o;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;d!==null;h--)a=n(a,d.value,h),d=d.prev;return a},e.prototype.toArray=function(){for(var n=new Array(this.length),o=0,a=this.head;a!==null;o++)n[o]=a.value,a=a.next;return n},e.prototype.toArrayReverse=function(){for(var n=new Array(this.length),o=0,a=this.tail;a!==null;o++)n[o]=a.value,a=a.prev;return n},e.prototype.slice=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(;h!==null&&d<o;d++,h=h.next)a.push(h.value);return a},e.prototype.sliceReverse=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=this.length,h=this.tail;h!==null&&d>o;d--)h=h.prev;for(;h!==null&&d>n;d--,h=h.prev)a.push(h.value);return a},e.prototype.splice=function(n,o,...a){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(var u=[],d=0;h&&d<o;d++)u.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var d=0;d<a.length;d++)h=t(this,h,a[d]);return u},e.prototype.reverse=function(){for(var n=this.head,o=this.tail,a=n;a!==null;a=a.prev){var d=a.prev;a.prev=a.next,a.next=d}return this.head=o,this.tail=n,this};function t(n,o,a){var d=o===n.head?new s(a,null,o,n):new s(a,o,o.next,n);return d.next===null&&(n.tail=d),d.prev===null&&(n.head=d),n.length++,d}function r(n,o){n.tail=new s(o,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function i(n,o){n.head=new s(o,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function s(n,o,a,d){if(!(this instanceof s))return new s(n,o,a,d);this.list=d,this.value=n,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{Gc()(e)}catch{}return gr}var vr,Gi;function Xc(){if(Gi)return vr;Gi=1;const e=Hc(),t=Symbol("max"),r=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),n=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),u=Symbol("updateAgeOnGet"),f=()=>1;class j{constructor(O){if(typeof O=="number"&&(O={max:O}),O||(O={}),O.max&&(typeof O.max!="number"||O.max<0))throw new TypeError("max must be a non-negative number");this[t]=O.max||1/0;const w=O.length||f;if(this[i]=typeof w!="function"?f:w,this[s]=O.stale||!1,O.maxAge&&typeof O.maxAge!="number")throw new TypeError("maxAge must be a number");this[n]=O.maxAge||0,this[o]=O.dispose,this[a]=O.noDisposeOnSet||!1,this[u]=O.updateAgeOnGet||!1,this.reset()}set max(O){if(typeof O!="number"||O<0)throw new TypeError("max must be a non-negative number");this[t]=O||1/0,E(this)}get max(){return this[t]}set allowStale(O){this[s]=!!O}get allowStale(){return this[s]}set maxAge(O){if(typeof O!="number")throw new TypeError("maxAge must be a non-negative number");this[n]=O,E(this)}get maxAge(){return this[n]}set lengthCalculator(O){typeof O!="function"&&(O=f),O!==this[i]&&(this[i]=O,this[r]=0,this[d].forEach(w=>{w.length=this[i](w.value,w.key),this[r]+=w.length})),E(this)}get lengthCalculator(){return this[i]}get length(){return this[r]}get itemCount(){return this[d].length}rforEach(O,w){w=w||this;for(let R=this[d].tail;R!==null;){const F=R.prev;N(this,O,R,w),R=F}}forEach(O,w){w=w||this;for(let R=this[d].head;R!==null;){const F=R.next;N(this,O,R,w),R=F}}keys(){return this[d].toArray().map(O=>O.key)}values(){return this[d].toArray().map(O=>O.value)}reset(){this[o]&&this[d]&&this[d].length&&this[d].forEach(O=>this[o](O.key,O.value)),this[h]=new Map,this[d]=new e,this[r]=0}dump(){return this[d].map(O=>S(this,O)?!1:{k:O.key,v:O.value,e:O.now+(O.maxAge||0)}).toArray().filter(O=>O)}dumpLru(){return this[d]}set(O,w,R){if(R=R||this[n],R&&typeof R!="number")throw new TypeError("maxAge must be a number");const F=R?Date.now():0,D=this[i](w,O);if(this[h].has(O)){if(D>this[t])return C(this,this[h].get(O)),!1;const W=this[h].get(O).value;return this[o]&&(this[a]||this[o](O,W.value)),W.now=F,W.maxAge=R,W.value=w,this[r]+=D-W.length,W.length=D,this.get(O),E(this),!0}const ne=new c(O,w,D,F,R);return ne.length>this[t]?(this[o]&&this[o](O,w),!1):(this[r]+=ne.length,this[d].unshift(ne),this[h].set(O,this[d].head),E(this),!0)}has(O){if(!this[h].has(O))return!1;const w=this[h].get(O).value;return!S(this,w)}get(O){return m(this,O,!0)}peek(O){return m(this,O,!1)}pop(){const O=this[d].tail;return O?(C(this,O),O.value):null}del(O){C(this,this[h].get(O))}load(O){this.reset();const w=Date.now();for(let R=O.length-1;R>=0;R--){const F=O[R],D=F.e||0;if(D===0)this.set(F.k,F.v);else{const ne=D-w;ne>0&&this.set(F.k,F.v,ne)}}}prune(){this[h].forEach((O,w)=>m(this,w,!1))}}const m=($,O,w)=>{const R=$[h].get(O);if(R){const F=R.value;if(S($,F)){if(C($,R),!$[s])return}else w&&($[u]&&(R.value.now=Date.now()),$[d].unshiftNode(R));return F.value}},S=($,O)=>{if(!O||!O.maxAge&&!$[n])return!1;const w=Date.now()-O.now;return O.maxAge?w>O.maxAge:$[n]&&w>$[n]},E=$=>{if($[r]>$[t])for(let O=$[d].tail;$[r]>$[t]&&O!==null;){const w=O.prev;C($,O),O=w}},C=($,O)=>{if(O){const w=O.value;$[o]&&$[o](w.key,w.value),$[r]-=w.length,$[h].delete(w.key),$[d].removeNode(O)}};class c{constructor(O,w,R,F,D){this.key=O,this.value=w,this.length=R,this.now=F,this.maxAge=D||0}}const N=($,O,w,R)=>{let F=w.value;S($,F)&&(C($,w),$[s]||(F=void 0)),F&&O.call(R,F.value,F.key,$)};return vr=j,vr}var Hi;function Yc(){if(Hi)return Nn.exports;Hi=1;var e=ll,t=vs(),r=Nn.exports=Kc(),i=Xc(),s=new i({max:1e3}),n={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function o(j){return n[j]||j.slice(0,-1)}var a={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Nn.exports.fromUrl=function(j,m){if(typeof j=="string"){var S=j+JSON.stringify(m||{});return s.has(S)||s.set(S,d(j,m)),s.get(S)}};function d(j,m){if(!(j==null||j==="")){var S=u(h(j)?"github:"+j:j),E=f(S),C=S.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(t).map(function(N){try{var $=t[N],O=null;E.auth&&a[E.protocol]&&(O=E.auth);var w=E.hash?decodeURIComponent(E.hash.substr(1)):null,R=null,F=null,D=null;if(C&&C[1]===N)R=C[2]&&decodeURIComponent(C[2]),F=decodeURIComponent(C[3].replace(/\.git$/,"")),D="shortcut";else{if(E.host&&E.host!==$.domain&&E.host.replace(/^www[.]/,"")!==$.domain||!$.protocols_re.test(E.protocol)||!E.path)return;var ne=$.pathmatch,Y=E.path.match(ne);if(!Y)return;Y[1]!==null&&Y[1]!==void 0&&(R=decodeURIComponent(Y[1].replace(/^:/,""))),F=decodeURIComponent(Y[2]),D=o(E.protocol)}return new r(N,R,O,F,w,D,m)}catch(W){if(!(W instanceof URIError))throw W}}).filter(function(N){return N});if(c.length===1)return c[0]}}function h(j){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(j)}function u(j){var m=e.parse(j);return m.protocol==="gist:"&&m.host&&!m.path?m.protocol+"/"+m.host:j}function f(j){var m=j.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!m){var S=e.parse(j);if(S.auth){const C=j.match(/[^@]+@[^:/]+/);if(C){var E=new e.URL(C[0]);S.auth=E.username||"",E.password&&(S.auth+=":"+E.password)}}return S}return{protocol:"git+ssh:",slashes:!0,auth:m[1],host:m[2],port:null,hostname:m[2],hash:m[4],search:null,query:null,pathname:"/"+m[3],path:"/"+m[3],href:"git+ssh://"+m[1]+"@"+m[2]+"/"+m[3]+(m[4]||"")}}return Nn.exports}var Gt={},ae={},yr,Xi;function Jc(){return Xi||(Xi=1,yr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),yr}var br,Yi;function Qc(){if(Yi)return br;Yi=1;const{charsWide:e,charsFullWidth:t}=Jc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return br={default:s=>s.replace(r,"xx").length,charsRegex:r},br}/*!
193
193
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
194
194
  *
195
195
  * Copyright (c) 2014-2016, Jon Schlinkert.
196
196
  * Licensed under the MIT License.
197
- */var xr,Yi;function Yc(){return Yi||(Yi=1,xr=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}),xr}/*!
197
+ */var xr,Ji;function Zc(){return Ji||(Ji=1,xr=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}),xr}/*!
198
198
  * is-glob <https://github.com/jonschlinkert/is-glob>
199
199
  *
200
200
  * Copyright (c) 2014-2017, Jon Schlinkert.
201
201
  * Released under the MIT License.
202
- */var wr,Ji;function Jc(){if(Ji)return wr;Ji=1;var e=Yc(),t={"{":"}","(":")","[":"]"},r=function(s){if(s[0]==="!")return!0;for(var n=0,o=-2,a=-2,d=-2,h=-2,u=-2;n<s.length;){if(s[n]==="*"||s[n+1]==="?"&&/[\].+)]/.test(s[n])||a!==-1&&s[n]==="["&&s[n+1]!=="]"&&(a<n&&(a=s.indexOf("]",n)),a>n&&(u===-1||u>a||(u=s.indexOf("\\",n),u===-1||u>a)))||d!==-1&&s[n]==="{"&&s[n+1]!=="}"&&(d=s.indexOf("}",n),d>n&&(u=s.indexOf("\\",n),u===-1||u>d))||h!==-1&&s[n]==="("&&s[n+1]==="?"&&/[:!=]/.test(s[n+2])&&s[n+3]!==")"&&(h=s.indexOf(")",n),h>n&&(u=s.indexOf("\\",n),u===-1||u>h))||o!==-1&&s[n]==="("&&s[n+1]!=="|"&&(o<n&&(o=s.indexOf("|",n)),o!==-1&&s[o+1]!==")"&&(h=s.indexOf(")",o),h>o&&(u=s.indexOf("\\",o),u===-1||u>h))))return!0;if(s[n]==="\\"){var f=s[n+1];n+=2;var j=t[f];if(j){var m=s.indexOf(j,n);m!==-1&&(n=m+1)}if(s[n]==="!")return!0}else n++}return!1},i=function(s){if(s[0]==="!")return!0;for(var n=0;n<s.length;){if(/[*?{}()[\]]/.test(s[n]))return!0;if(s[n]==="\\"){var o=s[n+1];n+=2;var a=t[o];if(a){var d=s.indexOf(a,n);d!==-1&&(n=d+1)}if(s[n]==="!")return!0}else n++}return!1};return wr=function(n,o){if(typeof n!="string"||n==="")return!1;if(e(n))return!0;var a=r;return o&&o.strict===!1&&(a=i),a(n)},wr}var An={exports:{}},Qi;function Qc(){return Qi||(Qi=1,function(e,t){var r={};t=e.exports=D;var i;typeof Ha=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?i=function(){var p=Array.prototype.slice.call(arguments,0);p.unshift("SEMVER"),console.log.apply(console,p)}:i=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,a=s-6,d=t.re=[],h=t.safeRe=[],u=t.src=[],f=t.tokens={},j=0;function m(p){f[p]=j++}var S="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",s],[S,a]];function C(p){for(var b=0;b<E.length;b++){var k=E[b][0],_=E[b][1];p=p.split(k+"*").join(k+"{0,"+_+"}").split(k+"+").join(k+"{1,"+_+"}")}return p}m("NUMERICIDENTIFIER"),u[f.NUMERICIDENTIFIER]="0|[1-9]\\d*",m("NUMERICIDENTIFIERLOOSE"),u[f.NUMERICIDENTIFIERLOOSE]="\\d+",m("NONNUMERICIDENTIFIER"),u[f.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",m("MAINVERSION"),u[f.MAINVERSION]="("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")",m("MAINVERSIONLOOSE"),u[f.MAINVERSIONLOOSE]="("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")",m("PRERELEASEIDENTIFIER"),u[f.PRERELEASEIDENTIFIER]="(?:"+u[f.NUMERICIDENTIFIER]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASEIDENTIFIERLOOSE"),u[f.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[f.NUMERICIDENTIFIERLOOSE]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASE"),u[f.PRERELEASE]="(?:-("+u[f.PRERELEASEIDENTIFIER]+"(?:\\."+u[f.PRERELEASEIDENTIFIER]+")*))",m("PRERELEASELOOSE"),u[f.PRERELEASELOOSE]="(?:-?("+u[f.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[f.PRERELEASEIDENTIFIERLOOSE]+")*))",m("BUILDIDENTIFIER"),u[f.BUILDIDENTIFIER]=S+"+",m("BUILD"),u[f.BUILD]="(?:\\+("+u[f.BUILDIDENTIFIER]+"(?:\\."+u[f.BUILDIDENTIFIER]+")*))",m("FULL"),m("FULLPLAIN"),u[f.FULLPLAIN]="v?"+u[f.MAINVERSION]+u[f.PRERELEASE]+"?"+u[f.BUILD]+"?",u[f.FULL]="^"+u[f.FULLPLAIN]+"$",m("LOOSEPLAIN"),u[f.LOOSEPLAIN]="[v=\\s]*"+u[f.MAINVERSIONLOOSE]+u[f.PRERELEASELOOSE]+"?"+u[f.BUILD]+"?",m("LOOSE"),u[f.LOOSE]="^"+u[f.LOOSEPLAIN]+"$",m("GTLT"),u[f.GTLT]="((?:<|>)?=?)",m("XRANGEIDENTIFIERLOOSE"),u[f.XRANGEIDENTIFIERLOOSE]=u[f.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",m("XRANGEIDENTIFIER"),u[f.XRANGEIDENTIFIER]=u[f.NUMERICIDENTIFIER]+"|x|X|\\*",m("XRANGEPLAIN"),u[f.XRANGEPLAIN]="[v=\\s]*("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:"+u[f.PRERELEASE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGEPLAINLOOSE"),u[f.XRANGEPLAINLOOSE]="[v=\\s]*("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:"+u[f.PRERELEASELOOSE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGE"),u[f.XRANGE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAIN]+"$",m("XRANGELOOSE"),u[f.XRANGELOOSE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAINLOOSE]+"$",m("COERCE"),u[f.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",m("COERCERTL"),d[f.COERCERTL]=new RegExp(u[f.COERCE],"g"),h[f.COERCERTL]=new RegExp(C(u[f.COERCE]),"g"),m("LONETILDE"),u[f.LONETILDE]="(?:~>?)",m("TILDETRIM"),u[f.TILDETRIM]="(\\s*)"+u[f.LONETILDE]+"\\s+",d[f.TILDETRIM]=new RegExp(u[f.TILDETRIM],"g"),h[f.TILDETRIM]=new RegExp(C(u[f.TILDETRIM]),"g");var c="$1~";m("TILDE"),u[f.TILDE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAIN]+"$",m("TILDELOOSE"),u[f.TILDELOOSE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAINLOOSE]+"$",m("LONECARET"),u[f.LONECARET]="(?:\\^)",m("CARETTRIM"),u[f.CARETTRIM]="(\\s*)"+u[f.LONECARET]+"\\s+",d[f.CARETTRIM]=new RegExp(u[f.CARETTRIM],"g"),h[f.CARETTRIM]=new RegExp(C(u[f.CARETTRIM]),"g");var N="$1^";m("CARET"),u[f.CARET]="^"+u[f.LONECARET]+u[f.XRANGEPLAIN]+"$",m("CARETLOOSE"),u[f.CARETLOOSE]="^"+u[f.LONECARET]+u[f.XRANGEPLAINLOOSE]+"$",m("COMPARATORLOOSE"),u[f.COMPARATORLOOSE]="^"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+")$|^$",m("COMPARATOR"),u[f.COMPARATOR]="^"+u[f.GTLT]+"\\s*("+u[f.FULLPLAIN]+")$|^$",m("COMPARATORTRIM"),u[f.COMPARATORTRIM]="(\\s*)"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+"|"+u[f.XRANGEPLAIN]+")",d[f.COMPARATORTRIM]=new RegExp(u[f.COMPARATORTRIM],"g"),h[f.COMPARATORTRIM]=new RegExp(C(u[f.COMPARATORTRIM]),"g");var $="$1$2$3";m("HYPHENRANGE"),u[f.HYPHENRANGE]="^\\s*("+u[f.XRANGEPLAIN]+")\\s+-\\s+("+u[f.XRANGEPLAIN]+")\\s*$",m("HYPHENRANGELOOSE"),u[f.HYPHENRANGELOOSE]="^\\s*("+u[f.XRANGEPLAINLOOSE]+")\\s+-\\s+("+u[f.XRANGEPLAINLOOSE]+")\\s*$",m("STAR"),u[f.STAR]="(<|>)?=?\\s*\\*";for(var O=0;O<j;O++)i(O,u[O]),d[O]||(d[O]=new RegExp(u[O]),h[O]=new RegExp(C(u[O])));t.parse=w;function w(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof D)return p;if(typeof p!="string"||p.length>s)return null;var k=b.loose?h[f.LOOSE]:h[f.FULL];if(!k.test(p))return null;try{return new D(p,b)}catch{return null}}t.valid=R;function R(p,b){var k=w(p,b);return k?k.version:null}t.clean=F;function F(p,b){var k=w(p.trim().replace(/^[=v]+/,""),b);return k?k.version:null}t.SemVer=D;function D(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof D){if(p.loose===b.loose)return p;p=p.version}else if(typeof p!="string")throw new TypeError("Invalid Version: "+p);if(p.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof D))return new D(p,b);i("SemVer",p,b),this.options=b,this.loose=!!b.loose;var k=p.trim().match(b.loose?h[f.LOOSE]:h[f.FULL]);if(!k)throw new TypeError("Invalid Version: "+p);if(this.raw=p,this.major=+k[1],this.minor=+k[2],this.patch=+k[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");k[4]?this.prerelease=k[4].split(".").map(function(_){if(/^[0-9]+$/.test(_)){var z=+_;if(z>=0&&z<n)return z}return _}):this.prerelease=[],this.build=k[5]?k[5].split("."):[],this.format()}D.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},D.prototype.toString=function(){return this.version},D.prototype.compare=function(p){return i("SemVer.compare",this.version,this.options,p),p instanceof D||(p=new D(p,this.options)),this.compareMain(p)||this.comparePre(p)},D.prototype.compareMain=function(p){return p instanceof D||(p=new D(p,this.options)),U(this.major,p.major)||U(this.minor,p.minor)||U(this.patch,p.patch)},D.prototype.comparePre=function(p){if(p instanceof D||(p=new D(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;var b=0;do{var k=this.prerelease[b],_=p.prerelease[b];if(i("prerelease compare",b,k,_),k===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(k===void 0)return-1;if(k===_)continue;return U(k,_)}while(++b)},D.prototype.compareBuild=function(p){p instanceof D||(p=new D(p,this.options));var b=0;do{var k=this.build[b],_=p.build[b];if(i("prerelease compare",b,k,_),k===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(k===void 0)return-1;if(k===_)continue;return U(k,_)}while(++b)},D.prototype.inc=function(p,b){switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",b),this.inc("pre",b);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var k=this.prerelease.length;--k>=0;)typeof this.prerelease[k]=="number"&&(this.prerelease[k]++,k=-2);k===-1&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+p)}return this.format(),this.raw=this.version,this},t.inc=ne;function ne(p,b,k,_){typeof k=="string"&&(_=k,k=void 0);try{return new D(p,k).inc(b,_).version}catch{return null}}t.diff=Y;function Y(p,b){if(Pe(p,b))return null;var k=w(p),_=w(b),z="";if(k.prerelease.length||_.prerelease.length){z="pre";var ee="prerelease"}for(var oe in k)if((oe==="major"||oe==="minor"||oe==="patch")&&k[oe]!==_[oe])return z+oe;return ee}t.compareIdentifiers=U;var W=/^[0-9]+$/;function U(p,b){var k=W.test(p),_=W.test(b);return k&&_&&(p=+p,b=+b),p===b?0:k&&!_?-1:_&&!k?1:p<b?-1:1}t.rcompareIdentifiers=H;function H(p,b){return U(b,p)}t.major=A;function A(p,b){return new D(p,b).major}t.minor=J;function J(p,b){return new D(p,b).minor}t.patch=M;function M(p,b){return new D(p,b).patch}t.compare=ue;function ue(p,b,k){return new D(p,k).compare(new D(b,k))}t.compareLoose=Ie;function Ie(p,b){return ue(p,b,!0)}t.compareBuild=K;function K(p,b,k){var _=new D(p,k),z=new D(b,k);return _.compare(z)||_.compareBuild(z)}t.rcompare=Ee;function Ee(p,b,k){return ue(b,p,k)}t.sort=ce;function ce(p,b){return p.sort(function(k,_){return t.compareBuild(k,_,b)})}t.rsort=Me;function Me(p,b){return p.sort(function(k,_){return t.compareBuild(_,k,b)})}t.gt=me;function me(p,b,k){return ue(p,b,k)>0}t.lt=Oe;function Oe(p,b,k){return ue(p,b,k)<0}t.eq=Pe;function Pe(p,b,k){return ue(p,b,k)===0}t.neq=nt;function nt(p,b,k){return ue(p,b,k)!==0}t.gte=ut;function ut(p,b,k){return ue(p,b,k)>=0}t.lte=ft;function ft(p,b,k){return ue(p,b,k)<=0}t.cmp=rt;function rt(p,b,k,_){switch(b){case"===":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p===k;case"!==":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p!==k;case"":case"=":case"==":return Pe(p,k,_);case"!=":return nt(p,k,_);case">":return me(p,k,_);case">=":return ut(p,k,_);case"<":return Oe(p,k,_);case"<=":return ft(p,k,_);default:throw new TypeError("Invalid operator: "+b)}}t.Comparator=we;function we(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof we){if(p.loose===!!b.loose)return p;p=p.value}if(!(this instanceof we))return new we(p,b);p=p.trim().split(/\s+/).join(" "),i("comparator",p,b),this.options=b,this.loose=!!b.loose,this.parse(p),this.semver===de?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var de={};we.prototype.parse=function(p){var b=this.options.loose?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],k=p.match(b);if(!k)throw new TypeError("Invalid comparator: "+p);this.operator=k[1]!==void 0?k[1]:"",this.operator==="="&&(this.operator=""),k[2]?this.semver=new D(k[2],this.options.loose):this.semver=de},we.prototype.toString=function(){return this.value},we.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===de||p===de)return!0;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}return rt(p,this.operator,this.semver,this.options)},we.prototype.intersects=function(p,b){if(!(p instanceof we))throw new TypeError("a Comparator is required");(!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1});var k;if(this.operator==="")return this.value===""?!0:(k=new ge(p.value,b),he(this.value,k,b));if(p.operator==="")return p.value===""?!0:(k=new ge(this.value,b),he(p.semver,k,b));var _=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),z=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ee=this.semver.version===p.semver.version,oe=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Se=rt(this.semver,"<",p.semver,b)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),xe=rt(this.semver,">",p.semver,b)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return _||z||ee&&oe||Se||xe},t.Range=ge;function ge(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof ge)return p.loose===!!b.loose&&p.includePrerelease===!!b.includePrerelease?p:new ge(p.raw,b);if(p instanceof we)return new ge(p.value,b);if(!(this instanceof ge))return new ge(p,b);if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(k){return this.parseRange(k.trim())},this).filter(function(k){return k.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ge.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ge.prototype.toString=function(){return this.range},ge.prototype.parseRange=function(p){var b=this.options.loose,k=b?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,st),i("hyphen replace",p),p=p.replace(h[f.COMPARATORTRIM],$),i("comparator trim",p,h[f.COMPARATORTRIM]),p=p.replace(h[f.TILDETRIM],c),p=p.replace(h[f.CARETTRIM],N),p=p.split(/\s+/).join(" ");var _=b?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],z=p.split(" ").map(function(ee){return jt(ee,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(z=z.filter(function(ee){return!!ee.match(_)})),z=z.map(function(ee){return new we(ee,this.options)},this),z},ge.prototype.intersects=function(p,b){if(!(p instanceof ge))throw new TypeError("a Range is required");return this.set.some(function(k){return Fe(k,b)&&p.set.some(function(_){return Fe(_,b)&&k.every(function(z){return _.every(function(ee){return z.intersects(ee,b)})})})})};function Fe(p,b){for(var k=!0,_=p.slice(),z=_.pop();k&&_.length;)k=_.every(function(ee){return z.intersects(ee,b)}),z=_.pop();return k}t.toComparators=$e;function $e(p,b){return new ge(p,b).set.map(function(k){return k.map(function(_){return _.value}).join(" ").trim().split(" ")})}function jt(p,b){return i("comp",p,b),p=Ct(p,b),i("caret",p),p=Et(p,b),i("tildes",p),p=Ve(p,b),i("xrange",p),p=pt(p,b),i("stars",p),p}function Ae(p){return!p||p.toLowerCase()==="x"||p==="*"}function Et(p,b){return p.trim().split(/\s+/).map(function(k){return Ot(k,b)}).join(" ")}function Ot(p,b){var k=b.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(_,z,ee,oe,Se){i("tilde",p,_,z,ee,oe,Se);var xe;return Ae(z)?xe="":Ae(ee)?xe=">="+z+".0.0 <"+(+z+1)+".0.0":Ae(oe)?xe=">="+z+"."+ee+".0 <"+z+"."+(+ee+1)+".0":Se?(i("replaceTilde pr",Se),xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+(+ee+1)+".0"):xe=">="+z+"."+ee+"."+oe+" <"+z+"."+(+ee+1)+".0",i("tilde return",xe),xe})}function Ct(p,b){return p.trim().split(/\s+/).map(function(k){return It(k,b)}).join(" ")}function It(p,b){i("caret",p,b);var k=b.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(_,z,ee,oe,Se){i("caret",p,_,z,ee,oe,Se);var xe;return Ae(z)?xe="":Ae(ee)?xe=">="+z+".0.0 <"+(+z+1)+".0.0":Ae(oe)?z==="0"?xe=">="+z+"."+ee+".0 <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+".0 <"+(+z+1)+".0.0":Se?(i("replaceCaret pr",Se),z==="0"?ee==="0"?xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+ee+"."+(+oe+1):xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+(+z+1)+".0.0"):(i("no pr"),z==="0"?ee==="0"?xe=">="+z+"."+ee+"."+oe+" <"+z+"."+ee+"."+(+oe+1):xe=">="+z+"."+ee+"."+oe+" <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+"."+oe+" <"+(+z+1)+".0.0"),i("caret return",xe),xe})}function Ve(p,b){return i("replaceXRanges",p,b),p.split(/\s+/).map(function(k){return Rt(k,b)}).join(" ")}function Rt(p,b){p=p.trim();var k=b.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(_,z,ee,oe,Se,xe){i("xRange",p,_,z,ee,oe,Se,xe);var Qe=Ae(ee),Je=Qe||Ae(oe),Le=Je||Ae(Se),Be=Le;return z==="="&&Be&&(z=""),xe=b.includePrerelease?"-0":"",Qe?z===">"||z==="<"?_="<0.0.0-0":_="*":z&&Be?(Je&&(oe=0),Se=0,z===">"?(z=">=",Je?(ee=+ee+1,oe=0,Se=0):(oe=+oe+1,Se=0)):z==="<="&&(z="<",Je?ee=+ee+1:oe=+oe+1),_=z+ee+"."+oe+"."+Se+xe):Je?_=">="+ee+".0.0"+xe+" <"+(+ee+1)+".0.0"+xe:Le&&(_=">="+ee+"."+oe+".0"+xe+" <"+ee+"."+(+oe+1)+".0"+xe),i("xRange return",_),_})}function pt(p,b){return i("replaceStars",p,b),p.trim().replace(h[f.STAR],"")}function st(p,b,k,_,z,ee,oe,Se,xe,Qe,Je,Le,Be){return Ae(k)?b="":Ae(_)?b=">="+k+".0.0":Ae(z)?b=">="+k+"."+_+".0":b=">="+b,Ae(xe)?Se="":Ae(Qe)?Se="<"+(+xe+1)+".0.0":Ae(Je)?Se="<"+xe+"."+(+Qe+1)+".0":Le?Se="<="+xe+"."+Qe+"."+Je+"-"+Le:Se="<="+Se,(b+" "+Se).trim()}ge.prototype.test=function(p){if(!p)return!1;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}for(var b=0;b<this.set.length;b++)if(V(this.set[b],p,this.options))return!0;return!1};function V(p,b,k){for(var _=0;_<p.length;_++)if(!p[_].test(b))return!1;if(b.prerelease.length&&!k.includePrerelease){for(_=0;_<p.length;_++)if(i(p[_].semver),p[_].semver!==de&&p[_].semver.prerelease.length>0){var z=p[_].semver;if(z.major===b.major&&z.minor===b.minor&&z.patch===b.patch)return!0}return!1}return!0}t.satisfies=he;function he(p,b,k){try{b=new ge(b,k)}catch{return!1}return b.test(p)}t.maxSatisfying=De;function De(p,b,k){var _=null,z=null;try{var ee=new ge(b,k)}catch{return null}return p.forEach(function(oe){ee.test(oe)&&(!_||z.compare(oe)===-1)&&(_=oe,z=new D(_,k))}),_}t.minSatisfying=Xe;function Xe(p,b,k){var _=null,z=null;try{var ee=new ge(b,k)}catch{return null}return p.forEach(function(oe){ee.test(oe)&&(!_||z.compare(oe)===1)&&(_=oe,z=new D(_,k))}),_}t.minVersion=it;function it(p,b){p=new ge(p,b);var k=new D("0.0.0");if(p.test(k)||(k=new D("0.0.0-0"),p.test(k)))return k;k=null;for(var _=0;_<p.set.length;++_){var z=p.set[_];z.forEach(function(ee){var oe=new D(ee.semver.version);switch(ee.operator){case">":oe.prerelease.length===0?oe.patch++:oe.prerelease.push(0),oe.raw=oe.format();case"":case">=":(!k||me(k,oe))&&(k=oe);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ee.operator)}})}return k&&p.test(k)?k:null}t.validRange=wt;function wt(p,b){try{return new ge(p,b).range||"*"}catch{return null}}t.ltr=qt;function qt(p,b,k){return L(p,b,"<",k)}t.gtr=Ue;function Ue(p,b,k){return L(p,b,">",k)}t.outside=L;function L(p,b,k,_){p=new D(p,_),b=new ge(b,_);var z,ee,oe,Se,xe;switch(k){case">":z=me,ee=ft,oe=Oe,Se=">",xe=">=";break;case"<":z=Oe,ee=ut,oe=me,Se="<",xe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(he(p,b,_))return!1;for(var Qe=0;Qe<b.set.length;++Qe){var Je=b.set[Qe],Le=null,Be=null;if(Je.forEach(function(Ye){Ye.semver===de&&(Ye=new we(">=0.0.0")),Le=Le||Ye,Be=Be||Ye,z(Ye.semver,Le.semver,_)?Le=Ye:oe(Ye.semver,Be.semver,_)&&(Be=Ye)}),Le.operator===Se||Le.operator===xe||(!Be.operator||Be.operator===Se)&&ee(p,Be.semver))return!1;if(Be.operator===xe&&oe(p,Be.semver))return!1}return!0}t.prerelease=re;function re(p,b){var k=w(p,b);return k&&k.prerelease.length?k.prerelease:null}t.intersects=ve;function ve(p,b,k){return p=new ge(p,k),b=new ge(b,k),p.intersects(b)}t.coerce=Re;function Re(p,b){if(p instanceof D)return p;if(typeof p=="number"&&(p=String(p)),typeof p!="string")return null;b=b||{};var k=null;if(!b.rtl)k=p.match(h[f.COERCE]);else{for(var _;(_=h[f.COERCERTL].exec(p))&&(!k||k.index+k[0].length!==p.length);)(!k||_.index+_[0].length!==k.index+k[0].length)&&(k=_),h[f.COERCERTL].lastIndex=_.index+_[1].length+_[2].length;h[f.COERCERTL].lastIndex=-1}return k===null?null:w(k[2]+"."+(k[3]||"0")+"."+(k[4]||"0"),b)}}(An,An.exports)),An.exports}var Sr,Zi;function Zc(){if(Zi)return Sr;Zi=1;const e=ii(),t=Qc(),r="semver",i={base:e.string(),type:"semverRange",validate:function(o,{error:a}){return t.validRange(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver range"}},s={};return s.compare={method:!1,validate:function(o,a,{exp:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{exp:d})},args:[{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compare",args:{exp:a}})}}}),s.cmp={method:function(o,a){return this.$_addRule({name:"cmp",args:{cmp:o,exp:a}})},validate:function(o,a,{cmp:d,exp:h}){return t.cmp(o,d,h)?o:a.error(`${r}.cmp`,{cmp:d,exp:h})},args:[{name:"cmp",assert:o=>["===","!==","","=","==","!=",">",">=","<","<="].includes(o),message:"needs to be a valid comparator"},{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},s.compareRange={method:!1,validate:function(o,a,{rng:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{rng:d})},args:[{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compareRange",args:{rng:a}})}}}),s.outside={method:function(o,a){return this.$_addRule({name:"outside",args:{hilo:o,rng:a}})},validate:function(o,a,{hilo:d,rng:h}){return t.outside(o,h,d)?o:a.error(`${r}.outside`,{hilo:d,rng:h})},args:[{name:"hilo",assert:o=>[">","<"].includes(o),message:"needs to be a valid comparator"},{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},Sr={semver:{base:e.string(),type:"semver",validate:function(o,{error:a}){return t.valid(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver expression",[`${r}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${r}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${r}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${r}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${r}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${r}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${r}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${r}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${r}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${r}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${r}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:s},semverRange:i},Sr}/*!
202
+ */var wr,Qi;function eu(){if(Qi)return wr;Qi=1;var e=Zc(),t={"{":"}","(":")","[":"]"},r=function(s){if(s[0]==="!")return!0;for(var n=0,o=-2,a=-2,d=-2,h=-2,u=-2;n<s.length;){if(s[n]==="*"||s[n+1]==="?"&&/[\].+)]/.test(s[n])||a!==-1&&s[n]==="["&&s[n+1]!=="]"&&(a<n&&(a=s.indexOf("]",n)),a>n&&(u===-1||u>a||(u=s.indexOf("\\",n),u===-1||u>a)))||d!==-1&&s[n]==="{"&&s[n+1]!=="}"&&(d=s.indexOf("}",n),d>n&&(u=s.indexOf("\\",n),u===-1||u>d))||h!==-1&&s[n]==="("&&s[n+1]==="?"&&/[:!=]/.test(s[n+2])&&s[n+3]!==")"&&(h=s.indexOf(")",n),h>n&&(u=s.indexOf("\\",n),u===-1||u>h))||o!==-1&&s[n]==="("&&s[n+1]!=="|"&&(o<n&&(o=s.indexOf("|",n)),o!==-1&&s[o+1]!==")"&&(h=s.indexOf(")",o),h>o&&(u=s.indexOf("\\",o),u===-1||u>h))))return!0;if(s[n]==="\\"){var f=s[n+1];n+=2;var j=t[f];if(j){var m=s.indexOf(j,n);m!==-1&&(n=m+1)}if(s[n]==="!")return!0}else n++}return!1},i=function(s){if(s[0]==="!")return!0;for(var n=0;n<s.length;){if(/[*?{}()[\]]/.test(s[n]))return!0;if(s[n]==="\\"){var o=s[n+1];n+=2;var a=t[o];if(a){var d=s.indexOf(a,n);d!==-1&&(n=d+1)}if(s[n]==="!")return!0}else n++}return!1};return wr=function(n,o){if(typeof n!="string"||n==="")return!1;if(e(n))return!0;var a=r;return o&&o.strict===!1&&(a=i),a(n)},wr}var An={exports:{}},Zi;function tu(){return Zi||(Zi=1,function(e,t){var r={};t=e.exports=D;var i;typeof Ja=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?i=function(){var p=Array.prototype.slice.call(arguments,0);p.unshift("SEMVER"),console.log.apply(console,p)}:i=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,a=s-6,d=t.re=[],h=t.safeRe=[],u=t.src=[],f=t.tokens={},j=0;function m(p){f[p]=j++}var S="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",s],[S,a]];function C(p){for(var b=0;b<E.length;b++){var k=E[b][0],_=E[b][1];p=p.split(k+"*").join(k+"{0,"+_+"}").split(k+"+").join(k+"{1,"+_+"}")}return p}m("NUMERICIDENTIFIER"),u[f.NUMERICIDENTIFIER]="0|[1-9]\\d*",m("NUMERICIDENTIFIERLOOSE"),u[f.NUMERICIDENTIFIERLOOSE]="\\d+",m("NONNUMERICIDENTIFIER"),u[f.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",m("MAINVERSION"),u[f.MAINVERSION]="("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")",m("MAINVERSIONLOOSE"),u[f.MAINVERSIONLOOSE]="("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")",m("PRERELEASEIDENTIFIER"),u[f.PRERELEASEIDENTIFIER]="(?:"+u[f.NUMERICIDENTIFIER]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASEIDENTIFIERLOOSE"),u[f.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[f.NUMERICIDENTIFIERLOOSE]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASE"),u[f.PRERELEASE]="(?:-("+u[f.PRERELEASEIDENTIFIER]+"(?:\\."+u[f.PRERELEASEIDENTIFIER]+")*))",m("PRERELEASELOOSE"),u[f.PRERELEASELOOSE]="(?:-?("+u[f.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[f.PRERELEASEIDENTIFIERLOOSE]+")*))",m("BUILDIDENTIFIER"),u[f.BUILDIDENTIFIER]=S+"+",m("BUILD"),u[f.BUILD]="(?:\\+("+u[f.BUILDIDENTIFIER]+"(?:\\."+u[f.BUILDIDENTIFIER]+")*))",m("FULL"),m("FULLPLAIN"),u[f.FULLPLAIN]="v?"+u[f.MAINVERSION]+u[f.PRERELEASE]+"?"+u[f.BUILD]+"?",u[f.FULL]="^"+u[f.FULLPLAIN]+"$",m("LOOSEPLAIN"),u[f.LOOSEPLAIN]="[v=\\s]*"+u[f.MAINVERSIONLOOSE]+u[f.PRERELEASELOOSE]+"?"+u[f.BUILD]+"?",m("LOOSE"),u[f.LOOSE]="^"+u[f.LOOSEPLAIN]+"$",m("GTLT"),u[f.GTLT]="((?:<|>)?=?)",m("XRANGEIDENTIFIERLOOSE"),u[f.XRANGEIDENTIFIERLOOSE]=u[f.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",m("XRANGEIDENTIFIER"),u[f.XRANGEIDENTIFIER]=u[f.NUMERICIDENTIFIER]+"|x|X|\\*",m("XRANGEPLAIN"),u[f.XRANGEPLAIN]="[v=\\s]*("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:"+u[f.PRERELEASE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGEPLAINLOOSE"),u[f.XRANGEPLAINLOOSE]="[v=\\s]*("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:"+u[f.PRERELEASELOOSE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGE"),u[f.XRANGE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAIN]+"$",m("XRANGELOOSE"),u[f.XRANGELOOSE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAINLOOSE]+"$",m("COERCE"),u[f.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",m("COERCERTL"),d[f.COERCERTL]=new RegExp(u[f.COERCE],"g"),h[f.COERCERTL]=new RegExp(C(u[f.COERCE]),"g"),m("LONETILDE"),u[f.LONETILDE]="(?:~>?)",m("TILDETRIM"),u[f.TILDETRIM]="(\\s*)"+u[f.LONETILDE]+"\\s+",d[f.TILDETRIM]=new RegExp(u[f.TILDETRIM],"g"),h[f.TILDETRIM]=new RegExp(C(u[f.TILDETRIM]),"g");var c="$1~";m("TILDE"),u[f.TILDE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAIN]+"$",m("TILDELOOSE"),u[f.TILDELOOSE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAINLOOSE]+"$",m("LONECARET"),u[f.LONECARET]="(?:\\^)",m("CARETTRIM"),u[f.CARETTRIM]="(\\s*)"+u[f.LONECARET]+"\\s+",d[f.CARETTRIM]=new RegExp(u[f.CARETTRIM],"g"),h[f.CARETTRIM]=new RegExp(C(u[f.CARETTRIM]),"g");var N="$1^";m("CARET"),u[f.CARET]="^"+u[f.LONECARET]+u[f.XRANGEPLAIN]+"$",m("CARETLOOSE"),u[f.CARETLOOSE]="^"+u[f.LONECARET]+u[f.XRANGEPLAINLOOSE]+"$",m("COMPARATORLOOSE"),u[f.COMPARATORLOOSE]="^"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+")$|^$",m("COMPARATOR"),u[f.COMPARATOR]="^"+u[f.GTLT]+"\\s*("+u[f.FULLPLAIN]+")$|^$",m("COMPARATORTRIM"),u[f.COMPARATORTRIM]="(\\s*)"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+"|"+u[f.XRANGEPLAIN]+")",d[f.COMPARATORTRIM]=new RegExp(u[f.COMPARATORTRIM],"g"),h[f.COMPARATORTRIM]=new RegExp(C(u[f.COMPARATORTRIM]),"g");var $="$1$2$3";m("HYPHENRANGE"),u[f.HYPHENRANGE]="^\\s*("+u[f.XRANGEPLAIN]+")\\s+-\\s+("+u[f.XRANGEPLAIN]+")\\s*$",m("HYPHENRANGELOOSE"),u[f.HYPHENRANGELOOSE]="^\\s*("+u[f.XRANGEPLAINLOOSE]+")\\s+-\\s+("+u[f.XRANGEPLAINLOOSE]+")\\s*$",m("STAR"),u[f.STAR]="(<|>)?=?\\s*\\*";for(var O=0;O<j;O++)i(O,u[O]),d[O]||(d[O]=new RegExp(u[O]),h[O]=new RegExp(C(u[O])));t.parse=w;function w(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof D)return p;if(typeof p!="string"||p.length>s)return null;var k=b.loose?h[f.LOOSE]:h[f.FULL];if(!k.test(p))return null;try{return new D(p,b)}catch{return null}}t.valid=R;function R(p,b){var k=w(p,b);return k?k.version:null}t.clean=F;function F(p,b){var k=w(p.trim().replace(/^[=v]+/,""),b);return k?k.version:null}t.SemVer=D;function D(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof D){if(p.loose===b.loose)return p;p=p.version}else if(typeof p!="string")throw new TypeError("Invalid Version: "+p);if(p.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof D))return new D(p,b);i("SemVer",p,b),this.options=b,this.loose=!!b.loose;var k=p.trim().match(b.loose?h[f.LOOSE]:h[f.FULL]);if(!k)throw new TypeError("Invalid Version: "+p);if(this.raw=p,this.major=+k[1],this.minor=+k[2],this.patch=+k[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");k[4]?this.prerelease=k[4].split(".").map(function(_){if(/^[0-9]+$/.test(_)){var z=+_;if(z>=0&&z<n)return z}return _}):this.prerelease=[],this.build=k[5]?k[5].split("."):[],this.format()}D.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},D.prototype.toString=function(){return this.version},D.prototype.compare=function(p){return i("SemVer.compare",this.version,this.options,p),p instanceof D||(p=new D(p,this.options)),this.compareMain(p)||this.comparePre(p)},D.prototype.compareMain=function(p){return p instanceof D||(p=new D(p,this.options)),q(this.major,p.major)||q(this.minor,p.minor)||q(this.patch,p.patch)},D.prototype.comparePre=function(p){if(p instanceof D||(p=new D(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;var b=0;do{var k=this.prerelease[b],_=p.prerelease[b];if(i("prerelease compare",b,k,_),k===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(k===void 0)return-1;if(k===_)continue;return q(k,_)}while(++b)},D.prototype.compareBuild=function(p){p instanceof D||(p=new D(p,this.options));var b=0;do{var k=this.build[b],_=p.build[b];if(i("prerelease compare",b,k,_),k===void 0&&_===void 0)return 0;if(_===void 0)return 1;if(k===void 0)return-1;if(k===_)continue;return q(k,_)}while(++b)},D.prototype.inc=function(p,b){switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",b),this.inc("pre",b);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var k=this.prerelease.length;--k>=0;)typeof this.prerelease[k]=="number"&&(this.prerelease[k]++,k=-2);k===-1&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+p)}return this.format(),this.raw=this.version,this},t.inc=ne;function ne(p,b,k,_){typeof k=="string"&&(_=k,k=void 0);try{return new D(p,k).inc(b,_).version}catch{return null}}t.diff=Y;function Y(p,b){if(Pe(p,b))return null;var k=w(p),_=w(b),z="";if(k.prerelease.length||_.prerelease.length){z="pre";var ee="prerelease"}for(var oe in k)if((oe==="major"||oe==="minor"||oe==="patch")&&k[oe]!==_[oe])return z+oe;return ee}t.compareIdentifiers=q;var W=/^[0-9]+$/;function q(p,b){var k=W.test(p),_=W.test(b);return k&&_&&(p=+p,b=+b),p===b?0:k&&!_?-1:_&&!k?1:p<b?-1:1}t.rcompareIdentifiers=H;function H(p,b){return q(b,p)}t.major=A;function A(p,b){return new D(p,b).major}t.minor=J;function J(p,b){return new D(p,b).minor}t.patch=M;function M(p,b){return new D(p,b).patch}t.compare=ue;function ue(p,b,k){return new D(p,k).compare(new D(b,k))}t.compareLoose=Ie;function Ie(p,b){return ue(p,b,!0)}t.compareBuild=K;function K(p,b,k){var _=new D(p,k),z=new D(b,k);return _.compare(z)||_.compareBuild(z)}t.rcompare=Ee;function Ee(p,b,k){return ue(b,p,k)}t.sort=ce;function ce(p,b){return p.sort(function(k,_){return t.compareBuild(k,_,b)})}t.rsort=Me;function Me(p,b){return p.sort(function(k,_){return t.compareBuild(_,k,b)})}t.gt=me;function me(p,b,k){return ue(p,b,k)>0}t.lt=Oe;function Oe(p,b,k){return ue(p,b,k)<0}t.eq=Pe;function Pe(p,b,k){return ue(p,b,k)===0}t.neq=nt;function nt(p,b,k){return ue(p,b,k)!==0}t.gte=ut;function ut(p,b,k){return ue(p,b,k)>=0}t.lte=ft;function ft(p,b,k){return ue(p,b,k)<=0}t.cmp=rt;function rt(p,b,k,_){switch(b){case"===":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p===k;case"!==":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p!==k;case"":case"=":case"==":return Pe(p,k,_);case"!=":return nt(p,k,_);case">":return me(p,k,_);case">=":return ut(p,k,_);case"<":return Oe(p,k,_);case"<=":return ft(p,k,_);default:throw new TypeError("Invalid operator: "+b)}}t.Comparator=we;function we(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof we){if(p.loose===!!b.loose)return p;p=p.value}if(!(this instanceof we))return new we(p,b);p=p.trim().split(/\s+/).join(" "),i("comparator",p,b),this.options=b,this.loose=!!b.loose,this.parse(p),this.semver===de?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var de={};we.prototype.parse=function(p){var b=this.options.loose?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],k=p.match(b);if(!k)throw new TypeError("Invalid comparator: "+p);this.operator=k[1]!==void 0?k[1]:"",this.operator==="="&&(this.operator=""),k[2]?this.semver=new D(k[2],this.options.loose):this.semver=de},we.prototype.toString=function(){return this.value},we.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===de||p===de)return!0;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}return rt(p,this.operator,this.semver,this.options)},we.prototype.intersects=function(p,b){if(!(p instanceof we))throw new TypeError("a Comparator is required");(!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1});var k;if(this.operator==="")return this.value===""?!0:(k=new ge(p.value,b),he(this.value,k,b));if(p.operator==="")return p.value===""?!0:(k=new ge(this.value,b),he(p.semver,k,b));var _=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),z=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ee=this.semver.version===p.semver.version,oe=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Se=rt(this.semver,"<",p.semver,b)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),xe=rt(this.semver,">",p.semver,b)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return _||z||ee&&oe||Se||xe},t.Range=ge;function ge(p,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),p instanceof ge)return p.loose===!!b.loose&&p.includePrerelease===!!b.includePrerelease?p:new ge(p.raw,b);if(p instanceof we)return new ge(p.value,b);if(!(this instanceof ge))return new ge(p,b);if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(k){return this.parseRange(k.trim())},this).filter(function(k){return k.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ge.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ge.prototype.toString=function(){return this.range},ge.prototype.parseRange=function(p){var b=this.options.loose,k=b?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,st),i("hyphen replace",p),p=p.replace(h[f.COMPARATORTRIM],$),i("comparator trim",p,h[f.COMPARATORTRIM]),p=p.replace(h[f.TILDETRIM],c),p=p.replace(h[f.CARETTRIM],N),p=p.split(/\s+/).join(" ");var _=b?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],z=p.split(" ").map(function(ee){return jt(ee,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(z=z.filter(function(ee){return!!ee.match(_)})),z=z.map(function(ee){return new we(ee,this.options)},this),z},ge.prototype.intersects=function(p,b){if(!(p instanceof ge))throw new TypeError("a Range is required");return this.set.some(function(k){return Fe(k,b)&&p.set.some(function(_){return Fe(_,b)&&k.every(function(z){return _.every(function(ee){return z.intersects(ee,b)})})})})};function Fe(p,b){for(var k=!0,_=p.slice(),z=_.pop();k&&_.length;)k=_.every(function(ee){return z.intersects(ee,b)}),z=_.pop();return k}t.toComparators=$e;function $e(p,b){return new ge(p,b).set.map(function(k){return k.map(function(_){return _.value}).join(" ").trim().split(" ")})}function jt(p,b){return i("comp",p,b),p=Ct(p,b),i("caret",p),p=Et(p,b),i("tildes",p),p=Ve(p,b),i("xrange",p),p=pt(p,b),i("stars",p),p}function Ae(p){return!p||p.toLowerCase()==="x"||p==="*"}function Et(p,b){return p.trim().split(/\s+/).map(function(k){return Ot(k,b)}).join(" ")}function Ot(p,b){var k=b.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(_,z,ee,oe,Se){i("tilde",p,_,z,ee,oe,Se);var xe;return Ae(z)?xe="":Ae(ee)?xe=">="+z+".0.0 <"+(+z+1)+".0.0":Ae(oe)?xe=">="+z+"."+ee+".0 <"+z+"."+(+ee+1)+".0":Se?(i("replaceTilde pr",Se),xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+(+ee+1)+".0"):xe=">="+z+"."+ee+"."+oe+" <"+z+"."+(+ee+1)+".0",i("tilde return",xe),xe})}function Ct(p,b){return p.trim().split(/\s+/).map(function(k){return It(k,b)}).join(" ")}function It(p,b){i("caret",p,b);var k=b.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(_,z,ee,oe,Se){i("caret",p,_,z,ee,oe,Se);var xe;return Ae(z)?xe="":Ae(ee)?xe=">="+z+".0.0 <"+(+z+1)+".0.0":Ae(oe)?z==="0"?xe=">="+z+"."+ee+".0 <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+".0 <"+(+z+1)+".0.0":Se?(i("replaceCaret pr",Se),z==="0"?ee==="0"?xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+ee+"."+(+oe+1):xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+"."+oe+"-"+Se+" <"+(+z+1)+".0.0"):(i("no pr"),z==="0"?ee==="0"?xe=">="+z+"."+ee+"."+oe+" <"+z+"."+ee+"."+(+oe+1):xe=">="+z+"."+ee+"."+oe+" <"+z+"."+(+ee+1)+".0":xe=">="+z+"."+ee+"."+oe+" <"+(+z+1)+".0.0"),i("caret return",xe),xe})}function Ve(p,b){return i("replaceXRanges",p,b),p.split(/\s+/).map(function(k){return Rt(k,b)}).join(" ")}function Rt(p,b){p=p.trim();var k=b.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(_,z,ee,oe,Se,xe){i("xRange",p,_,z,ee,oe,Se,xe);var Qe=Ae(ee),Je=Qe||Ae(oe),Le=Je||Ae(Se),Be=Le;return z==="="&&Be&&(z=""),xe=b.includePrerelease?"-0":"",Qe?z===">"||z==="<"?_="<0.0.0-0":_="*":z&&Be?(Je&&(oe=0),Se=0,z===">"?(z=">=",Je?(ee=+ee+1,oe=0,Se=0):(oe=+oe+1,Se=0)):z==="<="&&(z="<",Je?ee=+ee+1:oe=+oe+1),_=z+ee+"."+oe+"."+Se+xe):Je?_=">="+ee+".0.0"+xe+" <"+(+ee+1)+".0.0"+xe:Le&&(_=">="+ee+"."+oe+".0"+xe+" <"+ee+"."+(+oe+1)+".0"+xe),i("xRange return",_),_})}function pt(p,b){return i("replaceStars",p,b),p.trim().replace(h[f.STAR],"")}function st(p,b,k,_,z,ee,oe,Se,xe,Qe,Je,Le,Be){return Ae(k)?b="":Ae(_)?b=">="+k+".0.0":Ae(z)?b=">="+k+"."+_+".0":b=">="+b,Ae(xe)?Se="":Ae(Qe)?Se="<"+(+xe+1)+".0.0":Ae(Je)?Se="<"+xe+"."+(+Qe+1)+".0":Le?Se="<="+xe+"."+Qe+"."+Je+"-"+Le:Se="<="+Se,(b+" "+Se).trim()}ge.prototype.test=function(p){if(!p)return!1;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}for(var b=0;b<this.set.length;b++)if(V(this.set[b],p,this.options))return!0;return!1};function V(p,b,k){for(var _=0;_<p.length;_++)if(!p[_].test(b))return!1;if(b.prerelease.length&&!k.includePrerelease){for(_=0;_<p.length;_++)if(i(p[_].semver),p[_].semver!==de&&p[_].semver.prerelease.length>0){var z=p[_].semver;if(z.major===b.major&&z.minor===b.minor&&z.patch===b.patch)return!0}return!1}return!0}t.satisfies=he;function he(p,b,k){try{b=new ge(b,k)}catch{return!1}return b.test(p)}t.maxSatisfying=De;function De(p,b,k){var _=null,z=null;try{var ee=new ge(b,k)}catch{return null}return p.forEach(function(oe){ee.test(oe)&&(!_||z.compare(oe)===-1)&&(_=oe,z=new D(_,k))}),_}t.minSatisfying=Xe;function Xe(p,b,k){var _=null,z=null;try{var ee=new ge(b,k)}catch{return null}return p.forEach(function(oe){ee.test(oe)&&(!_||z.compare(oe)===1)&&(_=oe,z=new D(_,k))}),_}t.minVersion=it;function it(p,b){p=new ge(p,b);var k=new D("0.0.0");if(p.test(k)||(k=new D("0.0.0-0"),p.test(k)))return k;k=null;for(var _=0;_<p.set.length;++_){var z=p.set[_];z.forEach(function(ee){var oe=new D(ee.semver.version);switch(ee.operator){case">":oe.prerelease.length===0?oe.patch++:oe.prerelease.push(0),oe.raw=oe.format();case"":case">=":(!k||me(k,oe))&&(k=oe);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ee.operator)}})}return k&&p.test(k)?k:null}t.validRange=wt;function wt(p,b){try{return new ge(p,b).range||"*"}catch{return null}}t.ltr=qt;function qt(p,b,k){return L(p,b,"<",k)}t.gtr=Ue;function Ue(p,b,k){return L(p,b,">",k)}t.outside=L;function L(p,b,k,_){p=new D(p,_),b=new ge(b,_);var z,ee,oe,Se,xe;switch(k){case">":z=me,ee=ft,oe=Oe,Se=">",xe=">=";break;case"<":z=Oe,ee=ut,oe=me,Se="<",xe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(he(p,b,_))return!1;for(var Qe=0;Qe<b.set.length;++Qe){var Je=b.set[Qe],Le=null,Be=null;if(Je.forEach(function(Ye){Ye.semver===de&&(Ye=new we(">=0.0.0")),Le=Le||Ye,Be=Be||Ye,z(Ye.semver,Le.semver,_)?Le=Ye:oe(Ye.semver,Be.semver,_)&&(Be=Ye)}),Le.operator===Se||Le.operator===xe||(!Be.operator||Be.operator===Se)&&ee(p,Be.semver))return!1;if(Be.operator===xe&&oe(p,Be.semver))return!1}return!0}t.prerelease=re;function re(p,b){var k=w(p,b);return k&&k.prerelease.length?k.prerelease:null}t.intersects=ve;function ve(p,b,k){return p=new ge(p,k),b=new ge(b,k),p.intersects(b)}t.coerce=Re;function Re(p,b){if(p instanceof D)return p;if(typeof p=="number"&&(p=String(p)),typeof p!="string")return null;b=b||{};var k=null;if(!b.rtl)k=p.match(h[f.COERCE]);else{for(var _;(_=h[f.COERCERTL].exec(p))&&(!k||k.index+k[0].length!==p.length);)(!k||_.index+_[0].length!==k.index+k[0].length)&&(k=_),h[f.COERCERTL].lastIndex=_.index+_[1].length+_[2].length;h[f.COERCERTL].lastIndex=-1}return k===null?null:w(k[2]+"."+(k[3]||"0")+"."+(k[4]||"0"),b)}}(An,An.exports)),An.exports}var Sr,eo;function nu(){if(eo)return Sr;eo=1;const e=oi(),t=tu(),r="semver",i={base:e.string(),type:"semverRange",validate:function(o,{error:a}){return t.validRange(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver range"}},s={};return s.compare={method:!1,validate:function(o,a,{exp:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{exp:d})},args:[{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compare",args:{exp:a}})}}}),s.cmp={method:function(o,a){return this.$_addRule({name:"cmp",args:{cmp:o,exp:a}})},validate:function(o,a,{cmp:d,exp:h}){return t.cmp(o,d,h)?o:a.error(`${r}.cmp`,{cmp:d,exp:h})},args:[{name:"cmp",assert:o=>["===","!==","","=","==","!=",">",">=","<","<="].includes(o),message:"needs to be a valid comparator"},{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},s.compareRange={method:!1,validate:function(o,a,{rng:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{rng:d})},args:[{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compareRange",args:{rng:a}})}}}),s.outside={method:function(o,a){return this.$_addRule({name:"outside",args:{hilo:o,rng:a}})},validate:function(o,a,{hilo:d,rng:h}){return t.outside(o,h,d)?o:a.error(`${r}.outside`,{hilo:d,rng:h})},args:[{name:"hilo",assert:o=>[">","<"].includes(o),message:"needs to be a valid comparator"},{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},Sr={semver:{base:e.string(),type:"semver",validate:function(o,{error:a}){return t.valid(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver expression",[`${r}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${r}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${r}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${r}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${r}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${r}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${r}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${r}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${r}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${r}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${r}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:s},semverRange:i},Sr}/*!
203
203
  * is-var-name | ISC (c) Shinnosuke Watanabe
204
204
  * https://github.com/shinnn/is-var-name
205
- */function eu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const tu=Object.freeze(Object.defineProperty({__proto__:null,default:eu},Symbol.toStringTag,{value:"Module"})),nu=Xa(tu);var Ge={},eo;function ru(){if(eo)return Ge;eo=1;const e=ii();function t(W){return W&&typeof W=="object"&&"default"in W?W.default:W}const r=t(e),i={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},s={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},n={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},o={"--volume":!0,"--publish":!0},a=new Set(["--publish","--volume"]),d=W=>{const[U]=W.split(":");return U?.startsWith("/")||U?.startsWith("./")||U?.startsWith("../")||U?.startsWith("~")||U?.startsWith("$BLOCKLET")};function h(W){return W.map(U=>{if(U.key!=="--volume"||U.value.startsWith("$BLOCKLET_APP_DIR/")||U.value.startsWith("$BLOCKLET_DATA_DIR/"))return U;const[H,...A]=U.value.split(":");if(!H||!d(U.value))return U;const J=H.startsWith("/")?`$BLOCKLET_DATA_DIR${H}`:`$BLOCKLET_DATA_DIR/${H}`;return{...U,value:[J,...A].join(":")}})}function u(W){let U=!0;return W.find(A=>A.key==="--publish"&&A.type==="web")?W.map(A=>{if(A.key==="--publish"){const J={...A,type:U?"docker":A.type};return U=A.type==="web",J}return A}):W.map(A=>{if(A.key==="--publish"){const J={...A,type:U?"web":"docker"};return U=!1,J}return A})}function f(W){if(!W)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(W=W.trim(),W.startsWith("$ docker run")&&(W=W.replace("$ docker run","docker run")),!W.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const H=W.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!H)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const A=[],J=[];let M=0,ue="",Ie="";const K=[];for(;M<H.length;){const ce=H[M];if(!ce){M++;continue}if(ce==="docker"||ce==="run"){M++;continue}if((ce==="-e"||ce==="--env")&&M+1<H.length){const Me=H[M+1]||"",[me,...Oe]=Me.split("=");if(me){const Pe=Oe.join("=").replace(/^['"]|['"]$/g,"");J.push({key:me,value:Pe})}M+=2;continue}if(ce.startsWith("-")&&K.length===0){const Me=ce.indexOf("=");let me=ce,Oe=null;Me!==-1&&(me=ce.substring(0,Me),Oe=ce.substring(Me+1).replace(/^['"]|['"]$/g,""));const Pe=i[me];if(!Pe){M+=2;continue}if(Pe==="--publish"){let nt="";if(Oe)nt=Oe,A.push({key:Pe,value:nt});else if(M+1<H.length&&!(H[M+1]||"").startsWith("-")){nt=(H[M+1]||"").replace(/^['"]|['"]$/g,""),A.push({key:Pe,value:nt}),M+=2;continue}else{A.push({key:Pe,value:"true"}),M++;continue}M++;continue}if(Oe!==null){A.push({key:Pe,value:Oe}),M++;continue}else if(M+1<H.length&&!(H[M+1]||"").startsWith("-")){const nt=(H[M+1]||"").replace(/^['"]|['"]$/g,"");A.push({key:Pe,value:nt}),M+=2;continue}else{A.push({key:Pe,value:"true"}),M++;continue}}K.push(ce),M++}ue=K[0]||"",Ie=K.slice(1).join(" ");const Ee=[];for(const ce of A)ce.name="",ce.path="",ce.prefix="",ce.protocol="",ce.proxyBehavior="service",ce.type="docker",!(a.has(ce.key)&&ce.value==="true")&&Ee.push(ce);for(const ce of J)ce.custom="",ce.description="",ce.secure=!1,ce.shared=!1,ce.required=!1;return{dockerArgs:u(h(Ee)),dockerEnvs:J,dockerImage:ue,dockerCommand:Ie}}function j({dockerArgs:W,dockerEnvs:U,dockerImage:H,dockerCommand:A}){if(W.length===0&&U.length===0&&!H)return"";const J=["docker run \\"],M=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const ue of W){const{key:Ie,value:K}=ue;if(M.has(Ie))if(K==="true")J.push(` ${Ie} \\`);else{const Ee=/[\s"']/g.test(K)?`"${K}"`:K;J.push(` ${Ie} ${Ee} \\`)}else if(!J.some(Ee=>Ee.startsWith(` ${Ie}`)))if(K==="true")J.push(` ${Ie} \\`);else{const Ee=/[\s"']/g.test(K)?`"${K}"`:K;J.push(` ${Ie} ${Ee} \\`)}}for(const ue of U){const{key:Ie,value:K}=ue,Ee=/["']/g.test(K)?K:`"${K}"`;J.push(` -e ${Ie}=${Ee} \\`)}return H&&J.push(` ${H} \\`),A&&J.push(` ${A} \\`),J[J.length-1]?.endsWith(" \\")&&(J[J.length-1]=(J[J.length-1]||"").slice(0,-2)),J.join(`
206
- `)}const m={"--volume":W=>{const[U]=W.split(":");return U?d(W)&&!W.startsWith("$BLOCKLET_APP_DIR/")&&!W.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":W.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},S=W=>W.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,J)=>J.toUpperCase()),E=W=>`--${W.replace(/([A-Z])/g,"-$1").toLowerCase()}`,C=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],c=["rm ","sudo "];function N(W){if(W==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(W))throw new Error("Docker CMD is invalid");const H=W.toLocaleLowerCase();if(c.some(J=>H.indexOf(J)!==-1))throw new Error("Docker CMD is invalid");if(C.some(J=>W.indexOf(J)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(W))throw new Error("Docker CMD is invalid")}const $=Array.from(new Set(Object.keys(s).map(S))),O=["publish","volume"],w=r.object({workdir:r.string().trim().optional(),image:r.string().trim().regex(/^[^\s]+$/).optional(),shell:r.string().trim().optional(),volumes:r.array().items(r.string().trim()).optional(),script:r.string().trim().optional(),installNodeModules:r.boolean().optional(),skipWrapDockerfile:r.boolean().optional(),command:r.string().allow("").default("").optional().custom((W,U)=>{try{return N(W),W}catch(H){return U.error("any.invalid",{message:H.message})}},"Docker CMD validation"),runBaseScript:r.boolean().optional(),...$.reduce((W,U)=>{const H=m[E(U)];return O.includes(U)?(W[U]=r.array().items(r.string().trim()).optional(),H?W[U]=r.array().items(r.string().trim().custom((A,J)=>{const M=H(A);return M?J.message(M):A})).optional():W[U]=r.array().items(r.string().trim()).optional(),W):(H?W[U]=r.string().trim().custom((A,J)=>{const M=H(A);return M?J.message(M):A}).optional():W[U]=r.string().trim().optional(),W)},{})}).optional(),R=W=>{const U=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return r.string().trim().regex(U).required().validate(W)},F=(W,U,H)=>{const A={};H.forEach(M=>{const ue=S(M.key);O.includes(ue)?A[ue]=[...A[ue]||[],M.value]:A[ue]=M.value});const{error:J}=R(W);if(J)return{error:J,value:A};try{N(W)}catch(M){return{error:M,value:A}}return A.image=W,A.command=U||"",w.validate(A)};function D(W,U){const H=JSON.parse(JSON.stringify(U)),A=new Map;let J=1;const M=[];return H.forEach(ue=>{if(ue.key==="--publish"){const K=ue.value.split(":");let Ee="127.0.0.1",ce="",Me="";K.length===2?[ce,Me]=K:K.length===3?[Ee,ce,Me]=K:K.length===1&&(Me=K[0]||"");let me=A.get(ce||"");if(me||(me=`$BLOCKLET_PORT_${J++}`,A.set(ce||"",me)),!M.find(Oe=>Oe.port===ce)){const Oe=ue.type||"docker",Pe=`${W.replace(/\W/g,"-")}-${M.length+1}`;M.push({type:Oe,proxyBehavior:ue.proxyBehavior||"",name:Pe,path:`/${Pe}`,port:ce||Me,containerPort:Number(Me)||0,hostIP:Ee,prefix:Oe==="docker"?`/${Pe}`:ue.prefix||"*"})}}}),M}function ne(W,U=!1){const H=[];if(!W)return H;for(const A of W){const J={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};U||(J.custom=A.custom||""),H.push(J)}return H}function Y(W,U){const H=JSON.parse(JSON.stringify(W));return U.split(".").map(J=>{const M=J.match(/(.+)\[(.+?)\]/);return M?[M[1],M[2]]:J}).flat().filter(Boolean).reduce((J,M)=>{if(!J||!M)return;const ue=M?.match(/(.+?)=(.+)/);if(Array.isArray(J)&&ue){const[,K,Ee]=ue;return K&&Ee&&(J=J.find(ce=>{const Me=Object.keys(ce).find(me=>me.toLowerCase()===K.toLowerCase());return Me&&ce[Me]===Ee})),J}const Ie=Object.keys(J).find(K=>K.toLowerCase()===M.toLowerCase());return Ie?J[Ie]:void 0},H)}return Ge.addBlockletPrefixVolume=h,Ge.allowDockerArgs=s,Ge.autoSetDockerArgs=n,Ge.dockerArgsToCamelCase=S,Ge.dockerArgsValidator=m,Ge.dockerBuildCommand=j,Ge.dockerCamelCaseToDash=E,Ge.dockerCmdValidator=N,Ge.dockerParseCommand=f,Ge.dockerParseEnvironments=ne,Ge.dockerParsePublishPorts=D,Ge.dockerSchema=w,Ge.getObjByPath=Y,Ge.isVolumePath=d,Ge.multiValueArgs=O,Ge.notAllowUseCustomDockerArgs=o,Ge.parseDockerArgsToSchema=F,Ge.whiteDockerArgs=i,Ge}var vn={},to;function iu(){if(to)return vn;to=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.toBlockletDid=void 0;const e=el(),t=tl(),r=Xn(),i=s=>{if((0,r.isValid)(s))return s;const n=(0,t.toHex)(Ol.from(typeof s=="string"?s.trim():s));return(0,r.fromPublicKey)(n,{role:e.types.RoleType.ROLE_ANY})};return vn.toBlockletDid=i,vn}var Nt={},no;function ou(){if(no)return Nt;no=1;var e=Nt&&Nt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.didExtension=Nt.fileExtension=void 0;const t=e(rs),r=e(ec()),i=Xn(),s=o=>({type:"file",base:o.string(),validate(a,{error:d}){return a&&typeof a=="string"?{value:a}:{errors:d("file.empty",{file:a})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:a=null,canSkip:d=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:a,canSkip:d}})},args:[{name:"baseDir",assert:a=>t.default.existsSync(a),message:"baseDir must exist"},{name:"canSkip",assert:a=>typeof a=="function",message:"canSkip must be a function"}],validate(a,{error:d},{baseDir:h,canSkip:u}={}){if(typeof u=="function"&&u(h,a))return a;try{return t.default.statSync(r.default.join(h,a)),a}catch(f){switch(f.code){case"ENOENT":return d("file.enoent",{file:a})}return d("file.error.generic",{message:f.message})}}}}});Nt.fileExtension=s;const n=o=>({type:"DID",base:o.string(),validate(a,{error:d}){return!a||typeof a!="string"?{errors:d("did.empty",{did:a})}:(0,i.isValid)(a)===!1?{errors:d("did.invalid",{did:a})}:{value:a}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return Nt.didExtension=n,Nt.default={fileExtension:s,didExtension:n},Nt}var yn={},Er={exports:{}};const su=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var ro;function au(){if(ro)return Er.exports;ro=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=su,r=["node_modules","favicon.ico"],i=Er.exports=function(n){var o=[],a=[];if(n===null)return a.push("name cannot be null"),s(o,a);if(n===void 0)return a.push("name cannot be undefined"),s(o,a);if(typeof n!="string")return a.push("name must be a string"),s(o,a);if(n.length||a.push("name length must be greater than zero"),n.match(/^\./)&&a.push("name cannot start with a period"),n.match(/^_/)&&a.push("name cannot start with an underscore"),n.trim()!==n&&a.push("name cannot contain leading or trailing spaces"),r.forEach(function(f){n.toLowerCase()===f&&a.push(f+" is a blacklisted name")}),t.forEach(function(f){n.toLowerCase()===f&&o.push(f+" is a core module name")}),n.length>214&&o.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&o.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&o.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var d=n.match(e);if(d){var h=d[1],u=d[2];if(encodeURIComponent(h)===h&&encodeURIComponent(u)===u)return s(o,a)}a.push("name can only contain URL-friendly characters")}return s(o,a)};i.scopedPackagePattern=e;var s=function(n,o){var a={validForNewPackages:o.length===0&&n.length===0,validForOldPackages:o.length===0,warnings:n,errors:o};return a.warnings.length||delete a.warnings,a.errors.length||delete a.errors,a};return Er.exports}var io;function ms(){return io||(io=1,function(e){var t=yn&&yn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Xn(),i=t(au()),s=32,n=a=>{if((0,r.toTypeInfo)(a).role!==r.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=n;const o=(a,{checkDid:d=!0}={})=>{if((0,r.isValid)(a))d&&(0,e.validateNewDid)(a);else{const{validForNewPackages:h,errors:u=[],warnings:f=[]}=(0,i.default)(a);if(!h)throw new Error(u[0]||f[0]);if(a.length>s)throw new Error("Blocklet name is too long")}};e.validateName=o,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}}(yn)),yn}var oo;function gs(){if(oo)return ae;oo=1;var e=ae&&ae.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(ae,"__esModule",{value:!0}),ae.Joi=ae.eventsSchema=ae.installBlockletDescriptionSchema=ae.installBlockletTitleSchema=ae.resourceBundleSchema=ae.authConfigSchema=ae.cacheableSchema=ae.statsSchema=ae.titleSchema=ae.themeSchema=ae.signatureSchema=ae.serviceSchema=ae.scriptsSchema=ae.personSchema=ae.navigationSchema=ae.navigationItemSchema=ae.updateMountPointSchema=ae.mountPointSchema=ae.logoSchema=ae.interfaceSchema=ae.environmentNameSchema=ae.environmentSchema=ae.engineSchema=ae.endpointSchema=ae.distSchema=ae.descriptionSchema=ae.createBlockletSchema=ae.componentSchema=ae.blockletNameSchema=ae.blockletMetaSchema=void 0;const t=e(rs),r=e(ii()),i=e(Xc()),s=e(Jc()),n=Zc(),o=e(nu),a=al(),d=Xn(),h=ru(),u=Yo(),f=iu(),j=ou(),m=ms(),S=ll(),E=i.default.default,C="/.well-known",c=r.default.extend(n.semver).extend(n.semverRange).extend(j.fileExtension).extend(j.didExtension);ae.Joi=c;const N=(V,he)=>(0,S.checkLink)(V)?V:he.message(`Invalid navigation link: ${V}
205
+ */function ru(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const iu=Object.freeze(Object.defineProperty({__proto__:null,default:ru},Symbol.toStringTag,{value:"Module"})),ou=Qa(iu);var Ge={},to;function su(){if(to)return Ge;to=1;const e=oi();function t(W){return W&&typeof W=="object"&&"default"in W?W.default:W}const r=t(e),i={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},s={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},n={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},o={"--volume":!0,"--publish":!0},a=new Set(["--publish","--volume"]),d=W=>{const[q]=W.split(":");return q?.startsWith("/")||q?.startsWith("./")||q?.startsWith("../")||q?.startsWith("~")||q?.startsWith("$BLOCKLET")};function h(W){return W.map(q=>{if(q.key!=="--volume"||q.value.startsWith("$BLOCKLET_APP_DIR/")||q.value.startsWith("$BLOCKLET_DATA_DIR/"))return q;const[H,...A]=q.value.split(":");if(!H||!d(q.value))return q;const J=H.startsWith("/")?`$BLOCKLET_DATA_DIR${H}`:`$BLOCKLET_DATA_DIR/${H}`;return{...q,value:[J,...A].join(":")}})}function u(W){let q=!0;return W.find(A=>A.key==="--publish"&&A.type==="web")?W.map(A=>{if(A.key==="--publish"){const J={...A,type:q?"docker":A.type};return q=A.type==="web",J}return A}):W.map(A=>{if(A.key==="--publish"){const J={...A,type:q?"web":"docker"};return q=!1,J}return A})}function f(W){if(!W)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(W=W.trim(),W.startsWith("$ docker run")&&(W=W.replace("$ docker run","docker run")),!W.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const H=W.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!H)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const A=[],J=[];let M=0,ue="",Ie="";const K=[];for(;M<H.length;){const ce=H[M];if(!ce){M++;continue}if(ce==="docker"||ce==="run"){M++;continue}if((ce==="-e"||ce==="--env")&&M+1<H.length){const Me=H[M+1]||"",[me,...Oe]=Me.split("=");if(me){const Pe=Oe.join("=").replace(/^['"]|['"]$/g,"");J.push({key:me,value:Pe})}M+=2;continue}if(ce.startsWith("-")&&K.length===0){const Me=ce.indexOf("=");let me=ce,Oe=null;Me!==-1&&(me=ce.substring(0,Me),Oe=ce.substring(Me+1).replace(/^['"]|['"]$/g,""));const Pe=i[me];if(!Pe){M+=2;continue}if(Pe==="--publish"){let nt="";if(Oe)nt=Oe,A.push({key:Pe,value:nt});else if(M+1<H.length&&!(H[M+1]||"").startsWith("-")){nt=(H[M+1]||"").replace(/^['"]|['"]$/g,""),A.push({key:Pe,value:nt}),M+=2;continue}else{A.push({key:Pe,value:"true"}),M++;continue}M++;continue}if(Oe!==null){A.push({key:Pe,value:Oe}),M++;continue}else if(M+1<H.length&&!(H[M+1]||"").startsWith("-")){const nt=(H[M+1]||"").replace(/^['"]|['"]$/g,"");A.push({key:Pe,value:nt}),M+=2;continue}else{A.push({key:Pe,value:"true"}),M++;continue}}K.push(ce),M++}ue=K[0]||"",Ie=K.slice(1).join(" ");const Ee=[];for(const ce of A)ce.name="",ce.path="",ce.prefix="",ce.protocol="",ce.proxyBehavior="service",ce.type="docker",!(a.has(ce.key)&&ce.value==="true")&&Ee.push(ce);for(const ce of J)ce.custom="",ce.description="",ce.secure=!1,ce.shared=!1,ce.required=!1;return{dockerArgs:u(h(Ee)),dockerEnvs:J,dockerImage:ue,dockerCommand:Ie}}function j({dockerArgs:W,dockerEnvs:q,dockerImage:H,dockerCommand:A}){if(W.length===0&&q.length===0&&!H)return"";const J=["docker run \\"],M=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const ue of W){const{key:Ie,value:K}=ue;if(M.has(Ie))if(K==="true")J.push(` ${Ie} \\`);else{const Ee=/[\s"']/g.test(K)?`"${K}"`:K;J.push(` ${Ie} ${Ee} \\`)}else if(!J.some(Ee=>Ee.startsWith(` ${Ie}`)))if(K==="true")J.push(` ${Ie} \\`);else{const Ee=/[\s"']/g.test(K)?`"${K}"`:K;J.push(` ${Ie} ${Ee} \\`)}}for(const ue of q){const{key:Ie,value:K}=ue,Ee=/["']/g.test(K)?K:`"${K}"`;J.push(` -e ${Ie}=${Ee} \\`)}return H&&J.push(` ${H} \\`),A&&J.push(` ${A} \\`),J[J.length-1]?.endsWith(" \\")&&(J[J.length-1]=(J[J.length-1]||"").slice(0,-2)),J.join(`
206
+ `)}const m={"--volume":W=>{const[q]=W.split(":");return q?d(W)&&!W.startsWith("$BLOCKLET_APP_DIR/")&&!W.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":W.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},S=W=>W.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,J)=>J.toUpperCase()),E=W=>`--${W.replace(/([A-Z])/g,"-$1").toLowerCase()}`,C=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],c=["rm ","sudo "];function N(W){if(W==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(W))throw new Error("Docker CMD is invalid");const H=W.toLocaleLowerCase();if(c.some(J=>H.indexOf(J)!==-1))throw new Error("Docker CMD is invalid");if(C.some(J=>W.indexOf(J)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(W))throw new Error("Docker CMD is invalid")}const $=Array.from(new Set(Object.keys(s).map(S))),O=["publish","volume"],w=r.object({workdir:r.string().trim().optional(),image:r.string().trim().regex(/^[^\s]+$/).optional(),shell:r.string().trim().optional(),volumes:r.array().items(r.string().trim()).optional(),script:r.string().trim().optional(),installNodeModules:r.boolean().optional(),skipWrapDockerfile:r.boolean().optional(),command:r.string().allow("").default("").optional().custom((W,q)=>{try{return N(W),W}catch(H){return q.error("any.invalid",{message:H.message})}},"Docker CMD validation"),runBaseScript:r.boolean().optional(),...$.reduce((W,q)=>{const H=m[E(q)];return O.includes(q)?(W[q]=r.array().items(r.string().trim()).optional(),H?W[q]=r.array().items(r.string().trim().custom((A,J)=>{const M=H(A);return M?J.message(M):A})).optional():W[q]=r.array().items(r.string().trim()).optional(),W):(H?W[q]=r.string().trim().custom((A,J)=>{const M=H(A);return M?J.message(M):A}).optional():W[q]=r.string().trim().optional(),W)},{})}).optional(),R=W=>{const q=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return r.string().trim().regex(q).required().validate(W)},F=(W,q,H)=>{const A={};H.forEach(M=>{const ue=S(M.key);O.includes(ue)?A[ue]=[...A[ue]||[],M.value]:A[ue]=M.value});const{error:J}=R(W);if(J)return{error:J,value:A};try{N(W)}catch(M){return{error:M,value:A}}return A.image=W,A.command=q||"",w.validate(A)};function D(W,q){const H=JSON.parse(JSON.stringify(q)),A=new Map;let J=1;const M=[];return H.forEach(ue=>{if(ue.key==="--publish"){const K=ue.value.split(":");let Ee="127.0.0.1",ce="",Me="";K.length===2?[ce,Me]=K:K.length===3?[Ee,ce,Me]=K:K.length===1&&(Me=K[0]||"");let me=A.get(ce||"");if(me||(me=`$BLOCKLET_PORT_${J++}`,A.set(ce||"",me)),!M.find(Oe=>Oe.port===ce)){const Oe=ue.type||"docker",Pe=`${W.replace(/\W/g,"-")}-${M.length+1}`;M.push({type:Oe,proxyBehavior:ue.proxyBehavior||"",name:Pe,path:`/${Pe}`,port:ce||Me,containerPort:Number(Me)||0,hostIP:Ee,prefix:Oe==="docker"?`/${Pe}`:ue.prefix||"*"})}}}),M}function ne(W,q=!1){const H=[];if(!W)return H;for(const A of W){const J={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};q||(J.custom=A.custom||""),H.push(J)}return H}function Y(W,q){const H=JSON.parse(JSON.stringify(W));return q.split(".").map(J=>{const M=J.match(/(.+)\[(.+?)\]/);return M?[M[1],M[2]]:J}).flat().filter(Boolean).reduce((J,M)=>{if(!J||!M)return;const ue=M?.match(/(.+?)=(.+)/);if(Array.isArray(J)&&ue){const[,K,Ee]=ue;return K&&Ee&&(J=J.find(ce=>{const Me=Object.keys(ce).find(me=>me.toLowerCase()===K.toLowerCase());return Me&&ce[Me]===Ee})),J}const Ie=Object.keys(J).find(K=>K.toLowerCase()===M.toLowerCase());return Ie?J[Ie]:void 0},H)}return Ge.addBlockletPrefixVolume=h,Ge.allowDockerArgs=s,Ge.autoSetDockerArgs=n,Ge.dockerArgsToCamelCase=S,Ge.dockerArgsValidator=m,Ge.dockerBuildCommand=j,Ge.dockerCamelCaseToDash=E,Ge.dockerCmdValidator=N,Ge.dockerParseCommand=f,Ge.dockerParseEnvironments=ne,Ge.dockerParsePublishPorts=D,Ge.dockerSchema=w,Ge.getObjByPath=Y,Ge.isVolumePath=d,Ge.multiValueArgs=O,Ge.notAllowUseCustomDockerArgs=o,Ge.parseDockerArgsToSchema=F,Ge.whiteDockerArgs=i,Ge}var vn={},no;function au(){if(no)return vn;no=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.toBlockletDid=void 0;const e=cl(),t=rl(),r=Yn(),i=s=>{if((0,r.isValid)(s))return s;const n=(0,t.toHex)(Rl.from(typeof s=="string"?s.trim():s));return(0,r.fromPublicKey)(n,{role:e.types.RoleType.ROLE_ANY})};return vn.toBlockletDid=i,vn}var Nt={},ro;function lu(){if(ro)return Nt;ro=1;var e=Nt&&Nt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.didExtension=Nt.fileExtension=void 0;const t=e(ss),r=e(rc()),i=Yn(),s=o=>({type:"file",base:o.string(),validate(a,{error:d}){return a&&typeof a=="string"?{value:a}:{errors:d("file.empty",{file:a})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:a=null,canSkip:d=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:a,canSkip:d}})},args:[{name:"baseDir",assert:a=>t.default.existsSync(a),message:"baseDir must exist"},{name:"canSkip",assert:a=>typeof a=="function",message:"canSkip must be a function"}],validate(a,{error:d},{baseDir:h,canSkip:u}={}){if(typeof u=="function"&&u(h,a))return a;try{return t.default.statSync(r.default.join(h,a)),a}catch(f){switch(f.code){case"ENOENT":return d("file.enoent",{file:a})}return d("file.error.generic",{message:f.message})}}}}});Nt.fileExtension=s;const n=o=>({type:"DID",base:o.string(),validate(a,{error:d}){return!a||typeof a!="string"?{errors:d("did.empty",{did:a})}:(0,i.isValid)(a)===!1?{errors:d("did.invalid",{did:a})}:{value:a}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return Nt.didExtension=n,Nt.default={fileExtension:s,didExtension:n},Nt}var yn={},Er={exports:{}};const cu=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var io;function uu(){if(io)return Er.exports;io=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=cu,r=["node_modules","favicon.ico"],i=Er.exports=function(n){var o=[],a=[];if(n===null)return a.push("name cannot be null"),s(o,a);if(n===void 0)return a.push("name cannot be undefined"),s(o,a);if(typeof n!="string")return a.push("name must be a string"),s(o,a);if(n.length||a.push("name length must be greater than zero"),n.match(/^\./)&&a.push("name cannot start with a period"),n.match(/^_/)&&a.push("name cannot start with an underscore"),n.trim()!==n&&a.push("name cannot contain leading or trailing spaces"),r.forEach(function(f){n.toLowerCase()===f&&a.push(f+" is a blacklisted name")}),t.forEach(function(f){n.toLowerCase()===f&&o.push(f+" is a core module name")}),n.length>214&&o.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&o.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&o.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var d=n.match(e);if(d){var h=d[1],u=d[2];if(encodeURIComponent(h)===h&&encodeURIComponent(u)===u)return s(o,a)}a.push("name can only contain URL-friendly characters")}return s(o,a)};i.scopedPackagePattern=e;var s=function(n,o){var a={validForNewPackages:o.length===0&&n.length===0,validForOldPackages:o.length===0,warnings:n,errors:o};return a.warnings.length||delete a.warnings,a.errors.length||delete a.errors,a};return Er.exports}var oo;function ys(){return oo||(oo=1,function(e){var t=yn&&yn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Yn(),i=t(uu()),s=32,n=a=>{if((0,r.toTypeInfo)(a).role!==r.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=n;const o=(a,{checkDid:d=!0}={})=>{if((0,r.isValid)(a))d&&(0,e.validateNewDid)(a);else{const{validForNewPackages:h,errors:u=[],warnings:f=[]}=(0,i.default)(a);if(!h)throw new Error(u[0]||f[0]);if(a.length>s)throw new Error("Blocklet name is too long")}};e.validateName=o,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}}(yn)),yn}var so;function bs(){if(so)return ae;so=1;var e=ae&&ae.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(ae,"__esModule",{value:!0}),ae.Joi=ae.eventsSchema=ae.installBlockletDescriptionSchema=ae.installBlockletTitleSchema=ae.resourceBundleSchema=ae.authConfigSchema=ae.cacheableSchema=ae.statsSchema=ae.titleSchema=ae.themeSchema=ae.signatureSchema=ae.serviceSchema=ae.scriptsSchema=ae.personSchema=ae.navigationSchema=ae.navigationItemSchema=ae.updateMountPointSchema=ae.mountPointSchema=ae.logoSchema=ae.interfaceSchema=ae.environmentNameSchema=ae.environmentSchema=ae.engineSchema=ae.endpointSchema=ae.distSchema=ae.descriptionSchema=ae.createBlockletSchema=ae.componentSchema=ae.blockletNameSchema=ae.blockletMetaSchema=void 0;const t=e(ss),r=e(oi()),i=e(Qc()),s=e(eu()),n=nu(),o=e(ou),a=ul(),d=Yn(),h=su(),u=Zo(),f=au(),j=lu(),m=ys(),S=dl(),E=i.default.default,C="/.well-known",c=r.default.extend(n.semver).extend(n.semverRange).extend(j.fileExtension).extend(j.didExtension);ae.Joi=c;const N=(V,he)=>(0,S.checkLink)(V)?V:he.message(`Invalid navigation link: ${V}
207
207
 
208
208
  A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
209
209
  - /en/home
@@ -217,7 +217,7 @@ A valid navigation id is should follow the rules of javascript variables, such a
217
217
  - foo123
218
218
 
219
219
  see detail in https://www.npmjs.com/package/is-var-name
220
- `),O=c.string().trim().min(1).custom(V=>{if(E(V)>u.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${u.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return V}).meta({className:"TTitle"});ae.titleSchema=O;const w=c.string().trim().min(3).max(160).meta({className:"TDescription"});ae.descriptionSchema=w;const R=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ae.installBlockletTitleSchema=R;const F=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ae.installBlockletDescriptionSchema=F;const D=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((V,he)=>V.includes(a.WELLKNOWN_BLOCKLET_LOGO_PATH)?he.message(`logo url should not include ${a.WELLKNOWN_BLOCKLET_LOGO_PATH}`):V).meta({className:"TLogo"});ae.logoSchema=D;const ne=c.string().trim().min(1),Y=ne.meta({className:"TMountPoint"}).custom((V,he)=>(0,S.isValidUrlPath)(V)?V:he.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ae.mountPointSchema=Y;const W=ne.meta({className:"TUpdateMountPoint"}).custom(V=>(0,S.urlPathFriendly)(V));ae.updateMountPointSchema=W;const U=c.string().custom(V=>((0,m.validateName)(V),V)).meta({className:"TBlockletName"});ae.blockletNameSchema=U;const H=[],A=c.string().trim().min(1).max(50).required().custom((V,he)=>V.startsWith("BLOCKLET")&&!H.includes(V)?he.message("Env name can not start with BLOCKLET_"):V.startsWith("COMPONENT")?he.message("Env name can not start with COMPONENT_"):V.startsWith("ABTNODE")?he.message("Env name can not start with ABTNODE_"):/[^\w]/.test(V)?he.message('Env name can include only numbers or letters or "_"'):V).meta({className:"TEnvironmentName",unknownType:"any"});ae.environmentNameSchema=A;const J=c.object({name:A.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.boolean().default(V=>V.secure?!1:void 0)}).custom((V,he)=>V.secure&&V.default?he.message(`Cannot declare default value for secure env ${V.name}`):V).meta({className:"TEnvironment",unknownType:"any"});ae.environmentSchema=J;const M=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});ae.scriptsSchema=M;const ue=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ae.serviceSchema=ue;const Ie=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ae.endpointSchema=Ie;const K=c.string().trim().custom((V,he)=>{const De=V.split("/").filter(Boolean);return De.length===0?he.message("cacheable path must be a valid pathname that is not /"):`/${De.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ae.cacheableSchema=K;const Ee=c.object({type:c.string().lowercase().valid(...u.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(u.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...u.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(u.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(u.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(K).unique(),services:c.array().items(ue).unique("name"),endpoints:c.array().items(Ie).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique(),proxyBehavior:c.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});ae.interfaceSchema=Ee;const ce=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:U.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:U.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Me=c.object({platform:c.string().valid(...u.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet","bun").default("node"),source:ce,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ae.engineSchema=Me;const me=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ae.personSchema=me;const Oe=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});ae.distSchema=Oe;const Pe=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});ae.statsSchema=Pe;const ut={source:c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:U.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})).required(),required:c.boolean(),title:O,description:w,mountPoint:Y,name:U},ft=(V,he)=>c.object(V).custom((De,Xe)=>!he&&De.source&&De.source.name&&!De.source.store?Xe.message(`missing 'store' in source of component ${De.name}`):De),rt=ft(ut).meta({className:"TComponent",unknownType:"any"});ae.componentSchema=rt;const we=ft(ut,!0),de=({checkStore:V}={})=>{const he=[rt,we];return c.array().items(V?he[0]:he[1]).optional().default([])},ge=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});ae.signatureSchema=ge;const Fe=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],$e={id:c.string().custom($),title:c.alternatives().try(c.string().min(1).max(u.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Fe),c.string().min(1).max(u.MAX_TITLE_LENGTH))).required(),description:c.alternatives().try(c.string().min(1).max(u.MAX_DESCRIPTION_LENGTH),c.object().min(1).pattern(c.string().valid(...Fe),c.string().min(1).max(u.MAX_DESCRIPTION_LENGTH))),link:c.alternatives().try(c.string().custom(N),c.object().min(1).pattern(c.string().valid(...Fe),c.string().custom(N))),component:c.string().min(1),section:c.array().items(c.string().valid("header","footer","bottom","social","dashboard","sessionManager","userCenter","bottomNavigation")).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean(),private:c.boolean()},jt=c.object({...$e,items:c.array().items(c.object({...$e}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ae.navigationItemSchema=jt;const Ae=c.array().items(jt).unique((V,he)=>V.id&&he.id?V.id===he.id:!1).meta({className:"TNavigation",unknownType:"any"});ae.navigationSchema=Ae;const Et=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ae.themeSchema=Et;const Ot=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ae.authConfigSchema=Ot;const Ct=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),It=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ae.resourceBundleSchema=It;const Ve=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});ae.eventsSchema=Ve;const Rt={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:w.required(),group:c.string().valid(...u.BLOCKLET_GROUPS),main:c.string().trim(),title:O.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:me.optional(),contributors:c.array().items(me).optional(),maintainers:c.array().items(me).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.number().greater(0).max(1).required()})).default([]).custom(V=>{if(V.length===0)return V;const he=V.reduce((De,Xe)=>De+Xe.value,0);if(he!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${he}`);return V},"invalid blocklet share"),componentPrice:c.array().items(c.object({parentPriceRange:c.array().items(c.number()).custom((V,he)=>V.length!==2?he.message("length of range should be 2"):V[0]<0?he.message("the first value should not less than 0 in range"):V[1]<=V[0]?he.message("the second value should greater than the first value in range"):V),type:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...u.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...u.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...u.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...u.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid(),aigne:c.boolean().optional()}).default({server:u.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(Ee).unique("name").custom((V,he)=>{if(V.filter(it=>it.type===u.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return he.message(`Only one ${u.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Xe=V.filter(it=>it.type===u.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const it of Xe)if(!it.prefix.startsWith(C))return he.message(`Wellknown path prefix must start with: ${C}`);return V}).default([]),environments:c.array().items(J).default([]).optional().custom((V,he)=>{if(V&&V.length){const De=V.filter((Xe,it)=>V.findIndex(wt=>wt.name===Xe.name)!==it);if(De.length)return he.message(`find duplicate environment names ${De.map(Xe=>Xe.name).join(", ")}`)}return V}),scripts:M,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(u.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional(),mcp:c.boolean().optional(),singleton:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(It),types:c.array().items(Ct).max(10)}),engine:c.alternatives().try(Me,c.array().items(Me)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:c.string().optional().allow(""),dist:Oe.optional(),stats:Pe.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(ge).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:de(),navigation:Ae,theme:Et,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:Ve.optional()},pt=c.object(Rt).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ae.blockletMetaSchema=pt;const st=(V,{ensureFiles:he=!1,ensureDist:De=!1,ensureComponentStore:Xe=!0,ensureName:it=!1,skipValidateDidName:wt=!1,...qt}={})=>((!V||!t.default.existsSync(V))&&(he=!1),c.object({...Rt,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:he?c.file().trim().exists({baseDir:V}).optional():c.string().trim().optional(),files:c.array().items(he?c.file().exists({baseDir:V,canSkip:(Ue,L)=>[u.BLOCKLET_ENTRY_FILE,u.BLOCKLET_BUNDLE_FILE].includes(L)||(0,s.default)(L)}):c.string().trim()).optional(),dist:De?Oe.required():Oe.optional(),components:de({checkStore:Xe}),name:it?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:h.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...qt}).rename("children","components").custom((Ue,L)=>{const{did:re,name:ve,docker:Re}=Ue;if(Re){const{image:b,dockerfile:k,network:_}=Re;if(!b&&!k)return L.message("Image or dockerfile must be set");if(b&&k)return L.message("Image and dockerfile cannot be set at the same time");if(_)return L.message("ExportPorts and network cannot be set at the same time");k&&(Ue.files||(Ue.files=[]),Ue.files.push(k))}let p;if((0,d.isValid)(re))try{return(0,m.validateNewDid)(re),Ue}catch(b){p=b}if(ve){(0,m.validateName)(ve,{checkDid:!wt});const b=(0,f.toBlockletDid)(ve);return b!==re?L.message(`The did of name "${ve}" should be "${b}"`):Ue}return p?L.message(p.message):Ue}));return ae.createBlockletSchema=st,ae.default={blockletNameSchema:U,componentSchema:rt,endpointSchema:Ie,serviceSchema:ue,createBlockletSchema:st,interfaceSchema:Ee,environmentSchema:J,environmentNameSchema:A,scriptsSchema:M,personSchema:me,distSchema:Oe,titleSchema:O,descriptionSchema:w,logoSchema:D,navigationSchema:Ae,themeSchema:Et,mountPointSchema:Y,updateMountPointSchema:W,authConfigSchema:Ot,resourceBundleSchema:It,installBlockletTitleSchema:R,installBlockletDescriptionSchema:F,eventsSchema:Ve,Joi:c},ae}var ht={},so;function lu(){if(so)return ht;so=1;var e=ht&&ht.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(ht,"__esModule",{value:!0}),ht.setService=ht.findService=ht.getDefaultServiceConfig=ht.getServiceConfig=void 0;const t=e(tc),r=gs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};ht.setService=s,s({name:"auth",schema:r.authConfigSchema,default:{}});const n=h=>{if(!h)throw new Error("service name should not be empty");const u=i[h];if(!u)throw new Error(`service ${h} does not exist`);return u},o=(h,u,{validate:f}={})=>{const j=n(h),m=(0,t.default)(u||{}),{value:S,error:E}=j.validate(m);if(f&&E)throw new Error(`Invalid blocklet service config: ${E.details.map(C=>C.message).join(", ")}`);return S};ht.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};ht.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return ht.findService=d,ht.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},ht}var ao;function cu(){if(ao)return Gt;ao=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.fixAndValidateService=Gt.validateMeta=void 0;const e=gs(),t=lu(),r=s=>(!s.interfaces||!s.interfaces.length||s.interfaces.forEach(n=>{n.services&&n.services.length&&n.services.forEach(o=>{o.config=(0,t.getServiceConfig)(o.name,o.config,{validate:!0})})}),s);Gt.fixAndValidateService=r;const i=(s,{ensureFiles:n=!1,ensureDist:o=!1,ensureComponentStore:a=!0,ensureName:d=!1,skipValidateDidName:h=!1,schemaOptions:u={}}={})=>{const f=(0,e.createBlockletSchema)(null,{ensureFiles:n,ensureDist:o,ensureComponentStore:a,ensureName:d,skipValidateDidName:h,...u}),{value:j,error:m}=f.validate(s);if(m)throw new Error(`Invalid blocklet meta: ${m.details.map(S=>S.message).join(", ")}`);return j};return Gt.validateMeta=i,Gt.default=i,Gt}var lo;function uu(){return lo||(lo=1,function(e){var t=kt&&kt.__createBinding||(Object.create?function(w,R,F,D){D===void 0&&(D=F);var ne=Object.getOwnPropertyDescriptor(R,F);(!ne||("get"in ne?!R.__esModule:ne.writable||ne.configurable))&&(ne={enumerable:!0,get:function(){return R[F]}}),Object.defineProperty(w,D,ne)}:function(w,R,F,D){D===void 0&&(D=F),w[D]=R[F]}),r=kt&&kt.__setModuleDefault||(Object.create?function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}:function(w,R){w.default=R}),i=kt&&kt.__importStar||function(){var w=function(R){return w=Object.getOwnPropertyNames||function(F){var D=[];for(var ne in F)Object.prototype.hasOwnProperty.call(F,ne)&&(D[D.length]=ne);return D},w(R)};return function(R){if(R&&R.__esModule)return R;var F={};if(R!=null)for(var D=w(R),ne=0;ne<D.length;ne++)D[ne]!=="default"&&t(F,R,D[ne]);return r(F,R),F}}(),s=kt&&kt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const n=s(cl),o=i(Gc()),a=Yo(),d=cu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=ms(),u=(w,R)=>{w.description||(w.description=`Blocklet from ${R}`),w.version||(w.version=a.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=u;const f=w=>{if(w.repository&&(typeof w.repository=="string"&&(w.repository={type:"git",url:w.repository}),w.repository.url)){const R=o.fromUrl(w.repository.url);R&&(w.repository.url=R.getDefaultRepresentation()==="shortcut"?R.https():R.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(R=>!(!R||typeof R!="string"))):delete w.files};e.fixFiles=j;const m=w=>{typeof w.keywords=="string"&&(w.keywords=w.keywords.split(/,\s+/)),w.keywords&&!Array.isArray(w.keywords)?delete w.keywords:w.keywords&&(w.keywords=w.keywords.filter(R=>!(typeof R!="string"||!R)))};e.fixKeywords=m;const S=w=>{typeof w.tags=="string"&&(w.tags=w.tags.split(/,\s+/)),w.tags&&!Array.isArray(w.tags)?delete w.tags:w.tags&&(w.tags=w.tags.filter(R=>!(typeof R!="string"||!R)))};e.fixTags=S;const E=(w,R)=>(w.author&&(w.author=R(w.author)),["maintainers","contributors"].forEach(F=>{Array.isArray(w[F])&&(w[F]=w[F].map(R))}),w),C=w=>{if(!w)return"";if(typeof w=="string")return w;const R=w.name||"",F=w.url||w.web,D=F?` (${F})`:"",ne=w.email||w.mail,Y=ne?` <${ne}>`:"";return R+Y+D};e.formatPerson=C;const c=w=>{if(typeof w!="string")return w;const R=w.match(/^([^(<]+)/),F=w.match(/\(([^)]+)\)/),D=w.match(/<([^>]+)>/),ne={};return R&&R[0].trim()&&(ne.name=R[0].trim()),D&&([,ne.email]=D),F&&([,ne.url]=F),ne};e.parsePerson=c;const N=w=>(E(w,C),E(w,c),w);e.fixPerson=N;const $=(w,R=!0)=>{if(Array.isArray(w.interfaces)||(w.interfaces=[]),w.interfaces.length)return w.interfaces.forEach(Y=>{Y.type===a.BLOCKLET_INTERFACE_TYPE_WEB&&(Y.protocol="http")}),w;const D=(0,n.default)(w,"capabilities.dynamicPathPrefix",!0)?a.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ne=({type:Y="web",name:W,path:U="/",protocol:H="http",port:A=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Y,name:W,path:U,prefix:D,port:A,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Y=>{w[Y]&&ne({name:Y,path:w[Y]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Y=>{ne({type:"service",name:Y.protocol,protocol:Y.protocol,port:{internal:`BLOCKLET_${Y.protocol}_PORT`.toUpperCase(),external:Y.port}})}),R&&(delete w.publicUrl,delete w.adminUrl,delete w.configUrl,delete w.docUrl,delete w.exposeServices,w.capabilities&&delete w.capabilities.dynamicPathPrefix),w};e.fixInterfaces=$;const O=w=>{const{did:R}=w;try{(0,h.validateNewDid)(R),w.name=R}catch{}return w};e.fixName=O,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:N,fixTags:S,fixName:O,formatPerson:C,parsePerson:c,fixInterfaces:$,fixService:d.fixAndValidateService}}(kt)),kt}var du=uu();function vs({owner:e,locale:t}){return l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?l.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}vs.propTypes={owner:B.object.isRequired,locale:B.string.isRequired};const hu="install-blocklet-from-URL",ys=()=>{const[e,t]=si(hu,"[]",{raw:!0}),r=s=>{const n=s.trim(),o=JSON.parse(e),a=o.findIndex(d=>d===n);a!==0&&(a>0&&o.splice(a,1),o.length>=10&&o.splice(9),o.unshift(n),t(JSON.stringify(o)))},i=s=>{if(!s)return;const n=JSON.parse(e),o=s.trim(),a=n.findIndex(d=>d===o);a>-1&&(n.splice(a,1),t(JSON.stringify(n)))};return{urls:e?JSON.parse(e):[],addUrlRecord:r,removeUrlRecord:i}};function bs({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=ys(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return l.jsxs(te,{children:[l.jsx(Ao,{freeSolo:!0,options:s,inputValue:e,onInputChange:(a,d)=>{t(d)},disableClearable:!0,popupIcon:null,renderInput:a=>$t.cloneElement(r,{...a}),renderOption:(a,d)=>q.createElement(Do,{...a,key:d,secondaryAction:l.jsx(No,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:l.jsx(va,{})})},l.jsx(ya,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:l.jsx(Mo,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),l.jsx(ba,{style:{margin:0},children:i})]})}bs.propTypes={onValueChange:B.func,children:B.node,value:B.string,helperText:B.string};function xs({onClick:e}){const{t}=xt();return l.jsx(ul,{title:t("launchBlocklet.withoutWallet"),icon:l.jsx(yt,{icon:dl,fontSize:"1em"}),onClick:e})}xs.propTypes={onClick:B.func.isRequired};function ws({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=dn(),{api:a,session:d}=nc(),[h,u]=q.useState(!1),[f,j]=q.useState(""),{t:m,locale:S}=xt(),E={dist:{}},{encryptKey:C}=hl(),[c,N]=q.useState(e),[$,O]=q.useState(e?1:0),[w,R]=q.useState(E),[F,D]=q.useState(!1),[ne,Y]=q.useState(""),[W]=si("instant-blocklet-install",!1),[U,H]=q.useState({}),A=s==="component",J=A?!0:!e,{addUrlRecord:M}=ys(),ue=q.useMemo(()=>(d.user?.connectedAccounts||[]).some(Fe=>Fe.provider===Mt.LOGIN_PROVIDER.WALLET),[d.user]),Ie=q.useMemo(()=>{let de=c.trim();return!de.startsWith("https://")&&!de.startsWith("http://")&&!de.startsWith("file://")&&(de=`file://${de}`),de},[c]),K=async()=>{R(E),j(null),u(!0);const de=Ie;try{const ge=decodeURIComponent(de);try{new URL(ge)}catch{throw new Error("Invalid URL")}const{meta:Fe,inStore:$e,registryUrl:jt}=await o.getBlockletMetaFromUrl({input:{url:ge}});R(Fe),H({inStore:$e,registryUrl:jt,inputUrl:de}),M(de)}catch(ge){console.error(ge);const Fe=`Blocklet Install failed: ${Ur(ge)}`;j(Fe),i(ge)}finally{u(!1)}},Ee=()=>{if(A){r({meta:w,...U}),t();return}if(W){u(!0),D(!0);return}const de=rn(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Zn(de,{blocklet_meta_url:decodeURIComponent(Ie.trim()),from:"url"})},ce=()=>{u(!1),D(!1),r({meta:w,...U}),t()},Me=()=>{u(!1),D(!1)};q.useEffect(()=>{e&&K()},[e]);const me=q.useMemo(()=>({title:w.title,wt:fl(w),blockletMetaUrl:decodeURIComponent(c.trim())}),[w,c]),Oe=q.useCallback(async()=>{if(ue||W){Y("");return}const de=new URL(window.location.href);de.pathname=rn(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),de.searchParams.set("_ek_",C),Object.keys(me).forEach(Fe=>{de.searchParams.set(Fe,me[Fe])});const{data:ge}=await a.get(de.href);ge.url?Y(ge.url):Y("")},[ue,me,a,C,W]);q.useEffect(()=>{Oe()},[Oe]);const Pe=q.useMemo(()=>ue&&ne?{...me,nw:ne,skipMigrateAccount:!0}:me,[me,ne,ue]),nt=[{name:m("common.name"),value:Ft.getDisplayName({meta:w},!0)},{name:m("common.version"),value:w.version},{name:m("common.did"),value:w.did?l.jsx(rc,{did:w.did}):null},{name:m("common.author"),value:w.owner?l.jsx(vs,{owner:w.owner,locale:S}):du.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],ut=()=>h?l.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:l.jsx(Tt,{})}):w.did?l.jsx("div",{style:{paddingLeft:"10%"},children:nt.map(de=>de.name===m("common.did")?l.jsx(_i,{valueComponent:"div",nameWidth:120,name:de.name,nameFormatter:()=>m("common.did"),children:de.value},de.name):l.jsx(_i,{valueComponent:"div",nameWidth:120,name:de.name,children:de.value},de.name))}):null,ft=Xl(async()=>{let de=w.title;d.user&&(de=`${d.user.fullName}'s ${w.title}`);try{ce(),await o.launchBlockletWithoutWallet({input:{title:de,blockletMetaUrl:decodeURIComponent(c.trim()),type:"store",storeUrl:U.registryUrl,onlyRequired:!0}})}catch(ge){console.error("launchBlockletWithoutWallet error:",ge),Yn.error(Ur(ge),{autoHideDuration:3e3})}}),rt=[{label:m("blocklet.fromUrl.step0"),body:l.jsx(je,{component:"div",children:l.jsx(bs,{style:{marginBottom:32},value:c,helperText:m("blocklet.fromUrl.description"),onValueChange:de=>{j(null),N(de)},children:l.jsx(Hn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:c,onChange:de=>{j(null),N(de.target.value)},disabled:h,onKeyPress:de=>{de.key==="Enter"&&(de.preventDefault(),K(),O(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{K(),O(1)}},{label:m("blocklet.fromUrl.step1"),body:ut(),cancel:m(J?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{J?O(de=>de-1):t()},onConfirm:()=>{Ee()}}],we=rt[$];return l.jsxs(l.Fragment,{children:[l.jsxs(oi,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>we.onCancel(),showCloseButton:$===0,disableEscapeKeyDown:!0,open:!0,actions:l.jsxs(l.Fragment,{children:[we.cancel&&l.jsx(vt,{onClick:de=>{de.stopPropagation(),j(null),we.onCancel()},color:"inherit",children:we.cancel||m("common.cancel")}),l.jsxs(vt,{onClick:de=>{de.stopPropagation(),we.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!c||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&$===0&&l.jsx(Tt,{size:16}),we.confirm]})]}),children:[J&&l.jsx(xa,{alternativeLabel:!0,activeStep:$,children:rt.map(({label:de})=>l.jsx(wa,{children:l.jsx(Sa,{children:de})},de))}),l.jsx(Ea,{component:"div",style:{marginTop:24},children:we.body}),!!f&&l.jsx(Bo,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),w&&F&&l.jsx(Jo,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!ue&&!W?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:ce,extraParams:Pe,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Me,customItems:W?[]:[l.jsx(xs,{onClick:ft})]})]})}ws.propTypes={defaultUrl:B.string,onCancel:B.func.isRequired,onSuccess:B.func.isRequired,onError:B.func,mode:B.oneOf(["install","component"]),handleText:B.object};const fu={meta:B.object.isRequired,onCancel:B.func.isRequired};function Ss({action:e,onSelect:t,onNext:r}){const{t:i}=xt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return l.jsxs(l.Fragment,{children:[l.jsx(ka,{children:s.map(n=>l.jsxs(Do,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[l.jsx(Ta,{sx:{minWidth:48},children:n.action==="purchase"?l.jsx(ja,{style:{color:e==="purchase"?Oi.primary.main:"#AAA",fontSize:32}}):l.jsx(Oa,{style:{color:e==="verify"?Oi.primary.main:"#AAA",fontSize:32}})}),l.jsx(Mo,{primary:n.title,secondary:n.description})]},n.action))}),r&&l.jsx(vt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Ss.propTypes={action:B.oneOf(["both","purchase","verify"]).isRequired,onSelect:B.func.isRequired,onNext:B.func.isRequired};function Es({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=xt(),{info:o}=dn(),a=pl(o),[d,h]=q.useState(null),u=new URL(e?.registryUrl).origin,f=Ft.getDisplayName({meta:e}),j=async(S,E)=>{const C=({downloadTokenList:$})=>{i({downloadTokenList:$})},c=$=>{Yn.error($),t($)};function N($){return gl(()=>Ni.get($).then(async({data:O})=>{const w=O?.downloadTokenList;if(O.status==="succeed"){if(w&&w.length)await C({downloadTokenList:w});else return await c(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return O.status==="error"?(console.error("vc error: ",O),await c(O?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:$}=ml(d);await N($)}else await C({downloadTokenList:S.downloadTokenList&&E(S.downloadTokenList)})};if(q.useEffect(()=>{if(r==="purchase"){const S=new URL(u);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",o.did),S.searchParams.set("blockletDid",e?.did);try{Ni.get(S.href).then(({data:E})=>{const C=`${E.url}`;h(C)})}catch(E){console.error("get next workflow url error: ",E)}}return()=>{h(null)}},[r]),r==="purchase"&&!d)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:Li.create({baseURL:u}).get,extraParams:{serverDid:o.did,blockletDid:e?.did},messages:{title:s("store.purchase.verify.auth.title",{name:f}),scan:s("store.purchase.verify.auth.scan"),confirm:s("store.purchase.verify.auth.confirm"),success:s("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Li.create({baseURL:rn(u,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:s("store.purchase.auth.title",{name:f}),scan:s("store.purchase.auth.scan"),confirm:s("store.purchase.auth.confirm"),success:l.jsxs(l.Fragment,{children:[l.jsx("p",{children:s("store.purchase.auth.success")}),l.jsx("p",{children:s("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return l.jsx(Jo,{open:!0,locale:n,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:j,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...m[r]})}Es.propTypes={...fu,handlePaySuccess:B.func,mode:B.oneOf(["verify","purchase"]).isRequired};function ks({ref:e=null,mode:t,...r}){const[i,s]=q.useState(t!=="both"?t:"verify"),[n,o]=q.useState(t!=="both"?2:1),a=h=>{h!==i&&s(h)},d=()=>{i&&n!==2&&o(2)};return q.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>n})),n===1?l.jsx("div",{style:{maxWidth:520},children:l.jsx(Ss,{action:i,onNext:null,onSelect:a})}):l.jsx(Es,{...r,mode:i})}ks.propTypes={mode:B.oneOf(["both","verify","purchase"]).isRequired,ref:B.any};function pu({...e}){return l.jsx(vt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ts({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=xt(),n=is();return!e||vl(e.meta)?l.jsx(mu,{children:r}):l.jsxs(gu,{isMobile:n,children:[l.jsx(pu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),l.jsx(te,{sx:{display:"flex",alignItems:"center"},children:r})]})}Ts.propTypes={blocklet:B.object,onStartNow:B.func,children:B.any,disabled:B.bool};const mu=tt(te)`
220
+ `),O=c.string().trim().min(1).custom(V=>{if(E(V)>u.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${u.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return V}).meta({className:"TTitle"});ae.titleSchema=O;const w=c.string().trim().min(3).max(160).meta({className:"TDescription"});ae.descriptionSchema=w;const R=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ae.installBlockletTitleSchema=R;const F=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ae.installBlockletDescriptionSchema=F;const D=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((V,he)=>V.includes(a.WELLKNOWN_BLOCKLET_LOGO_PATH)?he.message(`logo url should not include ${a.WELLKNOWN_BLOCKLET_LOGO_PATH}`):V).meta({className:"TLogo"});ae.logoSchema=D;const ne=c.string().trim().min(1),Y=ne.meta({className:"TMountPoint"}).custom((V,he)=>(0,S.isValidUrlPath)(V)?V:he.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ae.mountPointSchema=Y;const W=ne.meta({className:"TUpdateMountPoint"}).custom(V=>(0,S.urlPathFriendly)(V));ae.updateMountPointSchema=W;const q=c.string().custom(V=>((0,m.validateName)(V),V)).meta({className:"TBlockletName"});ae.blockletNameSchema=q;const H=[],A=c.string().trim().min(1).max(50).required().custom((V,he)=>V.startsWith("BLOCKLET")&&!H.includes(V)?he.message("Env name can not start with BLOCKLET_"):V.startsWith("COMPONENT")?he.message("Env name can not start with COMPONENT_"):V.startsWith("ABTNODE")?he.message("Env name can not start with ABTNODE_"):/[^\w]/.test(V)?he.message('Env name can include only numbers or letters or "_"'):V).meta({className:"TEnvironmentName",unknownType:"any"});ae.environmentNameSchema=A;const J=c.object({name:A.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.boolean().default(V=>V.secure?!1:void 0)}).custom((V,he)=>V.secure&&V.default?he.message(`Cannot declare default value for secure env ${V.name}`):V).meta({className:"TEnvironment",unknownType:"any"});ae.environmentSchema=J;const M=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});ae.scriptsSchema=M;const ue=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ae.serviceSchema=ue;const Ie=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ae.endpointSchema=Ie;const K=c.string().trim().custom((V,he)=>{const De=V.split("/").filter(Boolean);return De.length===0?he.message("cacheable path must be a valid pathname that is not /"):`/${De.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ae.cacheableSchema=K;const Ee=c.object({type:c.string().lowercase().valid(...u.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(u.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...u.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(u.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(u.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(K).unique(),services:c.array().items(ue).unique("name"),endpoints:c.array().items(Ie).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique(),proxyBehavior:c.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});ae.interfaceSchema=Ee;const ce=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:q.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:q.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Me=c.object({platform:c.string().valid(...u.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet","bun").default("node"),source:ce,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ae.engineSchema=Me;const me=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ae.personSchema=me;const Oe=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});ae.distSchema=Oe;const Pe=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});ae.statsSchema=Pe;const ut={source:c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:q.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})).required(),required:c.boolean(),title:O,description:w,mountPoint:Y,name:q},ft=(V,he)=>c.object(V).custom((De,Xe)=>!he&&De.source&&De.source.name&&!De.source.store?Xe.message(`missing 'store' in source of component ${De.name}`):De),rt=ft(ut).meta({className:"TComponent",unknownType:"any"});ae.componentSchema=rt;const we=ft(ut,!0),de=({checkStore:V}={})=>{const he=[rt,we];return c.array().items(V?he[0]:he[1]).optional().default([])},ge=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});ae.signatureSchema=ge;const Fe=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],$e={id:c.string().custom($),title:c.alternatives().try(c.string().min(1).max(u.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Fe),c.string().min(1).max(u.MAX_TITLE_LENGTH))).required(),description:c.alternatives().try(c.string().min(1).max(u.MAX_DESCRIPTION_LENGTH),c.object().min(1).pattern(c.string().valid(...Fe),c.string().min(1).max(u.MAX_DESCRIPTION_LENGTH))),link:c.alternatives().try(c.string().custom(N),c.object().min(1).pattern(c.string().valid(...Fe),c.string().custom(N))),component:c.string().min(1),section:c.array().items(c.string().valid("header","footer","bottom","social","dashboard","sessionManager","userCenter","bottomNavigation")).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean(),private:c.boolean()},jt=c.object({...$e,items:c.array().items(c.object({...$e}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ae.navigationItemSchema=jt;const Ae=c.array().items(jt).unique((V,he)=>V.id&&he.id?V.id===he.id:!1).meta({className:"TNavigation",unknownType:"any"});ae.navigationSchema=Ae;const Et=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ae.themeSchema=Et;const Ot=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ae.authConfigSchema=Ot;const Ct=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),It=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ae.resourceBundleSchema=It;const Ve=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});ae.eventsSchema=Ve;const Rt={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:w.required(),group:c.string().valid(...u.BLOCKLET_GROUPS),main:c.string().trim(),title:O.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:me.optional(),contributors:c.array().items(me).optional(),maintainers:c.array().items(me).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.number().greater(0).max(1).required()})).default([]).custom(V=>{if(V.length===0)return V;const he=V.reduce((De,Xe)=>De+Xe.value,0);if(he!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${he}`);return V},"invalid blocklet share"),componentPrice:c.array().items(c.object({parentPriceRange:c.array().items(c.number()).custom((V,he)=>V.length!==2?he.message("length of range should be 2"):V[0]<0?he.message("the first value should not less than 0 in range"):V[1]<=V[0]?he.message("the second value should greater than the first value in range"):V),type:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...u.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...u.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...u.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...u.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid(),aigne:c.boolean().optional()}).default({server:u.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(Ee).unique("name").custom((V,he)=>{if(V.filter(it=>it.type===u.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return he.message(`Only one ${u.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Xe=V.filter(it=>it.type===u.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const it of Xe)if(!it.prefix.startsWith(C))return he.message(`Wellknown path prefix must start with: ${C}`);return V}).default([]),environments:c.array().items(J).default([]).optional().custom((V,he)=>{if(V&&V.length){const De=V.filter((Xe,it)=>V.findIndex(wt=>wt.name===Xe.name)!==it);if(De.length)return he.message(`find duplicate environment names ${De.map(Xe=>Xe.name).join(", ")}`)}return V}),scripts:M,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(u.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional(),mcp:c.boolean().optional(),singleton:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(It),types:c.array().items(Ct).max(10)}),engine:c.alternatives().try(Me,c.array().items(Me)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:c.string().optional().allow(""),dist:Oe.optional(),stats:Pe.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(ge).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:de(),navigation:Ae,theme:Et,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:Ve.optional()},pt=c.object(Rt).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ae.blockletMetaSchema=pt;const st=(V,{ensureFiles:he=!1,ensureDist:De=!1,ensureComponentStore:Xe=!0,ensureName:it=!1,skipValidateDidName:wt=!1,...qt}={})=>((!V||!t.default.existsSync(V))&&(he=!1),c.object({...Rt,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:he?c.file().trim().exists({baseDir:V}).optional():c.string().trim().optional(),files:c.array().items(he?c.file().exists({baseDir:V,canSkip:(Ue,L)=>[u.BLOCKLET_ENTRY_FILE,u.BLOCKLET_BUNDLE_FILE].includes(L)||(0,s.default)(L)}):c.string().trim()).optional(),dist:De?Oe.required():Oe.optional(),components:de({checkStore:Xe}),name:it?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:h.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...qt}).rename("children","components").custom((Ue,L)=>{const{did:re,name:ve,docker:Re}=Ue;if(Re){const{image:b,dockerfile:k,network:_}=Re;if(!b&&!k)return L.message("Image or dockerfile must be set");if(b&&k)return L.message("Image and dockerfile cannot be set at the same time");if(_)return L.message("ExportPorts and network cannot be set at the same time");k&&(Ue.files||(Ue.files=[]),Ue.files.push(k))}let p;if((0,d.isValid)(re))try{return(0,m.validateNewDid)(re),Ue}catch(b){p=b}if(ve){(0,m.validateName)(ve,{checkDid:!wt});const b=(0,f.toBlockletDid)(ve);return b!==re?L.message(`The did of name "${ve}" should be "${b}"`):Ue}return p?L.message(p.message):Ue}));return ae.createBlockletSchema=st,ae.default={blockletNameSchema:q,componentSchema:rt,endpointSchema:Ie,serviceSchema:ue,createBlockletSchema:st,interfaceSchema:Ee,environmentSchema:J,environmentNameSchema:A,scriptsSchema:M,personSchema:me,distSchema:Oe,titleSchema:O,descriptionSchema:w,logoSchema:D,navigationSchema:Ae,themeSchema:Et,mountPointSchema:Y,updateMountPointSchema:W,authConfigSchema:Ot,resourceBundleSchema:It,installBlockletTitleSchema:R,installBlockletDescriptionSchema:F,eventsSchema:Ve,Joi:c},ae}var ht={},ao;function du(){if(ao)return ht;ao=1;var e=ht&&ht.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(ht,"__esModule",{value:!0}),ht.setService=ht.findService=ht.getDefaultServiceConfig=ht.getServiceConfig=void 0;const t=e(ic),r=bs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};ht.setService=s,s({name:"auth",schema:r.authConfigSchema,default:{}});const n=h=>{if(!h)throw new Error("service name should not be empty");const u=i[h];if(!u)throw new Error(`service ${h} does not exist`);return u},o=(h,u,{validate:f}={})=>{const j=n(h),m=(0,t.default)(u||{}),{value:S,error:E}=j.validate(m);if(f&&E)throw new Error(`Invalid blocklet service config: ${E.details.map(C=>C.message).join(", ")}`);return S};ht.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};ht.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return ht.findService=d,ht.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},ht}var lo;function hu(){if(lo)return Gt;lo=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.fixAndValidateService=Gt.validateMeta=void 0;const e=bs(),t=du(),r=s=>(!s.interfaces||!s.interfaces.length||s.interfaces.forEach(n=>{n.services&&n.services.length&&n.services.forEach(o=>{o.config=(0,t.getServiceConfig)(o.name,o.config,{validate:!0})})}),s);Gt.fixAndValidateService=r;const i=(s,{ensureFiles:n=!1,ensureDist:o=!1,ensureComponentStore:a=!0,ensureName:d=!1,skipValidateDidName:h=!1,schemaOptions:u={}}={})=>{const f=(0,e.createBlockletSchema)(null,{ensureFiles:n,ensureDist:o,ensureComponentStore:a,ensureName:d,skipValidateDidName:h,...u}),{value:j,error:m}=f.validate(s);if(m)throw new Error(`Invalid blocklet meta: ${m.details.map(S=>S.message).join(", ")}`);return j};return Gt.validateMeta=i,Gt.default=i,Gt}var co;function fu(){return co||(co=1,function(e){var t=kt&&kt.__createBinding||(Object.create?function(w,R,F,D){D===void 0&&(D=F);var ne=Object.getOwnPropertyDescriptor(R,F);(!ne||("get"in ne?!R.__esModule:ne.writable||ne.configurable))&&(ne={enumerable:!0,get:function(){return R[F]}}),Object.defineProperty(w,D,ne)}:function(w,R,F,D){D===void 0&&(D=F),w[D]=R[F]}),r=kt&&kt.__setModuleDefault||(Object.create?function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}:function(w,R){w.default=R}),i=kt&&kt.__importStar||function(){var w=function(R){return w=Object.getOwnPropertyNames||function(F){var D=[];for(var ne in F)Object.prototype.hasOwnProperty.call(F,ne)&&(D[D.length]=ne);return D},w(R)};return function(R){if(R&&R.__esModule)return R;var F={};if(R!=null)for(var D=w(R),ne=0;ne<D.length;ne++)D[ne]!=="default"&&t(F,R,D[ne]);return r(F,R),F}}(),s=kt&&kt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const n=s(hl),o=i(Yc()),a=Zo(),d=hu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=ys(),u=(w,R)=>{w.description||(w.description=`Blocklet from ${R}`),w.version||(w.version=a.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=u;const f=w=>{if(w.repository&&(typeof w.repository=="string"&&(w.repository={type:"git",url:w.repository}),w.repository.url)){const R=o.fromUrl(w.repository.url);R&&(w.repository.url=R.getDefaultRepresentation()==="shortcut"?R.https():R.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(R=>!(!R||typeof R!="string"))):delete w.files};e.fixFiles=j;const m=w=>{typeof w.keywords=="string"&&(w.keywords=w.keywords.split(/,\s+/)),w.keywords&&!Array.isArray(w.keywords)?delete w.keywords:w.keywords&&(w.keywords=w.keywords.filter(R=>!(typeof R!="string"||!R)))};e.fixKeywords=m;const S=w=>{typeof w.tags=="string"&&(w.tags=w.tags.split(/,\s+/)),w.tags&&!Array.isArray(w.tags)?delete w.tags:w.tags&&(w.tags=w.tags.filter(R=>!(typeof R!="string"||!R)))};e.fixTags=S;const E=(w,R)=>(w.author&&(w.author=R(w.author)),["maintainers","contributors"].forEach(F=>{Array.isArray(w[F])&&(w[F]=w[F].map(R))}),w),C=w=>{if(!w)return"";if(typeof w=="string")return w;const R=w.name||"",F=w.url||w.web,D=F?` (${F})`:"",ne=w.email||w.mail,Y=ne?` <${ne}>`:"";return R+Y+D};e.formatPerson=C;const c=w=>{if(typeof w!="string")return w;const R=w.match(/^([^(<]+)/),F=w.match(/\(([^)]+)\)/),D=w.match(/<([^>]+)>/),ne={};return R&&R[0].trim()&&(ne.name=R[0].trim()),D&&([,ne.email]=D),F&&([,ne.url]=F),ne};e.parsePerson=c;const N=w=>(E(w,C),E(w,c),w);e.fixPerson=N;const $=(w,R=!0)=>{if(Array.isArray(w.interfaces)||(w.interfaces=[]),w.interfaces.length)return w.interfaces.forEach(Y=>{Y.type===a.BLOCKLET_INTERFACE_TYPE_WEB&&(Y.protocol="http")}),w;const D=(0,n.default)(w,"capabilities.dynamicPathPrefix",!0)?a.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ne=({type:Y="web",name:W,path:q="/",protocol:H="http",port:A=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Y,name:W,path:q,prefix:D,port:A,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Y=>{w[Y]&&ne({name:Y,path:w[Y]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Y=>{ne({type:"service",name:Y.protocol,protocol:Y.protocol,port:{internal:`BLOCKLET_${Y.protocol}_PORT`.toUpperCase(),external:Y.port}})}),R&&(delete w.publicUrl,delete w.adminUrl,delete w.configUrl,delete w.docUrl,delete w.exposeServices,w.capabilities&&delete w.capabilities.dynamicPathPrefix),w};e.fixInterfaces=$;const O=w=>{const{did:R}=w;try{(0,h.validateNewDid)(R),w.name=R}catch{}return w};e.fixName=O,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:N,fixTags:S,fixName:O,formatPerson:C,parsePerson:c,fixInterfaces:$,fixService:d.fixAndValidateService}}(kt)),kt}var pu=fu();function xs({owner:e,locale:t}){return l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?l.jsx(Yo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}xs.propTypes={owner:B.object.isRequired,locale:B.string.isRequired};const mu="install-blocklet-from-URL",ws=()=>{const[e,t]=ai(mu,"[]",{raw:!0}),r=s=>{const n=s.trim(),o=JSON.parse(e),a=o.findIndex(d=>d===n);a!==0&&(a>0&&o.splice(a,1),o.length>=10&&o.splice(9),o.unshift(n),t(JSON.stringify(o)))},i=s=>{if(!s)return;const n=JSON.parse(e),o=s.trim(),a=n.findIndex(d=>d===o);a>-1&&(n.splice(a,1),t(JSON.stringify(n)))};return{urls:e?JSON.parse(e):[],addUrlRecord:r,removeUrlRecord:i}};function Ss({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=ws(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return l.jsxs(te,{children:[l.jsx(Bo,{freeSolo:!0,options:s,inputValue:e,onInputChange:(a,d)=>{t(d)},disableClearable:!0,popupIcon:null,renderInput:a=>$t.cloneElement(r,{...a}),renderOption:(a,d)=>U.createElement(Fo,{...a,key:d,secondaryAction:l.jsx(Mo,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:l.jsx(xa,{})})},l.jsx(wa,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:l.jsx($o,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),l.jsx(Sa,{style:{margin:0},children:i})]})}Ss.propTypes={onValueChange:B.func,children:B.node,value:B.string,helperText:B.string};function Es({onClick:e}){const{t}=xt();return l.jsx(fl,{title:t("launchBlocklet.withoutWallet"),icon:l.jsx(yt,{icon:pl,fontSize:"1em"}),onClick:e})}Es.propTypes={onClick:B.func.isRequired};function ks({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=dn(),{api:a,session:d}=oc(),[h,u]=U.useState(!1),[f,j]=U.useState(""),{t:m,locale:S}=xt(),E={dist:{}},{encryptKey:C}=ml(),[c,N]=U.useState(e),[$,O]=U.useState(e?1:0),[w,R]=U.useState(E),[F,D]=U.useState(!1),[ne,Y]=U.useState(""),[W]=ai("instant-blocklet-install",!1),[q,H]=U.useState({}),A=s==="component",J=A?!0:!e,{addUrlRecord:M}=ws(),ue=U.useMemo(()=>(d.user?.connectedAccounts||[]).some(Fe=>Fe.provider===Mt.LOGIN_PROVIDER.WALLET),[d.user]),Ie=U.useMemo(()=>{let de=c.trim();return!de.startsWith("https://")&&!de.startsWith("http://")&&!de.startsWith("file://")&&(de=`file://${de}`),de},[c]),K=async()=>{R(E),j(null),u(!0);const de=Ie;try{const ge=decodeURIComponent(de);try{new URL(ge)}catch{throw new Error("Invalid URL")}const{meta:Fe,inStore:$e,registryUrl:jt}=await o.getBlockletMetaFromUrl({input:{url:ge}});R(Fe),H({inStore:$e,registryUrl:jt,inputUrl:de}),M(de)}catch(ge){console.error(ge);const Fe=`Blocklet Install failed: ${qr(ge)}`;j(Fe),i(ge)}finally{u(!1)}},Ee=()=>{if(A){r({meta:w,...q}),t();return}if(W){u(!0),D(!0);return}const de=rn(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Zn(de,{blocklet_meta_url:decodeURIComponent(Ie.trim()),from:"url"})},ce=()=>{u(!1),D(!1),r({meta:w,...q}),t()},Me=()=>{u(!1),D(!1)};U.useEffect(()=>{e&&K()},[e]);const me=U.useMemo(()=>({title:w.title,wt:gl(w),blockletMetaUrl:decodeURIComponent(c.trim())}),[w,c]),Oe=U.useCallback(async()=>{if(ue||W){Y("");return}const de=new URL(window.location.href);de.pathname=rn(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),de.searchParams.set("_ek_",C),Object.keys(me).forEach(Fe=>{de.searchParams.set(Fe,me[Fe])});const{data:ge}=await a.get(de.href);ge.url?Y(ge.url):Y("")},[ue,me,a,C,W]);U.useEffect(()=>{Oe()},[Oe]);const Pe=U.useMemo(()=>ue&&ne?{...me,nw:ne,skipMigrateAccount:!0}:me,[me,ne,ue]),nt=[{name:m("common.name"),value:Ft.getDisplayName({meta:w},!0)},{name:m("common.version"),value:w.version},{name:m("common.did"),value:w.did?l.jsx(sc,{did:w.did}):null},{name:m("common.author"),value:w.owner?l.jsx(xs,{owner:w.owner,locale:S}):pu.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],ut=()=>h?l.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:l.jsx(Tt,{})}):w.did?l.jsx("div",{style:{paddingLeft:"10%"},children:nt.map(de=>de.name===m("common.did")?l.jsx(Ni,{valueComponent:"div",nameWidth:120,name:de.name,nameFormatter:()=>m("common.did"),children:de.value},de.name):l.jsx(Ni,{valueComponent:"div",nameWidth:120,name:de.name,children:de.value},de.name))}):null,ft=Ql(async()=>{let de=w.title;d.user&&(de=`${d.user.fullName}'s ${w.title}`);try{ce(),await o.launchBlockletWithoutWallet({input:{title:de,blockletMetaUrl:decodeURIComponent(c.trim()),type:"store",storeUrl:q.registryUrl,onlyRequired:!0}})}catch(ge){console.error("launchBlockletWithoutWallet error:",ge),Xn.error(qr(ge),{autoHideDuration:3e3})}}),rt=[{label:m("blocklet.fromUrl.step0"),body:l.jsx(je,{component:"div",children:l.jsx(Ss,{style:{marginBottom:32},value:c,helperText:m("blocklet.fromUrl.description"),onValueChange:de=>{j(null),N(de)},children:l.jsx(Hn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:c,onChange:de=>{j(null),N(de.target.value)},disabled:h,onKeyPress:de=>{de.key==="Enter"&&(de.preventDefault(),K(),O(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{K(),O(1)}},{label:m("blocklet.fromUrl.step1"),body:ut(),cancel:m(J?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{J?O(de=>de-1):t()},onConfirm:()=>{Ee()}}],we=rt[$];return l.jsxs(l.Fragment,{children:[l.jsxs(si,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>we.onCancel(),showCloseButton:$===0,disableEscapeKeyDown:!0,open:!0,actions:l.jsxs(l.Fragment,{children:[we.cancel&&l.jsx(vt,{onClick:de=>{de.stopPropagation(),j(null),we.onCancel()},color:"inherit",children:we.cancel||m("common.cancel")}),l.jsxs(vt,{onClick:de=>{de.stopPropagation(),we.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!c||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&$===0&&l.jsx(Tt,{size:16}),we.confirm]})]}),children:[J&&l.jsx(Ea,{alternativeLabel:!0,activeStep:$,children:rt.map(({label:de})=>l.jsx(ka,{children:l.jsx(Ta,{children:de})},de))}),l.jsx(ja,{component:"div",style:{marginTop:24},children:we.body}),!!f&&l.jsx(Uo,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),w&&F&&l.jsx(es,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!ue&&!W?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:ce,extraParams:Pe,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:Me,customItems:W?[]:[l.jsx(Es,{onClick:ft})]})]})}ks.propTypes={defaultUrl:B.string,onCancel:B.func.isRequired,onSuccess:B.func.isRequired,onError:B.func,mode:B.oneOf(["install","component"]),handleText:B.object};const gu={meta:B.object.isRequired,onCancel:B.func.isRequired};function Ts({action:e,onSelect:t,onNext:r}){const{t:i}=xt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return l.jsxs(l.Fragment,{children:[l.jsx(Oa,{children:s.map(n=>l.jsxs(Fo,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[l.jsx(Ca,{sx:{minWidth:48},children:n.action==="purchase"?l.jsx(Ia,{style:{color:e==="purchase"?Ci.primary.main:"#AAA",fontSize:32}}):l.jsx(Ra,{style:{color:e==="verify"?Ci.primary.main:"#AAA",fontSize:32}})}),l.jsx($o,{primary:n.title,secondary:n.description})]},n.action))}),r&&l.jsx(vt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Ts.propTypes={action:B.oneOf(["both","purchase","verify"]).isRequired,onSelect:B.func.isRequired,onNext:B.func.isRequired};function js({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=xt(),{info:o}=dn(),a=vl(o),[d,h]=U.useState(null),u=new URL(e?.registryUrl).origin,f=Ft.getDisplayName({meta:e}),j=async(S,E)=>{const C=({downloadTokenList:$})=>{i({downloadTokenList:$})},c=$=>{Xn.error($),t($)};function N($){return bl(()=>Ai.get($).then(async({data:O})=>{const w=O?.downloadTokenList;if(O.status==="succeed"){if(w&&w.length)await C({downloadTokenList:w});else return await c(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return O.status==="error"?(console.error("vc error: ",O),await c(O?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:$}=yl(d);await N($)}else await C({downloadTokenList:S.downloadTokenList&&E(S.downloadTokenList)})};if(U.useEffect(()=>{if(r==="purchase"){const S=new URL(u);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",o.did),S.searchParams.set("blockletDid",e?.did);try{Ai.get(S.href).then(({data:E})=>{const C=`${E.url}`;h(C)})}catch(E){console.error("get next workflow url error: ",E)}}return()=>{h(null)}},[r]),r==="purchase"&&!d)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:_i.create({baseURL:u}).get,extraParams:{serverDid:o.did,blockletDid:e?.did},messages:{title:s("store.purchase.verify.auth.title",{name:f}),scan:s("store.purchase.verify.auth.scan"),confirm:s("store.purchase.verify.auth.confirm"),success:s("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:_i.create({baseURL:rn(u,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:s("store.purchase.auth.title",{name:f}),scan:s("store.purchase.auth.scan"),confirm:s("store.purchase.auth.confirm"),success:l.jsxs(l.Fragment,{children:[l.jsx("p",{children:s("store.purchase.auth.success")}),l.jsx("p",{children:s("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return l.jsx(es,{open:!0,locale:n,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:j,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...m[r]})}js.propTypes={...gu,handlePaySuccess:B.func,mode:B.oneOf(["verify","purchase"]).isRequired};function Os({ref:e=null,mode:t,...r}){const[i,s]=U.useState(t!=="both"?t:"verify"),[n,o]=U.useState(t!=="both"?2:1),a=h=>{h!==i&&s(h)},d=()=>{i&&n!==2&&o(2)};return U.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>n})),n===1?l.jsx("div",{style:{maxWidth:520},children:l.jsx(Ts,{action:i,onNext:null,onSelect:a})}):l.jsx(js,{...r,mode:i})}Os.propTypes={mode:B.oneOf(["both","verify","purchase"]).isRequired,ref:B.any};function vu({...e}){return l.jsx(vt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Cs({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=xt(),n=as();return!e||xl(e.meta)?l.jsx(yu,{children:r}):l.jsxs(bu,{isMobile:n,children:[l.jsx(vu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),l.jsx(te,{sx:{display:"flex",alignItems:"center"},children:r})]})}Cs.propTypes={blocklet:B.object,onStartNow:B.func,children:B.any,disabled:B.bool};const yu=tt(te)`
221
221
  width: 100%;
222
222
  margin-top: auto;
223
223
  padding-top: 24px;
@@ -232,7 +232,7 @@ see detail in https://www.npmjs.com/package/is-var-name
232
232
  width: 100%;
233
233
  }
234
234
  }
235
- `,gu=tt(te)`
235
+ `,bu=tt(te)`
236
236
  padding-top: 24px;
237
237
  margin-top: auto;
238
238
  width: 100%;
@@ -262,12 +262,12 @@ see detail in https://www.npmjs.com/package/is-var-name
262
262
  justify-content: space-between;
263
263
  gap: '32px',
264
264
  }}
265
- `;function js({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=is(),{blocklet:i}=Jn(),{updateSpaceGateway:s,loading:n,hasStorageEndpoint:o}=Bl();return q.useEffect(()=>{t?.()},[i]),n?l.jsx(El,{relative:"parent",children:l.jsx(Tt,{})}):l.jsxs(vu,{children:[l.jsx(te,{sx:{width:r?"360px":"720px"},children:o?l.jsx(ac,{}):l.jsx(lc,{})}),e?.capabilities?.didSpace==="required"&&l.jsx(Ts,{mt:8,children:l.jsx(cc,{onConnect:s})})]})}js.propTypes={blockletMeta:B.any.isRequired,onEndpointUpdate:Ca.func};const vu=tt(sc)`
265
+ `;function Is({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=as(),{blocklet:i}=Jn(),{updateSpaceGateway:s,loading:n,hasStorageEndpoint:o}=Ul();return U.useEffect(()=>{t?.()},[i]),n?l.jsx(jl,{relative:"parent",children:l.jsx(Tt,{})}):l.jsxs(xu,{children:[l.jsx(te,{sx:{width:r?"360px":"720px"},children:o?l.jsx(uc,{}):l.jsx(dc,{})}),e?.capabilities?.didSpace==="required"&&l.jsx(Cs,{mt:8,children:l.jsx(hc,{onConnect:s})})]})}Is.propTypes={blockletMeta:B.any.isRequired,onEndpointUpdate:Pa.func};const xu=tt(cc)`
266
266
  height: 100%;
267
267
  overflow-y: auto;
268
268
  padding-bottom: 32px;
269
269
  overflow-x: hidden;
270
- `;function Os({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=xt(),{info:a,inService:d}=dn(),{blocklet:h}=Jn(),[u,f]=q.useState(!1),j=q.useRef(null),[m,S]=q.useState(),[E,C]=si(n||"tmp"),[c,N]=n?[E,C]:[m,S],{storeList:$,teamDid:O}=Qo({fromBlocklet:d,blocklet:h,nodeInfo:a}),w=es([...s.map(F=>({...F,protected:!0})),...$],"url"),R=c&&w.find(F=>c===F.url)||w[0];return l.jsxs(l.Fragment,{children:[l.jsxs(yu,{children:[l.jsx(vt,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:l.jsx(Ia,{color:"primary"}),onClick:()=>{f(!0)},style:{padding:"0 2px"},children:l.jsx(je,{color:"primary",children:R.name})}),l.jsx(je,{color:"primary",children:i})]}),l.jsxs(Hn,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:o("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:F=>{const D=F.target.value;N(D.url),e(D)},style:{display:"none"},margin:"normal",slotProps:{select:{open:u,MenuProps:{anchorEl:j.current},renderValue:F=>F?.name,onClose:()=>{f(!1)}}},children:[w?.map(F=>l.jsx(ni,{sx:{width:"400px",maxWidth:"90vw"},value:F,"data-cy":F.url,children:l.jsx(Qa,{teamDid:O,store:F,onDelete:()=>{c===F.url&&N(w[0]?.url)}})},F.url)),!Ko.isInServerlessMode(a)&&l.jsx(Za,{disabled:t,storeList:w,teamDid:O,onAdd:F=>{N(F)}})]}),r({currentRegistry:R})]})}Os.propTypes={onChange:B.func,loading:B.bool,children:B.any.isRequired,extra:B.node,storageKey:B.string,stores:B.arrayOf(B.shape({name:B.string.isRequired,url:B.string.isRequired}))};const yu=tt.div`
270
+ `;function Rs({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=xt(),{info:a,inService:d}=dn(),{blocklet:h}=Jn(),[u,f]=U.useState(!1),j=U.useRef(null),[m,S]=U.useState(),[E,C]=ai(n||"tmp"),[c,N]=n?[E,C]:[m,S],{storeList:$,teamDid:O}=ts({fromBlocklet:d,blocklet:h,nodeInfo:a}),w=rs([...s.map(F=>({...F,protected:!0})),...$],"url"),R=c&&w.find(F=>c===F.url)||w[0];return l.jsxs(l.Fragment,{children:[l.jsxs(wu,{children:[l.jsx(vt,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:l.jsx(La,{color:"primary"}),onClick:()=>{f(!0)},style:{padding:"0 2px"},children:l.jsx(je,{color:"primary",children:R.name})}),l.jsx(je,{color:"primary",children:i})]}),l.jsxs(Hn,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:o("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:F=>{const D=F.target.value;N(D.url),e(D)},style:{display:"none"},margin:"normal",slotProps:{select:{open:u,MenuProps:{anchorEl:j.current},renderValue:F=>F?.name,onClose:()=>{f(!1)}}},children:[w?.map(F=>l.jsx(ri,{sx:{width:"400px",maxWidth:"90vw"},value:F,"data-cy":F.url,children:l.jsx(tl,{teamDid:O,store:F,onDelete:()=>{c===F.url&&N(w[0]?.url)}})},F.url)),!Xo.isInServerlessMode(a)&&l.jsx(nl,{disabled:t,storeList:w,teamDid:O,onAdd:F=>{N(F)}})]}),r({currentRegistry:R})]})}Rs.propTypes={onChange:B.func,loading:B.bool,children:B.any.isRequired,extra:B.node,storageKey:B.string,stores:B.arrayOf(B.shape({name:B.string.isRequired,url:B.string.isRequired}))};const wu=tt.div`
271
271
  display: flex;
272
272
  justify-content: space-between;
273
273
  align-items: center;
@@ -278,7 +278,7 @@ see detail in https://www.npmjs.com/package/is-var-name
278
278
  color: ${e=>e.theme.palette.text.primary};
279
279
  // font-weight: bold;
280
280
  }
281
- `,bu=Qt("div")`
281
+ `,Su=Qt("div")`
282
282
  background-color: transparent !important;
283
283
  & > :not(.Mui-disabled) {
284
284
  position: relative;
@@ -486,8 +486,8 @@ see detail in https://www.npmjs.com/package/is-var-name
486
486
  color: ${e=>e.theme.palette.common.white}!important;
487
487
  }
488
488
  }
489
- `;const co=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),xu=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},Cs={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function qr({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?l.jsx(Fo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Ho({[`& .${Ra.tooltip}`]:{fontSize:s,fontWeight:n,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:o,display:"flex",alignItems:"center"}},i?.popper?.sx)}},children:r}):r}function Dn({icon:e=null,children:t=null,maxWidth:r=100,title:i=void 0,sx:s={}}){return(t===0||t)&&l.jsxs(lt,{direction:"row",sx:[{alignItems:"center",gap:.5},{maxWidth:r,overflow:"hidden"},...Array.isArray(s)?s:[s]],children:[e,l.jsx(qr,{title:i||(typeof t=="string"?t:""),children:l.jsx(je,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function wu({...e}){const{title:t,description:r="",cover:i="",avatar:s,author:n,download:o,did:a,official:d,buttonText:h="Install",buttonDisabled:u,buttonLoading:f,button:j,onButtonClick:m=()=>{},onMainClick:S,className:E,ref:C,icons:c,status:N,...$}=e,O=Ut(),w=(Y,W=()=>!1)=>(U,...H)=>{const A=Y instanceof Function;(W()||A)&&(U.preventDefault(),U.stopPropagation(),A&&Y(...H))},R=S&&w(S),F=w(m,()=>!!(j||u||f)),D=q.isValidElement(t)?{children:t}:{title:co(t),dangerouslySetInnerHTML:{__html:t}},ne=q.isValidElement(r)?{children:r}:{title:co(r),dangerouslySetInnerHTML:{__html:r}};return l.jsxs(Pa,{variant:"outlined",onClick:R,...$,sx:{p:{xs:2,md:3},borderRadius:1,...$.sx},children:[l.jsxs(lt,{direction:"row",sx:{flex:1,gap:1,alignItems:"center",overflow:"hidden","& > *":{flexShrink:0}},children:[l.jsx(Vn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),l.jsx(je,{className:"blocklet-title",...D,sx:[{fontWeight:"fontWeightMedium",fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...Array.isArray(D.sx)?D.sx:[D.sx]]}),l.jsxs(te,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&l.jsx(qr,{title:d.tooltip,children:l.jsx(La,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),c?.map(Y=>l.jsx(qr,{title:Y.title,children:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon,style:{color:Y.color}}):Y.icon},Y.key))]}),m&&l.jsxs(vt,{variant:"outlined",size:"small",disabled:u||f,style:{color:O.palette.text.primary,borderColor:O.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:O.typography.fontWeightMedium},onClick:F,children:[f&&l.jsx(Tt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),l.jsx(lt,{sx:{py:2},children:l.jsx(je,{className:"blocklet-description",variant:"body2",...ne,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(ne.sx)?ne.sx:[ne.sx]]})}),l.jsxs(lt,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(Dn,{icon:l.jsx(Vn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),l.jsx(Dn,{icon:l.jsx(yt,{icon:Cs}),title:o,children:xu(o)}),N?.filter(Y=>Y.align!=="right").map(Y=>l.jsx(Dn,{icon:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,children:Y.text},Y.key)),l.jsx(te,{sx:{flex:1}}),N?.filter(Y=>Y.align==="right").map(Y=>l.jsx(Dn,{icon:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,sx:{color:Y.color},children:Y.text},Y.key))]})]})}const Su={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},wn=/^[a-z0-9]+(-[a-z0-9]+)*$/,er=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),h={provider:s.length>0?s[0]:i,prefix:d,name:a};return t&&!qn(h)?null:h}const n=s[0],o=n.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!qn(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!qn(a,r)?null:a}return null},qn=(e,t)=>e?!!((e.provider===""||e.provider.match(wn))&&(t&&e.prefix===""||e.prefix.match(wn))&&e.name.match(wn)):!1,Is=Object.freeze({left:0,top:0,width:16,height:16}),Kn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ai=Object.freeze({...Is,...Kn}),Wr=Object.freeze({...ai,body:"",hidden:!1});function Eu(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function uo(e,t){const r=Eu(e,t);for(const i in Wr)i in Kn?i in e&&!(i in r)&&(r[i]=Kn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function ku(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function n(o){if(r[o])return s[o]=[];if(!(o in s)){s[o]=null;const a=i[o]&&i[o].parent,d=a&&n(a);d&&(s[o]=[a].concat(d))}return s[o]}return Object.keys(r).concat(Object.keys(i)).forEach(n),s}function Tu(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=uo(i[a]||s[a],n)}return o(t),r.forEach(o),uo(e,n)}function Rs(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=ku(e);for(const s in i){const n=i[s];n&&(t(s,Tu(e,s,n)),r.push(s))}return r}const ju={provider:"",aliases:{},not_found:{},...Is};function kr(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ps(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!kr(e,ju))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(wn)||typeof n.body!="string"||!kr(n,Wr))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(wn)||typeof o!="string"||!r[o]&&!i[o]||!kr(n,Wr))return null}return t}const ho=Object.create(null);function Ou(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function on(e,t){const r=ho[e]||(ho[e]=Object.create(null));return r[t]||(r[t]=Ou(e,t))}function li(e,t){return Ps(t)?Rs(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Cu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let En=!1;function Ls(e){return typeof e=="boolean"&&(En=e),En}function Iu(e){const t=typeof e=="string"?er(e,!0,En):e;if(t){const r=on(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function Ru(e,t){const r=er(e,!0,En);if(!r)return!1;const i=on(r.provider,r.prefix);return Cu(i,r.name,t)}function Pu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),En&&!t&&!e.prefix){let s=!1;return Ps(e)&&(e.prefix="",Rs(e,(n,o)=>{o&&Ru(n,o)&&(s=!0)})),s}const r=e.prefix;if(!qn({provider:t,prefix:r,name:"a"}))return!1;const i=on(t,r);return!!li(i,e)}const _s=Object.freeze({width:null,height:null}),Ns=Object.freeze({..._s,...Kn}),Lu=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_u=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function fo(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Lu);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=_u.test(n);for(;;){if(o){const a=parseFloat(n);isNaN(a)?s.push(n):s.push(Math.ceil(a*t*r)/r)}else s.push(n);if(n=i.shift(),n===void 0)return s.join("");o=!o}}const Nu=e=>e==="unset"||e==="undefined"||e==="none";function Au(e,t){const r={...ai,...e},i={...Ns,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(S=>{const E=[],C=S.hFlip,c=S.vFlip;let N=S.rotate;C?c?N+=2:(E.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),E.push("scale(-1 1)"),s.top=s.left=0):c&&(E.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),E.push("scale(1 -1)"),s.top=s.left=0);let $;switch(N<0&&(N-=Math.floor(N/4)*4),N=N%4,N){case 1:$=s.height/2+s.top,E.unshift("rotate(90 "+$.toString()+" "+$.toString()+")");break;case 2:E.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:$=s.width/2+s.left,E.unshift("rotate(-90 "+$.toString()+" "+$.toString()+")");break}N%2===1&&(s.left!==s.top&&($=s.left,s.left=s.top,s.top=$),s.width!==s.height&&($=s.width,s.width=s.height,s.height=$)),E.length&&(n='<g transform="'+E.join(" ")+'">'+n+"</g>")});const o=i.width,a=i.height,d=s.width,h=s.height;let u,f;o===null?(f=a===null?"1em":a==="auto"?h:a,u=fo(f,d/h)):(u=o==="auto"?d:o,f=a===null?fo(u,h/d):a==="auto"?h:a);const j={},m=(S,E)=>{Nu(E)||(j[S]=E.toString())};return m("width",u),m("height",f),j.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+h.toString(),{attributes:j,body:n}}const Du=/\sid="(\S+)"/g,Mu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bu=0;function Fu(e,t=Mu){const r=[];let i;for(;i=Du.exec(e);)r.push(i[1]);if(!r.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(n=>{const o=typeof t=="function"?t(n):t+(Bu++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const zr=Object.create(null);function $u(e,t){zr[e]=t}function Vr(e){return zr[e]||zr[""]}function ci(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ui=Object.create(null),bn=["https://api.simplesvg.com","https://api.unisvg.com"],Wn=[];for(;bn.length>0;)bn.length===1||Math.random()>.5?Wn.push(bn.shift()):Wn.push(bn.pop());ui[""]=ci({resources:["https://api.iconify.design"].concat(Wn)});function Uu(e,t){const r=ci(t);return r===null?!1:(ui[e]=r,!0)}function di(e){return ui[e]}const qu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let po=qu();function Wu(e,t){const r=di(e);if(!r)return 0;let i;if(!r.maxURL)i=0;else{let s=0;r.resources.forEach(o=>{s=Math.max(s,o.length)});const n=t+".json?icons=";i=r.maxURL-s-r.path.length-n.length}return i}function zu(e){return e===404}const Vu=(e,t,r)=>{const i=[],s=Wu(e,t),n="icons";let o={type:n,provider:e,prefix:t,icons:[]},a=0;return r.forEach((d,h)=>{a+=d.length+1,a>=s&&h>0&&(i.push(o),o={type:n,provider:e,prefix:t,icons:[]},a=d.length),o.icons.push(d)}),i.push(o),i};function Ku(e){if(typeof e=="string"){const t=di(e);if(t)return t.path}return"/"}const Gu=(e,t,r)=>{if(!po){r("abort",424);return}let i=Ku(t.provider);switch(t.type){case"icons":{const n=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});i+=n+".json?"+d.toString();break}case"custom":{const n=t.uri;i+=n.slice(0,1)==="/"?n.slice(1):n;break}default:r("abort",400);return}let s=503;po(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(zu(o)?"abort":"next",o)});return}return s=501,n.json()}).then(n=>{if(typeof n!="object"||n===null){setTimeout(()=>{n===404?r("abort",n):r("next",s)});return}setTimeout(()=>{r("success",n)})}).catch(()=>{r("next",s)})},Hu={prepare:Vu,send:Gu};function Xu(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((s,n)=>s.provider!==n.provider?s.provider.localeCompare(n.provider):s.prefix!==n.prefix?s.prefix.localeCompare(n.prefix):s.name.localeCompare(n.name));let i={provider:"",prefix:"",name:""};return e.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const n=s.provider,o=s.prefix,a=s.name,d=r[n]||(r[n]=Object.create(null)),h=d[o]||(d[o]=on(n,o));let u;a in h.icons?u=t.loaded:o===""||h.missing.has(a)?u=t.missing:u=t.pending;const f={provider:n,prefix:o,name:a};u.push(f)}),t}function As(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Yu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const i=e.provider,s=e.prefix;t.forEach(n=>{const o=n.icons,a=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==s)return!0;const h=d.name;if(e.icons[h])o.loaded.push({provider:i,prefix:s,name:h});else if(e.missing.has(h))o.missing.push({provider:i,prefix:s,name:h});else return r=!0,!0;return!1}),o.pending.length!==a&&(r||As([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let Ju=0;function Qu(e,t,r){const i=Ju++,s=As.bind(null,r,i);if(!t.pending.length)return s;const n={id:i,icons:t,callback:e,abort:s};return r.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(n)}),s}function Zu(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?er(s,t,r):s;n&&i.push(n)}),i}var ed={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function td(e,t,r,i){const s=e.resources.length,n=e.random?Math.floor(Math.random()*s):e.index;let o;if(e.random){let R=e.resources.slice(0);for(o=[];R.length>1;){const F=Math.floor(Math.random()*R.length);o.push(R[F]),R=R.slice(0,F).concat(R.slice(F+1))}o=o.concat(R)}else o=e.resources.slice(n).concat(e.resources.slice(0,n));const a=Date.now();let d="pending",h=0,u,f=null,j=[],m=[];typeof i=="function"&&m.push(i);function S(){f&&(clearTimeout(f),f=null)}function E(){d==="pending"&&(d="aborted"),S(),j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function C(R,F){F&&(m=[]),typeof R=="function"&&m.push(R)}function c(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:C,abort:E}}function N(){d="failed",m.forEach(R=>{R(void 0,u)})}function $(){j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function O(R,F,D){const ne=F!=="success";switch(j=j.filter(Y=>Y!==R),d){case"pending":break;case"failed":if(ne||!e.dataAfterTimeout)return;break;default:return}if(F==="abort"){u=D,N();return}if(ne){u=D,j.length||(o.length?w():N());return}if(S(),$(),!e.random){const Y=e.resources.indexOf(R.resource);Y!==-1&&Y!==e.index&&(e.index=Y)}d="completed",m.forEach(Y=>{Y(D)})}function w(){if(d!=="pending")return;S();const R=o.shift();if(R===void 0){if(j.length){f=setTimeout(()=>{S(),d==="pending"&&($(),N())},e.timeout);return}N();return}const F={status:"pending",resource:R,callback:(D,ne)=>{O(F,D,ne)}};j.push(F),h++,f=setTimeout(w,e.rotate),r(R,t,F.callback)}return setTimeout(w),c}function Ds(e){const t={...ed,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=td(t,a,d,(f,j)=>{i(),h&&h(f,j)});return r.push(u),u}function n(a){return r.find(d=>a(d))||null}return{query:s,find:n,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function mo(){}const Tr=Object.create(null);function nd(e){if(!Tr[e]){const t=di(e);if(!t)return;const r=Ds(t),i={config:t,redundancy:r};Tr[e]=i}return Tr[e]}function rd(e,t,r){let i,s;if(typeof e=="string"){const n=Vr(e);if(!n)return r(void 0,424),mo;s=n.send;const o=nd(e);o&&(i=o.redundancy)}else{const n=ci(e);if(n){i=Ds(n);const o=e.resources?e.resources[0]:"",a=Vr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),mo):i.query(t,s,r)().abort}const go="iconify2",kn="iconify",Ms=kn+"-count",vo=kn+"-version",Bs=36e5,id=168;function Kr(e,t){try{return e.getItem(t)}catch{}}function hi(e,t,r){try{return e.setItem(t,r),!0}catch{}}function yo(e,t){try{e.removeItem(t)}catch{}}function Gr(e,t){return hi(e,Ms,t.toString())}function Hr(e){return parseInt(Kr(e,Ms))||0}const tr={local:!0,session:!0},Fs={local:new Set,session:new Set};let fi=!1;function od(e){fi=e}let Mn=typeof window>"u"?{}:window;function $s(e){const t=e+"Storage";try{if(Mn&&Mn[t]&&typeof Mn[t].length=="number")return Mn[t]}catch{}tr[e]=!1}function Us(e,t){const r=$s(e);if(!r)return;const i=Kr(r,vo);if(i!==go){if(i){const a=Hr(r);for(let d=0;d<a;d++)yo(r,kn+d.toString())}hi(r,vo,go),Gr(r,0);return}const s=Math.floor(Date.now()/Bs)-id,n=a=>{const d=kn+a.toString(),h=Kr(r,d);if(typeof h=="string"){try{const u=JSON.parse(h);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>s&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}yo(r,d)}};let o=Hr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,Gr(r,o)):Fs[e].add(a))}function qs(){if(!fi){od(!0);for(const e in tr)Us(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=on(i,s);if(!li(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function sd(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in tr)Us(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ad(e,t){fi||qs();function r(i){let s;if(!tr[i]||!(s=$s(i)))return;const n=Fs[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Hr(s),!Gr(s,o+1))return;const a={cached:Math.floor(Date.now()/Bs),provider:e.provider,data:t};return hi(s,kn+o.toString(),JSON.stringify(a))}t.lastModified&&!sd(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function bo(){}function ld(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Yu(e)}))}function cd(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:r,prefix:i}=e,s=e.iconsToLoad;delete e.iconsToLoad;let n;if(!s||!(n=Vr(r)))return;n.prepare(r,i,s).forEach(a=>{rd(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=li(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ad(e,d)}catch(h){console.error(h)}ld(e)})})}))}const ud=(e,t)=>{const r=Zu(e,!0,Ls()),i=Xu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,bo)}),()=>{d=!1}}const s=Object.create(null),n=[];let o,a;return i.pending.forEach(d=>{const{provider:h,prefix:u}=d;if(u===a&&h===o)return;o=h,a=u,n.push(on(h,u));const f=s[h]||(s[h]=Object.create(null));f[u]||(f[u]=[])}),i.pending.forEach(d=>{const{provider:h,prefix:u,name:f}=d,j=on(h,u),m=j.pendingIcons||(j.pendingIcons=new Set);m.has(f)||(m.add(f),s[h][u].push(f))}),n.forEach(d=>{const{provider:h,prefix:u}=d;s[h][u].length&&cd(d,s[h][u])}),t?Qu(t,i,n):bo};function dd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in _s?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const hd=/[\s,]+/;function fd(e,t){t.split(hd).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function pd(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(r===""){const s=parseInt(e);return isNaN(s)?0:i(s)}else if(r!==e){let s=0;switch(r){case"%":s=25;break;case"deg":s=90}if(s){let n=parseFloat(e.slice(0,e.length-r.length));return isNaN(n)?0:(n=n/s,n%1===0?i(n):0)}}return t}function md(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function gd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function vd(e){return"data:image/svg+xml,"+gd(e)}function yd(e){return'url("'+vd(e)+'")'}let Sn;function bd(){try{Sn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Sn=null}}function xd(e){return Sn===void 0&&bd(),Sn?Sn.createHTML(e):e}const Ws={...Ns,inline:!1},wd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sd={display:"inline-block"},Xr={backgroundColor:"currentColor"},zs={backgroundColor:"transparent"},xo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},wo={WebkitMask:Xr,mask:Xr,background:zs};for(const e in wo){const t=wo[e];for(const r in xo)t[e+r]=xo[r]}const Ed={...Ws,inline:!0};function So(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const kd=(e,t,r,i)=>{const s=r?Ed:Ws,n=dd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?wd:{},ref:i};for(let c in t){const N=t[c];if(N!==void 0)switch(c){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[c]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&fd(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[c]=pd(N):typeof N=="number"&&(n[c]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete h["aria-hidden"];break;default:s[c]===void 0&&(h[c]=N)}}const u=Au(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let c=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:xd(Fu(u.body,N?()=>N+"ID"+c++:"iconifyReact"))},$t.createElement("svg",h)}const{body:j,width:m,height:S}=e,E=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),C=md(j,{...f,width:m+"",height:S+""});return h.style={...a,"--svg":yd(C),width:So(f.width),height:So(f.height),...Sd,...E?Xr:zs,...d},$t.createElement("span",h)};Ls(!0);$u("",Hu);if(typeof document<"u"&&typeof window<"u"){qs();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Pu(i))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const i="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Uu(r,s)||console.error(i)}catch{console.error(i)}}}}class Vs extends $t.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const r=this.state,i=this.props.icon;if(typeof i=="object"&&i!==null&&typeof i.body=="string"){this._icon="",this._abortLoading(),(t||r.icon===null)&&this._setData({data:i});return}let s;if(typeof i!="string"||(s=er(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Iu(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:ud([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==i||r.icon===null){this._abortLoading(),this._icon=i;const o=["iconify"];s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),this._setData({data:n,classes:o}),this.props.onLoad&&this.props.onLoad(i)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,r=this.state.icon;if(r===null)return t.children?t.children:$t.createElement("span",{});let i=t;return r.classes&&(i={...t,className:(typeof t.className=="string"?t.className+" ":"")+r.classes.join(" ")}),kd({...ai,...r.data},i,t._inline,t._ref)}}const Bt=$t.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return $t.createElement(Vs,i)});$t.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return $t.createElement(Vs,i)});var zn={exports:{}},Td=zn.exports,Eo;function jd(){return Eo||(Eo=1,function(e,t){(function(r,i){e.exports=i(Ya())})(Td,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(C,c,N,$,O,w){if(w!==u){var R=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw R.name="Invariant Violation",R}}function S(){return m}m.isRequired=m;var E={array:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:S,element:m,elementType:m,instanceOf:S,node:m,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:j,resetWarningCache:f};return E.PropTypes=E,E}},697:(a,d,h)=>{a.exports=h(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:a=>{var d=typeof Element<"u",h=typeof Map=="function",u=typeof Set=="function",f=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function j(m,S){if(m===S)return!0;if(m&&S&&typeof m=="object"&&typeof S=="object"){if(m.constructor!==S.constructor)return!1;var E,C,c,N;if(Array.isArray(m)){if((E=m.length)!=S.length)return!1;for(C=E;C--!=0;)if(!j(m[C],S[C]))return!1;return!0}if(h&&m instanceof Map&&S instanceof Map){if(m.size!==S.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!S.has(C.value[0]))return!1;for(N=m.entries();!(C=N.next()).done;)if(!j(C.value[1],S.get(C.value[0])))return!1;return!0}if(u&&m instanceof Set&&S instanceof Set){if(m.size!==S.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!S.has(C.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(S)){if((E=m.length)!=S.length)return!1;for(C=E;C--!=0;)if(m[C]!==S[C])return!1;return!0}if(m.constructor===RegExp)return m.source===S.source&&m.flags===S.flags;if(m.valueOf!==Object.prototype.valueOf)return m.valueOf()===S.valueOf();if(m.toString!==Object.prototype.toString)return m.toString()===S.toString();if((E=(c=Object.keys(m)).length)!==Object.keys(S).length)return!1;for(C=E;C--!=0;)if(!Object.prototype.hasOwnProperty.call(S,c[C]))return!1;if(d&&m instanceof Element)return!1;for(C=E;C--!=0;)if((c[C]!=="_owner"&&c[C]!=="__v"&&c[C]!=="__o"||!m.$$typeof)&&!j(m[c[C]],S[c[C]]))return!1;return!0}return m!=m&&S!=S}a.exports=function(m,S){try{return j(m,S)}catch(E){if((E.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw E}}},359:a=>{a.exports=r}},s={};function n(a){var d=s[a];if(d!==void 0)return d.exports;var h=s[a]={exports:{}};return i[a](h,h.exports,n),h.exports}n.n=a=>{var d=a&&a.__esModule?()=>a.default:()=>a;return n.d(d,{a:d}),d},n.d=(a,d)=>{for(var h in d)n.o(d,h)&&!n.o(a,h)&&Object.defineProperty(a,h,{enumerable:!0,get:d[h]})},n.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),n.o=(a,d)=>Object.prototype.hasOwnProperty.call(a,d),n.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o={};return(()=>{function a(x){var g,T,I="";if(typeof x=="string"||typeof x=="number")I+=x;else if(typeof x=="object")if(Array.isArray(x))for(g=0;g<x.length;g++)x[g]&&(T=a(x[g]))&&(I&&(I+=" "),I+=T);else for(g in x)x[g]&&(I&&(I+=" "),I+=g);return I}function d(){for(var x,g,T=0,I="";T<arguments.length;)(x=arguments[T++])&&(g=a(x))&&(I&&(I+=" "),I+=g);return I}n.r(o),n.d(o,{default:()=>ma});var h=n(359),u=n.n(h);const f=function(x){var g=typeof x;return x!=null&&(g=="object"||g=="function")},j=typeof Rn=="object"&&Rn&&Rn.Object===Object&&Rn;var m=typeof self=="object"&&self&&self.Object===Object&&self;const S=j||m||Function("return this")(),E=function(){return S.Date.now()};var C=/\s/,c=/^\s+/;const N=function(x){return x&&x.slice(0,function(g){for(var T=g.length;T--&&C.test(g.charAt(T)););return T}(x)+1).replace(c,"")},$=S.Symbol;var O=Object.prototype,w=O.hasOwnProperty,R=O.toString,F=$?$.toStringTag:void 0,D=Object.prototype.toString,ne=$?$.toStringTag:void 0;const Y=function(x){return x==null?x===void 0?"[object Undefined]":"[object Null]":ne&&ne in Object(x)?function(g){var T=w.call(g,F),I=g[F];try{g[F]=void 0;var Q=!0}catch{}var fe=R.call(g);return Q&&(T?g[F]=I:delete g[F]),fe}(x):function(g){return D.call(g)}(x)};var W=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,H=/^0o[0-7]+$/i,A=parseInt;const J=function(x){if(typeof x=="number")return x;if(function(I){return typeof I=="symbol"||function(Q){return Q!=null&&typeof Q=="object"}(I)&&Y(I)=="[object Symbol]"}(x))return NaN;if(f(x)){var g=typeof x.valueOf=="function"?x.valueOf():x;x=f(g)?g+"":g}if(typeof x!="string")return x===0?x:+x;x=N(x);var T=U.test(x);return T||H.test(x)?A(x.slice(2),T?2:8):W.test(x)?NaN:+x};var M=Math.max,ue=Math.min;const Ie=function(x,g,T){var I,Q,fe,Ce,y,v,P=0,G=!1,Z=!1,X=!0;if(typeof x!="function")throw new TypeError("Expected a function");function be(pe){var Te=I,_e=Q;return I=Q=void 0,P=pe,Ce=x.apply(_e,Te)}function ye(pe){return P=pe,y=setTimeout(ie,g),G?be(pe):Ce}function ke(pe){var Te=pe-v;return v===void 0||Te>=g||Te<0||Z&&pe-P>=fe}function ie(){var pe=E();if(ke(pe))return se(pe);y=setTimeout(ie,function(Te){var _e=g-(Te-v);return Z?ue(_e,fe-(Te-P)):_e}(pe))}function se(pe){return y=void 0,X&&I?be(pe):(I=Q=void 0,Ce)}function le(){var pe=E(),Te=ke(pe);if(I=arguments,Q=this,v=pe,Te){if(y===void 0)return ye(v);if(Z)return clearTimeout(y),y=setTimeout(ie,g),be(v)}return y===void 0&&(y=setTimeout(ie,g)),Ce}return g=J(g)||0,f(T)&&(G=!!T.leading,fe=(Z="maxWait"in T)?M(J(T.maxWait)||0,g):fe,X="trailing"in T?!!T.trailing:X),le.cancel=function(){y!==void 0&&clearTimeout(y),P=0,I=v=Q=y=void 0},le.flush=function(){return y===void 0?Ce:se(E())},le},K=function(x,g,T){var I=!0,Q=!0;if(typeof x!="function")throw new TypeError("Expected a function");return f(T)&&(I="leading"in T?!!T.leading:I,Q="trailing"in T?!!T.trailing:Q),Ie(x,g,{leading:I,maxWait:g,trailing:Q})};var Ee=n(590),ce=n.n(Ee),Me=function(){if(typeof Map<"u")return Map;function x(g,T){var I=-1;return g.some(function(Q,fe){return Q[0]===T&&(I=fe,!0)}),I}return function(){function g(){this.__entries__=[]}return Object.defineProperty(g.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),g.prototype.get=function(T){var I=x(this.__entries__,T),Q=this.__entries__[I];return Q&&Q[1]},g.prototype.set=function(T,I){var Q=x(this.__entries__,T);~Q?this.__entries__[Q][1]=I:this.__entries__.push([T,I])},g.prototype.delete=function(T){var I=this.__entries__,Q=x(I,T);~Q&&I.splice(Q,1)},g.prototype.has=function(T){return!!~x(this.__entries__,T)},g.prototype.clear=function(){this.__entries__.splice(0)},g.prototype.forEach=function(T,I){I===void 0&&(I=null);for(var Q=0,fe=this.__entries__;Q<fe.length;Q++){var Ce=fe[Q];T.call(I,Ce[1],Ce[0])}},g}()}(),me=typeof window<"u"&&typeof document<"u"&&window.document===document,Oe=n.g!==void 0&&n.g.Math===Math?n.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Pe=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Oe):function(x){return setTimeout(function(){return x(Date.now())},1e3/60)},nt=["top","right","bottom","left","width","height","size","weight"],ut=typeof MutationObserver<"u",ft=function(){function x(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(g,T){var I=!1,Q=!1,fe=0;function Ce(){I&&(I=!1,g()),Q&&v()}function y(){Pe(Ce)}function v(){var P=Date.now();if(I){if(P-fe<2)return;Q=!0}else I=!0,Q=!1,setTimeout(y,20);fe=P}return v}(this.refresh.bind(this))}return x.prototype.addObserver=function(g){~this.observers_.indexOf(g)||this.observers_.push(g),this.connected_||this.connect_()},x.prototype.removeObserver=function(g){var T=this.observers_,I=T.indexOf(g);~I&&T.splice(I,1),!T.length&&this.connected_&&this.disconnect_()},x.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},x.prototype.updateObservers_=function(){var g=this.observers_.filter(function(T){return T.gatherActive(),T.hasActive()});return g.forEach(function(T){return T.broadcastActive()}),g.length>0},x.prototype.connect_=function(){me&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ut?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},x.prototype.disconnect_=function(){me&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},x.prototype.onTransitionEnd_=function(g){var T=g.propertyName,I=T===void 0?"":T;nt.some(function(Q){return!!~I.indexOf(Q)})&&this.refresh()},x.getInstance=function(){return this.instance_||(this.instance_=new x),this.instance_},x.instance_=null,x}(),rt=function(x,g){for(var T=0,I=Object.keys(g);T<I.length;T++){var Q=I[T];Object.defineProperty(x,Q,{value:g[Q],enumerable:!1,writable:!1,configurable:!0})}return x},we=function(x){return x&&x.ownerDocument&&x.ownerDocument.defaultView||Oe},de=Ae(0,0,0,0);function ge(x){return parseFloat(x)||0}function Fe(x){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(I,Q){return I+ge(x["border-"+Q+"-width"])},0)}var $e=typeof SVGGraphicsElement<"u"?function(x){return x instanceof we(x).SVGGraphicsElement}:function(x){return x instanceof we(x).SVGElement&&typeof x.getBBox=="function"};function jt(x){return me?$e(x)?function(g){var T=g.getBBox();return Ae(0,0,T.width,T.height)}(x):function(g){var T=g.clientWidth,I=g.clientHeight;if(!T&&!I)return de;var Q=we(g).getComputedStyle(g),fe=function(X){for(var be={},ye=0,ke=["top","right","bottom","left"];ye<ke.length;ye++){var ie=ke[ye],se=X["padding-"+ie];be[ie]=ge(se)}return be}(Q),Ce=fe.left+fe.right,y=fe.top+fe.bottom,v=ge(Q.width),P=ge(Q.height);if(Q.boxSizing==="border-box"&&(Math.round(v+Ce)!==T&&(v-=Fe(Q,"left","right")+Ce),Math.round(P+y)!==I&&(P-=Fe(Q,"top","bottom")+y)),!function(X){return X===we(X).document.documentElement}(g)){var G=Math.round(v+Ce)-T,Z=Math.round(P+y)-I;Math.abs(G)!==1&&(v-=G),Math.abs(Z)!==1&&(P-=Z)}return Ae(fe.left,fe.top,v,P)}(x):de}function Ae(x,g,T,I){return{x,y:g,width:T,height:I}}var Et=function(){function x(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ae(0,0,0,0),this.target=g}return x.prototype.isActive=function(){var g=jt(this.target);return this.contentRect_=g,g.width!==this.broadcastWidth||g.height!==this.broadcastHeight},x.prototype.broadcastRect=function(){var g=this.contentRect_;return this.broadcastWidth=g.width,this.broadcastHeight=g.height,g},x}(),Ot=function(x,g){var T,I,Q,fe,Ce,y,v,P=(I=(T=g).x,Q=T.y,fe=T.width,Ce=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),rt(v,{x:I,y:Q,width:fe,height:Ce,top:Q,right:I+fe,bottom:Ce+Q,left:I}),v);rt(this,{target:x,contentRect:P})},Ct=function(){function x(g,T,I){if(this.activeObservations_=[],this.observations_=new Me,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=I}return x.prototype.observe=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof we(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)||(T.set(g,new Et(g)),this.controller_.addObserver(this),this.controller_.refresh())}},x.prototype.unobserve=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof we(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)&&(T.delete(g),T.size||this.controller_.removeObserver(this))}},x.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},x.prototype.gatherActive=function(){var g=this;this.clearActive(),this.observations_.forEach(function(T){T.isActive()&&g.activeObservations_.push(T)})},x.prototype.broadcastActive=function(){if(this.hasActive()){var g=this.callbackCtx_,T=this.activeObservations_.map(function(I){return new Ot(I.target,I.broadcastRect())});this.callback_.call(g,T,g),this.clearActive()}},x.prototype.clearActive=function(){this.activeObservations_.splice(0)},x.prototype.hasActive=function(){return this.activeObservations_.length>0},x}(),It=typeof WeakMap<"u"?new WeakMap:new Me,Ve=function x(g){if(!(this instanceof x))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var T=ft.getInstance(),I=new Ct(g,T,this);It.set(this,I)};["observe","unobserve","disconnect"].forEach(function(x){Ve.prototype[x]=function(){var g;return(g=It.get(this))[x].apply(g,arguments)}});const Rt=Oe.ResizeObserver!==void 0?Oe.ResizeObserver:Ve,pt="Left",st="Right",V="Up",he="Down",De={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xe={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},it="mousemove",wt="mouseup";function qt(x,g){if(g===0)return x;const T=Math.PI/180*g;return[x[0]*Math.cos(T)+x[1]*Math.sin(T),x[1]*Math.cos(T)-x[0]*Math.sin(T)]}function Ue(x){const{trackMouse:g}=x,T=h.useRef(Object.assign({},Xe)),I=h.useRef(Object.assign({},De)),Q=h.useRef(Object.assign({},I.current));let fe;for(fe in Q.current=Object.assign({},I.current),I.current=Object.assign(Object.assign({},De),x),De)I.current[fe]===void 0&&(I.current[fe]=De[fe]);const[Ce,y]=h.useMemo(()=>function(v,P){const G=ie=>{const se="touches"in ie;se&&ie.touches.length>1||v((le,pe)=>{pe.trackMouse&&!se&&(document.addEventListener(it,Z),document.addEventListener(wt,be));const{clientX:Te,clientY:_e}=se?ie.touches[0]:ie,ze=qt([Te,_e],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:ie}),Object.assign(Object.assign(Object.assign({},le),Xe),{initial:ze.slice(),xy:ze,start:ie.timeStamp||0})})},Z=ie=>{v((se,le)=>{const pe="touches"in ie;if(pe&&ie.touches.length>1)return se;if(ie.timeStamp-se.start>le.swipeDuration)return se.swiping?Object.assign(Object.assign({},se),{swiping:!1}):se;const{clientX:Te,clientY:_e}=pe?ie.touches[0]:ie,[ze,dt]=qt([Te,_e],le.rotationAngle),at=ze-se.xy[0],Ze=dt-se.xy[1],We=Math.abs(at),Ne=Math.abs(Ze),Kt=(ie.timeStamp||0)-se.start,fn=Math.sqrt(We*We+Ne*Ne)/(Kt||1),pn=[at/(Kt||1),Ze/(Kt||1)],Dt=function(mn,un,gn,mt){return mn>un?gn>0?st:pt:mt>0?he:V}(We,Ne,at,Ze),nn=typeof le.delta=="number"?le.delta:le.delta[Dt.toLowerCase()]||De.delta;if(We<nn&&Ne<nn&&!se.swiping)return se;const Lt={absX:We,absY:Ne,deltaX:at,deltaY:Ze,dir:Dt,event:ie,first:se.first,initial:se.initial,velocity:fn,vxvy:pn};Lt.first&&le.onSwipeStart&&le.onSwipeStart(Lt),le.onSwiping&&le.onSwiping(Lt);let cn=!1;return(le.onSwiping||le.onSwiped||le[`onSwiped${Dt}`])&&(cn=!0),cn&&le.preventScrollOnSwipe&&le.trackTouch&&ie.cancelable&&ie.preventDefault(),Object.assign(Object.assign({},se),{first:!1,eventData:Lt,swiping:!0})})},X=ie=>{v((se,le)=>{let pe;if(se.swiping&&se.eventData){if(ie.timeStamp-se.start<le.swipeDuration){pe=Object.assign(Object.assign({},se.eventData),{event:ie}),le.onSwiped&&le.onSwiped(pe);const Te=le[`onSwiped${pe.dir}`];Te&&Te(pe)}}else le.onTap&&le.onTap({event:ie});return le.onTouchEndOrOnMouseUp&&le.onTouchEndOrOnMouseUp({event:ie}),Object.assign(Object.assign(Object.assign({},se),Xe),{eventData:pe})})},be=ie=>{document.removeEventListener(it,Z),document.removeEventListener(wt,be),X(ie)},ye=(ie,se)=>{let le=()=>{};if(ie&&ie.addEventListener){const pe=Object.assign(Object.assign({},De.touchEventOptions),se.touchEventOptions),Te=[["touchstart",G,pe],["touchmove",Z,Object.assign(Object.assign({},pe),se.preventScrollOnSwipe?{passive:!1}:{})],["touchend",X,pe]];Te.forEach(([_e,ze,dt])=>ie.addEventListener(_e,ze,dt)),le=()=>Te.forEach(([_e,ze])=>ie.removeEventListener(_e,ze))}return le},ke={ref:ie=>{ie!==null&&v((se,le)=>{if(se.el===ie)return se;const pe={};return se.el&&se.el!==ie&&se.cleanUpTouch&&(se.cleanUpTouch(),pe.cleanUpTouch=void 0),le.trackTouch&&ie&&(pe.cleanUpTouch=ye(ie,le)),Object.assign(Object.assign(Object.assign({},se),{el:ie}),pe)})}};return P.trackMouse&&(ke.onMouseDown=G),[ke,ye]}(v=>T.current=v(T.current,I.current),{trackMouse:g}),[g]);return T.current=function(v,P,G,Z){return P.trackTouch&&v.el?v.cleanUpTouch?P.preventScrollOnSwipe!==G.preventScrollOnSwipe||P.touchEventOptions.passive!==G.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Z(v.el,P)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Z(v.el,P)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,I.current,Q.current,y),Ce}var L=n(697);function re(x){return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},re(x)}function ve(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function Re(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ve(Object(T),!0).forEach(function(I){p(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):ve(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function p(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(re(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(re(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return re(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var b={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},k=u().memo(function(x){var g=Re(Re({},b),x),T=g.description,I=g.fullscreen,Q=g.handleImageLoaded,fe=g.isFullscreen,Ce=g.onImageError,y=g.original,v=g.originalAlt,P=g.originalHeight,G=g.originalWidth,Z=g.originalTitle,X=g.sizes,be=g.srcSet,ye=g.loading,ke=fe&&I||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:ke,alt:v,srcSet:be,height:P,width:G,sizes:X,title:Z,onLoad:function(ie){return Q(ie,y)},onError:Ce,loading:ye}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:L.string,fullscreen:L.string,handleImageLoaded:L.func.isRequired,isFullscreen:L.bool,onImageError:L.func.isRequired,original:L.string.isRequired,originalAlt:L.string,originalHeight:L.string,originalWidth:L.string,originalTitle:L.string,sizes:L.string,srcSet:L.string,loading:L.string};const _=k;function z(x){return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},z(x)}function ee(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function oe(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ee(Object(T),!0).forEach(function(I){Se(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):ee(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function Se(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(z(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(z(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return z(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var xe={left:u().createElement("polyline",{points:"15 18 9 12 15 6"}),right:u().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:u().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:u().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:u().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:u().createElement(u().Fragment,null,u().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),u().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Qe={strokeWidth:1,viewBox:"0 0 24 24"},Je=function(x){var g=oe(oe({},Qe),x),T=g.strokeWidth,I=g.viewBox,Q=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:I,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},xe[Q])};Je.propTypes={strokeWidth:L.number,viewBox:L.string,icon:(0,L.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Le=Je;var Be=u().memo(function(x){var g=x.isFullscreen,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:T,"aria-label":"Open Fullscreen"},u().createElement(Le,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Be.displayName="Fullscreen",Be.propTypes={isFullscreen:L.bool.isRequired,onClick:L.func.isRequired};const Ye=Be;var At=u().memo(function(x){var g=x.disabled,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:g,onClick:T,"aria-label":"Previous Slide"},u().createElement(Le,{icon:"left",viewBox:"6 0 12 24"}))});At.displayName="LeftNav",At.propTypes={disabled:L.bool.isRequired,onClick:L.func.isRequired};const sn=At;var Zt=u().memo(function(x){var g=x.disabled,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:g,onClick:T,"aria-label":"Next Slide"},u().createElement(Le,{icon:"right",viewBox:"6 0 12 24"}))});Zt.displayName="RightNav",Zt.propTypes={disabled:L.bool.isRequired,onClick:L.func.isRequired};const rr=Zt;var ot=u().memo(function(x){var g=x.isPlaying,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:T,"aria-label":"Play or Pause Slideshow"},u().createElement(Le,{strokeWidth:2,icon:g?"pause":"play"}))});ot.displayName="PlayPause",ot.propTypes={isPlaying:L.bool.isRequired,onClick:L.func.isRequired};const hn=ot;function Pt(x){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Pt(x)}function Wt(){return Wt=Object.assign?Object.assign.bind():function(x){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(x[I]=T[I])}return x},Wt.apply(this,arguments)}function an(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function ln(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?an(Object(T),!0).forEach(function(I){Cn(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):an(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function Cn(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(Pt(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(Pt(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return Pt(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var zt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},en=function(x){var g=ln(ln({},zt),x),T=g.children,I=g.className,Q=Ue({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Wt({},Q,{className:I}),T)};en.propTypes={children:L.node.isRequired,className:L.string,delta:L.number,onSwiped:L.func,onSwiping:L.func};const tn=en;function Vt(x){return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Vt(x)}function yi(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function bi(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?yi(Object(T),!0).forEach(function(I){xi(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):yi(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function ha(x,g){for(var T=0;T<g.length;T++){var I=g[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,wi(I.key),I)}}function ir(x,g){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,I){return T.__proto__=I,T},ir(x,g)}function fa(x,g){if(g&&(Vt(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ke(x)}function Ke(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function In(x){return In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},In(x)}function xi(x,g,T){return(g=wi(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}function wi(x){var g=function(T,I){if(Vt(T)!=="object"||T===null)return T;var Q=T[Symbol.toPrimitive];if(Q!==void 0){var fe=Q.call(T,I);if(Vt(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(x,"string");return Vt(g)==="symbol"?g:String(g)}var Si=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],pa=(0,L.arrayOf)((0,L.shape)({srcSet:L.string,media:L.string}));function Ei(x){var g=parseInt(x.keyCode||x.which||0,10);return g===66||g===62}var or=function(x){(function(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),v&&ir(y,v)})(Ce,x);var g,T,I,Q,fe=(I=Ce,Q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var y,v=In(I);if(Q){var P=In(this).constructor;y=Reflect.construct(v,arguments,P)}else y=v.apply(this,arguments);return fa(this,y)});function Ce(y){var v;return function(P,G){if(!(P instanceof G))throw new TypeError("Cannot call a class as a function")}(this,Ce),xi(Ke(v=fe.call(this,y)),"onBulletClick",function(P,G){var Z=v.props,X=Z.onBulletClick,be=Z.items,ye=v.state.currentIndex;P.target.blur(),ye!==G&&(be.length===2?v.slideToIndexWithStyleReset(G,P):v.slideToIndex(G,P)),X&&X(P,G)}),v.state={currentIndex:y.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(y.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},v.loadedImages={},v.imageGallery=u().createRef(),v.thumbnailsWrapper=u().createRef(),v.thumbnails=u().createRef(),v.imageGallerySlideWrapper=u().createRef(),v.handleImageLoaded=v.handleImageLoaded.bind(Ke(v)),v.handleKeyDown=v.handleKeyDown.bind(Ke(v)),v.handleMouseDown=v.handleMouseDown.bind(Ke(v)),v.handleResize=v.handleResize.bind(Ke(v)),v.handleTouchMove=v.handleTouchMove.bind(Ke(v)),v.handleOnSwiped=v.handleOnSwiped.bind(Ke(v)),v.handleScreenChange=v.handleScreenChange.bind(Ke(v)),v.handleSwiping=v.handleSwiping.bind(Ke(v)),v.handleThumbnailSwiping=v.handleThumbnailSwiping.bind(Ke(v)),v.handleOnThumbnailSwiped=v.handleOnThumbnailSwiped.bind(Ke(v)),v.onThumbnailMouseLeave=v.onThumbnailMouseLeave.bind(Ke(v)),v.handleImageError=v.handleImageError.bind(Ke(v)),v.pauseOrPlay=v.pauseOrPlay.bind(Ke(v)),v.renderThumbInner=v.renderThumbInner.bind(Ke(v)),v.renderItem=v.renderItem.bind(Ke(v)),v.slideLeft=v.slideLeft.bind(Ke(v)),v.slideRight=v.slideRight.bind(Ke(v)),v.toggleFullScreen=v.toggleFullScreen.bind(Ke(v)),v.togglePlay=v.togglePlay.bind(Ke(v)),v.unthrottledSlideToIndex=v.slideToIndex,v.slideToIndex=K(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Ce,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,P=y.useWindowKeyDown;v&&this.play(),P?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(y,v){var P=this.props,G=P.items,Z=P.lazyLoad,X=P.slideDuration,be=P.slideInterval,ye=P.startIndex,ke=P.thumbnailPosition,ie=P.showThumbnails,se=P.useWindowKeyDown,le=this.state,pe=le.currentIndex,Te=le.isPlaying,_e=y.items.length!==G.length,ze=!ce()(y.items,G),dt=y.startIndex!==ye,at=y.thumbnailPosition!==ke,Ze=y.showThumbnails!==ie;be===y.slideInterval&&X===y.slideDuration||Te&&(this.pause(),this.play()),at&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ze&&ie&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ze&&!ie&&this.removeThumbnailsResizeObserver(),(_e||Ze)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==X&&(this.slideToIndex=K(this.unthrottledSlideToIndex,X,{trailing:!1})),!Z||y.lazyLoad&&!ze||(this.lazyLoaded=[]),se!==y.useWindowKeyDown&&(se?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(dt||ze)&&this.setState({currentIndex:ye,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var y=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),y?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var y=this,v=this.state,P=v.currentIndex,G=v.isTransitioning,Z=this.props,X=Z.onSlide,be=Z.slideDuration;this.transitionTimer=window.setTimeout(function(){G&&(y.setState({isTransitioning:!G,isSwipingThumbnail:!1}),X&&X(P))},be+50)}},{key:"onThumbnailClick",value:function(y,v){var P=this.props,G=P.onThumbnailClick,Z=P.items,X=this.state.currentIndex;y.target.parentNode.parentNode.blur(),X!==v&&(Z.length===2?this.slideToIndexWithStyleReset(v,y):this.slideToIndex(v,y)),G&&G(y,v)}},{key:"onThumbnailMouseOver",value:function(y,v){var P=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){P.slideToIndex(v),P.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var y=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,y&&this.play()}}},{key:"setThumbsTranslate",value:function(y){this.setState({thumbsTranslate:y})}},{key:"setModalFullscreen",value:function(y){var v=this.props.onScreenChange;this.setState({modalFullscreen:y}),v&&v(y)}},{key:"getThumbsTranslate",value:function(y){var v,P=this.props,G=P.disableThumbnailScroll,Z=P.items,X=this.state,be=X.thumbnailsWrapperWidth,ye=X.thumbnailsWrapperHeight,ke=this.thumbnails&&this.thumbnails.current;if(G)return 0;if(ke){if(this.isThumbnailVertical()){if(ke.scrollHeight<=ye)return 0;v=ke.scrollHeight-ye}else{if(ke.scrollWidth<=be||be<=0)return 0;v=ke.scrollWidth-be}return y*(v/(Z.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(y){switch(y){case"left":y=" ".concat("image-gallery-thumbnails-left");break;case"right":y=" ".concat("image-gallery-thumbnails-right");break;case"bottom":y=" ".concat("image-gallery-thumbnails-bottom");break;case"top":y=" ".concat("image-gallery-thumbnails-top")}return y}},{key:"getAlignmentClassName",value:function(y){var v=this.state.currentIndex,P=this.props,G=P.infinite,Z=P.items,X="",be="image-gallery-left",ye="image-gallery-right";switch(y){case v-1:X=" ".concat(be);break;case v:X=" ".concat("image-gallery-center");break;case v+1:X=" ".concat(ye)}return Z.length>=3&&G&&(y===0&&v===Z.length-1?X=" ".concat(ye):y===Z.length-1&&v===0&&(X=" ".concat(be))),X}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Z=v.previousIndex,X=P!==Z,be=y===0&&Z===0,ye=y===1&&Z===1,ke=y===0&&P===1,ie=y===1&&P===0,se=G===0,le=-100*P+100*y+G;return G>0?this.direction="left":G<0&&(this.direction="right"),ie&&G>0&&(le=-100+G),ke&&G<0&&(le=100+G),X?be&&se&&this.direction==="left"?le=100:ye&&se&&this.direction==="right"&&(le=-100):(ie&&se&&this.direction==="left"&&(le=-100),ke&&se&&this.direction==="right"&&(le=100)),le}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Z=v.slideStyle,X=this.props,be=X.infinite,ye=X.items,ke=X.useTranslate3D,ie=X.isRTL,se=-100*P,le=ye.length-1,pe=(se+100*y)*(ie?-1:1)+G;be&&ye.length>2&&(P===0&&y===le?pe=-100*(ie?-1:1)+G:P===le&&y===0&&(pe=100*(ie?-1:1)+G)),be&&ye.length===2&&(pe=this.getTranslateXForTwoSlide(y));var Te="translate(".concat(pe,"%, 0)");return ke&&(Te="translate3d(".concat(pe,"%, 0, 0)")),bi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:Te,MozTransform:Te,msTransform:Te,OTransform:Te,transform:Te},Z)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,P=v.useTranslate3D,G=v.isRTL,Z=this.state,X=Z.thumbsTranslate,be=Z.thumbsStyle,ye=G?-1*X:X;return this.isThumbnailVertical()?(y="translate(0, ".concat(X,"px)"),P&&(y="translate3d(0, ".concat(X,"px, 0)"))):(y="translate(".concat(ye,"px, 0)"),P&&(y="translate3d(".concat(ye,"px, 0, 0)"))),bi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},be)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,P=this.props,G=P.items,Z=P.slideOnThumbnailOver,X=P.onClick,be=P.lazyLoad,ye=P.onTouchMove,ke=P.onTouchEnd,ie=P.onTouchStart,se=P.onMouseOver,le=P.onMouseLeave,pe=P.renderItem,Te=P.renderThumbInner,_e=P.showThumbnails,ze=P.showBullets,dt=[],at=[],Ze=[];return G.forEach(function(We,Ne){var Kt=y.getAlignmentClassName(Ne),fn=We.originalClass?" ".concat(We.originalClass):"",pn=We.thumbnailClass?" ".concat(We.thumbnailClass):"",Dt=We.renderItem||pe||y.renderItem,nn=We.renderThumbInner||Te||y.renderThumbInner,Lt=!be||Kt||y.lazyLoaded[Ne];Lt&&be&&!y.lazyLoaded[Ne]&&(y.lazyLoaded[Ne]=!0);var cn=y.getSlideStyle(Ne),mn=u().createElement("div",{"aria-label":"Go to Slide ".concat(Ne+1),key:"slide-".concat(Ne),tabIndex:"-1",className:"image-gallery-slide ".concat(Kt," ").concat(fn),style:cn,onClick:X,onKeyUp:y.handleSlideKeyUp,onTouchMove:ye,onTouchEnd:ke,onTouchStart:ie,onMouseOver:se,onFocus:se,onMouseLeave:le,role:"button"},Lt?Dt(We):u().createElement("div",{style:{height:"100%"}}));if(dt.push(mn),_e&&We.thumbnail){var un=d("image-gallery-thumbnail",pn,{active:v===Ne});at.push(u().createElement("button",{key:"thumbnail-".concat(Ne),type:"button",tabIndex:"0","aria-pressed":v===Ne?"true":"false","aria-label":"Go to Slide ".concat(Ne+1),className:un,onMouseLeave:Z?y.onThumbnailMouseLeave:null,onMouseOver:function(mt){return y.handleThumbnailMouseOver(mt,Ne)},onFocus:function(mt){return y.handleThumbnailMouseOver(mt,Ne)},onKeyUp:function(mt){return y.handleThumbnailKeyUp(mt,Ne)},onClick:function(mt){return y.onThumbnailClick(mt,Ne)}},nn(We)))}if(ze){var gn=d("image-gallery-bullet",We.bulletClass,{active:v===Ne});Ze.push(u().createElement("button",{type:"button",key:"bullet-".concat(Ne),className:gn,onClick:function(mt){return y.onBulletClick(mt,Ne)},"aria-pressed":v===Ne?"true":"false","aria-label":"Go to Slide ".concat(Ne+1)}))}}),{slides:dt,thumbnails:at,bullets:Ze}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,P=v.previousIndex,G=v.currentIndex,Z=y.length-1;return Math.abs(P-G)>1&&!(P===0&&G===Z)&&!(P===Z&&G===0)}},{key:"isFirstOrLastSlide",value:function(y){return y===this.props.items.length-1||y===0}},{key:"slideIsTransitioning",value:function(y){var v=this.state,P=v.isTransitioning,G=v.previousIndex,Z=v.currentIndex;return P&&!(y===G||y===Z)}},{key:"isSlideVisible",value:function(y){return!this.slideIsTransitioning(y)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(y)}},{key:"slideThumbnailBar",value:function(){var y=this.state,v=y.currentIndex,P=y.isSwipingThumbnail,G=-this.getThumbsTranslate(v);P||(v===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:G,thumbsSwipedTranslate:G}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(y){var v=y.event,P=y.absX,G=y.dir,Z=this.props,X=Z.disableSwipe,be=Z.stopPropagation,ye=this.state,ke=ye.galleryWidth,ie=ye.isTransitioning,se=ye.swipingUpDown,le=ye.swipingLeftRight;if(G!==V&&G!==he&&!se||le){if(G!==pt&&G!==st||le||this.setState({swipingLeftRight:!0}),!X){var pe=this.props.swipingTransitionDuration;if(be&&v.preventDefault(),ie)this.setState({currentSlideOffset:0});else{var Te=G===st?1:-1,_e=P/ke*100;Math.abs(_e)>=100&&(_e=100);var ze={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:Te*_e,slideStyle:ze})}}}else se||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,P=y.absX,G=y.absY,Z=y.dir,X=this.props,be=X.stopPropagation,ye=X.swipingThumbnailTransitionDuration,ke=this.state,ie=ke.thumbsSwipedTranslate,se=ke.thumbnailsWrapperHeight,le=ke.thumbnailsWrapperWidth,pe=ke.swipingUpDown,Te=ke.swipingLeftRight;if(this.isThumbnailVertical()){if((Z===pt||Z===st||Te)&&!pe)return void(Te||this.setState({swipingLeftRight:!0}));Z!==V&&Z!==he||pe||this.setState({swipingUpDown:!0})}else{if((Z===V||Z===he||pe)&&!Te)return void(pe||this.setState({swipingUpDown:!0}));Z!==pt&&Z!==st||Te||this.setState({swipingLeftRight:!0})}var _e,ze,dt,at,Ze,We=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(_e=ie+(Z===he?G:-G),ze=We.scrollHeight-se+20,dt=Math.abs(_e)>ze,at=_e>20,Ze=We.scrollHeight<=se):(_e=ie+(Z===st?P:-P),ze=We.scrollWidth-le+20,dt=Math.abs(_e)>ze,at=_e>20,Ze=We.scrollWidth<=le),!Ze&&(Z!==pt&&Z!==V||!dt)&&(Z!==st&&Z!==he||!at)){be&&v.stopPropagation();var Ne={transition:"transform ".concat(ye,"ms ease-out")};this.setState({thumbsTranslate:_e,thumbsStyle:Ne})}}},{key:"handleOnThumbnailSwiped",value:function(){var y=this.state.thumbsTranslate,v=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:y,thumbsStyle:{transition:"all ".concat(v,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var y=this.state.currentSlideOffset,v=this.props.swipeThreshold;return Math.abs(y)>v}},{key:"resetSwipingDirection",value:function(){var y=this.state,v=y.swipingUpDown,P=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),P&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,P=y.dir,G=y.velocity,Z=this.props,X=Z.disableSwipe,be=Z.stopPropagation,ye=Z.flickThreshold;if(!X){var ke=this.props.isRTL;be&&v.stopPropagation(),this.resetSwipingDirection();var ie=(P===pt?1:-1)*(ke?-1:1),se=G>ye&&!(P===V||P===he);this.handleOnSwipedTo(ie,se)}}},{key:"handleOnSwipedTo",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=G;!this.sufficientSwipe()&&!v||Z||(X+=y),(y===-1&&!this.canSlideLeft()||y===1&&!this.canSlideRight())&&(X=G),this.unthrottledSlideToIndex(X)}},{key:"handleTouchMove",value:function(y){this.state.swipingLeftRight&&y.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(y){var v=this.props,P=v.disableKeyDown,G=v.useBrowserFullscreen,Z=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!P)switch(parseInt(y.keyCode||y.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(y);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(y);break;case 27:Z&&!G&&this.exitFullScreen()}}},{key:"handleImageError",value:function(y){var v=this.props.onErrorImageURL;v&&y.target.src.indexOf(v)===-1&&(y.target.src=v)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var y=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(y)))}},{key:"initSlideWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeSlideWrapperObserver=new Rt(Ie(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperWidth:G.contentRect.width},v.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(y.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeThumbnailWrapperObserver=new Rt(Ie(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperHeight:G.contentRect.height},v.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(y.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var y=this.props,v=y.onScreenChange,P=y.useBrowserFullscreen,G=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Z=this.imageGallery.current===G;v&&v(Z),P&&this.setState({isFullscreen:Z})}},{key:"slideToIndex",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=this.props,be=X.items,ye=X.slideDuration,ke=X.onBeforeSlide;if(!Z){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var ie=be.length-1,se=y;y<0?se=ie:y>ie&&(se=0),ke&&se!==G&&ke(se),this.setState({previousIndex:G,currentIndex:se,isTransitioning:se!==G,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ye,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"right":"left")}},{key:"slideRight",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"left":"right")}},{key:"slideTo",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=this.props.items,be=G+(v==="left"?-1:1);Z||(X.length===2?this.slideToIndexWithStyleReset(be,y):this.slideToIndex(be,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var P=this,G=this.state,Z=G.currentIndex,X=G.currentSlideOffset;this.setState({currentSlideOffset:X+(Z>y?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return P.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){Ei(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){Ei(y)&&(0,this.props.onClick)(y)}},{key:"isThumbnailVertical",value:function(){var y=this.props.thumbnailPosition;return y==="left"||y==="right"}},{key:"addScreenChangeEvent",value:function(){var y=this;Si.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;Si.forEach(function(v){document.removeEventListener(v,y.handleScreenChange)})}},{key:"fullScreen",value:function(){var y=this.props.useBrowserFullscreen,v=this.imageGallery.current;y?v.requestFullscreen?v.requestFullscreen():v.msRequestFullscreen?v.msRequestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen?v.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var y=this.state.isFullscreen,v=this.props.useBrowserFullscreen;y&&(v?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var y=this.props.infinite,v=this.state.currentIndex;y||this.canSlideRight()?this.slideToIndex(v+1):this.pause()}},{key:"play",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props,P=v.onPlay,G=v.slideInterval,Z=v.slideDuration,X=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(G,Z)),P&&y&&P(X))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,P=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(P))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var P=this.props.onImageLoad;!this.loadedImages[v]&&P&&(this.loadedImages[v]=!0,P(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,P=this.props.onImageError||this.handleImageError;return u().createElement(_,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:P,original:y.original,originalAlt:y.originalAlt,originalHeight:y.originalHeight,originalWidth:y.originalWidth,originalTitle:y.originalTitle,sizes:y.sizes,loading:y.loading,srcSet:y.srcSet})}},{key:"renderThumbInner",value:function(y){var v=this.props.onThumbnailError||this.handleImageError;return u().createElement("span",{className:"image-gallery-thumbnail-inner"},u().createElement("img",{className:"image-gallery-thumbnail-image",src:y.thumbnail,height:y.thumbnailHeight,width:y.thumbnailWidth,alt:y.thumbnailAlt,title:y.thumbnailTitle,loading:y.thumbnailLoading,onError:v}),y.thumbnailLabel&&u().createElement("div",{className:"image-gallery-thumbnail-label"},y.thumbnailLabel))}},{key:"render",value:function(){var y=this.state,v=y.currentIndex,P=y.isFullscreen,G=y.modalFullscreen,Z=y.isPlaying,X=this.props,be=X.additionalClass,ye=X.disableThumbnailSwipe,ke=X.indexSeparator,ie=X.isRTL,se=X.items,le=X.thumbnailPosition,pe=X.renderFullscreenButton,Te=X.renderCustomControls,_e=X.renderLeftNav,ze=X.renderRightNav,dt=X.showBullets,at=X.showFullscreenButton,Ze=X.showIndex,We=X.showThumbnails,Ne=X.showNav,Kt=X.showPlayButton,fn=X.renderPlayPauseButton,pn=this.getThumbnailStyle(),Dt=this.getSlideItems(),nn=Dt.slides,Lt=Dt.thumbnails,cn=Dt.bullets,mn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(le),{"image-gallery-rtl":ie}),un=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:mn},Te&&Te(),this.canSlide()?u().createElement(u().Fragment,null,Ne&&u().createElement(u().Fragment,null,_e(this.slideLeft,!this.canSlideLeft()),ze(this.slideRight,!this.canSlideRight())),u().createElement(tn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},nn))):u().createElement("div",{className:"image-gallery-slides"},nn),Kt&&fn(this.togglePlay,Z),dt&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},cn)),at&&pe(this.toggleFullScreen,P),Ze&&u().createElement("div",{className:"image-gallery-index"},u().createElement("span",{className:"image-gallery-index-current"},v+1),u().createElement("span",{className:"image-gallery-index-separator"},ke),u().createElement("span",{className:"image-gallery-index-total"},se.length))),gn=d("image-gallery",be,{"fullscreen-modal":G}),mt=d("image-gallery-content",this.getThumbnailPositionClassName(le),{fullscreen:P}),ga=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(le),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&ie},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ye},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ye});return u().createElement("div",{ref:this.imageGallery,className:gn,"aria-live":"polite"},u().createElement("div",{className:mt},(le==="bottom"||le==="right")&&un,We&&Lt.length>0?u().createElement(tn,{className:ga,delta:0,onSwiping:!ye&&this.handleThumbnailSwiping,onSwiped:!ye&&this.handleOnThumbnailSwiped},u().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},u().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:pn,"aria-label":"Thumbnail Navigation"},Lt))):null,(le==="top"||le==="left")&&un))}}],T&&ha(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Ce}(u().Component);or.propTypes={flickThreshold:L.number,items:(0,L.arrayOf)((0,L.shape)({bulletClass:L.string,bulletOnClick:L.func,description:L.string,original:L.string,originalHeight:L.number,originalWidth:L.number,loading:L.string,thumbnailHeight:L.number,thumbnailWidth:L.number,thumbnailLoading:L.string,fullscreen:L.string,originalAlt:L.string,originalTitle:L.string,thumbnail:L.string,thumbnailAlt:L.string,thumbnailLabel:L.string,thumbnailTitle:L.string,originalClass:L.string,thumbnailClass:L.string,renderItem:L.func,renderThumbInner:L.func,imageSet:pa,srcSet:L.string,sizes:L.string})).isRequired,showNav:L.bool,autoPlay:L.bool,lazyLoad:L.bool,infinite:L.bool,showIndex:L.bool,showBullets:L.bool,showThumbnails:L.bool,showPlayButton:L.bool,showFullscreenButton:L.bool,disableThumbnailScroll:L.bool,disableKeyDown:L.bool,disableSwipe:L.bool,disableThumbnailSwipe:L.bool,useBrowserFullscreen:L.bool,onErrorImageURL:L.string,indexSeparator:L.string,thumbnailPosition:(0,L.oneOf)(["top","bottom","left","right"]),startIndex:L.number,slideDuration:L.number,slideInterval:L.number,slideOnThumbnailOver:L.bool,swipeThreshold:L.number,swipingTransitionDuration:L.number,swipingThumbnailTransitionDuration:L.number,onSlide:L.func,onBeforeSlide:L.func,onScreenChange:L.func,onPause:L.func,onPlay:L.func,onClick:L.func,onImageLoad:L.func,onImageError:L.func,onTouchMove:L.func,onTouchEnd:L.func,onTouchStart:L.func,onMouseOver:L.func,onMouseLeave:L.func,onBulletClick:L.func,onThumbnailError:L.func,onThumbnailClick:L.func,renderCustomControls:L.func,renderLeftNav:L.func,renderRightNav:L.func,renderPlayPauseButton:L.func,renderFullscreenButton:L.func,renderItem:L.func,renderThumbInner:L.func,stopPropagation:L.bool,additionalClass:L.string,useTranslate3D:L.bool,isRTL:L.bool,useWindowKeyDown:L.bool},or.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(x,g){return u().createElement(sn,{onClick:x,disabled:g})},renderRightNav:function(x,g){return u().createElement(rr,{onClick:x,disabled:g})},renderPlayPauseButton:function(x,g){return u().createElement(hn,{onClick:x,isPlaying:g})},renderFullscreenButton:function(x,g){return u().createElement(Ye,{onClick:x,isFullscreen:g})},useWindowKeyDown:!0};const ma=or})(),o})())}(zn)),zn.exports}var Od=jd();const Cd=ri(Od);function Id(){var e=new Map;function t(r){var i=r.root,s=r.rootMargin,n=r.threshold,o=e.get(i);o||(o=new Map,e.set(i,o));var a=JSON.stringify({rootMargin:s,threshold:n}),d=o.get(a);if(!d){var h=new Map,u=new IntersectionObserver(function(f){f.forEach(function(j){var m=h.get(j.target);m?.(j)})},{root:i,rootMargin:s,threshold:n});d={observer:u,entryCallbacks:h},o.set(a,d)}return{observe:function(j,m){var S,E;(S=d)==null||S.entryCallbacks.set(j,m),(E=d)==null||E.observer.observe(j)},unobserve:function(j){var m,S;(m=d)==null||m.entryCallbacks.delete(j),(S=d)==null||S.observer.unobserve(j)}}}return{getObserver:t}}var Rd="0px",Pd=[0],Ld=Id();function _d(e){var t,r,i=(t=e?.rootMargin)!=null?t:Rd,s=(r=e?.threshold)!=null?r:Pd,n=q.useRef(null),o=q.useRef(null),a=q.useRef(null),d=q.useState(),h=d[0],u=d[1],f=q.useCallback(function(){var E=n.current;if(!E){u(void 0);return}var C=Ld.getObserver({root:o.current,rootMargin:i,threshold:s});C.observe(E,function(c){u(c)}),a.current=C},[i,s]),j=q.useCallback(function(){var E=a.current,C=n.current;C&&E?.unobserve(C),a.current=null},[]),m=q.useCallback(function(E){j(),n.current=E,f()},[f,j]),S=q.useCallback(function(E){j(),o.current=E,f()},[f,j]);return[m,{entry:h,rootRef:S}]}function Yr(){return Yr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Yr.apply(this,arguments)}function Nd(e){var t,r=_d(e),i=r[0],s=r[1],n=!!((t=s.entry)!=null&&t.isIntersecting),o=q.useState(n),a=o[0],d=o[1];return n&&!a&&d(!0),[i,Yr({},s,{isVisible:n,wasEverVisible:a})]}var Ad=100;function Dd(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Ad:o,d=Nd({rootMargin:s}),h=d[0],u=d[1],f=u.rootRef,j=u.isVisible,m=!n&&!t&&j&&r;return q.useEffect(function(){if(m){var S=setTimeout(function(){i()},a);return function(){clearTimeout(S)}}},[i,m,a]),[h,{rootRef:f}]}const Md={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},Bd={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'},Fd={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/>'};var jr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Or(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){r(window.event)})}function Ks(e,t){for(var r=t.slice(0,t.length-1),i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Gs(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),r=t.lastIndexOf("");r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function $d(e,t){for(var r=e.length>=t.length?e:t,i=e.length>=t.length?t:e,s=!0,n=0;n<r.length;n++)i.indexOf(r[n])===-1&&(s=!1);return s}var pi={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":jr?173:189,"=":jr?61:187,";":jr?59:186,"'":222,"[":219,"]":221,"\\":220},Jt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Jr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},et={16:!1,18:!1,17:!1,91:!1},He={};for(var Bn=1;Bn<20;Bn++)pi["f".concat(Bn)]=111+Bn;var qe=[],ko=!1,Hs="all",Xs=[],nr=function(t){return pi[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Ys(e){Hs=e||"all"}function Tn(){return Hs||"all"}function Ud(){return qe.slice(0)}function qd(e){var t=e.target||e.srcElement,r=t.tagName,i=!0;return(t.isContentEditable||(r==="INPUT"||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function Wd(e){return typeof e=="string"&&(e=nr(e)),qe.indexOf(e)!==-1}function zd(e,t){var r,i;e||(e=Tn());for(var s in He)if(Object.prototype.hasOwnProperty.call(He,s))for(r=He[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1):i++;Tn()===e&&Ys(t||"all")}function Vd(e){var t=e.keyCode||e.which||e.charCode,r=qe.indexOf(t);if(r>=0&&qe.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&qe.splice(0,qe.length),(t===93||t===224)&&(t=91),t in et){et[t]=!1;for(var i in Jt)Jt[i]===t&&(bt[i]=!1)}}function Kd(e){if(typeof e>"u")Object.keys(He).forEach(function(o){return delete He[o]});else if(Array.isArray(e))e.forEach(function(o){o.key&&Cr(o)});else if(typeof e=="object")e.key&&Cr(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var s=r[0],n=r[1];typeof s=="function"&&(n=s,s=""),Cr({key:e,scope:s,method:n,splitKey:"+"})}}var Cr=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Gs(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":nr(f);if(He[j]){i||(i=Tn());var m=u>1?Ks(Jt,h):[];He[j]=He[j].filter(function(S){var E=s?S.method===s:!0;return!(E&&S.scope===i&&$d(S.mods,m))})}})};function To(e,t,r,i){if(t.element===i){var s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(var n in et)Object.prototype.hasOwnProperty.call(et,n)&&(!et[n]&&t.mods.indexOf(+n)>-1||et[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!et[16]&&!et[18]&&!et[17]&&!et[91]||s||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function jo(e,t){var r=He["*"],i=e.keyCode||e.which||e.charCode;if(bt.filter.call(this,e)){if((i===93||i===224)&&(i=91),qe.indexOf(i)===-1&&i!==229&&qe.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var E=Jr[S];e[S]&&qe.indexOf(E)===-1?qe.push(E):!e[S]&&qe.indexOf(E)>-1?qe.splice(qe.indexOf(E),1):S==="metaKey"&&e[S]&&qe.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(qe=qe.slice(qe.indexOf(E))))}),i in et){et[i]=!0;for(var s in Jt)Jt[s]===i&&(bt[s]=!0);if(!r)return}for(var n in et)Object.prototype.hasOwnProperty.call(et,n)&&(et[n]=e[Jr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(qe.indexOf(17)===-1&&qe.push(17),qe.indexOf(18)===-1&&qe.push(18),et[17]=!0,et[18]=!0);var o=Tn();if(r)for(var a=0;a<r.length;a++)r[a].scope===o&&(e.type==="keydown"&&r[a].keydown||e.type==="keyup"&&r[a].keyup)&&To(e,r[a],o,t);if(i in He){for(var d=0;d<He[i].length;d++)if((e.type==="keydown"&&He[i][d].keydown||e.type==="keyup"&&He[i][d].keyup)&&He[i][d].key){for(var h=He[i][d],u=h.splitKey,f=h.key.split(u),j=[],m=0;m<f.length;m++)j.push(nr(f[m]));j.sort().join("")===qe.sort().join("")&&To(e,h,o,t)}}}}function Gd(e){return Xs.indexOf(e)>-1}function bt(e,t,r){qe=[];var i=Gs(e),s=[],n="all",o=document,a=0,d=!1,h=!0,u="+",f=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(n=t.scope),t.element&&(o=t.element),t.keyup&&(d=t.keyup),t.keydown!==void 0&&(h=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(u=t.splitKey)),typeof t=="string"&&(n=t);a<i.length;a++)e=i[a].split(u),s=[],e.length>1&&(s=Ks(Jt,e)),e=e[e.length-1],e=e==="*"?"*":nr(e),e in He||(He[e]=[]),He[e].push({keyup:d,keydown:h,scope:n,mods:s,shortcut:i[a],method:r,key:i[a],splitKey:u,element:o});typeof o<"u"&&!Gd(o)&&window&&(Xs.push(o),Or(o,"keydown",function(j){jo(j,o)},f),ko||(ko=!0,Or(window,"focus",function(){qe=[]},f)),Or(o,"keyup",function(j){jo(j,o),Vd(j)},f))}function Hd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(He).forEach(function(r){var i=He[r].find(function(s){return s.scope===t&&s.shortcut===e});i&&i.method&&i.method()})}var Ir={setScope:Ys,getScope:Tn,deleteScope:zd,getPressedKeyCodes:Ud,isPressed:Wd,filter:qd,trigger:Hd,unbind:Kd,keyMap:pi,modifier:Jt,modifierMap:Jr};for(var Rr in Ir)Object.prototype.hasOwnProperty.call(Ir,Rr)&&(bt[Rr]=Ir[Rr]);if(typeof window<"u"){var Xd=window.hotkeys;bt.noConflict=function(e){return e&&window.hotkeys===bt&&(window.hotkeys=Xd),bt},window.hotkeys=bt}bt.filter=function(){return!0};var Js=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Yd=function(t){return Js(t,["INPUT","TEXTAREA","SELECT"])};function Jd(e,t,r,i){r instanceof Array&&(i=r,r=void 0);var s=r||{},n=s.enableOnTags,o=s.filter,a=s.keyup,d=s.keydown,h=s.filterPreventDefault,u=h===void 0?!0:h,f=s.enabled,j=f===void 0?!0:f,m=s.enableOnContentEditable,S=m===void 0?!1:m,E=q.useRef(null),C=q.useCallback(function(c,N){var $,O;return o&&!o(c)?!u:Yd(c)&&!Js(c,n)||($=c.target)!=null&&$.isContentEditable&&!S?!0:E.current===null||document.activeElement===E.current||(O=E.current)!=null&&O.contains(document.activeElement)?(t(c,N),!0):!1},i?[E,n,o].concat(i):[E,n,o]);return q.useEffect(function(){if(!j){bt.unbind(e,C);return}return a&&d!==!0&&(r.keydown=!1),bt(e,r||{},C),function(){return bt.unbind(e,C)}},[C,e,j]),E}bt.isPressed;const Qs=q.createContext({open:!1,toggleOpen:e=>{}});function Qd({children:e}){const[t,r]=q.useState(!1),i=n=>{r(n??!n)},s=q.useMemo(()=>({open:t,toggleOpen:i}),[t]);return l.jsx(Qs.Provider,{value:s,children:e})}function mi(){return q.useContext(Qs)}const St={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Zd=e=>On(async()=>{const{data:t}=await e.get(St.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function eh(e,t){const r=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Rl(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:i,onSearchSelect:s=a=>{t.onFilterChange({...r,keyword:a.title})},emptyCategory:n}=t;!r.category&&!n&&(r.category="All");const o=a=>{const d={...r,...a};i(sr(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?sr(r,(h,u)=>a.includes(u)):{};i(sr(d,h=>h===""||h===void 0))},handleActiveMenu:a=>{a!==e.menu&&i({menu:a})},handleSort:(a,d)=>{o({sortBy:a,sortDirection:d||a==="nameAsc"?"asc":"desc"})},handleKeyword:a=>{o({category:void 0,keyword:a||void 0})},handlePrice:a=>{o({price:a===e.price?void 0:a})},handleCategory:a=>{o({category:a===e.category?"":a})},handleDeveloper:a=>{o({owner:a||void 0})},handlePage:a=>{o({currentPage:a})},handleSwitchIsOfficial:a=>{o({isOfficial:a==="true"?"true":""})},handleSwitchShowResources:a=>{o({showResources:a})},handleSearchSelect:a=>{s(a)}}}const th=(e,t,r)=>e&&t||!r,Zs=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ea=(e,t,r)=>{const i=Pl(e),s=Ll(i.search);if(_l(e)?.endsWith(".gif"))return s.imageFilter?Nl({...i,search:""}):e;if(s.imageFilter)return e;const n=r||window.blocklet?.version,{w:o,h:a}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Zn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},nh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],rh=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),ih=e=>Array.isArray(e)?e.map(t=>t.message).join(`
490
- `):e.response?.data?.error?e.response.data.error.message||e.response.data.error:e.message||e,oh=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),sh=()=>window.innerWidth<=600,ah={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",official:"Official Blocklets",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",searchPlaceholder:"Search blocklet"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},lh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",official:"官方 Blocklet",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Pr={en:Ci(ah),zh:Ci(lh)},ta=(e,t)=>{const r={};return e&&(r["x-blocklet-server-version"]=e),t&&(r["x-blocklet-store-version"]=t),r},ch=e=>(t,r)=>{const i=Pr[e]?Pr[e][t]:Pr.en[t];return oh(i,r)||t},na={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSwitchIsOfficial:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},ra=q.createContext(na),{Provider:uh,Consumer:Df}=ra;function dh(e){const{locale:t="zh",filters:r={},serverVersion:i="",onFilterChange:s=()=>{},minItemWidth:n=350,queryFilter:o=!0,layout:a={},wrapChildren:d=K=>K,extraFilter:h=K=>K,baseSearch:u=!1,fetchCategoryDelay:f=0,showResourcesSwitch:j=!1,showCategory:m=!0,tagFilters:S=[],children:E,storeVersion:C,onSearchSelect:c=()=>{},endpoint:N,blockletRender:$,compact:O=!1}=e,w=ta(i,C),R=q.useMemo(()=>Zo({baseURL:N,headers:w}),[N]),F=eh(r,{onFilterChange:s,emptyCategory:!a.showExplore,onSearchSelect:c}),[D,ne]=q.useState(""),{data:Y=[],error:W,loading:U,run:H}=Zd(R),A=q.useMemo(()=>{const K=Il(Y,[ce=>ce.name],["asc"]),Ee=K.findIndex(ce=>ce.name==="All"||ce.locales.en==="All");return Ee>-1?[{...K[Ee],_id:"All"},...K.slice(0,Ee),...K.slice(Ee+1)]:K},[Y]),J=q.useCallback(ch(t),[t]),M=q.useMemo(()=>rh(A,t),[A,t]),ue=nh(J),Ie={search:F,compact:O,errors:{fetchCategoriesError:W},loadings:{fetchCategoriesLoading:U},extraFilter:h,endpoint:N,queryFilter:o,layout:{showExplore:a.showExplore??!1,showCategory:a.showCategory??!0,showTitle:a.showTitle??!0,showSearch:a.showSearch??!0},minItemWidth:n,wrapChildren:d,t:J,storeVersion:C,serverVersion:i,selectedCategory:F.filters.category||(a.showExplore?"":"All"),categoryList:A,blockletRender:$,locale:t,categoryOptions:M,priceOptions:ue,storeApi:R,baseSearch:u,showResourcesSwitch:j,showCategory:m,tagFilters:S,onFilterChange:s,getCategoryLocale:K=>{if(!K)return null;const Ee=Y.find(ce=>ce._id===K||ce.locales.en==="All");return Ee?Ee.locales[t]||Ee.locales.en:null},get developerName(){return D},updateDeveloperName:ne};return q.useEffect(()=>{setTimeout(H,f||0)},[N,H,f]),l.jsx(uh,{value:Ie,children:E})}function ct(){return q.useContext(ra)||na}function ia({children:e,onClick:t,size:r=32,...i}){return l.jsx(jn,{...i,onClick:t,variant:"outlined",sx:[{minWidth:r,height:r,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(i.sx)?i.sx:[i.sx]],children:e})}function Fn(e,t){return e===void 0?t:e}function gi({xs:e=void 0,sm:t=void 0,md:r=void 0,lg:i=void 0,xl:s=void 0,exact:n=!1}){const o=Ut(),a=Yt(o.breakpoints.down("sm")),d=Yt(o.breakpoints.between("sm","md")),h=Yt(o.breakpoints.between("md","lg")),u=Yt(o.breakpoints.between("lg","xl"));if(n)return a?e||null:d?t||null:h?r||null:u?i||null:s||null;let f=e;return a||(f=Fn(t,f),d)||(f=Fn(r,f),h)||(f=Fn(i,f),u)?f:Fn(s,f)}function hh({children:e}){const{open:t,toggleOpen:r}=mi();return l.jsx(gi,{xs:l.jsx(Aa,{open:t,onClose:()=>r(!1),children:e}),md:l.jsx(te,{children:e})})}function fh({loading:e=!1,disabled:t,...r}){return l.jsx(jn,{disableElevation:!0,disabled:t||e===!0,...r,sx:[{borderRadius:"4px"},...Array.isArray(r.sx)?r.sx:[r.sx]],startIcon:e&&l.jsx(Tt,{size:"1em"})})}function Qr({value:e,options:t,onChange:r,placeholder:i="",...s}){const n=q.useRef(null),o=Ut(),[a,d]=q.useState(!1),[h,u]=q.useState(e!==null?e:""),f=Yt(o.breakpoints.down("sm"));q.useEffect(()=>{u(e!==null?e:"")},[e]);const j=q.useCallback(()=>{d(!1)},[]),m=q.useCallback(()=>{d(!0)},[]);function S(C){u(C.value),r(C.value),f&&j()}function E(C){return C===h}return l.jsxs(l.Fragment,{children:[l.jsxs(ph,{ref:n,onClick:m,variant:"outlined",size:"medium",className:["my-select__selector",xn(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...s,children:[t.find(C=>C.value===h)?.name||i,l.jsx(Ba,{className:"my-select__arrowdown",component:Fa,sx:{width:18,height:18}})]}),l.jsx($a,{open:a,anchorEl:n.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:c})=>l.jsx(Ua,{...C,style:{transformOrigin:c==="bottom"?"center top":"center bottom"},children:l.jsx(qa,{children:l.jsx(Wa,{onClickAway:j,children:l.jsx(mh,{autoFocusItem:a,onMouseEnter:m,onMouseLeave:j,children:t.map(N=>l.jsxs(ni,{onClick:()=>S(N),sx:{fontSize:14},children:[l.jsx(Vo,{sx:{mr:1,fontSize:16,visibility:E(N.value)?"visible":"hidden"}}),N.name]},N.value))})})})})})]})}const ph=Qt(fh)`
489
+ `;const uo=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Eu=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},Ps={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function Wr({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?l.jsx(qo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Jo({[`& .${_a.tooltip}`]:{fontSize:s,fontWeight:n,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:o,display:"flex",alignItems:"center"}},i?.popper?.sx)}},children:r}):r}function Dn({icon:e=null,children:t=null,maxWidth:r=100,title:i=void 0,sx:s={}}){return(t===0||t)&&l.jsxs(lt,{direction:"row",sx:[{alignItems:"center",gap:.5},{maxWidth:r,overflow:"hidden"},...Array.isArray(s)?s:[s]],children:[e,l.jsx(Wr,{title:i||(typeof t=="string"?t:""),children:l.jsx(je,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function ku({...e}){const{title:t,description:r="",cover:i="",avatar:s,author:n,download:o,did:a,official:d,buttonText:h="Install",buttonDisabled:u,buttonLoading:f,button:j,onButtonClick:m=()=>{},onMainClick:S,className:E,ref:C,icons:c,status:N,...$}=e,O=Ut(),w=(Y,W=()=>!1)=>(q,...H)=>{const A=Y instanceof Function;(W()||A)&&(q.preventDefault(),q.stopPropagation(),A&&Y(...H))},R=S&&w(S),F=w(m,()=>!!(j||u||f)),D=U.isValidElement(t)?{children:t}:{title:uo(t),dangerouslySetInnerHTML:{__html:t}},ne=U.isValidElement(r)?{children:r}:{title:uo(r),dangerouslySetInnerHTML:{__html:r}};return l.jsxs(Na,{variant:"outlined",onClick:R,...$,sx:{p:{xs:2,md:3},borderRadius:1,...$.sx},children:[l.jsxs(lt,{direction:"row",sx:{flex:1,gap:1,alignItems:"center",overflow:"hidden","& > *":{flexShrink:0}},children:[l.jsx(Vn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),l.jsx(je,{className:"blocklet-title",...D,sx:[{fontWeight:"fontWeightMedium",fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...Array.isArray(D.sx)?D.sx:[D.sx]]}),l.jsxs(te,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&l.jsx(Wr,{title:d.tooltip,children:l.jsx(Aa,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),c?.map(Y=>l.jsx(Wr,{title:Y.title,children:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon,style:{color:Y.color}}):Y.icon},Y.key))]}),m&&l.jsxs(vt,{variant:"outlined",size:"small",disabled:u||f,style:{color:O.palette.text.primary,borderColor:O.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:O.typography.fontWeightMedium},onClick:F,children:[f&&l.jsx(Tt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),l.jsx(lt,{sx:{py:2},children:l.jsx(je,{className:"blocklet-description",variant:"body2",...ne,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(ne.sx)?ne.sx:[ne.sx]]})}),l.jsxs(lt,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(Dn,{icon:l.jsx(Vn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),l.jsx(Dn,{icon:l.jsx(yt,{icon:Ps}),title:o,children:Eu(o)}),N?.filter(Y=>Y.align!=="right").map(Y=>l.jsx(Dn,{icon:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,children:Y.text},Y.key)),l.jsx(te,{sx:{flex:1}}),N?.filter(Y=>Y.align==="right").map(Y=>l.jsx(Dn,{icon:typeof Y.icon=="string"?l.jsx(yt,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,sx:{color:Y.color},children:Y.text},Y.key))]})]})}const Tu={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},wn=/^[a-z0-9]+(-[a-z0-9]+)*$/,er=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),h={provider:s.length>0?s[0]:i,prefix:d,name:a};return t&&!qn(h)?null:h}const n=s[0],o=n.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!qn(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!qn(a,r)?null:a}return null},qn=(e,t)=>e?!!((e.provider===""||e.provider.match(wn))&&(t&&e.prefix===""||e.prefix.match(wn))&&e.name.match(wn)):!1,Ls=Object.freeze({left:0,top:0,width:16,height:16}),Kn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),li=Object.freeze({...Ls,...Kn}),zr=Object.freeze({...li,body:"",hidden:!1});function ju(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function ho(e,t){const r=ju(e,t);for(const i in zr)i in Kn?i in e&&!(i in r)&&(r[i]=Kn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Ou(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function n(o){if(r[o])return s[o]=[];if(!(o in s)){s[o]=null;const a=i[o]&&i[o].parent,d=a&&n(a);d&&(s[o]=[a].concat(d))}return s[o]}return Object.keys(r).concat(Object.keys(i)).forEach(n),s}function Cu(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=ho(i[a]||s[a],n)}return o(t),r.forEach(o),ho(e,n)}function _s(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=Ou(e);for(const s in i){const n=i[s];n&&(t(s,Cu(e,s,n)),r.push(s))}return r}const Iu={provider:"",aliases:{},not_found:{},...Ls};function kr(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ns(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!kr(e,Iu))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(wn)||typeof n.body!="string"||!kr(n,zr))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(wn)||typeof o!="string"||!r[o]&&!i[o]||!kr(n,zr))return null}return t}const fo=Object.create(null);function Ru(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function on(e,t){const r=fo[e]||(fo[e]=Object.create(null));return r[t]||(r[t]=Ru(e,t))}function ci(e,t){return Ns(t)?_s(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Pu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let En=!1;function As(e){return typeof e=="boolean"&&(En=e),En}function Lu(e){const t=typeof e=="string"?er(e,!0,En):e;if(t){const r=on(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function _u(e,t){const r=er(e,!0,En);if(!r)return!1;const i=on(r.provider,r.prefix);return Pu(i,r.name,t)}function Nu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),En&&!t&&!e.prefix){let s=!1;return Ns(e)&&(e.prefix="",_s(e,(n,o)=>{o&&_u(n,o)&&(s=!0)})),s}const r=e.prefix;if(!qn({provider:t,prefix:r,name:"a"}))return!1;const i=on(t,r);return!!ci(i,e)}const Ds=Object.freeze({width:null,height:null}),Ms=Object.freeze({...Ds,...Kn}),Au=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Du=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function po(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Au);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=Du.test(n);for(;;){if(o){const a=parseFloat(n);isNaN(a)?s.push(n):s.push(Math.ceil(a*t*r)/r)}else s.push(n);if(n=i.shift(),n===void 0)return s.join("");o=!o}}const Mu=e=>e==="unset"||e==="undefined"||e==="none";function Bu(e,t){const r={...li,...e},i={...Ms,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(S=>{const E=[],C=S.hFlip,c=S.vFlip;let N=S.rotate;C?c?N+=2:(E.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),E.push("scale(-1 1)"),s.top=s.left=0):c&&(E.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),E.push("scale(1 -1)"),s.top=s.left=0);let $;switch(N<0&&(N-=Math.floor(N/4)*4),N=N%4,N){case 1:$=s.height/2+s.top,E.unshift("rotate(90 "+$.toString()+" "+$.toString()+")");break;case 2:E.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:$=s.width/2+s.left,E.unshift("rotate(-90 "+$.toString()+" "+$.toString()+")");break}N%2===1&&(s.left!==s.top&&($=s.left,s.left=s.top,s.top=$),s.width!==s.height&&($=s.width,s.width=s.height,s.height=$)),E.length&&(n='<g transform="'+E.join(" ")+'">'+n+"</g>")});const o=i.width,a=i.height,d=s.width,h=s.height;let u,f;o===null?(f=a===null?"1em":a==="auto"?h:a,u=po(f,d/h)):(u=o==="auto"?d:o,f=a===null?po(u,h/d):a==="auto"?h:a);const j={},m=(S,E)=>{Mu(E)||(j[S]=E.toString())};return m("width",u),m("height",f),j.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+h.toString(),{attributes:j,body:n}}const Fu=/\sid="(\S+)"/g,$u="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Uu=0;function qu(e,t=$u){const r=[];let i;for(;i=Fu.exec(e);)r.push(i[1]);if(!r.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(n=>{const o=typeof t=="function"?t(n):t+(Uu++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const Vr=Object.create(null);function Wu(e,t){Vr[e]=t}function Kr(e){return Vr[e]||Vr[""]}function ui(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const di=Object.create(null),bn=["https://api.simplesvg.com","https://api.unisvg.com"],Wn=[];for(;bn.length>0;)bn.length===1||Math.random()>.5?Wn.push(bn.shift()):Wn.push(bn.pop());di[""]=ui({resources:["https://api.iconify.design"].concat(Wn)});function zu(e,t){const r=ui(t);return r===null?!1:(di[e]=r,!0)}function hi(e){return di[e]}const Vu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let mo=Vu();function Ku(e,t){const r=hi(e);if(!r)return 0;let i;if(!r.maxURL)i=0;else{let s=0;r.resources.forEach(o=>{s=Math.max(s,o.length)});const n=t+".json?icons=";i=r.maxURL-s-r.path.length-n.length}return i}function Gu(e){return e===404}const Hu=(e,t,r)=>{const i=[],s=Ku(e,t),n="icons";let o={type:n,provider:e,prefix:t,icons:[]},a=0;return r.forEach((d,h)=>{a+=d.length+1,a>=s&&h>0&&(i.push(o),o={type:n,provider:e,prefix:t,icons:[]},a=d.length),o.icons.push(d)}),i.push(o),i};function Xu(e){if(typeof e=="string"){const t=hi(e);if(t)return t.path}return"/"}const Yu=(e,t,r)=>{if(!mo){r("abort",424);return}let i=Xu(t.provider);switch(t.type){case"icons":{const n=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});i+=n+".json?"+d.toString();break}case"custom":{const n=t.uri;i+=n.slice(0,1)==="/"?n.slice(1):n;break}default:r("abort",400);return}let s=503;mo(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(Gu(o)?"abort":"next",o)});return}return s=501,n.json()}).then(n=>{if(typeof n!="object"||n===null){setTimeout(()=>{n===404?r("abort",n):r("next",s)});return}setTimeout(()=>{r("success",n)})}).catch(()=>{r("next",s)})},Ju={prepare:Hu,send:Yu};function Qu(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((s,n)=>s.provider!==n.provider?s.provider.localeCompare(n.provider):s.prefix!==n.prefix?s.prefix.localeCompare(n.prefix):s.name.localeCompare(n.name));let i={provider:"",prefix:"",name:""};return e.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const n=s.provider,o=s.prefix,a=s.name,d=r[n]||(r[n]=Object.create(null)),h=d[o]||(d[o]=on(n,o));let u;a in h.icons?u=t.loaded:o===""||h.missing.has(a)?u=t.missing:u=t.pending;const f={provider:n,prefix:o,name:a};u.push(f)}),t}function Bs(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Zu(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const i=e.provider,s=e.prefix;t.forEach(n=>{const o=n.icons,a=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==s)return!0;const h=d.name;if(e.icons[h])o.loaded.push({provider:i,prefix:s,name:h});else if(e.missing.has(h))o.missing.push({provider:i,prefix:s,name:h});else return r=!0,!0;return!1}),o.pending.length!==a&&(r||Bs([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let ed=0;function td(e,t,r){const i=ed++,s=Bs.bind(null,r,i);if(!t.pending.length)return s;const n={id:i,icons:t,callback:e,abort:s};return r.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(n)}),s}function nd(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?er(s,t,r):s;n&&i.push(n)}),i}var rd={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function id(e,t,r,i){const s=e.resources.length,n=e.random?Math.floor(Math.random()*s):e.index;let o;if(e.random){let R=e.resources.slice(0);for(o=[];R.length>1;){const F=Math.floor(Math.random()*R.length);o.push(R[F]),R=R.slice(0,F).concat(R.slice(F+1))}o=o.concat(R)}else o=e.resources.slice(n).concat(e.resources.slice(0,n));const a=Date.now();let d="pending",h=0,u,f=null,j=[],m=[];typeof i=="function"&&m.push(i);function S(){f&&(clearTimeout(f),f=null)}function E(){d==="pending"&&(d="aborted"),S(),j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function C(R,F){F&&(m=[]),typeof R=="function"&&m.push(R)}function c(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:C,abort:E}}function N(){d="failed",m.forEach(R=>{R(void 0,u)})}function $(){j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function O(R,F,D){const ne=F!=="success";switch(j=j.filter(Y=>Y!==R),d){case"pending":break;case"failed":if(ne||!e.dataAfterTimeout)return;break;default:return}if(F==="abort"){u=D,N();return}if(ne){u=D,j.length||(o.length?w():N());return}if(S(),$(),!e.random){const Y=e.resources.indexOf(R.resource);Y!==-1&&Y!==e.index&&(e.index=Y)}d="completed",m.forEach(Y=>{Y(D)})}function w(){if(d!=="pending")return;S();const R=o.shift();if(R===void 0){if(j.length){f=setTimeout(()=>{S(),d==="pending"&&($(),N())},e.timeout);return}N();return}const F={status:"pending",resource:R,callback:(D,ne)=>{O(F,D,ne)}};j.push(F),h++,f=setTimeout(w,e.rotate),r(R,t,F.callback)}return setTimeout(w),c}function Fs(e){const t={...rd,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=id(t,a,d,(f,j)=>{i(),h&&h(f,j)});return r.push(u),u}function n(a){return r.find(d=>a(d))||null}return{query:s,find:n,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function go(){}const Tr=Object.create(null);function od(e){if(!Tr[e]){const t=hi(e);if(!t)return;const r=Fs(t),i={config:t,redundancy:r};Tr[e]=i}return Tr[e]}function sd(e,t,r){let i,s;if(typeof e=="string"){const n=Kr(e);if(!n)return r(void 0,424),go;s=n.send;const o=od(e);o&&(i=o.redundancy)}else{const n=ui(e);if(n){i=Fs(n);const o=e.resources?e.resources[0]:"",a=Kr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),go):i.query(t,s,r)().abort}const vo="iconify2",kn="iconify",$s=kn+"-count",yo=kn+"-version",Us=36e5,ad=168;function Gr(e,t){try{return e.getItem(t)}catch{}}function fi(e,t,r){try{return e.setItem(t,r),!0}catch{}}function bo(e,t){try{e.removeItem(t)}catch{}}function Hr(e,t){return fi(e,$s,t.toString())}function Xr(e){return parseInt(Gr(e,$s))||0}const tr={local:!0,session:!0},qs={local:new Set,session:new Set};let pi=!1;function ld(e){pi=e}let Mn=typeof window>"u"?{}:window;function Ws(e){const t=e+"Storage";try{if(Mn&&Mn[t]&&typeof Mn[t].length=="number")return Mn[t]}catch{}tr[e]=!1}function zs(e,t){const r=Ws(e);if(!r)return;const i=Gr(r,yo);if(i!==vo){if(i){const a=Xr(r);for(let d=0;d<a;d++)bo(r,kn+d.toString())}fi(r,yo,vo),Hr(r,0);return}const s=Math.floor(Date.now()/Us)-ad,n=a=>{const d=kn+a.toString(),h=Gr(r,d);if(typeof h=="string"){try{const u=JSON.parse(h);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>s&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}bo(r,d)}};let o=Xr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,Hr(r,o)):qs[e].add(a))}function Vs(){if(!pi){ld(!0);for(const e in tr)zs(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=on(i,s);if(!ci(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function cd(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in tr)zs(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ud(e,t){pi||Vs();function r(i){let s;if(!tr[i]||!(s=Ws(i)))return;const n=qs[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Xr(s),!Hr(s,o+1))return;const a={cached:Math.floor(Date.now()/Us),provider:e.provider,data:t};return fi(s,kn+o.toString(),JSON.stringify(a))}t.lastModified&&!cd(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function xo(){}function dd(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Zu(e)}))}function hd(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:r,prefix:i}=e,s=e.iconsToLoad;delete e.iconsToLoad;let n;if(!s||!(n=Kr(r)))return;n.prepare(r,i,s).forEach(a=>{sd(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=ci(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ud(e,d)}catch(h){console.error(h)}dd(e)})})}))}const fd=(e,t)=>{const r=nd(e,!0,As()),i=Qu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,xo)}),()=>{d=!1}}const s=Object.create(null),n=[];let o,a;return i.pending.forEach(d=>{const{provider:h,prefix:u}=d;if(u===a&&h===o)return;o=h,a=u,n.push(on(h,u));const f=s[h]||(s[h]=Object.create(null));f[u]||(f[u]=[])}),i.pending.forEach(d=>{const{provider:h,prefix:u,name:f}=d,j=on(h,u),m=j.pendingIcons||(j.pendingIcons=new Set);m.has(f)||(m.add(f),s[h][u].push(f))}),n.forEach(d=>{const{provider:h,prefix:u}=d;s[h][u].length&&hd(d,s[h][u])}),t?td(t,i,n):xo};function pd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in Ds?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const md=/[\s,]+/;function gd(e,t){t.split(md).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function vd(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(r===""){const s=parseInt(e);return isNaN(s)?0:i(s)}else if(r!==e){let s=0;switch(r){case"%":s=25;break;case"deg":s=90}if(s){let n=parseFloat(e.slice(0,e.length-r.length));return isNaN(n)?0:(n=n/s,n%1===0?i(n):0)}}return t}function yd(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function bd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function xd(e){return"data:image/svg+xml,"+bd(e)}function wd(e){return'url("'+xd(e)+'")'}let Sn;function Sd(){try{Sn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Sn=null}}function Ed(e){return Sn===void 0&&Sd(),Sn?Sn.createHTML(e):e}const Ks={...Ms,inline:!1},kd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Td={display:"inline-block"},Yr={backgroundColor:"currentColor"},Gs={backgroundColor:"transparent"},wo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},So={WebkitMask:Yr,mask:Yr,background:Gs};for(const e in So){const t=So[e];for(const r in wo)t[e+r]=wo[r]}const jd={...Ks,inline:!0};function Eo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Od=(e,t,r,i)=>{const s=r?jd:Ks,n=pd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?kd:{},ref:i};for(let c in t){const N=t[c];if(N!==void 0)switch(c){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[c]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&gd(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[c]=vd(N):typeof N=="number"&&(n[c]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete h["aria-hidden"];break;default:s[c]===void 0&&(h[c]=N)}}const u=Bu(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let c=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:Ed(qu(u.body,N?()=>N+"ID"+c++:"iconifyReact"))},$t.createElement("svg",h)}const{body:j,width:m,height:S}=e,E=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),C=yd(j,{...f,width:m+"",height:S+""});return h.style={...a,"--svg":wd(C),width:Eo(f.width),height:Eo(f.height),...Td,...E?Yr:Gs,...d},$t.createElement("span",h)};As(!0);Wu("",Ju);if(typeof document<"u"&&typeof window<"u"){Vs();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Nu(i))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const i="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;zu(r,s)||console.error(i)}catch{console.error(i)}}}}class Hs extends $t.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const r=this.state,i=this.props.icon;if(typeof i=="object"&&i!==null&&typeof i.body=="string"){this._icon="",this._abortLoading(),(t||r.icon===null)&&this._setData({data:i});return}let s;if(typeof i!="string"||(s=er(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Lu(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:fd([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==i||r.icon===null){this._abortLoading(),this._icon=i;const o=["iconify"];s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),this._setData({data:n,classes:o}),this.props.onLoad&&this.props.onLoad(i)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,r=this.state.icon;if(r===null)return t.children?t.children:$t.createElement("span",{});let i=t;return r.classes&&(i={...t,className:(typeof t.className=="string"?t.className+" ":"")+r.classes.join(" ")}),Od({...li,...r.data},i,t._inline,t._ref)}}const Bt=$t.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return $t.createElement(Hs,i)});$t.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return $t.createElement(Hs,i)});var zn={exports:{}},Cd=zn.exports,ko;function Id(){return ko||(ko=1,function(e,t){(function(r,i){e.exports=i(Za())})(Cd,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(C,c,N,$,O,w){if(w!==u){var R=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw R.name="Invariant Violation",R}}function S(){return m}m.isRequired=m;var E={array:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:S,element:m,elementType:m,instanceOf:S,node:m,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:j,resetWarningCache:f};return E.PropTypes=E,E}},697:(a,d,h)=>{a.exports=h(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:a=>{var d=typeof Element<"u",h=typeof Map=="function",u=typeof Set=="function",f=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function j(m,S){if(m===S)return!0;if(m&&S&&typeof m=="object"&&typeof S=="object"){if(m.constructor!==S.constructor)return!1;var E,C,c,N;if(Array.isArray(m)){if((E=m.length)!=S.length)return!1;for(C=E;C--!=0;)if(!j(m[C],S[C]))return!1;return!0}if(h&&m instanceof Map&&S instanceof Map){if(m.size!==S.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!S.has(C.value[0]))return!1;for(N=m.entries();!(C=N.next()).done;)if(!j(C.value[1],S.get(C.value[0])))return!1;return!0}if(u&&m instanceof Set&&S instanceof Set){if(m.size!==S.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!S.has(C.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(S)){if((E=m.length)!=S.length)return!1;for(C=E;C--!=0;)if(m[C]!==S[C])return!1;return!0}if(m.constructor===RegExp)return m.source===S.source&&m.flags===S.flags;if(m.valueOf!==Object.prototype.valueOf)return m.valueOf()===S.valueOf();if(m.toString!==Object.prototype.toString)return m.toString()===S.toString();if((E=(c=Object.keys(m)).length)!==Object.keys(S).length)return!1;for(C=E;C--!=0;)if(!Object.prototype.hasOwnProperty.call(S,c[C]))return!1;if(d&&m instanceof Element)return!1;for(C=E;C--!=0;)if((c[C]!=="_owner"&&c[C]!=="__v"&&c[C]!=="__o"||!m.$$typeof)&&!j(m[c[C]],S[c[C]]))return!1;return!0}return m!=m&&S!=S}a.exports=function(m,S){try{return j(m,S)}catch(E){if((E.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw E}}},359:a=>{a.exports=r}},s={};function n(a){var d=s[a];if(d!==void 0)return d.exports;var h=s[a]={exports:{}};return i[a](h,h.exports,n),h.exports}n.n=a=>{var d=a&&a.__esModule?()=>a.default:()=>a;return n.d(d,{a:d}),d},n.d=(a,d)=>{for(var h in d)n.o(d,h)&&!n.o(a,h)&&Object.defineProperty(a,h,{enumerable:!0,get:d[h]})},n.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),n.o=(a,d)=>Object.prototype.hasOwnProperty.call(a,d),n.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o={};return(()=>{function a(x){var g,T,I="";if(typeof x=="string"||typeof x=="number")I+=x;else if(typeof x=="object")if(Array.isArray(x))for(g=0;g<x.length;g++)x[g]&&(T=a(x[g]))&&(I&&(I+=" "),I+=T);else for(g in x)x[g]&&(I&&(I+=" "),I+=g);return I}function d(){for(var x,g,T=0,I="";T<arguments.length;)(x=arguments[T++])&&(g=a(x))&&(I&&(I+=" "),I+=g);return I}n.r(o),n.d(o,{default:()=>ya});var h=n(359),u=n.n(h);const f=function(x){var g=typeof x;return x!=null&&(g=="object"||g=="function")},j=typeof Rn=="object"&&Rn&&Rn.Object===Object&&Rn;var m=typeof self=="object"&&self&&self.Object===Object&&self;const S=j||m||Function("return this")(),E=function(){return S.Date.now()};var C=/\s/,c=/^\s+/;const N=function(x){return x&&x.slice(0,function(g){for(var T=g.length;T--&&C.test(g.charAt(T)););return T}(x)+1).replace(c,"")},$=S.Symbol;var O=Object.prototype,w=O.hasOwnProperty,R=O.toString,F=$?$.toStringTag:void 0,D=Object.prototype.toString,ne=$?$.toStringTag:void 0;const Y=function(x){return x==null?x===void 0?"[object Undefined]":"[object Null]":ne&&ne in Object(x)?function(g){var T=w.call(g,F),I=g[F];try{g[F]=void 0;var Q=!0}catch{}var fe=R.call(g);return Q&&(T?g[F]=I:delete g[F]),fe}(x):function(g){return D.call(g)}(x)};var W=/^[-+]0x[0-9a-f]+$/i,q=/^0b[01]+$/i,H=/^0o[0-7]+$/i,A=parseInt;const J=function(x){if(typeof x=="number")return x;if(function(I){return typeof I=="symbol"||function(Q){return Q!=null&&typeof Q=="object"}(I)&&Y(I)=="[object Symbol]"}(x))return NaN;if(f(x)){var g=typeof x.valueOf=="function"?x.valueOf():x;x=f(g)?g+"":g}if(typeof x!="string")return x===0?x:+x;x=N(x);var T=q.test(x);return T||H.test(x)?A(x.slice(2),T?2:8):W.test(x)?NaN:+x};var M=Math.max,ue=Math.min;const Ie=function(x,g,T){var I,Q,fe,Ce,y,v,P=0,G=!1,Z=!1,X=!0;if(typeof x!="function")throw new TypeError("Expected a function");function be(pe){var Te=I,_e=Q;return I=Q=void 0,P=pe,Ce=x.apply(_e,Te)}function ye(pe){return P=pe,y=setTimeout(ie,g),G?be(pe):Ce}function ke(pe){var Te=pe-v;return v===void 0||Te>=g||Te<0||Z&&pe-P>=fe}function ie(){var pe=E();if(ke(pe))return se(pe);y=setTimeout(ie,function(Te){var _e=g-(Te-v);return Z?ue(_e,fe-(Te-P)):_e}(pe))}function se(pe){return y=void 0,X&&I?be(pe):(I=Q=void 0,Ce)}function le(){var pe=E(),Te=ke(pe);if(I=arguments,Q=this,v=pe,Te){if(y===void 0)return ye(v);if(Z)return clearTimeout(y),y=setTimeout(ie,g),be(v)}return y===void 0&&(y=setTimeout(ie,g)),Ce}return g=J(g)||0,f(T)&&(G=!!T.leading,fe=(Z="maxWait"in T)?M(J(T.maxWait)||0,g):fe,X="trailing"in T?!!T.trailing:X),le.cancel=function(){y!==void 0&&clearTimeout(y),P=0,I=v=Q=y=void 0},le.flush=function(){return y===void 0?Ce:se(E())},le},K=function(x,g,T){var I=!0,Q=!0;if(typeof x!="function")throw new TypeError("Expected a function");return f(T)&&(I="leading"in T?!!T.leading:I,Q="trailing"in T?!!T.trailing:Q),Ie(x,g,{leading:I,maxWait:g,trailing:Q})};var Ee=n(590),ce=n.n(Ee),Me=function(){if(typeof Map<"u")return Map;function x(g,T){var I=-1;return g.some(function(Q,fe){return Q[0]===T&&(I=fe,!0)}),I}return function(){function g(){this.__entries__=[]}return Object.defineProperty(g.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),g.prototype.get=function(T){var I=x(this.__entries__,T),Q=this.__entries__[I];return Q&&Q[1]},g.prototype.set=function(T,I){var Q=x(this.__entries__,T);~Q?this.__entries__[Q][1]=I:this.__entries__.push([T,I])},g.prototype.delete=function(T){var I=this.__entries__,Q=x(I,T);~Q&&I.splice(Q,1)},g.prototype.has=function(T){return!!~x(this.__entries__,T)},g.prototype.clear=function(){this.__entries__.splice(0)},g.prototype.forEach=function(T,I){I===void 0&&(I=null);for(var Q=0,fe=this.__entries__;Q<fe.length;Q++){var Ce=fe[Q];T.call(I,Ce[1],Ce[0])}},g}()}(),me=typeof window<"u"&&typeof document<"u"&&window.document===document,Oe=n.g!==void 0&&n.g.Math===Math?n.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Pe=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Oe):function(x){return setTimeout(function(){return x(Date.now())},1e3/60)},nt=["top","right","bottom","left","width","height","size","weight"],ut=typeof MutationObserver<"u",ft=function(){function x(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(g,T){var I=!1,Q=!1,fe=0;function Ce(){I&&(I=!1,g()),Q&&v()}function y(){Pe(Ce)}function v(){var P=Date.now();if(I){if(P-fe<2)return;Q=!0}else I=!0,Q=!1,setTimeout(y,20);fe=P}return v}(this.refresh.bind(this))}return x.prototype.addObserver=function(g){~this.observers_.indexOf(g)||this.observers_.push(g),this.connected_||this.connect_()},x.prototype.removeObserver=function(g){var T=this.observers_,I=T.indexOf(g);~I&&T.splice(I,1),!T.length&&this.connected_&&this.disconnect_()},x.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},x.prototype.updateObservers_=function(){var g=this.observers_.filter(function(T){return T.gatherActive(),T.hasActive()});return g.forEach(function(T){return T.broadcastActive()}),g.length>0},x.prototype.connect_=function(){me&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ut?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},x.prototype.disconnect_=function(){me&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},x.prototype.onTransitionEnd_=function(g){var T=g.propertyName,I=T===void 0?"":T;nt.some(function(Q){return!!~I.indexOf(Q)})&&this.refresh()},x.getInstance=function(){return this.instance_||(this.instance_=new x),this.instance_},x.instance_=null,x}(),rt=function(x,g){for(var T=0,I=Object.keys(g);T<I.length;T++){var Q=I[T];Object.defineProperty(x,Q,{value:g[Q],enumerable:!1,writable:!1,configurable:!0})}return x},we=function(x){return x&&x.ownerDocument&&x.ownerDocument.defaultView||Oe},de=Ae(0,0,0,0);function ge(x){return parseFloat(x)||0}function Fe(x){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(I,Q){return I+ge(x["border-"+Q+"-width"])},0)}var $e=typeof SVGGraphicsElement<"u"?function(x){return x instanceof we(x).SVGGraphicsElement}:function(x){return x instanceof we(x).SVGElement&&typeof x.getBBox=="function"};function jt(x){return me?$e(x)?function(g){var T=g.getBBox();return Ae(0,0,T.width,T.height)}(x):function(g){var T=g.clientWidth,I=g.clientHeight;if(!T&&!I)return de;var Q=we(g).getComputedStyle(g),fe=function(X){for(var be={},ye=0,ke=["top","right","bottom","left"];ye<ke.length;ye++){var ie=ke[ye],se=X["padding-"+ie];be[ie]=ge(se)}return be}(Q),Ce=fe.left+fe.right,y=fe.top+fe.bottom,v=ge(Q.width),P=ge(Q.height);if(Q.boxSizing==="border-box"&&(Math.round(v+Ce)!==T&&(v-=Fe(Q,"left","right")+Ce),Math.round(P+y)!==I&&(P-=Fe(Q,"top","bottom")+y)),!function(X){return X===we(X).document.documentElement}(g)){var G=Math.round(v+Ce)-T,Z=Math.round(P+y)-I;Math.abs(G)!==1&&(v-=G),Math.abs(Z)!==1&&(P-=Z)}return Ae(fe.left,fe.top,v,P)}(x):de}function Ae(x,g,T,I){return{x,y:g,width:T,height:I}}var Et=function(){function x(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ae(0,0,0,0),this.target=g}return x.prototype.isActive=function(){var g=jt(this.target);return this.contentRect_=g,g.width!==this.broadcastWidth||g.height!==this.broadcastHeight},x.prototype.broadcastRect=function(){var g=this.contentRect_;return this.broadcastWidth=g.width,this.broadcastHeight=g.height,g},x}(),Ot=function(x,g){var T,I,Q,fe,Ce,y,v,P=(I=(T=g).x,Q=T.y,fe=T.width,Ce=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),rt(v,{x:I,y:Q,width:fe,height:Ce,top:Q,right:I+fe,bottom:Ce+Q,left:I}),v);rt(this,{target:x,contentRect:P})},Ct=function(){function x(g,T,I){if(this.activeObservations_=[],this.observations_=new Me,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=I}return x.prototype.observe=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof we(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)||(T.set(g,new Et(g)),this.controller_.addObserver(this),this.controller_.refresh())}},x.prototype.unobserve=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof we(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)&&(T.delete(g),T.size||this.controller_.removeObserver(this))}},x.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},x.prototype.gatherActive=function(){var g=this;this.clearActive(),this.observations_.forEach(function(T){T.isActive()&&g.activeObservations_.push(T)})},x.prototype.broadcastActive=function(){if(this.hasActive()){var g=this.callbackCtx_,T=this.activeObservations_.map(function(I){return new Ot(I.target,I.broadcastRect())});this.callback_.call(g,T,g),this.clearActive()}},x.prototype.clearActive=function(){this.activeObservations_.splice(0)},x.prototype.hasActive=function(){return this.activeObservations_.length>0},x}(),It=typeof WeakMap<"u"?new WeakMap:new Me,Ve=function x(g){if(!(this instanceof x))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var T=ft.getInstance(),I=new Ct(g,T,this);It.set(this,I)};["observe","unobserve","disconnect"].forEach(function(x){Ve.prototype[x]=function(){var g;return(g=It.get(this))[x].apply(g,arguments)}});const Rt=Oe.ResizeObserver!==void 0?Oe.ResizeObserver:Ve,pt="Left",st="Right",V="Up",he="Down",De={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Xe={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},it="mousemove",wt="mouseup";function qt(x,g){if(g===0)return x;const T=Math.PI/180*g;return[x[0]*Math.cos(T)+x[1]*Math.sin(T),x[1]*Math.cos(T)-x[0]*Math.sin(T)]}function Ue(x){const{trackMouse:g}=x,T=h.useRef(Object.assign({},Xe)),I=h.useRef(Object.assign({},De)),Q=h.useRef(Object.assign({},I.current));let fe;for(fe in Q.current=Object.assign({},I.current),I.current=Object.assign(Object.assign({},De),x),De)I.current[fe]===void 0&&(I.current[fe]=De[fe]);const[Ce,y]=h.useMemo(()=>function(v,P){const G=ie=>{const se="touches"in ie;se&&ie.touches.length>1||v((le,pe)=>{pe.trackMouse&&!se&&(document.addEventListener(it,Z),document.addEventListener(wt,be));const{clientX:Te,clientY:_e}=se?ie.touches[0]:ie,ze=qt([Te,_e],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:ie}),Object.assign(Object.assign(Object.assign({},le),Xe),{initial:ze.slice(),xy:ze,start:ie.timeStamp||0})})},Z=ie=>{v((se,le)=>{const pe="touches"in ie;if(pe&&ie.touches.length>1)return se;if(ie.timeStamp-se.start>le.swipeDuration)return se.swiping?Object.assign(Object.assign({},se),{swiping:!1}):se;const{clientX:Te,clientY:_e}=pe?ie.touches[0]:ie,[ze,dt]=qt([Te,_e],le.rotationAngle),at=ze-se.xy[0],Ze=dt-se.xy[1],We=Math.abs(at),Ne=Math.abs(Ze),Kt=(ie.timeStamp||0)-se.start,fn=Math.sqrt(We*We+Ne*Ne)/(Kt||1),pn=[at/(Kt||1),Ze/(Kt||1)],Dt=function(mn,un,gn,mt){return mn>un?gn>0?st:pt:mt>0?he:V}(We,Ne,at,Ze),nn=typeof le.delta=="number"?le.delta:le.delta[Dt.toLowerCase()]||De.delta;if(We<nn&&Ne<nn&&!se.swiping)return se;const Lt={absX:We,absY:Ne,deltaX:at,deltaY:Ze,dir:Dt,event:ie,first:se.first,initial:se.initial,velocity:fn,vxvy:pn};Lt.first&&le.onSwipeStart&&le.onSwipeStart(Lt),le.onSwiping&&le.onSwiping(Lt);let cn=!1;return(le.onSwiping||le.onSwiped||le[`onSwiped${Dt}`])&&(cn=!0),cn&&le.preventScrollOnSwipe&&le.trackTouch&&ie.cancelable&&ie.preventDefault(),Object.assign(Object.assign({},se),{first:!1,eventData:Lt,swiping:!0})})},X=ie=>{v((se,le)=>{let pe;if(se.swiping&&se.eventData){if(ie.timeStamp-se.start<le.swipeDuration){pe=Object.assign(Object.assign({},se.eventData),{event:ie}),le.onSwiped&&le.onSwiped(pe);const Te=le[`onSwiped${pe.dir}`];Te&&Te(pe)}}else le.onTap&&le.onTap({event:ie});return le.onTouchEndOrOnMouseUp&&le.onTouchEndOrOnMouseUp({event:ie}),Object.assign(Object.assign(Object.assign({},se),Xe),{eventData:pe})})},be=ie=>{document.removeEventListener(it,Z),document.removeEventListener(wt,be),X(ie)},ye=(ie,se)=>{let le=()=>{};if(ie&&ie.addEventListener){const pe=Object.assign(Object.assign({},De.touchEventOptions),se.touchEventOptions),Te=[["touchstart",G,pe],["touchmove",Z,Object.assign(Object.assign({},pe),se.preventScrollOnSwipe?{passive:!1}:{})],["touchend",X,pe]];Te.forEach(([_e,ze,dt])=>ie.addEventListener(_e,ze,dt)),le=()=>Te.forEach(([_e,ze])=>ie.removeEventListener(_e,ze))}return le},ke={ref:ie=>{ie!==null&&v((se,le)=>{if(se.el===ie)return se;const pe={};return se.el&&se.el!==ie&&se.cleanUpTouch&&(se.cleanUpTouch(),pe.cleanUpTouch=void 0),le.trackTouch&&ie&&(pe.cleanUpTouch=ye(ie,le)),Object.assign(Object.assign(Object.assign({},se),{el:ie}),pe)})}};return P.trackMouse&&(ke.onMouseDown=G),[ke,ye]}(v=>T.current=v(T.current,I.current),{trackMouse:g}),[g]);return T.current=function(v,P,G,Z){return P.trackTouch&&v.el?v.cleanUpTouch?P.preventScrollOnSwipe!==G.preventScrollOnSwipe||P.touchEventOptions.passive!==G.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Z(v.el,P)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Z(v.el,P)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,I.current,Q.current,y),Ce}var L=n(697);function re(x){return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},re(x)}function ve(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function Re(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ve(Object(T),!0).forEach(function(I){p(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):ve(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function p(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(re(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(re(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return re(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var b={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},k=u().memo(function(x){var g=Re(Re({},b),x),T=g.description,I=g.fullscreen,Q=g.handleImageLoaded,fe=g.isFullscreen,Ce=g.onImageError,y=g.original,v=g.originalAlt,P=g.originalHeight,G=g.originalWidth,Z=g.originalTitle,X=g.sizes,be=g.srcSet,ye=g.loading,ke=fe&&I||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:ke,alt:v,srcSet:be,height:P,width:G,sizes:X,title:Z,onLoad:function(ie){return Q(ie,y)},onError:Ce,loading:ye}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:L.string,fullscreen:L.string,handleImageLoaded:L.func.isRequired,isFullscreen:L.bool,onImageError:L.func.isRequired,original:L.string.isRequired,originalAlt:L.string,originalHeight:L.string,originalWidth:L.string,originalTitle:L.string,sizes:L.string,srcSet:L.string,loading:L.string};const _=k;function z(x){return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},z(x)}function ee(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function oe(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ee(Object(T),!0).forEach(function(I){Se(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):ee(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function Se(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(z(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(z(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return z(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var xe={left:u().createElement("polyline",{points:"15 18 9 12 15 6"}),right:u().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:u().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:u().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:u().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:u().createElement(u().Fragment,null,u().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),u().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Qe={strokeWidth:1,viewBox:"0 0 24 24"},Je=function(x){var g=oe(oe({},Qe),x),T=g.strokeWidth,I=g.viewBox,Q=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:I,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},xe[Q])};Je.propTypes={strokeWidth:L.number,viewBox:L.string,icon:(0,L.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Le=Je;var Be=u().memo(function(x){var g=x.isFullscreen,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:T,"aria-label":"Open Fullscreen"},u().createElement(Le,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Be.displayName="Fullscreen",Be.propTypes={isFullscreen:L.bool.isRequired,onClick:L.func.isRequired};const Ye=Be;var At=u().memo(function(x){var g=x.disabled,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:g,onClick:T,"aria-label":"Previous Slide"},u().createElement(Le,{icon:"left",viewBox:"6 0 12 24"}))});At.displayName="LeftNav",At.propTypes={disabled:L.bool.isRequired,onClick:L.func.isRequired};const sn=At;var Zt=u().memo(function(x){var g=x.disabled,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:g,onClick:T,"aria-label":"Next Slide"},u().createElement(Le,{icon:"right",viewBox:"6 0 12 24"}))});Zt.displayName="RightNav",Zt.propTypes={disabled:L.bool.isRequired,onClick:L.func.isRequired};const rr=Zt;var ot=u().memo(function(x){var g=x.isPlaying,T=x.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:T,"aria-label":"Play or Pause Slideshow"},u().createElement(Le,{strokeWidth:2,icon:g?"pause":"play"}))});ot.displayName="PlayPause",ot.propTypes={isPlaying:L.bool.isRequired,onClick:L.func.isRequired};const hn=ot;function Pt(x){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Pt(x)}function Wt(){return Wt=Object.assign?Object.assign.bind():function(x){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(x[I]=T[I])}return x},Wt.apply(this,arguments)}function an(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function ln(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?an(Object(T),!0).forEach(function(I){Cn(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):an(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function Cn(x,g,T){return(g=function(I){var Q=function(fe,Ce){if(Pt(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Ce);if(Pt(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return Pt(Q)==="symbol"?Q:String(Q)}(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}var zt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},en=function(x){var g=ln(ln({},zt),x),T=g.children,I=g.className,Q=Ue({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Wt({},Q,{className:I}),T)};en.propTypes={children:L.node.isRequired,className:L.string,delta:L.number,onSwiped:L.func,onSwiping:L.func};const tn=en;function Vt(x){return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Vt(x)}function bi(x,g){var T=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);g&&(I=I.filter(function(Q){return Object.getOwnPropertyDescriptor(x,Q).enumerable})),T.push.apply(T,I)}return T}function xi(x){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?bi(Object(T),!0).forEach(function(I){wi(x,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(T)):bi(Object(T)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(T,I))})}return x}function ma(x,g){for(var T=0;T<g.length;T++){var I=g[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,Si(I.key),I)}}function ir(x,g){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,I){return T.__proto__=I,T},ir(x,g)}function ga(x,g){if(g&&(Vt(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ke(x)}function Ke(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function In(x){return In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},In(x)}function wi(x,g,T){return(g=Si(g))in x?Object.defineProperty(x,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[g]=T,x}function Si(x){var g=function(T,I){if(Vt(T)!=="object"||T===null)return T;var Q=T[Symbol.toPrimitive];if(Q!==void 0){var fe=Q.call(T,I);if(Vt(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(x,"string");return Vt(g)==="symbol"?g:String(g)}var Ei=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],va=(0,L.arrayOf)((0,L.shape)({srcSet:L.string,media:L.string}));function ki(x){var g=parseInt(x.keyCode||x.which||0,10);return g===66||g===62}var or=function(x){(function(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),v&&ir(y,v)})(Ce,x);var g,T,I,Q,fe=(I=Ce,Q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var y,v=In(I);if(Q){var P=In(this).constructor;y=Reflect.construct(v,arguments,P)}else y=v.apply(this,arguments);return ga(this,y)});function Ce(y){var v;return function(P,G){if(!(P instanceof G))throw new TypeError("Cannot call a class as a function")}(this,Ce),wi(Ke(v=fe.call(this,y)),"onBulletClick",function(P,G){var Z=v.props,X=Z.onBulletClick,be=Z.items,ye=v.state.currentIndex;P.target.blur(),ye!==G&&(be.length===2?v.slideToIndexWithStyleReset(G,P):v.slideToIndex(G,P)),X&&X(P,G)}),v.state={currentIndex:y.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(y.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},v.loadedImages={},v.imageGallery=u().createRef(),v.thumbnailsWrapper=u().createRef(),v.thumbnails=u().createRef(),v.imageGallerySlideWrapper=u().createRef(),v.handleImageLoaded=v.handleImageLoaded.bind(Ke(v)),v.handleKeyDown=v.handleKeyDown.bind(Ke(v)),v.handleMouseDown=v.handleMouseDown.bind(Ke(v)),v.handleResize=v.handleResize.bind(Ke(v)),v.handleTouchMove=v.handleTouchMove.bind(Ke(v)),v.handleOnSwiped=v.handleOnSwiped.bind(Ke(v)),v.handleScreenChange=v.handleScreenChange.bind(Ke(v)),v.handleSwiping=v.handleSwiping.bind(Ke(v)),v.handleThumbnailSwiping=v.handleThumbnailSwiping.bind(Ke(v)),v.handleOnThumbnailSwiped=v.handleOnThumbnailSwiped.bind(Ke(v)),v.onThumbnailMouseLeave=v.onThumbnailMouseLeave.bind(Ke(v)),v.handleImageError=v.handleImageError.bind(Ke(v)),v.pauseOrPlay=v.pauseOrPlay.bind(Ke(v)),v.renderThumbInner=v.renderThumbInner.bind(Ke(v)),v.renderItem=v.renderItem.bind(Ke(v)),v.slideLeft=v.slideLeft.bind(Ke(v)),v.slideRight=v.slideRight.bind(Ke(v)),v.toggleFullScreen=v.toggleFullScreen.bind(Ke(v)),v.togglePlay=v.togglePlay.bind(Ke(v)),v.unthrottledSlideToIndex=v.slideToIndex,v.slideToIndex=K(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Ce,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,P=y.useWindowKeyDown;v&&this.play(),P?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(y,v){var P=this.props,G=P.items,Z=P.lazyLoad,X=P.slideDuration,be=P.slideInterval,ye=P.startIndex,ke=P.thumbnailPosition,ie=P.showThumbnails,se=P.useWindowKeyDown,le=this.state,pe=le.currentIndex,Te=le.isPlaying,_e=y.items.length!==G.length,ze=!ce()(y.items,G),dt=y.startIndex!==ye,at=y.thumbnailPosition!==ke,Ze=y.showThumbnails!==ie;be===y.slideInterval&&X===y.slideDuration||Te&&(this.pause(),this.play()),at&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ze&&ie&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ze&&!ie&&this.removeThumbnailsResizeObserver(),(_e||Ze)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==X&&(this.slideToIndex=K(this.unthrottledSlideToIndex,X,{trailing:!1})),!Z||y.lazyLoad&&!ze||(this.lazyLoaded=[]),se!==y.useWindowKeyDown&&(se?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(dt||ze)&&this.setState({currentIndex:ye,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var y=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),y?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var y=this,v=this.state,P=v.currentIndex,G=v.isTransitioning,Z=this.props,X=Z.onSlide,be=Z.slideDuration;this.transitionTimer=window.setTimeout(function(){G&&(y.setState({isTransitioning:!G,isSwipingThumbnail:!1}),X&&X(P))},be+50)}},{key:"onThumbnailClick",value:function(y,v){var P=this.props,G=P.onThumbnailClick,Z=P.items,X=this.state.currentIndex;y.target.parentNode.parentNode.blur(),X!==v&&(Z.length===2?this.slideToIndexWithStyleReset(v,y):this.slideToIndex(v,y)),G&&G(y,v)}},{key:"onThumbnailMouseOver",value:function(y,v){var P=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){P.slideToIndex(v),P.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var y=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,y&&this.play()}}},{key:"setThumbsTranslate",value:function(y){this.setState({thumbsTranslate:y})}},{key:"setModalFullscreen",value:function(y){var v=this.props.onScreenChange;this.setState({modalFullscreen:y}),v&&v(y)}},{key:"getThumbsTranslate",value:function(y){var v,P=this.props,G=P.disableThumbnailScroll,Z=P.items,X=this.state,be=X.thumbnailsWrapperWidth,ye=X.thumbnailsWrapperHeight,ke=this.thumbnails&&this.thumbnails.current;if(G)return 0;if(ke){if(this.isThumbnailVertical()){if(ke.scrollHeight<=ye)return 0;v=ke.scrollHeight-ye}else{if(ke.scrollWidth<=be||be<=0)return 0;v=ke.scrollWidth-be}return y*(v/(Z.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(y){switch(y){case"left":y=" ".concat("image-gallery-thumbnails-left");break;case"right":y=" ".concat("image-gallery-thumbnails-right");break;case"bottom":y=" ".concat("image-gallery-thumbnails-bottom");break;case"top":y=" ".concat("image-gallery-thumbnails-top")}return y}},{key:"getAlignmentClassName",value:function(y){var v=this.state.currentIndex,P=this.props,G=P.infinite,Z=P.items,X="",be="image-gallery-left",ye="image-gallery-right";switch(y){case v-1:X=" ".concat(be);break;case v:X=" ".concat("image-gallery-center");break;case v+1:X=" ".concat(ye)}return Z.length>=3&&G&&(y===0&&v===Z.length-1?X=" ".concat(ye):y===Z.length-1&&v===0&&(X=" ".concat(be))),X}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Z=v.previousIndex,X=P!==Z,be=y===0&&Z===0,ye=y===1&&Z===1,ke=y===0&&P===1,ie=y===1&&P===0,se=G===0,le=-100*P+100*y+G;return G>0?this.direction="left":G<0&&(this.direction="right"),ie&&G>0&&(le=-100+G),ke&&G<0&&(le=100+G),X?be&&se&&this.direction==="left"?le=100:ye&&se&&this.direction==="right"&&(le=-100):(ie&&se&&this.direction==="left"&&(le=-100),ke&&se&&this.direction==="right"&&(le=100)),le}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Z=v.slideStyle,X=this.props,be=X.infinite,ye=X.items,ke=X.useTranslate3D,ie=X.isRTL,se=-100*P,le=ye.length-1,pe=(se+100*y)*(ie?-1:1)+G;be&&ye.length>2&&(P===0&&y===le?pe=-100*(ie?-1:1)+G:P===le&&y===0&&(pe=100*(ie?-1:1)+G)),be&&ye.length===2&&(pe=this.getTranslateXForTwoSlide(y));var Te="translate(".concat(pe,"%, 0)");return ke&&(Te="translate3d(".concat(pe,"%, 0, 0)")),xi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:Te,MozTransform:Te,msTransform:Te,OTransform:Te,transform:Te},Z)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,P=v.useTranslate3D,G=v.isRTL,Z=this.state,X=Z.thumbsTranslate,be=Z.thumbsStyle,ye=G?-1*X:X;return this.isThumbnailVertical()?(y="translate(0, ".concat(X,"px)"),P&&(y="translate3d(0, ".concat(X,"px, 0)"))):(y="translate(".concat(ye,"px, 0)"),P&&(y="translate3d(".concat(ye,"px, 0, 0)"))),xi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},be)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,P=this.props,G=P.items,Z=P.slideOnThumbnailOver,X=P.onClick,be=P.lazyLoad,ye=P.onTouchMove,ke=P.onTouchEnd,ie=P.onTouchStart,se=P.onMouseOver,le=P.onMouseLeave,pe=P.renderItem,Te=P.renderThumbInner,_e=P.showThumbnails,ze=P.showBullets,dt=[],at=[],Ze=[];return G.forEach(function(We,Ne){var Kt=y.getAlignmentClassName(Ne),fn=We.originalClass?" ".concat(We.originalClass):"",pn=We.thumbnailClass?" ".concat(We.thumbnailClass):"",Dt=We.renderItem||pe||y.renderItem,nn=We.renderThumbInner||Te||y.renderThumbInner,Lt=!be||Kt||y.lazyLoaded[Ne];Lt&&be&&!y.lazyLoaded[Ne]&&(y.lazyLoaded[Ne]=!0);var cn=y.getSlideStyle(Ne),mn=u().createElement("div",{"aria-label":"Go to Slide ".concat(Ne+1),key:"slide-".concat(Ne),tabIndex:"-1",className:"image-gallery-slide ".concat(Kt," ").concat(fn),style:cn,onClick:X,onKeyUp:y.handleSlideKeyUp,onTouchMove:ye,onTouchEnd:ke,onTouchStart:ie,onMouseOver:se,onFocus:se,onMouseLeave:le,role:"button"},Lt?Dt(We):u().createElement("div",{style:{height:"100%"}}));if(dt.push(mn),_e&&We.thumbnail){var un=d("image-gallery-thumbnail",pn,{active:v===Ne});at.push(u().createElement("button",{key:"thumbnail-".concat(Ne),type:"button",tabIndex:"0","aria-pressed":v===Ne?"true":"false","aria-label":"Go to Slide ".concat(Ne+1),className:un,onMouseLeave:Z?y.onThumbnailMouseLeave:null,onMouseOver:function(mt){return y.handleThumbnailMouseOver(mt,Ne)},onFocus:function(mt){return y.handleThumbnailMouseOver(mt,Ne)},onKeyUp:function(mt){return y.handleThumbnailKeyUp(mt,Ne)},onClick:function(mt){return y.onThumbnailClick(mt,Ne)}},nn(We)))}if(ze){var gn=d("image-gallery-bullet",We.bulletClass,{active:v===Ne});Ze.push(u().createElement("button",{type:"button",key:"bullet-".concat(Ne),className:gn,onClick:function(mt){return y.onBulletClick(mt,Ne)},"aria-pressed":v===Ne?"true":"false","aria-label":"Go to Slide ".concat(Ne+1)}))}}),{slides:dt,thumbnails:at,bullets:Ze}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,P=v.previousIndex,G=v.currentIndex,Z=y.length-1;return Math.abs(P-G)>1&&!(P===0&&G===Z)&&!(P===Z&&G===0)}},{key:"isFirstOrLastSlide",value:function(y){return y===this.props.items.length-1||y===0}},{key:"slideIsTransitioning",value:function(y){var v=this.state,P=v.isTransitioning,G=v.previousIndex,Z=v.currentIndex;return P&&!(y===G||y===Z)}},{key:"isSlideVisible",value:function(y){return!this.slideIsTransitioning(y)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(y)}},{key:"slideThumbnailBar",value:function(){var y=this.state,v=y.currentIndex,P=y.isSwipingThumbnail,G=-this.getThumbsTranslate(v);P||(v===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:G,thumbsSwipedTranslate:G}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(y){var v=y.event,P=y.absX,G=y.dir,Z=this.props,X=Z.disableSwipe,be=Z.stopPropagation,ye=this.state,ke=ye.galleryWidth,ie=ye.isTransitioning,se=ye.swipingUpDown,le=ye.swipingLeftRight;if(G!==V&&G!==he&&!se||le){if(G!==pt&&G!==st||le||this.setState({swipingLeftRight:!0}),!X){var pe=this.props.swipingTransitionDuration;if(be&&v.preventDefault(),ie)this.setState({currentSlideOffset:0});else{var Te=G===st?1:-1,_e=P/ke*100;Math.abs(_e)>=100&&(_e=100);var ze={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:Te*_e,slideStyle:ze})}}}else se||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,P=y.absX,G=y.absY,Z=y.dir,X=this.props,be=X.stopPropagation,ye=X.swipingThumbnailTransitionDuration,ke=this.state,ie=ke.thumbsSwipedTranslate,se=ke.thumbnailsWrapperHeight,le=ke.thumbnailsWrapperWidth,pe=ke.swipingUpDown,Te=ke.swipingLeftRight;if(this.isThumbnailVertical()){if((Z===pt||Z===st||Te)&&!pe)return void(Te||this.setState({swipingLeftRight:!0}));Z!==V&&Z!==he||pe||this.setState({swipingUpDown:!0})}else{if((Z===V||Z===he||pe)&&!Te)return void(pe||this.setState({swipingUpDown:!0}));Z!==pt&&Z!==st||Te||this.setState({swipingLeftRight:!0})}var _e,ze,dt,at,Ze,We=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(_e=ie+(Z===he?G:-G),ze=We.scrollHeight-se+20,dt=Math.abs(_e)>ze,at=_e>20,Ze=We.scrollHeight<=se):(_e=ie+(Z===st?P:-P),ze=We.scrollWidth-le+20,dt=Math.abs(_e)>ze,at=_e>20,Ze=We.scrollWidth<=le),!Ze&&(Z!==pt&&Z!==V||!dt)&&(Z!==st&&Z!==he||!at)){be&&v.stopPropagation();var Ne={transition:"transform ".concat(ye,"ms ease-out")};this.setState({thumbsTranslate:_e,thumbsStyle:Ne})}}},{key:"handleOnThumbnailSwiped",value:function(){var y=this.state.thumbsTranslate,v=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:y,thumbsStyle:{transition:"all ".concat(v,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var y=this.state.currentSlideOffset,v=this.props.swipeThreshold;return Math.abs(y)>v}},{key:"resetSwipingDirection",value:function(){var y=this.state,v=y.swipingUpDown,P=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),P&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,P=y.dir,G=y.velocity,Z=this.props,X=Z.disableSwipe,be=Z.stopPropagation,ye=Z.flickThreshold;if(!X){var ke=this.props.isRTL;be&&v.stopPropagation(),this.resetSwipingDirection();var ie=(P===pt?1:-1)*(ke?-1:1),se=G>ye&&!(P===V||P===he);this.handleOnSwipedTo(ie,se)}}},{key:"handleOnSwipedTo",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=G;!this.sufficientSwipe()&&!v||Z||(X+=y),(y===-1&&!this.canSlideLeft()||y===1&&!this.canSlideRight())&&(X=G),this.unthrottledSlideToIndex(X)}},{key:"handleTouchMove",value:function(y){this.state.swipingLeftRight&&y.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(y){var v=this.props,P=v.disableKeyDown,G=v.useBrowserFullscreen,Z=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!P)switch(parseInt(y.keyCode||y.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(y);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(y);break;case 27:Z&&!G&&this.exitFullScreen()}}},{key:"handleImageError",value:function(y){var v=this.props.onErrorImageURL;v&&y.target.src.indexOf(v)===-1&&(y.target.src=v)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var y=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(y)))}},{key:"initSlideWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeSlideWrapperObserver=new Rt(Ie(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperWidth:G.contentRect.width},v.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(y.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeThumbnailWrapperObserver=new Rt(Ie(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperHeight:G.contentRect.height},v.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(y.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var y=this.props,v=y.onScreenChange,P=y.useBrowserFullscreen,G=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Z=this.imageGallery.current===G;v&&v(Z),P&&this.setState({isFullscreen:Z})}},{key:"slideToIndex",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=this.props,be=X.items,ye=X.slideDuration,ke=X.onBeforeSlide;if(!Z){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var ie=be.length-1,se=y;y<0?se=ie:y>ie&&(se=0),ke&&se!==G&&ke(se),this.setState({previousIndex:G,currentIndex:se,isTransitioning:se!==G,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ye,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"right":"left")}},{key:"slideRight",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"left":"right")}},{key:"slideTo",value:function(y,v){var P=this.state,G=P.currentIndex,Z=P.isTransitioning,X=this.props.items,be=G+(v==="left"?-1:1);Z||(X.length===2?this.slideToIndexWithStyleReset(be,y):this.slideToIndex(be,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var P=this,G=this.state,Z=G.currentIndex,X=G.currentSlideOffset;this.setState({currentSlideOffset:X+(Z>y?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return P.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){ki(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){ki(y)&&(0,this.props.onClick)(y)}},{key:"isThumbnailVertical",value:function(){var y=this.props.thumbnailPosition;return y==="left"||y==="right"}},{key:"addScreenChangeEvent",value:function(){var y=this;Ei.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;Ei.forEach(function(v){document.removeEventListener(v,y.handleScreenChange)})}},{key:"fullScreen",value:function(){var y=this.props.useBrowserFullscreen,v=this.imageGallery.current;y?v.requestFullscreen?v.requestFullscreen():v.msRequestFullscreen?v.msRequestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen?v.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var y=this.state.isFullscreen,v=this.props.useBrowserFullscreen;y&&(v?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var y=this.props.infinite,v=this.state.currentIndex;y||this.canSlideRight()?this.slideToIndex(v+1):this.pause()}},{key:"play",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props,P=v.onPlay,G=v.slideInterval,Z=v.slideDuration,X=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(G,Z)),P&&y&&P(X))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,P=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(P))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var P=this.props.onImageLoad;!this.loadedImages[v]&&P&&(this.loadedImages[v]=!0,P(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,P=this.props.onImageError||this.handleImageError;return u().createElement(_,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:P,original:y.original,originalAlt:y.originalAlt,originalHeight:y.originalHeight,originalWidth:y.originalWidth,originalTitle:y.originalTitle,sizes:y.sizes,loading:y.loading,srcSet:y.srcSet})}},{key:"renderThumbInner",value:function(y){var v=this.props.onThumbnailError||this.handleImageError;return u().createElement("span",{className:"image-gallery-thumbnail-inner"},u().createElement("img",{className:"image-gallery-thumbnail-image",src:y.thumbnail,height:y.thumbnailHeight,width:y.thumbnailWidth,alt:y.thumbnailAlt,title:y.thumbnailTitle,loading:y.thumbnailLoading,onError:v}),y.thumbnailLabel&&u().createElement("div",{className:"image-gallery-thumbnail-label"},y.thumbnailLabel))}},{key:"render",value:function(){var y=this.state,v=y.currentIndex,P=y.isFullscreen,G=y.modalFullscreen,Z=y.isPlaying,X=this.props,be=X.additionalClass,ye=X.disableThumbnailSwipe,ke=X.indexSeparator,ie=X.isRTL,se=X.items,le=X.thumbnailPosition,pe=X.renderFullscreenButton,Te=X.renderCustomControls,_e=X.renderLeftNav,ze=X.renderRightNav,dt=X.showBullets,at=X.showFullscreenButton,Ze=X.showIndex,We=X.showThumbnails,Ne=X.showNav,Kt=X.showPlayButton,fn=X.renderPlayPauseButton,pn=this.getThumbnailStyle(),Dt=this.getSlideItems(),nn=Dt.slides,Lt=Dt.thumbnails,cn=Dt.bullets,mn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(le),{"image-gallery-rtl":ie}),un=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:mn},Te&&Te(),this.canSlide()?u().createElement(u().Fragment,null,Ne&&u().createElement(u().Fragment,null,_e(this.slideLeft,!this.canSlideLeft()),ze(this.slideRight,!this.canSlideRight())),u().createElement(tn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},nn))):u().createElement("div",{className:"image-gallery-slides"},nn),Kt&&fn(this.togglePlay,Z),dt&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},cn)),at&&pe(this.toggleFullScreen,P),Ze&&u().createElement("div",{className:"image-gallery-index"},u().createElement("span",{className:"image-gallery-index-current"},v+1),u().createElement("span",{className:"image-gallery-index-separator"},ke),u().createElement("span",{className:"image-gallery-index-total"},se.length))),gn=d("image-gallery",be,{"fullscreen-modal":G}),mt=d("image-gallery-content",this.getThumbnailPositionClassName(le),{fullscreen:P}),ba=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(le),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&ie},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ye},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ye});return u().createElement("div",{ref:this.imageGallery,className:gn,"aria-live":"polite"},u().createElement("div",{className:mt},(le==="bottom"||le==="right")&&un,We&&Lt.length>0?u().createElement(tn,{className:ba,delta:0,onSwiping:!ye&&this.handleThumbnailSwiping,onSwiped:!ye&&this.handleOnThumbnailSwiped},u().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},u().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:pn,"aria-label":"Thumbnail Navigation"},Lt))):null,(le==="top"||le==="left")&&un))}}],T&&ma(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Ce}(u().Component);or.propTypes={flickThreshold:L.number,items:(0,L.arrayOf)((0,L.shape)({bulletClass:L.string,bulletOnClick:L.func,description:L.string,original:L.string,originalHeight:L.number,originalWidth:L.number,loading:L.string,thumbnailHeight:L.number,thumbnailWidth:L.number,thumbnailLoading:L.string,fullscreen:L.string,originalAlt:L.string,originalTitle:L.string,thumbnail:L.string,thumbnailAlt:L.string,thumbnailLabel:L.string,thumbnailTitle:L.string,originalClass:L.string,thumbnailClass:L.string,renderItem:L.func,renderThumbInner:L.func,imageSet:va,srcSet:L.string,sizes:L.string})).isRequired,showNav:L.bool,autoPlay:L.bool,lazyLoad:L.bool,infinite:L.bool,showIndex:L.bool,showBullets:L.bool,showThumbnails:L.bool,showPlayButton:L.bool,showFullscreenButton:L.bool,disableThumbnailScroll:L.bool,disableKeyDown:L.bool,disableSwipe:L.bool,disableThumbnailSwipe:L.bool,useBrowserFullscreen:L.bool,onErrorImageURL:L.string,indexSeparator:L.string,thumbnailPosition:(0,L.oneOf)(["top","bottom","left","right"]),startIndex:L.number,slideDuration:L.number,slideInterval:L.number,slideOnThumbnailOver:L.bool,swipeThreshold:L.number,swipingTransitionDuration:L.number,swipingThumbnailTransitionDuration:L.number,onSlide:L.func,onBeforeSlide:L.func,onScreenChange:L.func,onPause:L.func,onPlay:L.func,onClick:L.func,onImageLoad:L.func,onImageError:L.func,onTouchMove:L.func,onTouchEnd:L.func,onTouchStart:L.func,onMouseOver:L.func,onMouseLeave:L.func,onBulletClick:L.func,onThumbnailError:L.func,onThumbnailClick:L.func,renderCustomControls:L.func,renderLeftNav:L.func,renderRightNav:L.func,renderPlayPauseButton:L.func,renderFullscreenButton:L.func,renderItem:L.func,renderThumbInner:L.func,stopPropagation:L.bool,additionalClass:L.string,useTranslate3D:L.bool,isRTL:L.bool,useWindowKeyDown:L.bool},or.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(x,g){return u().createElement(sn,{onClick:x,disabled:g})},renderRightNav:function(x,g){return u().createElement(rr,{onClick:x,disabled:g})},renderPlayPauseButton:function(x,g){return u().createElement(hn,{onClick:x,isPlaying:g})},renderFullscreenButton:function(x,g){return u().createElement(Ye,{onClick:x,isFullscreen:g})},useWindowKeyDown:!0};const ya=or})(),o})())}(zn)),zn.exports}var Rd=Id();const Pd=ii(Rd);function Ld(){var e=new Map;function t(r){var i=r.root,s=r.rootMargin,n=r.threshold,o=e.get(i);o||(o=new Map,e.set(i,o));var a=JSON.stringify({rootMargin:s,threshold:n}),d=o.get(a);if(!d){var h=new Map,u=new IntersectionObserver(function(f){f.forEach(function(j){var m=h.get(j.target);m?.(j)})},{root:i,rootMargin:s,threshold:n});d={observer:u,entryCallbacks:h},o.set(a,d)}return{observe:function(j,m){var S,E;(S=d)==null||S.entryCallbacks.set(j,m),(E=d)==null||E.observer.observe(j)},unobserve:function(j){var m,S;(m=d)==null||m.entryCallbacks.delete(j),(S=d)==null||S.observer.unobserve(j)}}}return{getObserver:t}}var _d="0px",Nd=[0],Ad=Ld();function Dd(e){var t,r,i=(t=e?.rootMargin)!=null?t:_d,s=(r=e?.threshold)!=null?r:Nd,n=U.useRef(null),o=U.useRef(null),a=U.useRef(null),d=U.useState(),h=d[0],u=d[1],f=U.useCallback(function(){var E=n.current;if(!E){u(void 0);return}var C=Ad.getObserver({root:o.current,rootMargin:i,threshold:s});C.observe(E,function(c){u(c)}),a.current=C},[i,s]),j=U.useCallback(function(){var E=a.current,C=n.current;C&&E?.unobserve(C),a.current=null},[]),m=U.useCallback(function(E){j(),n.current=E,f()},[f,j]),S=U.useCallback(function(E){j(),o.current=E,f()},[f,j]);return[m,{entry:h,rootRef:S}]}function Jr(){return Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Jr.apply(this,arguments)}function Md(e){var t,r=Dd(e),i=r[0],s=r[1],n=!!((t=s.entry)!=null&&t.isIntersecting),o=U.useState(n),a=o[0],d=o[1];return n&&!a&&d(!0),[i,Jr({},s,{isVisible:n,wasEverVisible:a})]}var Bd=100;function Fd(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Bd:o,d=Md({rootMargin:s}),h=d[0],u=d[1],f=u.rootRef,j=u.isVisible,m=!n&&!t&&j&&r;return U.useEffect(function(){if(m){var S=setTimeout(function(){i()},a);return function(){clearTimeout(S)}}},[i,m,a]),[h,{rootRef:f}]}const $d={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},Ud={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'},qd={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/>'};var jr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Or(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){r(window.event)})}function Xs(e,t){for(var r=t.slice(0,t.length-1),i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Ys(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),r=t.lastIndexOf("");r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function Wd(e,t){for(var r=e.length>=t.length?e:t,i=e.length>=t.length?t:e,s=!0,n=0;n<r.length;n++)i.indexOf(r[n])===-1&&(s=!1);return s}var mi={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":jr?173:189,"=":jr?61:187,";":jr?59:186,"'":222,"[":219,"]":221,"\\":220},Jt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Qr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},et={16:!1,18:!1,17:!1,91:!1},He={};for(var Bn=1;Bn<20;Bn++)mi["f".concat(Bn)]=111+Bn;var qe=[],To=!1,Js="all",Qs=[],nr=function(t){return mi[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Zs(e){Js=e||"all"}function Tn(){return Js||"all"}function zd(){return qe.slice(0)}function Vd(e){var t=e.target||e.srcElement,r=t.tagName,i=!0;return(t.isContentEditable||(r==="INPUT"||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function Kd(e){return typeof e=="string"&&(e=nr(e)),qe.indexOf(e)!==-1}function Gd(e,t){var r,i;e||(e=Tn());for(var s in He)if(Object.prototype.hasOwnProperty.call(He,s))for(r=He[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1):i++;Tn()===e&&Zs(t||"all")}function Hd(e){var t=e.keyCode||e.which||e.charCode,r=qe.indexOf(t);if(r>=0&&qe.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&qe.splice(0,qe.length),(t===93||t===224)&&(t=91),t in et){et[t]=!1;for(var i in Jt)Jt[i]===t&&(bt[i]=!1)}}function Xd(e){if(typeof e>"u")Object.keys(He).forEach(function(o){return delete He[o]});else if(Array.isArray(e))e.forEach(function(o){o.key&&Cr(o)});else if(typeof e=="object")e.key&&Cr(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var s=r[0],n=r[1];typeof s=="function"&&(n=s,s=""),Cr({key:e,scope:s,method:n,splitKey:"+"})}}var Cr=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Ys(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":nr(f);if(He[j]){i||(i=Tn());var m=u>1?Xs(Jt,h):[];He[j]=He[j].filter(function(S){var E=s?S.method===s:!0;return!(E&&S.scope===i&&Wd(S.mods,m))})}})};function jo(e,t,r,i){if(t.element===i){var s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(var n in et)Object.prototype.hasOwnProperty.call(et,n)&&(!et[n]&&t.mods.indexOf(+n)>-1||et[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!et[16]&&!et[18]&&!et[17]&&!et[91]||s||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function Oo(e,t){var r=He["*"],i=e.keyCode||e.which||e.charCode;if(bt.filter.call(this,e)){if((i===93||i===224)&&(i=91),qe.indexOf(i)===-1&&i!==229&&qe.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var E=Qr[S];e[S]&&qe.indexOf(E)===-1?qe.push(E):!e[S]&&qe.indexOf(E)>-1?qe.splice(qe.indexOf(E),1):S==="metaKey"&&e[S]&&qe.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(qe=qe.slice(qe.indexOf(E))))}),i in et){et[i]=!0;for(var s in Jt)Jt[s]===i&&(bt[s]=!0);if(!r)return}for(var n in et)Object.prototype.hasOwnProperty.call(et,n)&&(et[n]=e[Qr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(qe.indexOf(17)===-1&&qe.push(17),qe.indexOf(18)===-1&&qe.push(18),et[17]=!0,et[18]=!0);var o=Tn();if(r)for(var a=0;a<r.length;a++)r[a].scope===o&&(e.type==="keydown"&&r[a].keydown||e.type==="keyup"&&r[a].keyup)&&jo(e,r[a],o,t);if(i in He){for(var d=0;d<He[i].length;d++)if((e.type==="keydown"&&He[i][d].keydown||e.type==="keyup"&&He[i][d].keyup)&&He[i][d].key){for(var h=He[i][d],u=h.splitKey,f=h.key.split(u),j=[],m=0;m<f.length;m++)j.push(nr(f[m]));j.sort().join("")===qe.sort().join("")&&jo(e,h,o,t)}}}}function Yd(e){return Qs.indexOf(e)>-1}function bt(e,t,r){qe=[];var i=Ys(e),s=[],n="all",o=document,a=0,d=!1,h=!0,u="+",f=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(n=t.scope),t.element&&(o=t.element),t.keyup&&(d=t.keyup),t.keydown!==void 0&&(h=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(u=t.splitKey)),typeof t=="string"&&(n=t);a<i.length;a++)e=i[a].split(u),s=[],e.length>1&&(s=Xs(Jt,e)),e=e[e.length-1],e=e==="*"?"*":nr(e),e in He||(He[e]=[]),He[e].push({keyup:d,keydown:h,scope:n,mods:s,shortcut:i[a],method:r,key:i[a],splitKey:u,element:o});typeof o<"u"&&!Yd(o)&&window&&(Qs.push(o),Or(o,"keydown",function(j){Oo(j,o)},f),To||(To=!0,Or(window,"focus",function(){qe=[]},f)),Or(o,"keyup",function(j){Oo(j,o),Hd(j)},f))}function Jd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(He).forEach(function(r){var i=He[r].find(function(s){return s.scope===t&&s.shortcut===e});i&&i.method&&i.method()})}var Ir={setScope:Zs,getScope:Tn,deleteScope:Gd,getPressedKeyCodes:zd,isPressed:Kd,filter:Vd,trigger:Jd,unbind:Xd,keyMap:mi,modifier:Jt,modifierMap:Qr};for(var Rr in Ir)Object.prototype.hasOwnProperty.call(Ir,Rr)&&(bt[Rr]=Ir[Rr]);if(typeof window<"u"){var Qd=window.hotkeys;bt.noConflict=function(e){return e&&window.hotkeys===bt&&(window.hotkeys=Qd),bt},window.hotkeys=bt}bt.filter=function(){return!0};var ea=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Zd=function(t){return ea(t,["INPUT","TEXTAREA","SELECT"])};function eh(e,t,r,i){r instanceof Array&&(i=r,r=void 0);var s=r||{},n=s.enableOnTags,o=s.filter,a=s.keyup,d=s.keydown,h=s.filterPreventDefault,u=h===void 0?!0:h,f=s.enabled,j=f===void 0?!0:f,m=s.enableOnContentEditable,S=m===void 0?!1:m,E=U.useRef(null),C=U.useCallback(function(c,N){var $,O;return o&&!o(c)?!u:Zd(c)&&!ea(c,n)||($=c.target)!=null&&$.isContentEditable&&!S?!0:E.current===null||document.activeElement===E.current||(O=E.current)!=null&&O.contains(document.activeElement)?(t(c,N),!0):!1},i?[E,n,o].concat(i):[E,n,o]);return U.useEffect(function(){if(!j){bt.unbind(e,C);return}return a&&d!==!0&&(r.keydown=!1),bt(e,r||{},C),function(){return bt.unbind(e,C)}},[C,e,j]),E}bt.isPressed;const Co="ABTWallet",Pr="ArcSphere";function Io(e,t){return new RegExp(`${t}/(?<version>[0-9.]+)`,"g").exec(e)?.groups?.version}function th(){const e=window?.navigator?.userAgent,[t]=U.useState({wallet:e.indexOf(Co)>-1||e.indexOf(Pr)>-1,walletVersion:Io(e,Co),arcSphere:e.indexOf(Pr)>-1,arcSphereVersion:Io(e,Pr),wechat:/MicroMessenger/i.test(e),mobile:{apple:{phone:!1,ipod:!1,tablet:!1,device:!1},amazon:{phone:!1,tablet:!1,device:!1},android:{phone:!1,tablet:!1,device:!1},windows:{phone:!1,tablet:!1,device:!1},other:{blackberry:!1,blackberry10:!1,opera:!1,firefox:!1,chrome:!1,device:!1},phone:!1,tablet:!1,any:!1,...il(e)}});return t}const ta=U.createContext({open:!1,toggleOpen:e=>{}});function nh({children:e}){const[t,r]=U.useState(!1),i=n=>{r(n??!n)},s=U.useMemo(()=>({open:t,toggleOpen:i}),[t]);return l.jsx(ta.Provider,{value:s,children:e})}function gi(){return U.useContext(ta)}const St={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},rh=e=>On(async()=>{const{data:t}=await e.get(St.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function ih(e,t){const r=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",..._l(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:i,onSearchSelect:s=a=>{t.onFilterChange({...r,keyword:a.title})},emptyCategory:n}=t;!r.category&&!n&&(r.category="All");const o=a=>{const d={...r,...a};i(sr(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?sr(r,(h,u)=>a.includes(u)):{};i(sr(d,h=>h===""||h===void 0))},handleActiveMenu:a=>{a!==e.menu&&i({menu:a})},handleSort:(a,d)=>{o({sortBy:a,sortDirection:d||a==="nameAsc"?"asc":"desc"})},handleKeyword:a=>{o({category:void 0,keyword:a||void 0})},handlePrice:a=>{o({price:a===e.price?void 0:a})},handleCategory:a=>{o({category:a===e.category?"":a})},handleDeveloper:a=>{o({owner:a||void 0})},handlePage:a=>{o({currentPage:a})},handleSwitchIsOfficial:a=>{o({isOfficial:a==="true"?"true":""})},handleSwitchShowResources:a=>{o({showResources:a})},handleSearchSelect:a=>{s(a)}}}const oh=(e,t,r)=>e&&t||!r,na=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ra=(e,t,r)=>{const i=Nl(e),s=Al(i.search);if(Dl(e)?.endsWith(".gif"))return s.imageFilter?Ml({...i,search:""}):e;if(s.imageFilter)return e;const n=r||window.blocklet?.version,{w:o,h:a}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Zn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},sh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],ah=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),lh=e=>Array.isArray(e)?e.map(t=>t.message).join(`
490
+ `):e.response?.data?.error?e.response.data.error.message||e.response.data.error:e.message||e,ch=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),uh=()=>window.innerWidth<=600,dh={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",official:"Official Blocklets",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",searchPlaceholder:"Search blocklet"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},hh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",official:"官方 Blocklet",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Lr={en:Ii(dh),zh:Ii(hh)},ia=(e,t)=>{const r={};return e&&(r["x-blocklet-server-version"]=e),t&&(r["x-blocklet-store-version"]=t),r},fh=e=>(t,r)=>{const i=Lr[e]?Lr[e][t]:Lr.en[t];return ch(i,r)||t},oa={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSwitchIsOfficial:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},sa=U.createContext(oa),{Provider:ph,Consumer:$f}=sa;function mh(e){const{locale:t="zh",filters:r={},serverVersion:i="",onFilterChange:s=()=>{},minItemWidth:n=350,queryFilter:o=!0,layout:a={},wrapChildren:d=K=>K,extraFilter:h=K=>K,baseSearch:u=!1,fetchCategoryDelay:f=0,showResourcesSwitch:j=!1,showCategory:m=!0,tagFilters:S=[],children:E,storeVersion:C,onSearchSelect:c=()=>{},endpoint:N,blockletRender:$,compact:O=!1}=e,w=ia(i,C),R=U.useMemo(()=>ns({baseURL:N,headers:w}),[N]),F=ih(r,{onFilterChange:s,emptyCategory:!a.showExplore,onSearchSelect:c}),[D,ne]=U.useState(""),{data:Y=[],error:W,loading:q,run:H}=rh(R),A=U.useMemo(()=>{const K=Ll(Y,[ce=>ce.name],["asc"]),Ee=K.findIndex(ce=>ce.name==="All"||ce.locales.en==="All");return Ee>-1?[{...K[Ee],_id:"All"},...K.slice(0,Ee),...K.slice(Ee+1)]:K},[Y]),J=U.useCallback(fh(t),[t]),M=U.useMemo(()=>ah(A,t),[A,t]),ue=sh(J),Ie={search:F,compact:O,errors:{fetchCategoriesError:W},loadings:{fetchCategoriesLoading:q},extraFilter:h,endpoint:N,queryFilter:o,layout:{showExplore:a.showExplore??!1,showCategory:a.showCategory??!0,showTitle:a.showTitle??!0,showSearch:a.showSearch??!0},minItemWidth:n,wrapChildren:d,t:J,storeVersion:C,serverVersion:i,selectedCategory:F.filters.category||(a.showExplore?"":"All"),categoryList:A,blockletRender:$,locale:t,categoryOptions:M,priceOptions:ue,storeApi:R,baseSearch:u,showResourcesSwitch:j,showCategory:m,tagFilters:S,onFilterChange:s,getCategoryLocale:K=>{if(!K)return null;const Ee=Y.find(ce=>ce._id===K||ce.locales.en==="All");return Ee?Ee.locales[t]||Ee.locales.en:null},get developerName(){return D},updateDeveloperName:ne};return U.useEffect(()=>{setTimeout(H,f||0)},[N,H,f]),l.jsx(ph,{value:Ie,children:E})}function ct(){return U.useContext(sa)||oa}function aa({children:e,onClick:t,size:r=32,...i}){return l.jsx(jn,{...i,onClick:t,variant:"outlined",sx:[{minWidth:r,height:r,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(i.sx)?i.sx:[i.sx]],children:e})}function Fn(e,t){return e===void 0?t:e}function vi({xs:e=void 0,sm:t=void 0,md:r=void 0,lg:i=void 0,xl:s=void 0,exact:n=!1}){const o=Ut(),a=Yt(o.breakpoints.down("sm")),d=Yt(o.breakpoints.between("sm","md")),h=Yt(o.breakpoints.between("md","lg")),u=Yt(o.breakpoints.between("lg","xl"));if(n)return a?e||null:d?t||null:h?r||null:u?i||null:s||null;let f=e;return a||(f=Fn(t,f),d)||(f=Fn(r,f),h)||(f=Fn(i,f),u)?f:Fn(s,f)}function gh({children:e}){const{open:t,toggleOpen:r}=gi();return l.jsx(vi,{xs:l.jsx(Ba,{open:t,onClose:()=>r(!1),children:e}),md:l.jsx(te,{children:e})})}function vh({loading:e=!1,disabled:t,...r}){return l.jsx(jn,{disableElevation:!0,disabled:t||e===!0,...r,sx:[{borderRadius:"4px"},...Array.isArray(r.sx)?r.sx:[r.sx]],startIcon:e&&l.jsx(Tt,{size:"1em"})})}function Zr({value:e,options:t,onChange:r,placeholder:i="",...s}){const n=U.useRef(null),o=Ut(),[a,d]=U.useState(!1),[h,u]=U.useState(e!==null?e:""),f=Yt(o.breakpoints.down("sm"));U.useEffect(()=>{u(e!==null?e:"")},[e]);const j=U.useCallback(()=>{d(!1)},[]),m=U.useCallback(()=>{d(!0)},[]);function S(C){u(C.value),r(C.value),f&&j()}function E(C){return C===h}return l.jsxs(l.Fragment,{children:[l.jsxs(yh,{ref:n,onClick:m,variant:"outlined",size:"medium",className:["my-select__selector",xn(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...s,children:[t.find(C=>C.value===h)?.name||i,l.jsx(Ua,{className:"my-select__arrowdown",component:qa,sx:{width:18,height:18}})]}),l.jsx(Wa,{open:a,anchorEl:n.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:c})=>l.jsx(za,{...C,style:{transformOrigin:c==="bottom"?"center top":"center bottom"},children:l.jsx(Va,{children:l.jsx(Ka,{onClickAway:j,children:l.jsx(bh,{autoFocusItem:a,onMouseEnter:m,onMouseLeave:j,children:t.map(N=>l.jsxs(ri,{onClick:()=>S(N),sx:{fontSize:14},children:[l.jsx(Ho,{sx:{mr:1,fontSize:16,visibility:E(N.value)?"visible":"hidden"}}),N.name]},N.value))})})})})})]})}const yh=Qt(vh)`
491
491
  border: 1px solid ${e=>e.theme.palette.divider};
492
492
  padding: 6px 8px 6px 12px;
493
493
  font-weight: ${e=>e.theme.typography.fontWeightRegular};
@@ -511,7 +511,7 @@ see detail in https://www.npmjs.com/package/is-var-name
511
511
  margin-right: 3px;
512
512
  }
513
513
  }
514
- `,mh=Qt(zo)`
514
+ `,bh=Qt(Go)`
515
515
  .my-select__option__icon {
516
516
  color: transparent;
517
517
  font-size: 14px;
@@ -527,7 +527,7 @@ see detail in https://www.npmjs.com/package/is-var-name
527
527
  color: ${e=>e.theme.palette.primary.main};
528
528
  }
529
529
  }
530
- `;function oa(){const{search:e,t}=ct(),{filters:r,handleSort:i,handlePrice:s}=e,n=Zs(t);return l.jsxs(lt,{direction:{xs:"row",md:"column"},sx:{alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between"},children:[l.jsx(ei,{control:l.jsx(ti,{checked:r.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:o=>s(o.target.checked?"free":"")}),label:t("blocklet.free")}),l.jsx(Qr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function gh({menus:e=[]}){const{selectedCategory:t,search:r,t:i,categoryOptions:s,loadings:n,layout:o,baseSearch:a,compact:d}=ct(),{filters:h,handleActiveMenu:u,handleCategory:f,cleanFilter:j}=r,{toggleOpen:m}=mi();q.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const S=th(a,o.showSearch,h.keyword);return o.showCategory&&!d?l.jsxs(hh,{children:[l.jsx(gi,{xs:l.jsxs(lt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[l.jsx(ia,{onClick:()=>m(!1),children:l.jsx(qo,{})}),l.jsx(je,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:i("common.category")})]}),md:null}),l.jsx(lt,{visibility:n.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?l.jsxs(l.Fragment,{children:[o.showExplore&&l.jsxs(te,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[l.jsxs(te,{display:"flex",alignItems:"center",gap:1,children:[l.jsx(Bt,{icon:Su,width:20,height:20}),l.jsx(je,{variant:"body1",color:!t&&!h.menu?"text.primary":"grey.400",fontWeight:!t&&!h.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),j()},children:i("explore.title")})]}),e.map(E=>l.jsxs(te,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof E.icon=="string"?l.jsx(Bt,{icon:E.icon,width:20,height:20}):E.icon,l.jsx(je,{variant:"body1",color:h.menu===E.key?"text.primary":"grey.400",fontWeight:h.menu===E.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),u(E.key),E.onClick?.()},children:E.title})]},E.key))]}),!!s.length&&l.jsx(lt,{gap:2,children:s.map(E=>l.jsx(je,{variant:"body1",title:E.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===E.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===E.value?j():f(E.value),m(!1)},children:E.name},E.value))})]}):l.jsx(oa,{})})]}):null}function vi(){const{endpoint:e,serverVersion:t,storeVersion:r}=ct(),i=ta(t,r),s=q.useMemo(()=>Zo({baseURL:e,headers:i}),[e]);return{get:async n=>{const{data:o}=await s.get(n);return o},post:async(n,o)=>{const{data:a}=await s.post(n,o);return a}}}const sa=q.memo(function(e){return l.jsx(te,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:l.jsx(Tt,{})})});function Oo({icon:e=null,children:t=null,maxWidth:r=100,title:i=""}){return(t===0||t)&&l.jsxs(lt,{direction:"row",sx:{alignItems:"center",gap:1,maxWidth:r,overflow:"hidden"},children:[e,l.jsx(je,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const vh=16/9,Lr=292,Zr=189,Gn=336;function yh(){const{t:e,search:t}=ct(),{get:r}=vi(),i=Ut(),s=Yt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=On(async()=>{const E=await r(Zn(St.blockletsPath,{didList:n.map(C=>C.did).join(",")}));return E?.dataList?n.map(C=>E.dataList.find(c=>c.did===C.did)):[]});a&&console.error("Get Banner Blocklets error:",a);const h={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!a&&n.length>0?l.jsxs(l.Fragment,{children:[l.jsx(je,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),l.jsx(te,{sx:{height:{xs:"auto",md:Lr},minHeight:Lr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?l.jsxs(te,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[l.jsx(Xt,{variant:"rounded",height:Zr,width:Gn}),l.jsxs(te,{sx:{flex:1,height:"100%"},children:[l.jsx(Xt,{variant:"text",height:50,width:100}),l.jsx(Xt,{variant:"text",height:40,width:"100%"}),l.jsx(Xt,{variant:"text",height:40,width:300}),l.jsxs(te,{sx:{display:"flex",gap:1,my:2},children:[l.jsx(Xt,{variant:"circular",height:20,width:20}),l.jsx(Xt,{variant:"text",height:20,width:50})]}),l.jsx(Xt,{variant:"rounded",height:30,width:100})]})]}):l.jsx(Cd,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:E=>l.jsx(te,{onClick:E,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ma,{sx:{...h,left:5}})}),renderRightNav:E=>l.jsx(te,{onClick:E,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Da,{sx:{...h,right:5}})}),items:n.map((E,C)=>({original:E.did,renderItem:()=>{const c=o[C]||{},N=E.cover||xh(E.did,c.screenshots?.[0]),$=ea(N,i.breakpoints.values.md*2);return l.jsxs(lt,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(c),sx:{height:{xs:"auto",md:Lr},display:"flex",justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},gap:{xs:2,md:5},cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${$}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},children:[u($),l.jsxs(lt,{sx:{flex:1,height:"100%",gap:3},children:[l.jsxs(te,{sx:{flex:1},children:[f(E.name||c.title||E.name),j(E.desc||c.description)]}),c.did&&m(c,E.baseNum),S(c)]})]})}}))})})]}):null;function u(E){return l.jsx(te,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Gn}},children:l.jsx(wh,{url:E})})}function f(E){return l.jsx(je,{variant:"h2",sx:{width:"100%"},children:E})}function j(E){return l.jsx(je,{variant:"body2",sx:{color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:71,pt:1,display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:E})}function m(E,C=0){const{did:c,owner:N,stats:$}=E;return l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(Oo,{icon:l.jsx(Vn,{src:N.avatar,did:c,size:20,variant:"circle"}),children:N.fullName}),l.jsx(Oo,{icon:l.jsx(Bt,{icon:Cs}),title:`${$.downloads+C}`,children:bh($.downloads+C)})]})}function S(E){return l.jsx(jn,{variant:"outlined",size:"small",onClick:()=>t.handleSearchSelect(E),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:e("explore.viewDetail")})}}const bh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,xh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function wh({url:e}){const[t,r]=q.useState(!0);return l.jsxs(l.Fragment,{children:[t&&l.jsx(Xt,{variant:"rectangular",sx:{width:{xs:"100%",md:Gn},height:{xs:"auto",md:Zr}}}),l.jsx(te,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:Gn},height:{xs:"auto",md:Zr},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:vh}})]})}function Sh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=ct();return l.jsxs(te,{sx:{mt:3},children:[l.jsx(je,{component:"h3",variant:"h3",sx:{mb:2},children:e}),l.jsx(ki,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>l.jsx(ki,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:l.jsx(te,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function Eh(){const{get:e}=vi(),{t}=ct(),{data:r=[],error:i,loading:s}=On(async()=>{const n=await e(St.explorePath);return Array.isArray(n)?n:[]});return i?l.jsx(Qn,{error:new Error(`Failed to fetch blocklets from ${St.explorePath}`)}):s?l.jsx(sa,{mt:15}):l.jsxs(l.Fragment,{children:[l.jsx(yh,{}),r.map(n=>n.blocklets?.length>0?l.jsx(Sh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const _r="__FREE_TEXT__",Co="__NO_RESULT__",Nr=40;function aa({endpoint:e,t,locale:r,filters:i,handleKeyword:s,handleSearchSelect:n,...o}){const a=q.useRef(null),d=q.useRef(!1),[h,u]=q.useState(!1),[f,j]=q.useState(""),[m,S]=q.useState(!1),E=vi(),[C,c]=q.useState(!1),N=o?.placeholder||t("common.searchStore"),$=async M=>{c(!0);const ue=await E.get(rn(e,Zn(St.blockletsPath,M)));return c(!1),ue.dataList||[]},{data:O,run:w}=On(M=>M?$({sortBy:St.nameDesc,page:1,pageSize:10,keyword:M,showResources:"true"}):Promise.resolve([]),{manual:!0});q.useEffect(()=>{c(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),Jd("ctrl + k, command + k",M=>(M.stopPropagation(),M.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const R=ns(M=>w(M),{wait:300}),F={name:_r,title:f,did:""};let D=[];return f&&(C?D=[F]:O?.length?D=[F,...O]:D=[{name:Co,title:t("blocklet.noResults"),did:""}]),l.jsxs(l.Fragment,{children:[l.jsxs(Na,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[l.jsxs(te,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[l.jsx(Wo,{fullWidth:!0,sx:{bgcolor:"grey.50",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,onChange:M=>ne(M.target.value),startAdornment:A(m),endAdornment:J()}),l.jsx(jn,{variant:"outlined",onClick:()=>{S(!1),j(i.keyword||"")},children:t("common.cancel")})]}),l.jsx(zo,{sx:{p:.5},children:D.map(M=>U(M))})]}),l.jsx(te,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:l.jsx(Bt,{icon:ar,style:{fontSize:22,color:"inherit"},onClick:()=>S(!0)})}),l.jsx(Ao,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:(M,ue)=>{u(!1),ue==="selectOption"&&!d.current&&s(f)},onKeyDown:M=>{M.key==="Enter"&&!f&&Y()},disableClearable:!0,inputValue:f,onInputChange:(M,ue)=>ne(ue),isOptionEqualToValue:(M,ue)=>M.name===ue.name,getOptionLabel:M=>M.title,getOptionKey:M=>M.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:M=>l.jsx(Hn,{...M,InputProps:{...M.InputProps,autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,startAdornment:A(h),endAdornment:J()}}),filterOptions:M=>M,...o,options:D,renderOption:(M,ue)=>U(ue),value:F,sx:[{bgcolor:"grey.50",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(o.sx)?o.sx:[o.sx]]})]});function ne(M){c(!0),j(M),d.current=!1,R.run(M)}function Y(){S(!1),j(""),ne(""),s("")}function W(M){M?.did?(S(!1),d.current=!0,j(""),n(M)):M.name===_r&&(S(!1),s(f))}function U(M){return l.jsxs(ni,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>W(M),children:[H(M),l.jsxs(je,{variant:"body1",children:[l.jsx(je,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:M.title}),l.jsx(je,{sx:{fontSize:"13px",color:"text.hint"},children:M.category?.locales?.[r||"en"]||""})]})]},M.did)}function H(M){if([_r,Co].includes(M.name))return l.jsx(te,{sx:{width:Nr,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:l.jsx(Bt,{icon:ar,style:{fontSize:28}})});let ue="";return M.logo&&(ue=rn(e,"assets",M.did,ea(M.logo,Nr,M.version))),l.jsx(Vn,{src:ue,size:Nr,style:{borderRadius:"8px",overflow:"hidden"}})}function A(M=!0){return l.jsx(te,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:M&&f&&C?l.jsx(Tt,{color:"inherit",size:16}):l.jsx(Bt,{icon:ar,style:{fontSize:16,cursor:"default"}})})}function J(){return f?l.jsx(te,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:l.jsx(Bt,{icon:Fd,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Y()})}):null}}function kh({placeholder:e,...t}){const{search:r,t:i}=ct(),{filters:s,handleKeyword:n}=r,[o,a]=q.useState(s.keyword||""),d=ns(n,{wait:300}),h=j=>{const{value:m}=j.target;a(m),d.run(m)},u=()=>{a(""),n("")};q.useEffect(()=>{a(s.keyword||"")},[s.keyword]);const f=e||i("common.searchPlaceholder");return l.jsx(Th,{inputProps:{"data-cy":"search-blocklet"},startAdornment:l.jsx(ji,{position:"start",children:l.jsx(jh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&l.jsx(ji,{position:"end",children:l.jsx(Oh,{"data-cy":"search-delete",onClick:u})}),...t})}const Th=Qt(Wo)`
530
+ `;function la(){const{search:e,t}=ct(),{filters:r,handleSort:i,handlePrice:s}=e,n=na(t);return l.jsxs(lt,{direction:{xs:"row",md:"column"},sx:{alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between"},children:[l.jsx(ti,{control:l.jsx(ni,{checked:r.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:o=>s(o.target.checked?"free":"")}),label:t("blocklet.free")}),l.jsx(Zr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function xh({menus:e=[]}){const{selectedCategory:t,search:r,t:i,categoryOptions:s,loadings:n,layout:o,baseSearch:a,compact:d}=ct(),{filters:h,handleActiveMenu:u,handleCategory:f,cleanFilter:j}=r,{toggleOpen:m}=gi();U.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const S=oh(a,o.showSearch,h.keyword);return o.showCategory&&!d?l.jsxs(gh,{children:[l.jsx(vi,{xs:l.jsxs(lt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[l.jsx(aa,{onClick:()=>m(!1),children:l.jsx(Vo,{})}),l.jsx(je,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:i("common.category")})]}),md:null}),l.jsx(lt,{visibility:n.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?l.jsxs(l.Fragment,{children:[o.showExplore&&l.jsxs(te,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[l.jsxs(te,{display:"flex",alignItems:"center",gap:1,children:[l.jsx(Bt,{icon:Tu,width:20,height:20}),l.jsx(je,{variant:"body1",color:!t&&!h.menu?"text.primary":"grey.400",fontWeight:!t&&!h.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),j()},children:i("explore.title")})]}),e.map(E=>l.jsxs(te,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof E.icon=="string"?l.jsx(Bt,{icon:E.icon,width:20,height:20}):E.icon,l.jsx(je,{variant:"body1",color:h.menu===E.key?"text.primary":"grey.400",fontWeight:h.menu===E.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),u(E.key),E.onClick?.()},children:E.title})]},E.key))]}),!!s.length&&l.jsx(lt,{gap:2,children:s.map(E=>l.jsx(je,{variant:"body1",title:E.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===E.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===E.value?j():f(E.value),m(!1)},children:E.name},E.value))})]}):l.jsx(la,{})})]}):null}function yi(){const{endpoint:e,serverVersion:t,storeVersion:r}=ct(),i=ia(t,r),s=U.useMemo(()=>ns({baseURL:e,headers:i}),[e]);return{get:async n=>{const{data:o}=await s.get(n);return o},post:async(n,o)=>{const{data:a}=await s.post(n,o);return a}}}const ca=U.memo(function(e){return l.jsx(te,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:l.jsx(Tt,{})})});function Ro({icon:e=null,children:t=null,maxWidth:r=100,title:i=""}){return(t===0||t)&&l.jsxs(lt,{direction:"row",sx:{alignItems:"center",gap:1,maxWidth:r,overflow:"hidden"},children:[e,l.jsx(je,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const wh=16/9,_r=292,ei=189,Gn=336;function Sh(){const{t:e,search:t}=ct(),{get:r}=yi(),i=Ut(),s=Yt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=On(async()=>{const E=await r(Zn(St.blockletsPath,{didList:n.map(C=>C.did).join(",")}));return E?.dataList?n.map(C=>E.dataList.find(c=>c.did===C.did)):[]});a&&console.error("Get Banner Blocklets error:",a);const h={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!a&&n.length>0?l.jsxs(l.Fragment,{children:[l.jsx(je,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),l.jsx(te,{sx:{height:{xs:"auto",md:_r},minHeight:_r,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?l.jsxs(te,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[l.jsx(Xt,{variant:"rounded",height:ei,width:Gn}),l.jsxs(te,{sx:{flex:1,height:"100%"},children:[l.jsx(Xt,{variant:"text",height:50,width:100}),l.jsx(Xt,{variant:"text",height:40,width:"100%"}),l.jsx(Xt,{variant:"text",height:40,width:300}),l.jsxs(te,{sx:{display:"flex",gap:1,my:2},children:[l.jsx(Xt,{variant:"circular",height:20,width:20}),l.jsx(Xt,{variant:"text",height:20,width:50})]}),l.jsx(Xt,{variant:"rounded",height:30,width:100})]})]}):l.jsx(Pd,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:E=>l.jsx(te,{onClick:E,sx:{display:{xs:"none",md:"block"}},children:l.jsx($a,{sx:{...h,left:5}})}),renderRightNav:E=>l.jsx(te,{onClick:E,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Fa,{sx:{...h,right:5}})}),items:n.map((E,C)=>({original:E.did,renderItem:()=>{const c=o[C]||{},N=E.cover||kh(E.did,c.screenshots?.[0]),$=ra(N,i.breakpoints.values.md*2);return l.jsxs(lt,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(c),sx:{height:{xs:"auto",md:_r},display:"flex",justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},gap:{xs:2,md:5},cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${$}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},children:[u($),l.jsxs(lt,{sx:{flex:1,height:"100%",gap:3},children:[l.jsxs(te,{sx:{flex:1},children:[f(E.name||c.title||E.name),j(E.desc||c.description)]}),c.did&&m(c,E.baseNum),S(c)]})]})}}))})})]}):null;function u(E){return l.jsx(te,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Gn}},children:l.jsx(Th,{url:E})})}function f(E){return l.jsx(je,{variant:"h2",sx:{width:"100%"},children:E})}function j(E){return l.jsx(je,{variant:"body2",sx:{color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:71,pt:1,display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:E})}function m(E,C=0){const{did:c,owner:N,stats:$}=E;return l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(Ro,{icon:l.jsx(Vn,{src:N.avatar,did:c,size:20,variant:"circle"}),children:N.fullName}),l.jsx(Ro,{icon:l.jsx(Bt,{icon:Ps}),title:`${$.downloads+C}`,children:Eh($.downloads+C)})]})}function S(E){return l.jsx(jn,{variant:"outlined",size:"small",onClick:()=>t.handleSearchSelect(E),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:e("explore.viewDetail")})}}const Eh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,kh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Th({url:e}){const[t,r]=U.useState(!0);return l.jsxs(l.Fragment,{children:[t&&l.jsx(Xt,{variant:"rectangular",sx:{width:{xs:"100%",md:Gn},height:{xs:"auto",md:ei}}}),l.jsx(te,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:Gn},height:{xs:"auto",md:ei},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:wh}})]})}function jh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=ct();return l.jsxs(te,{sx:{mt:3},children:[l.jsx(je,{component:"h3",variant:"h3",sx:{mb:2},children:e}),l.jsx(Ti,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>l.jsx(Ti,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:l.jsx(te,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function Oh(){const{get:e}=yi(),{t}=ct(),{data:r=[],error:i,loading:s}=On(async()=>{const n=await e(St.explorePath);return Array.isArray(n)?n:[]});return i?l.jsx(Qn,{error:new Error(`Failed to fetch blocklets from ${St.explorePath}`)}):s?l.jsx(ca,{mt:15}):l.jsxs(l.Fragment,{children:[l.jsx(Sh,{}),r.map(n=>n.blocklets?.length>0?l.jsx(jh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const Nr="__FREE_TEXT__",Po="__NO_RESULT__",Ar=40;function ua({endpoint:e,t,locale:r,filters:i,handleKeyword:s,handleSearchSelect:n,...o}){const a=U.useRef(null),d=U.useRef(!1),[h,u]=U.useState(!1),[f,j]=U.useState(""),[m,S]=U.useState(!1),E=yi(),[C,c]=U.useState(!1),N=o?.placeholder||t("common.searchStore"),$=async M=>{c(!0);const ue=await E.get(rn(e,Zn(St.blockletsPath,M)));return c(!1),ue.dataList||[]},{data:O,run:w}=On(M=>M?$({sortBy:St.nameDesc,page:1,pageSize:10,keyword:M,showResources:"true"}):Promise.resolve([]),{manual:!0});U.useEffect(()=>{c(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),eh("ctrl + k, command + k",M=>(M.stopPropagation(),M.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const R=os(M=>w(M),{wait:300}),F={name:Nr,title:f,did:""};let D=[];return f&&(C?D=[F]:O?.length?D=[F,...O]:D=[{name:Po,title:t("blocklet.noResults"),did:""}]),l.jsxs(l.Fragment,{children:[l.jsxs(Ma,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[l.jsxs(te,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[l.jsx(Ko,{fullWidth:!0,sx:{bgcolor:"grey.50",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,onChange:M=>ne(M.target.value),startAdornment:A(m),endAdornment:J()}),l.jsx(jn,{variant:"outlined",onClick:()=>{S(!1),j(i.keyword||"")},children:t("common.cancel")})]}),l.jsx(Go,{sx:{p:.5},children:D.map(M=>q(M))})]}),l.jsx(te,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:l.jsx(Bt,{icon:ar,style:{fontSize:22,color:"inherit"},onClick:()=>S(!0)})}),l.jsx(Bo,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:(M,ue)=>{u(!1),ue==="selectOption"&&!d.current&&s(f)},onKeyDown:M=>{M.key==="Enter"&&!f&&Y()},disableClearable:!0,inputValue:f,onInputChange:(M,ue)=>ne(ue),isOptionEqualToValue:(M,ue)=>M.name===ue.name,getOptionLabel:M=>M.title,getOptionKey:M=>M.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:M=>l.jsx(Hn,{...M,InputProps:{...M.InputProps,autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,startAdornment:A(h),endAdornment:J()}}),filterOptions:M=>M,...o,options:D,renderOption:(M,ue)=>q(ue),value:F,sx:[{bgcolor:"grey.50",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(o.sx)?o.sx:[o.sx]]})]});function ne(M){c(!0),j(M),d.current=!1,R.run(M)}function Y(){S(!1),j(""),ne(""),s("")}function W(M){M?.did?(S(!1),d.current=!0,j(""),n(M)):M.name===Nr&&(S(!1),s(f))}function q(M){return l.jsxs(ri,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>W(M),children:[H(M),l.jsxs(je,{variant:"body1",children:[l.jsx(je,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:M.title}),l.jsx(je,{sx:{fontSize:"13px",color:"text.hint"},children:M.category?.locales?.[r||"en"]||""})]})]},M.did)}function H(M){if([Nr,Po].includes(M.name))return l.jsx(te,{sx:{width:Ar,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:l.jsx(Bt,{icon:ar,style:{fontSize:28}})});let ue="";return M.logo&&(ue=rn(e,"assets",M.did,ra(M.logo,Ar,M.version))),l.jsx(Vn,{src:ue,size:Ar,style:{borderRadius:"8px",overflow:"hidden"}})}function A(M=!0){return l.jsx(te,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:M&&f&&C?l.jsx(Tt,{color:"inherit",size:16}):l.jsx(Bt,{icon:ar,style:{fontSize:16,cursor:"default"}})})}function J(){return f?l.jsx(te,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:l.jsx(Bt,{icon:qd,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Y()})}):null}}function Ch({placeholder:e,...t}){const{search:r,t:i}=ct(),{filters:s,handleKeyword:n}=r,[o,a]=U.useState(s.keyword||""),d=os(n,{wait:300}),h=j=>{const{value:m}=j.target;a(m),d.run(m)},u=()=>{a(""),n("")};U.useEffect(()=>{a(s.keyword||"")},[s.keyword]);const f=e||i("common.searchPlaceholder");return l.jsx(Ih,{inputProps:{"data-cy":"search-blocklet"},startAdornment:l.jsx(Oi,{position:"start",children:l.jsx(Rh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&l.jsx(Oi,{position:"end",children:l.jsx(Ph,{"data-cy":"search-delete",onClick:u})}),...t})}const Ih=Qt(Ko)`
531
531
  background-color: ${e=>e.theme.palette.grey[50]};
532
532
  font-size: 14px;
533
533
  border-radius: 6px;
@@ -544,19 +544,19 @@ see detail in https://www.npmjs.com/package/is-var-name
544
544
  color: transparent;
545
545
  }
546
546
  }
547
- `,jh=Qt(za)`
547
+ `,Rh=Qt(Ga)`
548
548
  color: ${e=>e.theme.palette.grey[500]};
549
- `,Oh=Qt(qo)`
549
+ `,Ph=Qt(Vo)`
550
550
  color: ${e=>e.theme.palette.grey[500]};
551
551
  font-size: 16px;
552
552
  cursor: pointer;
553
- `;function Ch(){const{search:e,t,endpoint:r,locale:i,getCategoryLocale:s,developerName:n,showResourcesSwitch:o,layout:a,baseSearch:d,categoryOptions:h,compact:u}=ct(),{filters:f,handleSort:j,handlePrice:m,handleDeveloper:S,handleSwitchShowResources:E,cleanFilter:C,handleCategory:c,handleSwitchIsOfficial:N}=e,$=Zs(t);return l.jsxs(lt,{className:"filter-bar",direction:{xs:"column",md:"row"},spacing:{xs:1,md:0},sx:{position:"sticky",top:0,zIndex:1e3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,pt:{xs:2,md:0},px:0,pb:u?2:3,backgroundColor:"background.default"},children:[!u&&l.jsx(je,{variant:"h2",sx:{textTransform:"capitalize"},children:s(f.category)}),l.jsxs(lt,{direction:"row",sx:{flex:1,alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2},children:[a.showSearch?l.jsx(te,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?l.jsx(kh,{}):l.jsx(aa,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,f.owner&&n&&l.jsx(Ti,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>S("")}),f.resourceDid&&f.resourceBlocklet&&l.jsx(Ti,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>C(["resourceDid","resourceBlocklet","showResources"])}),l.jsx(Ar,{checked:f.isOfficial==="true",onChange:O=>N(O?"true":"false"),label:t("common.official")}),o?l.jsx(Ar,{checked:f.showResources!=="false",onChange:O=>E(O?"true":"false"),label:t("common.showResources")}):null,l.jsx(Ar,{checked:f.price==="free",onChange:O=>m(O?"free":""),label:t("blocklet.free")}),u&&l.jsx(te,{children:l.jsx(Qr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:O=>c(O)})}),l.jsx(Qr,{value:f.sortBy||$[0].value,options:$,placeholder:t("sort.sort"),onChange:O=>j(O)})]})]})}function Ar({checked:e,onChange:t,label:r}){const i=Ut();return l.jsx(ei,{sx:{m:0,p:0},className:"check-button",control:l.jsx(ti,{checked:e,icon:l.jsx(Bt,{style:{padding:0,color:i.palette.text.secondary},icon:Md}),checkedIcon:l.jsx(Bt,{style:{padding:0,color:i.palette.primary.main},icon:Bd}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function $n({children:e}){return l.jsxs(te,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[l.jsx(rl,{}),e]})}function Io(){const{t:e}=ct();return l.jsx(je,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Dr({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=ct(),s=()=>i==="zh"?"、":" , ";return l.jsxs(te,{sx:{mt:1,display:"flex"},children:[l.jsx(je,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&l.jsx(je,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&l.jsx(je,{children:r("blocklet.keywordTip")})]})}function Mr({primaryStart:e,primaryEnd:t,filter:r}){return l.jsxs(je,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[l.jsx(je,{children:e}),l.jsx(je,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),l.jsxs(je,{children:[t," "]})]})}function Ih(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=ct(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return l.jsxs($n,{children:[l.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Dr,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return l.jsxs($n,{children:[l.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Dr,{keywordTip:!0})]});if(n){const o=r(i);return l.jsxs($n,{children:[o?l.jsx(Mr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):l.jsx(Io,{}),l.jsx(Dr,{filterTip:!0})]})}return l.jsx($n,{children:l.jsx(Io,{})})}const Rh=(e,t,r,i)=>Jl(async s=>{s||(r.currentPage=r.defaultCurrentPage);const{currentPage:n,pageSize:o}=r,a={...t,category:t.category==="All"?"":t.category,sortBy:St[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(St.blockletsPath,{params:a});return r.currentPage++,{page:n,pageSize:o,list:d?.dataList||[],total:d?.total||0}},{isNoMore:s=>s?s.page*s.pageSize>=s.total:!1,reloadDeps:[e,yl(t)],onError:i});function Ph(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=ct(),{filters:n}=t,o=Yl({currentPage:St.currentPage,pageSize:sh()?St.mobilePageSize:St.pageSize,defaultCurrentPage:St.defaultCurrentPage}),[a,d]=q.useState(null),h=Rh(e,n,o,d),u=q.useMemo(()=>r?r(h.data?.list||[]):h.data?.list||[],[h.data,r]);return q.useEffect(()=>{const f=u.find(j=>j.owner.did===n.owner);s(f?.owner.fullName||f?.author.name||"")},[n.owner,u,s]),{blocklets:u,fetchBlockletsError:a,loadMore:h.loadMore,hasNextPage:!h.noMore,total:h.data?.total||0,loadings:{fetchBlockletsLoading:h.loading,loadingMore:h.loadingMore},errors:{...i,fetchBlockletsError:a}}}function Lh(){const{t:e,search:t,endpoint:r,blockletRender:i,serverVersion:s,minItemWidth:n,layout:o,baseSearch:a,compact:d}=ct(),{filters:h}=t,{blocklets:u,errors:f,loadMore:j,loadings:m,hasNextPage:S,total:E}=Ph(),[C]=Dd({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:S,onLoadMore:j});if(f.fetchBlockletsError){const O=new Error(`Failed to fetch blocklets from ${r}: ${ih(f.fetchBlockletsError)}`);return l.jsx(Qn,{error:O})}const c=a&&o.showSearch||!h.keyword;return l.jsxs(l.Fragment,{children:[c?l.jsx(Ch,{}):l.jsxs(l.Fragment,{children:[l.jsx(gi,{xs:l.jsx(oa,{}),md:null}),$()]}),N(),!m.fetchBlockletsLoading&&S&&l.jsx(te,{ref:C,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?l.jsx(Tt,{}):null})]});function N(){return m.fetchBlockletsLoading?l.jsx(sa,{mt:15}):u.length?l.jsx(te,{className:"blocklet-list",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${n}px, 1fr))`},p:"2px",rowGap:2,columnGap:d?0:2},children:u.map(O=>l.jsx(te,{"data-blocklet-did":O.did,sx:{minWidth:{xs:"100%",sm:n},maxWidth:"calc(100vw - 32px)"},children:i({blocklet:O,blocklets:u,serverVersion:s})},O.did))}):l.jsx(Ih,{})}function $(){return l.jsxs(lt,{direction:"row",className:"search-result-title",sx:{alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0}},children:[l.jsx(je,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),l.jsx(je,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:E})})]})}}function _h(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=ct(),{toggleOpen:n}=mi(),o=nl().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return l.jsxs(te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs(je,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[l.jsx(ia,{onClick:()=>n(!0),children:l.jsx(_a,{})}),r(t)||e("common.category")]}),o&&a&&l.jsx(aa,{locale:i,endpoint:window.blocklet?.prefix||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:e,filters:s.filters,handleKeyword:s.handleKeyword,handleSearchSelect:s.handleSearchSelect})]})}function Nh({menus:e=[],children:t=void 0}){const{search:r,layout:i,compact:s}=ct(),{filters:n}=r,o=q.useRef(null),a=n.category||n.keyword||n.price,d=e.find(h=>h.key===n.menu)?.key;return l.jsx(Qd,{children:l.jsxs(Xo,{FallbackComponent:Qn,children:[!s&&l.jsx(_h,{}),l.jsxs(te,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[l.jsx(gh,{menus:e}),l.jsxs(lt,{sx:[{height:"100%",position:"relative",flex:1},s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"}],children:[d&&t?.(d),!d&&(i.showExplore&&!a?l.jsx(Eh,{}):l.jsx(Lh,{}))]})]})]})})}function Ah(e){const{menus:t,children:r,...i}=e,s=Ut(),n=$o(Cl({},s,{typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return l.jsx(Uo,{theme:n,children:l.jsx(dh,{...i,children:l.jsx(Nh,{menus:t,children:r})})})}const Dh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},Mh={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},Bh={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},Fh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},$h=(e,t)=>!t||!e?!0:Fr.satisfies(Fr.coerce(e),t);function la({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=xt();return $h(t,r)?e:l.jsx(Fo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:l.jsx(je,{children:l.jsx(jn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}la.propTypes={children:B.node.isRequired,serverVersion:B.string,requirementVersion:B.string};const Uh=(e,t)=>rn(t,`/blocklets/${e.did}`),Ro=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,qh=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1;function ca({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=xt();let o=rn(i,bl(e.did,e.logo||""));try{const C=new URL(o);C.searchParams.set("v",e.version||+new Date),o=C.href}catch{}const[a,d]=q.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(C){Yn.error(C.message)}finally{d(!1)}},{blocklet:u}=Jn(),f=()=>(u?.children||[]).find(N=>N.meta.bundleDid===e.did).meta.version,m=(()=>{const C=(u?.children||[]).find(c=>c.meta.bundleDid===e.did);if(C){try{const c=C.meta.version,N=e.version;if(Fr.gt(N,c))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=e.requirements?.server,E=[];return m==="upgrade"?E.push({key:"upgrade",icon:l.jsx(yt,{icon:Fh,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:l.jsx(te,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?E.push({key:"disable",icon:l.jsx(yt,{icon:Dh,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):qh(e)&&E.push({key:"purchase",icon:l.jsx(yt,{icon:Mh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),l.jsx(Wh,{title:Ro({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Ro({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:h,icons:e.docker?.image?[{key:"docker",icon:l.jsx(te,{sx:{display:"flex",color:"primary.main"},children:l.jsx(yt,{icon:Bh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:E,button:l.jsx(la,{serverVersion:s,requirementVersion:S,size:"small",children:l.jsx("div",{style:{display:"flex",alignItems:"center"},children:l.jsx(bu,{children:l.jsx(vt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const c=Uh(e,i);c&&window.open(c,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ca.propTypes={blocklet:B.object.isRequired,blocklets:B.array,handleButtonClick:B.func,endpoint:B.string,serverVersion:B.string};function ua({handleButtonClick:e=null,handleSearchSelect:t=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:s=void 0,serverVersion:n="",resourceType:o="",resourceDid:a="",showResourcesSwitch:d=!0,showCategory:h=!0,compact:u=!1,...f}){const j=Ut(),{locale:m}=xt(),[S,E]=q.useState(!1),[C,c]=q.useState({}),N=w=>{c(w)},$=r,O=q.useMemo(()=>$o(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return q.useEffect(()=>{c({showResources:!0,resourceType:o,resourceDid:a})},[$,o,a]),q.useEffect(()=>{E(!0),c({showResources:!0,resourceType:o,resourceDid:a})},[]),l.jsx(Uo,{theme:O,children:l.jsx(Xo,{FallbackComponent:Qn,resetKeys:[$],children:l.jsxs(te,{...f,sx:Ho({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[S&&l.jsx(Ah,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const R={...w,handleButtonClick:e,endpoint:$};return i({...w,defaultRender:l.jsx(ca,{...R})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:$,locale:m,onFilterChange:N,onSearchSelect:t,filters:C,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),l.jsx(te,{sx:{mt:2},children:" "})]})})})}ua.propTypes={storeUrl:B.string.isRequired,handleButtonClick:B.func,handleSearchSelect:B.func,handleBlockletRender:B.func,extraFilter:B.func,serverVersion:B.string,resourceType:B.string,resourceDid:B.string,showResourcesSwitch:B.bool,showCategory:B.bool,compact:B.bool};const Wh=tt(wu)`
553
+ `;function Lh(){const{search:e,t,endpoint:r,locale:i,getCategoryLocale:s,developerName:n,showResourcesSwitch:o,layout:a,baseSearch:d,categoryOptions:h,compact:u}=ct(),{filters:f,handleSort:j,handlePrice:m,handleDeveloper:S,handleSwitchShowResources:E,cleanFilter:C,handleCategory:c,handleSwitchIsOfficial:N}=e,$=na(t);return l.jsxs(lt,{className:"filter-bar",direction:{xs:"column",md:"row"},spacing:{xs:1,md:0},sx:{position:"sticky",top:0,zIndex:1e3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,pt:{xs:2,md:0},px:0,pb:u?2:3,backgroundColor:"background.default"},children:[!u&&l.jsx(je,{variant:"h2",sx:{textTransform:"capitalize"},children:s(f.category)}),l.jsxs(lt,{direction:"row",sx:{flex:1,alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2},children:[a.showSearch?l.jsx(te,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?l.jsx(Ch,{}):l.jsx(ua,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,f.owner&&n&&l.jsx(ji,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>S("")}),f.resourceDid&&f.resourceBlocklet&&l.jsx(ji,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>C(["resourceDid","resourceBlocklet","showResources"])}),l.jsx(Dr,{checked:f.isOfficial==="true",onChange:O=>N(O?"true":"false"),label:t("common.official")}),o?l.jsx(Dr,{checked:f.showResources!=="false",onChange:O=>E(O?"true":"false"),label:t("common.showResources")}):null,l.jsx(Dr,{checked:f.price==="free",onChange:O=>m(O?"free":""),label:t("blocklet.free")}),u&&l.jsx(te,{children:l.jsx(Zr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:O=>c(O)})}),l.jsx(Zr,{value:f.sortBy||$[0].value,options:$,placeholder:t("sort.sort"),onChange:O=>j(O)})]})]})}function Dr({checked:e,onChange:t,label:r}){const i=Ut();return l.jsx(ti,{sx:{m:0,p:0},className:"check-button",control:l.jsx(ni,{checked:e,icon:l.jsx(Bt,{style:{padding:0,color:i.palette.text.secondary},icon:$d}),checkedIcon:l.jsx(Bt,{style:{padding:0,color:i.palette.primary.main},icon:Ud}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function $n({children:e}){return l.jsxs(te,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[l.jsx(ol,{}),e]})}function Lo(){const{t:e}=ct();return l.jsx(je,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Mr({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=ct(),s=()=>i==="zh"?"、":" , ";return l.jsxs(te,{sx:{mt:1,display:"flex"},children:[l.jsx(je,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&l.jsx(je,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&l.jsx(je,{children:r("blocklet.keywordTip")})]})}function Br({primaryStart:e,primaryEnd:t,filter:r}){return l.jsxs(je,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[l.jsx(je,{children:e}),l.jsx(je,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),l.jsxs(je,{children:[t," "]})]})}function _h(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=ct(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return l.jsxs($n,{children:[l.jsx(Br,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Mr,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return l.jsxs($n,{children:[l.jsx(Br,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Mr,{keywordTip:!0})]});if(n){const o=r(i);return l.jsxs($n,{children:[o?l.jsx(Br,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):l.jsx(Lo,{}),l.jsx(Mr,{filterTip:!0})]})}return l.jsx($n,{children:l.jsx(Lo,{})})}const Nh=(e,t,r,i)=>ec(async s=>{s||(r.currentPage=r.defaultCurrentPage);const{currentPage:n,pageSize:o}=r,a={...t,category:t.category==="All"?"":t.category,sortBy:St[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(St.blockletsPath,{params:a});return r.currentPage++,{page:n,pageSize:o,list:d?.dataList||[],total:d?.total||0}},{isNoMore:s=>s?s.page*s.pageSize>=s.total:!1,reloadDeps:[e,wl(t)],onError:i});function Ah(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=ct(),{filters:n}=t,o=Zl({currentPage:St.currentPage,pageSize:uh()?St.mobilePageSize:St.pageSize,defaultCurrentPage:St.defaultCurrentPage}),[a,d]=U.useState(null),h=Nh(e,n,o,d),u=U.useMemo(()=>r?r(h.data?.list||[]):h.data?.list||[],[h.data,r]);return U.useEffect(()=>{const f=u.find(j=>j.owner.did===n.owner);s(f?.owner.fullName||f?.author.name||"")},[n.owner,u,s]),{blocklets:u,fetchBlockletsError:a,loadMore:h.loadMore,hasNextPage:!h.noMore,total:h.data?.total||0,loadings:{fetchBlockletsLoading:h.loading,loadingMore:h.loadingMore},errors:{...i,fetchBlockletsError:a}}}function Dh(){const{t:e,search:t,endpoint:r,blockletRender:i,serverVersion:s,minItemWidth:n,layout:o,baseSearch:a,compact:d}=ct(),{filters:h}=t,{blocklets:u,errors:f,loadMore:j,loadings:m,hasNextPage:S,total:E}=Ah(),[C]=Fd({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:S,onLoadMore:j});if(f.fetchBlockletsError){const O=new Error(`Failed to fetch blocklets from ${r}: ${lh(f.fetchBlockletsError)}`);return l.jsx(Qn,{error:O})}const c=a&&o.showSearch||!h.keyword;return l.jsxs(l.Fragment,{children:[c?l.jsx(Lh,{}):l.jsxs(l.Fragment,{children:[l.jsx(vi,{xs:l.jsx(la,{}),md:null}),$()]}),N(),!m.fetchBlockletsLoading&&S&&l.jsx(te,{ref:C,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?l.jsx(Tt,{}):null})]});function N(){return m.fetchBlockletsLoading?l.jsx(ca,{mt:15}):u.length?l.jsx(te,{className:"blocklet-list",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${n}px, 1fr))`},p:"2px",rowGap:2,columnGap:d?0:2},children:u.map(O=>l.jsx(te,{"data-blocklet-did":O.did,sx:{minWidth:{xs:"100%",sm:n},maxWidth:"calc(100vw - 32px)"},children:i({blocklet:O,blocklets:u,serverVersion:s})},O.did))}):l.jsx(_h,{})}function $(){return l.jsxs(lt,{direction:"row",className:"search-result-title",sx:{alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0}},children:[l.jsx(je,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),l.jsx(je,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:E})})]})}}function Mh(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=ct(),{toggleOpen:n}=gi(),o=th().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return l.jsxs(te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs(je,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[l.jsx(aa,{onClick:()=>n(!0),children:l.jsx(Da,{})}),r(t)||e("common.category")]}),o&&a&&l.jsx(ua,{locale:i,endpoint:window.blocklet?.prefix||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:e,filters:s.filters,handleKeyword:s.handleKeyword,handleSearchSelect:s.handleSearchSelect})]})}function Bh({menus:e=[],children:t=void 0}){const{search:r,layout:i,compact:s}=ct(),{filters:n}=r,o=U.useRef(null),a=n.category||n.keyword||n.price,d=e.find(h=>h.key===n.menu)?.key;return l.jsx(nh,{children:l.jsxs(Qo,{FallbackComponent:Qn,children:[!s&&l.jsx(Mh,{}),l.jsxs(te,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[l.jsx(xh,{menus:e}),l.jsxs(lt,{sx:[{height:"100%",position:"relative",flex:1},s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"}],children:[d&&t?.(d),!d&&(i.showExplore&&!a?l.jsx(Oh,{}):l.jsx(Dh,{}))]})]})]})})}function Fh(e){const{menus:t,children:r,...i}=e,s=Ut(),n=Wo(Pl({},s,{typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return l.jsx(zo,{theme:n,children:l.jsx(mh,{...i,children:l.jsx(Bh,{menus:t,children:r})})})}const $h={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},Uh={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},qh={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},Wh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},zh=(e,t)=>!t||!e?!0:$r.satisfies($r.coerce(e),t);function da({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=xt();return zh(t,r)?e:l.jsx(qo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:l.jsx(je,{children:l.jsx(jn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}da.propTypes={children:B.node.isRequired,serverVersion:B.string,requirementVersion:B.string};const Vh=(e,t)=>rn(t,`/blocklets/${e.did}`),_o=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,Kh=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1;function ha({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=xt();let o=rn(i,Sl(e.did,e.logo||""));try{const C=new URL(o);C.searchParams.set("v",e.version||+new Date),o=C.href}catch{}const[a,d]=U.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(C){Xn.error(C.message)}finally{d(!1)}},{blocklet:u}=Jn(),f=()=>(u?.children||[]).find(N=>N.meta.bundleDid===e.did).meta.version,m=(()=>{const C=(u?.children||[]).find(c=>c.meta.bundleDid===e.did);if(C){try{const c=C.meta.version,N=e.version;if($r.gt(N,c))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=e.requirements?.server,E=[];return m==="upgrade"?E.push({key:"upgrade",icon:l.jsx(yt,{icon:Wh,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:l.jsx(te,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?E.push({key:"disable",icon:l.jsx(yt,{icon:$h,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):Kh(e)&&E.push({key:"purchase",icon:l.jsx(yt,{icon:Uh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),l.jsx(Gh,{title:_o({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:_o({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:h,icons:e.docker?.image?[{key:"docker",icon:l.jsx(te,{sx:{display:"flex",color:"primary.main"},children:l.jsx(yt,{icon:qh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:E,button:l.jsx(da,{serverVersion:s,requirementVersion:S,size:"small",children:l.jsx("div",{style:{display:"flex",alignItems:"center"},children:l.jsx(Su,{children:l.jsx(vt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const c=Vh(e,i);c&&window.open(c,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ha.propTypes={blocklet:B.object.isRequired,blocklets:B.array,handleButtonClick:B.func,endpoint:B.string,serverVersion:B.string};function fa({handleButtonClick:e=null,handleSearchSelect:t=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:s=void 0,serverVersion:n="",resourceType:o="",resourceDid:a="",showResourcesSwitch:d=!0,showCategory:h=!0,compact:u=!1,...f}){const j=Ut(),{locale:m}=xt(),[S,E]=U.useState(!1),[C,c]=U.useState({}),N=w=>{c(w)},$=r,O=U.useMemo(()=>Wo(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return U.useEffect(()=>{c({showResources:!0,resourceType:o,resourceDid:a})},[$,o,a]),U.useEffect(()=>{E(!0),c({showResources:!0,resourceType:o,resourceDid:a})},[]),l.jsx(zo,{theme:O,children:l.jsx(Qo,{FallbackComponent:Qn,resetKeys:[$],children:l.jsxs(te,{...f,sx:Jo({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[S&&l.jsx(Fh,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const R={...w,handleButtonClick:e,endpoint:$};return i({...w,defaultRender:l.jsx(ha,{...R})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:$,locale:m,onFilterChange:N,onSearchSelect:t,filters:C,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),l.jsx(te,{sx:{mt:2},children:" "})]})})})}fa.propTypes={storeUrl:B.string.isRequired,handleButtonClick:B.func,handleSearchSelect:B.func,handleBlockletRender:B.func,extraFilter:B.func,serverVersion:B.string,resourceType:B.string,resourceDid:B.string,showResourcesSwitch:B.bool,showCategory:B.bool,compact:B.bool};const Gh=tt(ku)`
554
554
  .ms-highlight {
555
555
  color: ${e=>e.theme.palette.primary.main};
556
556
  }
557
- `;function da({ref:e=null,meta:t=null,isMobile:r,onStepChange:i}){const s=Ut(),{steps:n,activeStep:o,setActiveStepByKey:a,setActiveStepByIndex:d}=kl(),{t:h,locale:u}=xt(),f=n[o];return q.useEffect(()=>{i(o)},[i,o]),q.useImperativeHandle(e,()=>({setActiveStepByKey:a,setActiveStepByIndex:d})),l.jsx(Vh,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:l.jsx(Tl,{locale:u,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?xl({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,theme:s,stepTip:h("blocklet.component.add"),children:l.jsx(zh,{children:typeof f?.body=="function"?f.body():f?.body})})})}da.propTypes={ref:B.any,meta:B.any,onStepChange:B.func.isRequired,isMobile:B.bool.isRequired};const Po=e=>e.isMobile?`
557
+ `;function pa({ref:e=null,meta:t=null,isMobile:r,onStepChange:i}){const s=Ut(),{steps:n,activeStep:o,setActiveStepByKey:a,setActiveStepByIndex:d}=Ol(),{t:h,locale:u}=xt(),f=n[o];return U.useEffect(()=>{i(o)},[i,o]),U.useImperativeHandle(e,()=>({setActiveStepByKey:a,setActiveStepByIndex:d})),l.jsx(Xh,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:l.jsx(Cl,{locale:u,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?El({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,theme:s,stepTip:h("blocklet.component.add"),children:l.jsx(Hh,{children:typeof f?.body=="function"?f.body():f?.body})})})}pa.propTypes={ref:B.any,meta:B.any,onStepChange:B.func.isRequired,isMobile:B.bool.isRequired};const No=e=>e.isMobile?`
558
558
  height: calc(100vh - 56px - 64px - 48px);
559
- `:"",zh=tt.div`
559
+ `:"",Hh=tt.div`
560
560
  width: 100%;
561
561
  height: 100%;
562
562
  display: flex;
@@ -572,7 +572,7 @@ see detail in https://www.npmjs.com/package/is-var-name
572
572
  aside {
573
573
  width: 140px;
574
574
  }
575
- `,Vh=tt(te)`
575
+ `,Xh=tt(te)`
576
576
  ${({className:e})=>e==="mobileStyle"?`
577
577
  & > div{
578
578
  height: 100%;
@@ -678,11 +678,11 @@ see detail in https://www.npmjs.com/package/is-var-name
678
678
  display: flex;
679
679
  height: 100%;
680
680
  align-items: center;
681
- ${e=>Po(e)}
681
+ ${e=>No(e)}
682
682
  }
683
683
 
684
684
  & .agreement-wrapper {
685
- ${e=>Po(e)}
685
+ ${e=>No(e)}
686
686
  max-height: 60vh;
687
687
  .eula-trigger {
688
688
  padding-right: 0;
@@ -695,7 +695,7 @@ see detail in https://www.npmjs.com/package/is-var-name
695
695
  & .connect {
696
696
  background: white;
697
697
  }
698
- `,Kh=(e,t)=>(e?.children||[]).find(r=>r.mountPoint===t)?.meta,Gh=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1,Hh=e=>[Mt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Mt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Br=e=>e?.configs?.find(t=>t.key===Mt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Xh=e=>(e.environments||[]).some(t=>t.required),Lo=(e,t)=>e?.some(r=>r.required&&!t[r.key]),Yh=({params:e,blocklet:t,t:r})=>{const i=e.title||e.name;return i?(t?.children||[]).find(n=>n.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},_o=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)},Jh=e=>e?.store?e.store:e?.url||"";function Qh({onClose:e=()=>{},mode:t="normal",stores:r=[],resourceType:i="",resourceDid:s="",storageKey:n="",inDialog:o=!0,selectedMeta:a=null,storeUrl:d="",showResourcesSwitch:h=!0,showFromUrl:u=!0,enableRunBackground:f=!0,showCategory:j=!0,installFromUrlParams:m=null}){const{t:S,locale:E}=xt(),[C,c]=q.useState(!1),[N,$]=q.useState(null),[O,w]=q.useState(""),[R,F]=q.useState(""),{api:D,ws:{useSubscription:ne},inService:Y,info:W}=dn(),{blocklet:U,actions:{refreshBlocklet:H}}=Jn(),[A,J]=q.useState(null),[M,ue]=q.useState(!1),Ie={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[K,Ee]=q.useState(Ie),[ce,Me]=q.useState(0),me=q.useRef({}),Oe=q.useRef({}),Pe=q.useRef({}),nt=Yt(re=>re.breakpoints.down("md")),ut=Ja(),[ft,rt]=q.useState(!0),{meta:we}=me.current,de=os(we),ge=q.useRef(!1),Fe=q.useRef(null),$e=re=>Ee(ve=>({...ve,...re}));q.useEffect(()=>{if(K.pathPrefix){const{errMsg:re}=st({...K,pathPrefix:K.pathPrefix,locale:E});w(re)}},[K.pathPrefix]),q.useEffect(()=>{ce===0&&Ee(Ie)},[ce]);const jt=()=>{const re=Br(U)??"";$e({didSpaceEndpoint:re})},Ae=()=>me?.current?.meta?Ft.getDisplayName(me.current):"",Et=()=>{c(!1),Ee({}),ge.current=!1,me.current={},e()},Ot=re=>{const ve=Re=>{$e({installResultProps:{variant:"error",title:Ae(),subTitle:re,footer:l.jsx(vt,{className:"bottom-button",disabled:Re,"data-cy":"retry-install-component",onClick:async()=>{ve(!0),await pt(me.current.installInput)},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center"},children:[Re&&l.jsx(Tt,{size:16,style:{marginRight:8}}),S("common.retry")]})})}})};ve()},Ct=re=>ve=>{(ve?.meta?.did||ve?.meta)===U?.meta?.did&&re(ve)},It=()=>{_o({timeout:0,componentDid:ut.componentDid,manual:!0}),Et(),setTimeout(()=>{const re=document.getElementsByClassName("dashboard-main")[0];re&&(re.scrollTop=re.scrollHeight)},200)};ne(Mt.BlockletEvents.componentInstalled,Ct(()=>{$e({installResultProps:{variant:"success",title:Ae(),subTitle:S("blocklet.component.installSuccessTip")}}),_o({componentDid:ut.componentDid})}),[U?.meta?.did]),ne(Mt.BlockletEvents.statusChange,Ct(()=>{const re=Br(U);$e(ve=>({...ve,didSpaceEndpoint:re}))}),[U?.meta?.did]),ne(Mt.BlockletEvents.downloadFailed,Ct(()=>{ge.current=!1,Ot(S("blocklet.component.installComponentError"))}),[U?.meta?.did]),ne(Mt.BlockletEvents.installFailed,Ct(()=>{ge.current=!1,Ot(S("blocklet.component.installComponentError"))}),[U?.meta?.did]);const Ve=[],Rt=re=>(U?.children||[]).find(ve=>ve.meta.did===re),pt=async re=>{ge.current=!0;const{pathPrefix:ve,bundleDid:Re,title:p,componentName:b="",componentDid:k=""}=K,_=me.current?.meta||{},{configs:z=[],registryUrl:ee,inStore:oe,inputUrl:Se,dist:xe}=_,Qe=me.current?.downloadTokenList,Je=Se||(oe?Ii(ee,Re,xe):"");c(!0);const Le={rootDid:U.meta.did,url:Je,mountPoint:ve?Pn.urlPathFriendly(ve):`/${Pn.urlPathFriendly(_.title||_.name)}`,title:p,name:b,did:K.isUpload&&K.upgradeDid?K.upgradeDid:k,dist:{tarball:"",integrity:""},onlyRequired:!ft,...K.hasEnvironmentsStep&&z.length>0?{configs:z.map(Be=>({...Be,value:K.configsValue[Be.key]||""}))}:{},...Qe?{downloadTokenList:Qe}:{},...re};try{if(await D.installComponent({input:Le}),ee){const{teamDid:Be,storeList:Ye}=Qo({fromBlocklet:Y,nodeInfo:W,blocklet:U}),{isNew:At,decoded:sn}=Sl(ee,Ye);At&&D.addBlockletStore({input:{teamDid:Be,url:sn}}).catch(Zt=>{console.error("addBlockletStore error: ",Zt)})}$e({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(Be){const Ye=Ur(Be);Yn.error(Ye),console.error("installComponent error: ",Be),Ot(Ye)}finally{c(!1),me.current.installInput=Le}},st=re=>{const ve=ic({params:{...re,did:re.bundleDid},blocklets:[U],blocklet:U,locale:E,isUpload:K.isUpload});let Re=ve;const p=Kh(U,K.pathPrefix);if(ve==="overwrite"&&p&&p.did!==re.bundleDid?($e({upgradeDid:p.did}),Re=""):($e({upgradeDid:""}),Re=ve),Re){const b=Rt(re.bundleDid),k=oc({params:{...re,did:re.bundleDid},blocklet:U});if(b&&b.mountPoint===k)return{errMsg:""}}return{errMsg:Re}},V=async re=>{const{errMsg:ve}=st({...K,locale:E});w(ve),ce===Ve.length-2&&!ge.current&&await pt(re),Oe.current?.setActiveStepByIndex?.(Re=>Re+1)},he=()=>{Oe.current?.setActiveStepByIndex?.(re=>re-1)},De=()=>{const{pathPrefix:re,bundleDid:ve,title:Re,componentName:p="",componentDid:b=""}=K,{meta:k={}}=me.current||{},{registryUrl:_,inStore:z,inputUrl:ee,dist:oe}=k,Se=z?Ii(_,ve,oe):ee;J({meta:k,installOpts:{type:"component",rootDid:U.meta.did,mountPoint:re,url:Se,title:Re,name:p,did:b}})},Xe=re=>{ue(!1),$e({purchaseResultProps:{variant:"error",title:Ae(),subTitle:re,style:{paddingTop:120},footer:l.jsx(vt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{$e({purchaseResultProps:{}})},children:S("common.retry")})}})},it=({downloadTokenList:re})=>{me.current.downloadTokenList=re,ue(!1),V()},wt=({chooseParams:re=me.current,componentDid:ve,isInit:Re=!1,isUpload:p=!1})=>{const{meta:b,registryUrl:k,inStore:_,inputUrl:z}=re,{did:ee,title:oe,name:Se}=b,xe=(U.settings?.children||[]).filter(ot=>ot.status==="deleted"&&ot.meta.bundleDid===ee),Qe=ve||"",Je=b.environments?.map(ot=>{const{name:hn,validation:Pt,...Wt}=ot,an={validation:Dl(Pt)?"":Pt};return{...Wt,key:hn,...an}});me.current={...re,meta:{...b,configs:Je,registryUrl:k,inStore:_,inputUrl:z}};let Le={};if(Re){const ot=[U],hn=Je||[],Pt=[],Wt=es(Al([...hn,...Pt]),"key").filter(zt=>!!zt.key).sort((zt,en)=>zt.required&&!en.required?-1:en.required&&!zt.required?1:0),an=Ft.getSharedConfigObj(ot[0],{configs:Wt}),ln={},Cn=Wt.map(zt=>{const{default:en,key:tn,...Vt}=zt;return ln[tn]=an[tn]||en,{...Vt,key:tn,hidden:!!Mt.BLOCKLET_CONFIGURABLE_KEY[tn]}});Le={...Le,configsList:Cn,configsValue:ln,hasMissRequiredConfigs:Lo(Cn,ln)}}const Be=U.children.some(ot=>ot.mountPoint==="/"),Ye=xe.find(ot=>ot.meta.bundleDid===ee),At=U.children.find(ot=>ot.meta.bundleDid===ee);Le.title=oe||"",Ye?Le={...Le,pathPrefix:Ye.mountPoint||"",componentName:Ye.meta.name,hasEnvironmentsStep:!1}:At?Le={...Le,pathPrefix:At.mountPoint||"",componentName:At.meta.name,hasEnvironmentsStep:!1}:Le={...Le,pathPrefix:Be?`/${Pn.urlPathFriendly(oe)||Pn.urlPathFriendly(Se)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:me.current.meta?.environments?.length>0};const sn=Gh(me.current.meta),Zt=Hh(me.current.meta),rr=Br(U);$e({bundleDid:ee,componentDid:Qe,...Le,hasRequiredEnvironments:Xh(me.current.meta),requirePurchase:sn,didSpaceIsRequiredSetup:Zt,didSpaceEndpoint:rr,isUpload:p}),Re&&sn&&De()},qt=async()=>{if(!Fe.current.loading)try{c(!0),await Fe.current.onSubmit()&&V()}catch(re){console.error("error",re)}finally{c(!1)}};q.useEffect(()=>{if(!a&&!m?.meta||ce!==0||!U)return;const{meta:re,inputUrl:ve="",inStore:Re=!0,registryUrl:p="",isUpload:b=!1}=m||{};wt({chooseParams:{blocklets:[a||re],meta:a||re,registryUrl:p||d||Jh(a?.bundleSource),inStore:Re,inputUrl:ve},isInit:!0,isUpload:b}),$e({showFromUrlDialog:!1}),V()},[a,ce,U,m]),Ve.push({key:"selectComponent",name:S("blocklet.component.selectComponent"),body:l.jsxs(Ht,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&K.showFromUrlDialog&&l.jsx(ws,{mode:"component",onCancel:()=>{$e({showFromUrlDialog:!1})},onSuccess:({meta:re,inputUrl:ve,inStore:Re,registryUrl:p})=>{wt({chooseParams:{meta:re,inputUrl:ve,inStore:Re,registryUrl:p},isInit:!0}),$e({showFromUrlDialog:!1}),V()},handleText:{title:S("blocklet.component.addComponentTip.fromUrl"),confirm:S("blocklet.component.choose")}}),l.jsx(Os,{stores:r,extra:Ko.isInServerlessMode(W)?null:u?l.jsxs(vt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{$e({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[l.jsx(Va,{style:{fontSize:20,marginRight:4}}),S("blocklet.component.addComponentTip.fromUrl")]}):null,loading:C,onChange:()=>{Ee({}),me.current={}},storageKey:n,children:({currentRegistry:re})=>l.jsx(ua,{showResourcesSwitch:h,showCategory:j,serverVersion:W?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:re.url,resourceType:i,resourceDid:s,handleButtonClick:ve=>{wt({chooseParams:{...ve,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:ve,defaultRender:Re})=>{const p=K?.bundleDid&&K?.bundleDid===ve?.did;return l.jsxs(ef,{children:[l.jsx(te,{className:p?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...p?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:Re}),p&&l.jsx(te,{className:"check-container",children:l.jsx(Vo,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:S("common.cancel"),confirm:Yh({params:K,blocklet:U,t:S}),onCancel:Et,onConfirm:()=>{V()}}),Ve.push({key:"agreement",name:S("launchBlocklet.introduction"),body:l.jsxs(Ht,{component:"div",className:"agreement-wrapper",children:[l.jsx($r,{title:S("launchBlocklet.introduction"),subTitle:S("blocklet.component.addComponentTip.introduction")}),we?l.jsx(fs,{meta:we,onClickNext:V,installRelated:ft,onChangeInstallRelated:rt,handleDescEle:l.jsx("p",{children:S("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:S("common.pre"),disabled:!de,confirm:S(de?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Et:he,onConfirm:()=>{ue(!1),V()}}),we&&K.requirePurchase&&Ve.push({key:"purchase",name:l.jsxs(l.Fragment,{children:[S("common.verifyNFT"),l.jsx(Ln,{})]}),body:l.jsxs(Ht,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(Pe.current?.getCurrentStep?.()===2||M)&&l.jsx(Un,{title:S("common.verifyNFT"),subTitle:S("blocklet.component.addComponentTip.verifyNFT")}),xn(K.purchaseResultProps)?A&&l.jsx(ks,{ref:Pe,meta:A.meta,mode:K.componentDid?"verify":"both",onCancel:Xe,installOpts:A.installOpts,handlePaySuccess:it}):l.jsx("div",{className:"flex-align-center flex-justify-center",children:l.jsx(Pi,{...K.purchaseResultProps})})]}),disabled:Pe.current?.getCurrentStep?.()===2||M,cancel:S("common.pre"),confirm:S("common.next"),onConfirm:()=>{typeof Pe.current.onNext=="function"&&(Pe.current.onNext(),ue(!0))},onCancel:()=>{he()}}),Ft.hasStartEngine(we)&&Ml.hasMountPoint(we)?Ve.push({key:"config",name:S("common.config"),error:O,body:l.jsxs(Ht,{component:"div",children:[l.jsx(Un,{title:S("common.config"),subTitle:S("blocklet.component.addComponentTip.config")}),l.jsx(Hn,{label:S("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:R||S("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:K.pathPrefix,onChange:re=>{const ve=re.target.value;$e({pathPrefix:ve}),F(S("common.slugifyHint",{value:wl(ve)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!O&&l.jsx(Bo,{severity:"error",style:{width:"100%",marginTop:8},children:O})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:()=>{V()}}):we&&(K.pathPrefix=we.interfaces?.[0]?.path||`/${we.did}`),we&&we?.requirements?.aigne&&Ve.push({key:"aigne",name:l.jsxs(je,{component:"div",title:S("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[S("setting.aigne.config")," ",l.jsx(Ln,{})]}),body:()=>l.jsxs(Ht,{component:"div",className:"aigne-config-wrapper",children:[l.jsx($r,{title:S("setting.aigne.config")}),l.jsx(te,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:l.jsx(Zl,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:Fe})})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:()=>{Fe.current.loading||he()},onConfirm:qt,loading:C||Fe.current?.loading,disabled:C||Fe.current?.loading}),we&&K?.hasEnvironmentsStep&&Ve.push({key:"environment",name:l.jsxs(l.Fragment,{children:[S("common.environment")," ",K.hasRequiredEnvironments&&l.jsx(Ln,{})]}),disabled:!!N||K?.hasMissRequiredConfigs,body:()=>l.jsxs(Ht,{component:"div",style:{overflowY:"auto"},children:[l.jsx(Un,{title:S("common.environment"),subTitle:S("blocklet.component.addComponentTip.environment")}),l.jsx($l,{style:{marginTop:-12,width:"100%"},schema:K.configsList,defaultValue:K.configsValue,onChange:(re,{action:ve,currentItem:Re,allValues:p})=>{ve==="confirm"&&$e({hasMissRequiredConfigs:Lo(K.configsList,p),configsValue:p}),ve==="edit"?$(Re):["cancel","confirm"].includes(ve)&&$(null)}})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:V}),we&&K?.didSpaceIsRequiredSetup&&Ve.push({key:"didSpace",name:l.jsxs(l.Fragment,{children:[S("blocklet.component.didSpaceConfig")," ",K.didSpaceIsRequiredSetup==="required"&&l.jsx(Ln,{})]}),disabled:K?.didSpaceIsRequiredSetup&&!K.didSpaceEndpoint,body:()=>l.jsx(Fl,{children:l.jsxs(Ht,{component:"div",children:[l.jsx(Un,{title:S("blocklet.component.didSpaceConfig"),subTitle:S("blocklet.component.didSpaceConfigTip")}),l.jsx(te,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:l.jsx(js,{blockletMeta:me.current.meta,onNext:()=>{V()},onEndpointUpdate:jt})})]})}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:V}),Ve.push({key:"install",name:Rt(we?.did)?S("common.upgrade"):S("common.install"),disabled:f?!1:xn(K.installResultProps),loading:f?!1:xn(K.installResultProps),body:l.jsx(Ht,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:xn(K.installResultProps)?l.jsx(il,{message:l.jsx(tf,{children:S(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):l.jsx("div",{style:{marginTop:120},children:l.jsx(Pi,{...K.installResultProps})})}),confirm:S("common.complete"),onConfirm:It});const Ue=Ve[ce]||{},L=()=>C||Ue.error||!K.bundleDid?!0:ce>1?!K.pathPrefix:!1;return U?l.jsxs(Zh,{sx:o?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[l.jsx(jl,{steps:Ve,mode:"memory",children:l.jsx(da,{ref:Oe,meta:we,isMobile:nt,onStepChange:re=>{Me(re)}})}),l.jsxs(te,{className:"action-bar",children:[Ue.cancel&&l.jsx(vt,{onClick:re=>{re.stopPropagation(),Ue.onCancel()},disabled:ce===Ve.length-2&&C,color:"inherit",children:Ue.cancel||S("common.cancel")}),Ue.confirm&&l.jsx(vt,{onClick:re=>{re.stopPropagation(),Ue.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof Ue.disabled=="boolean"?Ue.disabled:L()),variant:"contained",autoFocus:!0,title:Ue.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Ue.loading=="boolean"?Ue.loading:C)&&l.jsx(Tt,{style:{marginRight:8},size:16}),l.jsx(te,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue.confirm})]})})]})]}):null}Qh.propTypes={onClose:B.func,mode:B.oneOf(["normal","embed"]),inDialog:B.bool,stores:B.arrayOf(B.string),storeUrl:B.string,resourceType:B.string,resourceDid:B.string,storageKey:B.string,selectedMeta:B.object,showResourcesSwitch:B.bool,showFromUrl:B.bool,enableRunBackground:B.bool,showCategory:B.bool,installFromUrlParams:B.object};const Zh=tt(te)`
698
+ `,Yh=(e,t)=>(e?.children||[]).find(r=>r.mountPoint===t)?.meta,Jh=e=>e.inStore&&Ft.isFreeBlocklet(e)===!1,Qh=e=>[Mt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Mt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Fr=e=>e?.configs?.find(t=>t.key===Mt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Zh=e=>(e.environments||[]).some(t=>t.required),Ao=(e,t)=>e?.some(r=>r.required&&!t[r.key]),ef=({params:e,blocklet:t,t:r})=>{const i=e.title||e.name;return i?(t?.children||[]).find(n=>n.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},Do=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)},tf=e=>e?.store?e.store:e?.url||"";function nf({onClose:e=()=>{},mode:t="normal",stores:r=[],resourceType:i="",resourceDid:s="",storageKey:n="",inDialog:o=!0,selectedMeta:a=null,storeUrl:d="",showResourcesSwitch:h=!0,showFromUrl:u=!0,enableRunBackground:f=!0,showCategory:j=!0,installFromUrlParams:m=null}){const{t:S,locale:E}=xt(),[C,c]=U.useState(!1),[N,$]=U.useState(null),[O,w]=U.useState(""),[R,F]=U.useState(""),{api:D,ws:{useSubscription:ne},inService:Y,info:W}=dn(),{blocklet:q,actions:{refreshBlocklet:H}}=Jn(),[A,J]=U.useState(null),[M,ue]=U.useState(!1),Ie={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[K,Ee]=U.useState(Ie),[ce,Me]=U.useState(0),me=U.useRef({}),Oe=U.useRef({}),Pe=U.useRef({}),nt=Yt(re=>re.breakpoints.down("md")),ut=el(),[ft,rt]=U.useState(!0),{meta:we}=me.current,de=ls(we),ge=U.useRef(!1),Fe=U.useRef(null),$e=re=>Ee(ve=>({...ve,...re}));U.useEffect(()=>{if(K.pathPrefix){const{errMsg:re}=st({...K,pathPrefix:K.pathPrefix,locale:E});w(re)}},[K.pathPrefix]),U.useEffect(()=>{ce===0&&Ee(Ie)},[ce]);const jt=()=>{const re=Fr(q)??"";$e({didSpaceEndpoint:re})},Ae=()=>me?.current?.meta?Ft.getDisplayName(me.current):"",Et=()=>{c(!1),Ee({}),ge.current=!1,me.current={},e()},Ot=re=>{const ve=Re=>{$e({installResultProps:{variant:"error",title:Ae(),subTitle:re,footer:l.jsx(vt,{className:"bottom-button",disabled:Re,"data-cy":"retry-install-component",onClick:async()=>{ve(!0),await pt(me.current.installInput)},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center"},children:[Re&&l.jsx(Tt,{size:16,style:{marginRight:8}}),S("common.retry")]})})}})};ve()},Ct=re=>ve=>{(ve?.meta?.did||ve?.meta)===q?.meta?.did&&re(ve)},It=()=>{Do({timeout:0,componentDid:ut.componentDid,manual:!0}),Et(),setTimeout(()=>{const re=document.getElementsByClassName("dashboard-main")[0];re&&(re.scrollTop=re.scrollHeight)},200)};ne(Mt.BlockletEvents.componentInstalled,Ct(()=>{$e({installResultProps:{variant:"success",title:Ae(),subTitle:S("blocklet.component.installSuccessTip")}}),Do({componentDid:ut.componentDid})}),[q?.meta?.did]),ne(Mt.BlockletEvents.statusChange,Ct(()=>{const re=Fr(q);$e(ve=>({...ve,didSpaceEndpoint:re}))}),[q?.meta?.did]),ne(Mt.BlockletEvents.downloadFailed,Ct(()=>{ge.current=!1,Ot(S("blocklet.component.installComponentError"))}),[q?.meta?.did]),ne(Mt.BlockletEvents.installFailed,Ct(()=>{ge.current=!1,Ot(S("blocklet.component.installComponentError"))}),[q?.meta?.did]);const Ve=[],Rt=re=>(q?.children||[]).find(ve=>ve.meta.did===re),pt=async re=>{ge.current=!0;const{pathPrefix:ve,bundleDid:Re,title:p,componentName:b="",componentDid:k=""}=K,_=me.current?.meta||{},{configs:z=[],registryUrl:ee,inStore:oe,inputUrl:Se,dist:xe}=_,Qe=me.current?.downloadTokenList,Je=Se||(oe?Ri(ee,Re,xe):"");c(!0);const Le={rootDid:q.meta.did,url:Je,mountPoint:ve?Pn.urlPathFriendly(ve):`/${Pn.urlPathFriendly(_.title||_.name)}`,title:p,name:b,did:K.isUpload&&K.upgradeDid?K.upgradeDid:k,dist:{tarball:"",integrity:""},onlyRequired:!ft,...K.hasEnvironmentsStep&&z.length>0?{configs:z.map(Be=>({...Be,value:K.configsValue[Be.key]||""}))}:{},...Qe?{downloadTokenList:Qe}:{},...re};try{if(await D.installComponent({input:Le}),ee){const{teamDid:Be,storeList:Ye}=ts({fromBlocklet:Y,nodeInfo:W,blocklet:q}),{isNew:At,decoded:sn}=Tl(ee,Ye);At&&D.addBlockletStore({input:{teamDid:Be,url:sn}}).catch(Zt=>{console.error("addBlockletStore error: ",Zt)})}$e({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(Be){const Ye=qr(Be);Xn.error(Ye),console.error("installComponent error: ",Be),Ot(Ye)}finally{c(!1),me.current.installInput=Le}},st=re=>{const ve=ac({params:{...re,did:re.bundleDid},blocklets:[q],blocklet:q,locale:E,isUpload:K.isUpload});let Re=ve;const p=Yh(q,K.pathPrefix);if(ve==="overwrite"&&p&&p.did!==re.bundleDid?($e({upgradeDid:p.did}),Re=""):($e({upgradeDid:""}),Re=ve),Re){const b=Rt(re.bundleDid),k=lc({params:{...re,did:re.bundleDid},blocklet:q});if(b&&b.mountPoint===k)return{errMsg:""}}return{errMsg:Re}},V=async re=>{const{errMsg:ve}=st({...K,locale:E});w(ve),ce===Ve.length-2&&!ge.current&&await pt(re),Oe.current?.setActiveStepByIndex?.(Re=>Re+1)},he=()=>{Oe.current?.setActiveStepByIndex?.(re=>re-1)},De=()=>{const{pathPrefix:re,bundleDid:ve,title:Re,componentName:p="",componentDid:b=""}=K,{meta:k={}}=me.current||{},{registryUrl:_,inStore:z,inputUrl:ee,dist:oe}=k,Se=z?Ri(_,ve,oe):ee;J({meta:k,installOpts:{type:"component",rootDid:q.meta.did,mountPoint:re,url:Se,title:Re,name:p,did:b}})},Xe=re=>{ue(!1),$e({purchaseResultProps:{variant:"error",title:Ae(),subTitle:re,style:{paddingTop:120},footer:l.jsx(vt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{$e({purchaseResultProps:{}})},children:S("common.retry")})}})},it=({downloadTokenList:re})=>{me.current.downloadTokenList=re,ue(!1),V()},wt=({chooseParams:re=me.current,componentDid:ve,isInit:Re=!1,isUpload:p=!1})=>{const{meta:b,registryUrl:k,inStore:_,inputUrl:z}=re,{did:ee,title:oe,name:Se}=b,xe=(q.settings?.children||[]).filter(ot=>ot.status==="deleted"&&ot.meta.bundleDid===ee),Qe=ve||"",Je=b.environments?.map(ot=>{const{name:hn,validation:Pt,...Wt}=ot,an={validation:Fl(Pt)?"":Pt};return{...Wt,key:hn,...an}});me.current={...re,meta:{...b,configs:Je,registryUrl:k,inStore:_,inputUrl:z}};let Le={};if(Re){const ot=[q],hn=Je||[],Pt=[],Wt=rs(Bl([...hn,...Pt]),"key").filter(zt=>!!zt.key).sort((zt,en)=>zt.required&&!en.required?-1:en.required&&!zt.required?1:0),an=Ft.getSharedConfigObj(ot[0],{configs:Wt}),ln={},Cn=Wt.map(zt=>{const{default:en,key:tn,...Vt}=zt;return ln[tn]=an[tn]||en,{...Vt,key:tn,hidden:!!Mt.BLOCKLET_CONFIGURABLE_KEY[tn]}});Le={...Le,configsList:Cn,configsValue:ln,hasMissRequiredConfigs:Ao(Cn,ln)}}const Be=q.children.some(ot=>ot.mountPoint==="/"),Ye=xe.find(ot=>ot.meta.bundleDid===ee),At=q.children.find(ot=>ot.meta.bundleDid===ee);Le.title=oe||"",Ye?Le={...Le,pathPrefix:Ye.mountPoint||"",componentName:Ye.meta.name,hasEnvironmentsStep:!1}:At?Le={...Le,pathPrefix:At.mountPoint||"",componentName:At.meta.name,hasEnvironmentsStep:!1}:Le={...Le,pathPrefix:Be?`/${Pn.urlPathFriendly(oe)||Pn.urlPathFriendly(Se)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:me.current.meta?.environments?.length>0};const sn=Jh(me.current.meta),Zt=Qh(me.current.meta),rr=Fr(q);$e({bundleDid:ee,componentDid:Qe,...Le,hasRequiredEnvironments:Zh(me.current.meta),requirePurchase:sn,didSpaceIsRequiredSetup:Zt,didSpaceEndpoint:rr,isUpload:p}),Re&&sn&&De()},qt=async()=>{if(!Fe.current.loading)try{c(!0),await Fe.current.onSubmit()&&V()}catch(re){console.error("error",re)}finally{c(!1)}};U.useEffect(()=>{if(!a&&!m?.meta||ce!==0||!q)return;const{meta:re,inputUrl:ve="",inStore:Re=!0,registryUrl:p="",isUpload:b=!1}=m||{};wt({chooseParams:{blocklets:[a||re],meta:a||re,registryUrl:p||d||tf(a?.bundleSource),inStore:Re,inputUrl:ve},isInit:!0,isUpload:b}),$e({showFromUrlDialog:!1}),V()},[a,ce,q,m]),Ve.push({key:"selectComponent",name:S("blocklet.component.selectComponent"),body:l.jsxs(Ht,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&K.showFromUrlDialog&&l.jsx(ks,{mode:"component",onCancel:()=>{$e({showFromUrlDialog:!1})},onSuccess:({meta:re,inputUrl:ve,inStore:Re,registryUrl:p})=>{wt({chooseParams:{meta:re,inputUrl:ve,inStore:Re,registryUrl:p},isInit:!0}),$e({showFromUrlDialog:!1}),V()},handleText:{title:S("blocklet.component.addComponentTip.fromUrl"),confirm:S("blocklet.component.choose")}}),l.jsx(Rs,{stores:r,extra:Xo.isInServerlessMode(W)?null:u?l.jsxs(vt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{$e({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[l.jsx(Ha,{style:{fontSize:20,marginRight:4}}),S("blocklet.component.addComponentTip.fromUrl")]}):null,loading:C,onChange:()=>{Ee({}),me.current={}},storageKey:n,children:({currentRegistry:re})=>l.jsx(fa,{showResourcesSwitch:h,showCategory:j,serverVersion:W?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:re.url,resourceType:i,resourceDid:s,handleButtonClick:ve=>{wt({chooseParams:{...ve,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:ve,defaultRender:Re})=>{const p=K?.bundleDid&&K?.bundleDid===ve?.did;return l.jsxs(of,{children:[l.jsx(te,{className:p?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...p?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:Re}),p&&l.jsx(te,{className:"check-container",children:l.jsx(Ho,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:S("common.cancel"),confirm:ef({params:K,blocklet:q,t:S}),onCancel:Et,onConfirm:()=>{V()}}),Ve.push({key:"agreement",name:S("launchBlocklet.introduction"),body:l.jsxs(Ht,{component:"div",className:"agreement-wrapper",children:[l.jsx(Ur,{title:S("launchBlocklet.introduction"),subTitle:S("blocklet.component.addComponentTip.introduction")}),we?l.jsx(gs,{meta:we,onClickNext:V,installRelated:ft,onChangeInstallRelated:rt,handleDescEle:l.jsx("p",{children:S("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:S("common.pre"),disabled:!de,confirm:S(de?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Et:he,onConfirm:()=>{ue(!1),V()}}),we&&K.requirePurchase&&Ve.push({key:"purchase",name:l.jsxs(l.Fragment,{children:[S("common.verifyNFT"),l.jsx(Ln,{})]}),body:l.jsxs(Ht,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(Pe.current?.getCurrentStep?.()===2||M)&&l.jsx(Un,{title:S("common.verifyNFT"),subTitle:S("blocklet.component.addComponentTip.verifyNFT")}),xn(K.purchaseResultProps)?A&&l.jsx(Os,{ref:Pe,meta:A.meta,mode:K.componentDid?"verify":"both",onCancel:Xe,installOpts:A.installOpts,handlePaySuccess:it}):l.jsx("div",{className:"flex-align-center flex-justify-center",children:l.jsx(Li,{...K.purchaseResultProps})})]}),disabled:Pe.current?.getCurrentStep?.()===2||M,cancel:S("common.pre"),confirm:S("common.next"),onConfirm:()=>{typeof Pe.current.onNext=="function"&&(Pe.current.onNext(),ue(!0))},onCancel:()=>{he()}}),Ft.hasStartEngine(we)&&$l.hasMountPoint(we)?Ve.push({key:"config",name:S("common.config"),error:O,body:l.jsxs(Ht,{component:"div",children:[l.jsx(Un,{title:S("common.config"),subTitle:S("blocklet.component.addComponentTip.config")}),l.jsx(Hn,{label:S("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:R||S("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:K.pathPrefix,onChange:re=>{const ve=re.target.value;$e({pathPrefix:ve}),F(S("common.slugifyHint",{value:kl(ve)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!O&&l.jsx(Uo,{severity:"error",style:{width:"100%",marginTop:8},children:O})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:()=>{V()}}):we&&(K.pathPrefix=we.interfaces?.[0]?.path||`/${we.did}`),we&&we?.requirements?.aigne&&Ve.push({key:"aigne",name:l.jsxs(je,{component:"div",title:S("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[S("setting.aigne.config")," ",l.jsx(Ln,{})]}),body:()=>l.jsxs(Ht,{component:"div",className:"aigne-config-wrapper",children:[l.jsx(Ur,{title:S("setting.aigne.config")}),l.jsx(te,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:l.jsx(nc,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:Fe})})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:()=>{Fe.current.loading||he()},onConfirm:qt,loading:C||Fe.current?.loading,disabled:C||Fe.current?.loading}),we&&K?.hasEnvironmentsStep&&Ve.push({key:"environment",name:l.jsxs(l.Fragment,{children:[S("common.environment")," ",K.hasRequiredEnvironments&&l.jsx(Ln,{})]}),disabled:!!N||K?.hasMissRequiredConfigs,body:()=>l.jsxs(Ht,{component:"div",style:{overflowY:"auto"},children:[l.jsx(Un,{title:S("common.environment"),subTitle:S("blocklet.component.addComponentTip.environment")}),l.jsx(Wl,{style:{marginTop:-12,width:"100%"},schema:K.configsList,defaultValue:K.configsValue,onChange:(re,{action:ve,currentItem:Re,allValues:p})=>{ve==="confirm"&&$e({hasMissRequiredConfigs:Ao(K.configsList,p),configsValue:p}),ve==="edit"?$(Re):["cancel","confirm"].includes(ve)&&$(null)}})]}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:V}),we&&K?.didSpaceIsRequiredSetup&&Ve.push({key:"didSpace",name:l.jsxs(l.Fragment,{children:[S("blocklet.component.didSpaceConfig")," ",K.didSpaceIsRequiredSetup==="required"&&l.jsx(Ln,{})]}),disabled:K?.didSpaceIsRequiredSetup&&!K.didSpaceEndpoint,body:()=>l.jsx(ql,{children:l.jsxs(Ht,{component:"div",children:[l.jsx(Un,{title:S("blocklet.component.didSpaceConfig"),subTitle:S("blocklet.component.didSpaceConfigTip")}),l.jsx(te,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:l.jsx(Is,{blockletMeta:me.current.meta,onNext:()=>{V()},onEndpointUpdate:jt})})]})}),cancel:S("common.pre"),confirm:S("common.next"),onCancel:he,onConfirm:V}),Ve.push({key:"install",name:Rt(we?.did)?S("common.upgrade"):S("common.install"),disabled:f?!1:xn(K.installResultProps),loading:f?!1:xn(K.installResultProps),body:l.jsx(Ht,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:xn(K.installResultProps)?l.jsx(sl,{message:l.jsx(sf,{children:S(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):l.jsx("div",{style:{marginTop:120},children:l.jsx(Li,{...K.installResultProps})})}),confirm:S("common.complete"),onConfirm:It});const Ue=Ve[ce]||{},L=()=>C||Ue.error||!K.bundleDid?!0:ce>1?!K.pathPrefix:!1;return q?l.jsxs(rf,{sx:o?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[l.jsx(Il,{steps:Ve,mode:"memory",children:l.jsx(pa,{ref:Oe,meta:we,isMobile:nt,onStepChange:re=>{Me(re)}})}),l.jsxs(te,{className:"action-bar",children:[Ue.cancel&&l.jsx(vt,{onClick:re=>{re.stopPropagation(),Ue.onCancel()},disabled:ce===Ve.length-2&&C,color:"inherit",children:Ue.cancel||S("common.cancel")}),Ue.confirm&&l.jsx(vt,{onClick:re=>{re.stopPropagation(),Ue.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof Ue.disabled=="boolean"?Ue.disabled:L()),variant:"contained",autoFocus:!0,title:Ue.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Ue.loading=="boolean"?Ue.loading:C)&&l.jsx(Tt,{style:{marginRight:8},size:16}),l.jsx(te,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue.confirm})]})})]})]}):null}nf.propTypes={onClose:B.func,mode:B.oneOf(["normal","embed"]),inDialog:B.bool,stores:B.arrayOf(B.string),storeUrl:B.string,resourceType:B.string,resourceDid:B.string,storageKey:B.string,selectedMeta:B.object,showResourcesSwitch:B.bool,showFromUrl:B.bool,enableRunBackground:B.bool,showCategory:B.bool,installFromUrlParams:B.object};const rf=tt(te)`
699
699
  .action-bar {
700
700
  display: flex;
701
701
  justify-content: flex-end;
@@ -711,9 +711,9 @@ see detail in https://www.npmjs.com/package/is-var-name
711
711
  `,Ht=tt(je)`
712
712
  width: 100%;
713
713
  height: 100%;
714
- `,Un=tt($r)`
714
+ `,Un=tt(Ur)`
715
715
  margin-bottom: 24px;
716
- `,ef=tt.div`
716
+ `,of=tt.div`
717
717
  position: relative;
718
718
 
719
719
  .choose-blocklet {
@@ -757,7 +757,7 @@ see detail in https://www.npmjs.com/package/is-var-name
757
757
  transition: all ease 0.2s;
758
758
  }
759
759
  }
760
- `,tf=tt.div`
760
+ `,sf=tt.div`
761
761
  color: ${e=>e.theme.palette.primary.main};
762
762
  .msg-before {
763
763
  display: inline-block;
@@ -765,4 +765,4 @@ see detail in https://www.npmjs.com/package/is-var-name
765
765
  font-size: 14px;
766
766
  margin-right: 6px;
767
767
  }
768
- `;export{Qh as A,vs as B,ws as I,Af as S,_f as a,Nf as b,Bh as d,du as f};
768
+ `;export{nf as A,xs as B,ks as I,Ff as S,Mf as a,Bf as b,qh as d,pu as f};