@abtnode/webapp 1.16.43-beta-20250422-042711-c40bec75 → 1.16.43-beta-20250424-125523-08a65a5c

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 (239) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-Dd50umeM.js → AdapterDayjs-Bg7uGgbF.js} +7 -7
  4. package/dist/assets/{Add-CaztVzCy.js → Add-lby-WMVZ.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-DVC5NCF_.js → ArrowDropDown-DroHSHv1.js} +1 -1
  6. package/dist/assets/{Autocomplete-BvgGgwn-.js → Autocomplete-D4Jvroxg.js} +1 -1
  7. package/dist/assets/{Breadcrumbs--d8mi7-f.js → Breadcrumbs-Degq7-cg.js} +1 -1
  8. package/dist/assets/{ButtonGroup-BwBRy_Vd.js → ButtonGroup-KbsqQYLp.js} +1 -1
  9. package/dist/assets/{CSSTransition-B2MHWQVG.js → CSSTransition-umLMVbSI.js} +1 -1
  10. package/dist/assets/{CallMerge-BKOZFJsL.js → CallMerge-D43L7gfn.js} +1 -1
  11. package/dist/assets/CardContent-BBNXKDLH.js +1 -0
  12. package/dist/assets/{ChevronLeft-BLMagiOR.js → ChevronLeft-CF_uwgT0.js} +1 -1
  13. package/dist/assets/{ChevronRight-CmLzNb37.js → ChevronRight-DbKKEEsR.js} +1 -1
  14. package/dist/assets/{Clear-DnKBhMMz.js → Clear-BYnHnNAI.js} +1 -1
  15. package/dist/assets/{Close-z9azgP87.js → Close-Dpq37qiZ.js} +1 -1
  16. package/dist/assets/{Community-CfAYk0rg.js → Community-D4w5taWL.js} +1 -1
  17. package/dist/assets/{Delete-lfXEd_sD.js → Delete-Ce85Ql3S.js} +1 -1
  18. package/dist/assets/Delete-ClxQ0y3-.js +1 -0
  19. package/dist/assets/{DeleteOutline-CpHx956r.js → DeleteOutline-C6TmcfH4.js} +1 -1
  20. package/dist/assets/{Done-B07f5HKr.js → Done-BjBoPP5g.js} +1 -1
  21. package/dist/assets/{Edit-DeW-Raa6.js → Edit-xi4J_eau.js} +1 -1
  22. package/dist/assets/{ErrorOutline-BamXOGix.js → ErrorOutline-CCSWIjK_.js} +1 -1
  23. package/dist/assets/{HelpOutline-PjbpgGnS.js → HelpOutline-D375iS8p.js} +1 -1
  24. package/dist/assets/{Holiday-os2if6d3.js → Holiday-CzE5h49l.js} +1 -1
  25. package/dist/assets/{Launch-VrwX5mL6.js → Launch-DePFcprE.js} +1 -1
  26. package/dist/assets/{Link-9GZNaOgm.js → Link-LyPYKPlx.js} +1 -1
  27. package/dist/assets/{ListItemButton-UrtScDNv.js → ListItemButton-CU1frsx_.js} +1 -1
  28. package/dist/assets/{ListSubheader-CXoRyaHI.js → ListSubheader-xl2l5mXh.js} +1 -1
  29. package/dist/assets/{LoadingButton-D_BY4Jqp.js → LoadingButton-CBSsH98L.js} +1 -1
  30. package/dist/assets/{LockIcon-BNPULy1Y.js → LockIcon-B45Spn4w.js} +1 -1
  31. package/dist/assets/{Meeting-DYJ-razI.js → Meeting-D5njBYzA.js} +1 -1
  32. package/dist/assets/{MoreHoriz-BGho5EZt.js → MoreHoriz-BBPO3lYM.js} +1 -1
  33. package/dist/assets/{MoreVert-Dsx1svGJ.js → MoreVert-CJEwAyrO.js} +1 -1
  34. package/dist/assets/{OffSick-DkD5M8d5.js → OffSick-DAPZSrTR.js} +1 -1
  35. package/dist/assets/{Public-DsP_rIVN.js → Public-DU9Zwfvz.js} +1 -1
  36. package/dist/assets/{Refresh-CY_XOdj5.js → Refresh-C8sRW4ey.js} +1 -1
  37. package/dist/assets/{SchemaReference.es-CHFc7aCW.js → SchemaReference.es-BmPkbXqa.js} +1 -1
  38. package/dist/assets/{Search-Cy1sS0Ys.js → Search-DNO2mA1t.js} +1 -1
  39. package/dist/assets/{Slider-DliZyLUu.js → Slider-D2j2o6C_.js} +1 -1
  40. package/dist/assets/{Stepper-D00G8whg.js → Stepper-ByBBXwpK.js} +1 -1
  41. package/dist/assets/{TableSearch-B7Ia4hYX.js → TableSearch-DEtaWkFM.js} +1 -1
  42. package/dist/assets/{ToggleButtonGroup-Dx7Cqen3.js → ToggleButtonGroup-ieIV-WGx.js} +1 -1
  43. package/dist/assets/{Verified-DEPnoVi2.js → Verified-QVVCTHQV.js} +1 -1
  44. package/dist/assets/{VerifiedUser-CtMfrkOq.js → VerifiedUser-DSfNrNs3.js} +1 -1
  45. package/dist/assets/{ViewColumn-1pLOayu5.js → ViewColumn-dIIJ-TaZ.js} +1 -1
  46. package/dist/assets/{ViewList-BAJgFctd.js → ViewList-BMlV2vpC.js} +1 -1
  47. package/dist/assets/{WorkingRemotely-CFsc5wBG.js → WorkingRemotely-CcpgKCrX.js} +1 -1
  48. package/dist/assets/{_createAggregator-BZiDTQ-1.js → _createAggregator-CTEoaHk3.js} +1 -1
  49. package/dist/assets/{actions-rKZA5Yl3.js → actions-DWXi51xP.js} +1 -1
  50. package/dist/assets/{actions-COYCVGfV.js → actions-D_w-E3e-.js} +2 -2
  51. package/dist/assets/{agreement-CvnU-wvl.js → agreement-CDVwTK7I.js} +4 -4
  52. package/dist/assets/api-DkiXYVLM.js +1 -0
  53. package/dist/assets/{appearance-BKSHEoHy.js → appearance-BNbra9Q0.js} +1 -1
  54. package/dist/assets/ar-BNaEJSr3.js +7 -0
  55. package/dist/assets/{audit-logs-C5PuRwaG.js → audit-logs-Bi1ieUq6.js} +2 -2
  56. package/dist/assets/blocklet-DidLj2Zo.js +1 -0
  57. package/dist/assets/{brace-fold.es-zOkKbJNK.js → brace-fold.es-hD6ePSd7.js} +1 -1
  58. package/dist/assets/{chain-nejdRVrr.js → chain-B1DYbRT2.js} +1 -1
  59. package/dist/assets/click-to-copy-D9mVJ-RV.js +1 -0
  60. package/dist/assets/cloneDeep-25ofqs0f.js +1 -0
  61. package/dist/assets/{closebrackets.es-D1eT-FTM.js → closebrackets.es-B0J2lA3U.js} +1 -1
  62. package/dist/assets/{codemirror.es-0rTHjVK9.js → codemirror.es-BaDyFG9Y.js} +1 -1
  63. package/dist/assets/{comment.es-BzTQxNrB.js → comment.es-DPh31JMD.js} +1 -1
  64. package/dist/assets/{config-navigation-DP1VP0AV.js → config-navigation-Czs5GZbX.js} +17 -17
  65. package/dist/assets/{connect-to-CLKjNArl.js → connect-to-P_JZVAGf.js} +1 -1
  66. package/dist/assets/de-BsZVQmUM.js +7 -0
  67. package/dist/assets/delete-confirm-CPbaWrD8.js +1 -0
  68. package/dist/assets/{detail-SkSHXUY6.js → detail-BkfZ-vLq.js} +3 -3
  69. package/dist/assets/{dialog.es-DTCttvK1.js → dialog.es-Cy5fQBet.js} +1 -1
  70. package/dist/assets/domains-BLRqSu-m.js +24 -0
  71. package/dist/assets/{download-hxkTe46m.js → download-gAaJAdD7.js} +1 -1
  72. package/dist/assets/emotion-react.browser.esm-BuYEJ5bP.js +1 -0
  73. package/dist/assets/es-ntlJbt-a.js +7 -0
  74. package/dist/assets/{foldgutter.es-D09BRatH.js → foldgutter.es-DpwInfY6.js} +1 -1
  75. package/dist/assets/fr-Bv4B0MVB.js +7 -0
  76. package/dist/assets/{get-safe-url-6iqduUH5.js → get-safe-url-CofQV3ai.js} +1 -1
  77. package/dist/assets/{get-safe-url-CVvG2J9I.js → get-safe-url-DzAjUQl5.js} +1 -1
  78. package/dist/assets/getValidReactChildren-BNMVx0A0.js +1 -0
  79. package/dist/assets/hi-DIf_hqVB.js +5 -0
  80. package/dist/assets/{hint.es-CElKEoBL.js → hint.es-zNpcbGGk.js} +1 -1
  81. package/dist/assets/{hint.es2-cm-ZWwEJ.js → hint.es2-5htyBXtO.js} +1 -1
  82. package/dist/assets/id-DZBgOnwF.js +7 -0
  83. package/dist/assets/{iframe-BtkIGcLr.js → iframe-DaFIiCmw.js} +1 -1
  84. package/dist/assets/{index-CrLu05HL.js → index-7G8x7Vl0.js} +24 -24
  85. package/dist/assets/{index-B8tVxEg2.js → index-B38OHLL1.js} +1 -1
  86. package/dist/assets/{index-BaNhzXWK.js → index-B5aj8g64.js} +25 -25
  87. package/dist/assets/{index-C1Ig2ZHh.js → index-B7k9dkSz.js} +1 -1
  88. package/dist/assets/{index-DFqgZ5xa.js → index-BH5HIFbb.js} +1 -1
  89. package/dist/assets/{index-Ca2ykS6T.js → index-BIAPYyhR.js} +1 -1
  90. package/dist/assets/{index-H4oRzuHX.js → index-BJV-jbRZ.js} +1 -1
  91. package/dist/assets/index-BcXeJXCR.js +1 -0
  92. package/dist/assets/{index-DU1prNlR.js → index-Bd8opEvI.js} +1 -1
  93. package/dist/assets/{index-iKNyCq23.js → index-BdtBG9co.js} +1 -1
  94. package/dist/assets/{index-C7M3KjDN.js → index-Bqki_NGY.js} +1 -1
  95. package/dist/assets/{index-BdcAx4jd.js → index-Bzt7VEv3.js} +1 -1
  96. package/dist/assets/{index-D5tFxfO4.js → index-C1TWTzPh.js} +3 -3
  97. package/dist/assets/index-C6d26-qR.js +1 -0
  98. package/dist/assets/{index-CwQRP9vW.js → index-CIOf_B3T.js} +1 -1
  99. package/dist/assets/{index-CkuW1m1M.js → index-CQ7uV-a-.js} +1 -1
  100. package/dist/assets/{index-dpcQFGC9.js → index-CTEKj5go.js} +1 -1
  101. package/dist/assets/{index-dPMBaXU5.js → index-CfWjDiL_.js} +1 -1
  102. package/dist/assets/{index-Db1NmfnY.js → index-CiCEonKE.js} +11 -11
  103. package/dist/assets/{index-D1AcZBxv.js → index-CkIbYyM0.js} +1 -1
  104. package/dist/assets/{index-CrdafeIA.js → index-Ct8zi4pq.js} +4 -4
  105. package/dist/assets/{index-B_8fIevk.js → index-CxfmUaF-.js} +1 -1
  106. package/dist/assets/index-Cy5Qtbob.js +1 -0
  107. package/dist/assets/{index-CmON_Ucm.js → index-D-8F2hnL.js} +3 -3
  108. package/dist/assets/{index-B-gpi2ba.js → index-D3aHzIo4.js} +1 -1
  109. package/dist/assets/{index-D5iXLg7U.js → index-D652L7CC.js} +1 -1
  110. package/dist/assets/{index-CH0ZtB03.js → index-DB-T1OVT.js} +1 -1
  111. package/dist/assets/{index-DacxPQzS.js → index-DEtsePs-.js} +9 -9
  112. package/dist/assets/{index-BG2kH0vO.js → index-DIt3-b0L.js} +1 -1
  113. package/dist/assets/index-DJipOB3r.js +327 -0
  114. package/dist/assets/{index-BYMuyFwb.js → index-DPbGXgqB.js} +2 -2
  115. package/dist/assets/{index-bYp_tt8z.js → index-DUWb27J9.js} +1 -1
  116. package/dist/assets/{index-Chf7gMD-.js → index-DX_pC0Y6.js} +5 -5
  117. package/dist/assets/{index-DMyuQ6gX.js → index-Di0aMImb.js} +1 -1
  118. package/dist/assets/{index-CdIzwolo.js → index-Dj8CUjVy.js} +1 -1
  119. package/dist/assets/{index-DwcH9Py2.js → index-DllLiKC-.js} +1 -1
  120. package/dist/assets/{index-BI57n5-1.js → index-Dmw-rWCR.js} +1 -1
  121. package/dist/assets/index-E6lSv66O.js +20 -0
  122. package/dist/assets/{index-PKxcb70p.js → index-QaZ1YHGi.js} +4 -4
  123. package/dist/assets/{index-BjeDI2iY.js → index-RxScS04A.js} +1 -1
  124. package/dist/assets/index-W1T8OGsQ.js +102 -0
  125. package/dist/assets/{index-BEKPz42W.js → index-ftNYfJO-.js} +2 -2
  126. package/dist/assets/{index-BCoMTShJ.js → index-kCV42hBz.js} +3 -3
  127. package/dist/assets/{index-BkTRcS0m.js → index-mzqVbRK8.js} +5 -5
  128. package/dist/assets/{index-DacB9LlP.js → index-peWL8owC.js} +1 -1
  129. package/dist/assets/{index-CoenHBJL.js → index-rRNsJfpm.js} +1 -1
  130. package/dist/assets/{index-C9UfyIb3.js → index-rZNPURo0.js} +1 -1
  131. package/dist/assets/index-uPaywPQ8.js +11 -0
  132. package/dist/assets/{index.esm-BiF80IE7.js → index.esm-C4Qz2Lyg.js} +1 -1
  133. package/dist/assets/{info-addon.es-LTLqCI-0.js → info-addon.es-BXYvd0W0.js} +1 -1
  134. package/dist/assets/{info.es-DGuZ8x_j.js → info.es-BqgAgM-L.js} +1 -1
  135. package/dist/assets/{install-from-url-CctlVaYm.js → install-from-url-xwgejqoQ.js} +1 -1
  136. package/dist/assets/{invitation-B5T1tiZS.js → invitation-DTsCoqpv.js} +5 -5
  137. package/dist/assets/is-path-prefix-equal-CH05cZsF.js +1 -0
  138. package/dist/assets/{item-C_feFNJE.js → item-CmVxSSOE.js} +5 -5
  139. package/dist/assets/ja-8jRYJGVw.js +7 -0
  140. package/dist/assets/{javascript.es-DXQm_49v.js → javascript.es-grXxHaUZ.js} +1 -1
  141. package/dist/assets/{jump-to-line.es-COQrSkxS.js → jump-to-line.es-B6hVDRl6.js} +1 -1
  142. package/dist/assets/{jump.es-Bt36pao4.js → jump.es-B_PWFf9O.js} +1 -1
  143. package/dist/assets/ko-C4pbuwv8.js +7 -0
  144. package/dist/assets/{lint.es-D7cZDq3q.js → lint.es-9mA5K-XH.js} +1 -1
  145. package/dist/assets/{lint.es2-DjlpYEUm.js → lint.es2-B8BrvpI1.js} +1 -1
  146. package/dist/assets/{lint.es3-DZfzAxs3.js → lint.es3-fLYIED-e.js} +1 -1
  147. package/dist/assets/{list-header-D6gN8uAe.js → list-header-DRRNzO0m.js} +1 -1
  148. package/dist/assets/{log-D0D7SXBT.js → log-CsCaVz2A.js} +1 -1
  149. package/dist/assets/{lottie-react.esm-Cq33pfIC.js → lottie-react.esm-BKXV9kCi.js} +1 -1
  150. package/dist/assets/{matchbrackets.es-3bFu-rM7.js → matchbrackets.es-CzWnE91z.js} +1 -1
  151. package/dist/assets/{memory-C4f-u36N.js → memory-gHhFfsR0.js} +1 -1
  152. package/dist/assets/{mode.es-fSwJIwcv.js → mode.es-C15J0aR6.js} +1 -1
  153. package/dist/assets/{mode.es2-DE0KN96r.js → mode.es2-DomABVUn.js} +1 -1
  154. package/dist/assets/{mode.es3-7lr44IEM.js → mode.es3-UeuTaWNm.js} +1 -1
  155. package/dist/assets/omit-CV0Lh9D4.js +1 -0
  156. package/dist/assets/{onlineParser.es-CgJfI2uz.js → onlineParser.es-BbMfA3YO.js} +1 -1
  157. package/dist/assets/{overview-BFj7mF3I.js → overview-Bu69g0aI.js} +2 -2
  158. package/dist/assets/{permission-CWRNDCfb.js → permission-KtOkmZK5.js} +1 -1
  159. package/dist/assets/{preference-Bu7eUUWY.js → preference-DioTxcDx.js} +4 -4
  160. package/dist/assets/pt-CMeQ7KWn.js +5 -0
  161. package/dist/assets/{raf-schd.esm-CHbi2ex4.js → raf-schd.esm-DqWgvWp8.js} +1 -1
  162. package/dist/assets/refType-M_fnNR8Y.js +1 -0
  163. package/dist/assets/{resource-dialog-Bkqsb65A.js → resource-dialog-CybAqKK7.js} +4 -4
  164. package/dist/assets/ru-8cWKcW3b.js +5 -0
  165. package/dist/assets/{runtime-BTj0lhIQ.js → runtime-C2qLnxoL.js} +1 -1
  166. package/dist/assets/{schema-v7IiGTwK.js → schema-B-wPSL-T.js} +1 -1
  167. package/dist/assets/{search.es-Dq3fEJn9.js → search.es-D-x2fK1z.js} +1 -1
  168. package/dist/assets/{searchcursor.es-4j5vi65s.js → searchcursor.es-DQ3R3tL0.js} +1 -1
  169. package/dist/assets/{service-lHsrm0NQ.js → service-1KS_Mvhf.js} +1 -1
  170. package/dist/assets/session-CDrB7OKD.js +1 -0
  171. package/dist/assets/shorten-label-3ndfcRTb.js +1 -0
  172. package/dist/assets/{show-hint.es-Ojy6T5sj.js → show-hint.es-kWFkQmfD.js} +1 -1
  173. package/dist/assets/{simple-select-F8H5fDWg.js → simple-select-CCb06xBs.js} +1 -1
  174. package/dist/assets/{spaces-BTXS6Yjp.js → spaces-Dlk0tiHl.js} +1 -1
  175. package/dist/assets/{status-IJGTdR69.js → status-D__Gu7bb.js} +1 -1
  176. package/dist/assets/{status-l9WKVdEe.js → status-qfhBp9Zz.js} +1 -1
  177. package/dist/assets/{sublime.es-B-15UZDa.js → sublime.es-D65uN2k1.js} +1 -1
  178. package/dist/assets/{switch-control-DonG73Yn.js → switch-control-Cpqmpl-t.js} +1 -1
  179. package/dist/assets/{table-icons-BHel_001.js → table-icons-Wfa_TiY1.js} +1 -1
  180. package/dist/assets/{team-B791iWfh.js → team-DLnveWtv.js} +1 -1
  181. package/dist/assets/th-DYYGBboI.js +5 -0
  182. package/dist/assets/{toLower-Na2C3nc2.js → toLower-Cc2jzGm2.js} +1 -1
  183. package/dist/assets/toUpper-B0N7bX3J.js +1 -0
  184. package/dist/assets/{traffic-C0ojZNhU.js → traffic-C9SC7OdE.js} +1 -1
  185. package/dist/assets/{url-evaluation-gByE9zMg.js → url-evaluation-C6gQAust.js} +1 -1
  186. package/dist/assets/{url-join-D1f7RCcb.js → url-join-BhaAJPg6.js} +1 -1
  187. package/dist/assets/{use-mobile-ccyNEJKq.js → use-mobile-BAkfxlsb.js} +1 -1
  188. package/dist/assets/{use-mobile-ate4xZwv.js → use-mobile-uaCblfH4.js} +1 -1
  189. package/dist/assets/{useAsync-VXf0m9o5.js → useAsync-UCL8EFNX.js} +1 -1
  190. package/dist/assets/{useLocalStorage-CM3CvKLy.js → useLocalStorage-CX0bausV.js} +1 -1
  191. package/dist/assets/{useThemeProps-BC8tRkwB.js → useThemeProps-ekXTUVYd.js} +1 -1
  192. package/dist/assets/{util-7WcGgtM2.js → util-CdmIFTbh.js} +1 -1
  193. package/dist/assets/vi-CfH0km8q.js +5 -0
  194. package/dist/assets/{wait-container-YMrkmjdy.js → wait-container-BqRh3coF.js} +3 -3
  195. package/dist/assets/withStyles-DQ3lkjuW.js +1 -0
  196. package/dist/assets/wrap-locale-DSOYhBxy.js +1 -0
  197. package/dist/assets/{zh-CY9wasmC.js → zh-DZlGQAU9.js} +1 -1
  198. package/dist/assets/zh-tw-Be5lgYGX.js +7 -0
  199. package/dist/index.html +1 -1
  200. package/dist/service-worker.js +1 -1
  201. package/package.json +1 -1
  202. package/dist/assets/CardContent-BtOX0LtZ.js +0 -1
  203. package/dist/assets/Delete-WcGTUKKB.js +0 -1
  204. package/dist/assets/api-DLD170qt.js +0 -1
  205. package/dist/assets/ar-DRtGxecv.js +0 -7
  206. package/dist/assets/blocklet-DJBGGeZX.js +0 -1
  207. package/dist/assets/click-to-copy-DMnzmGmb.js +0 -1
  208. package/dist/assets/cloneDeep-B9FR8YvV.js +0 -1
  209. package/dist/assets/de-BZDWXY3K.js +0 -7
  210. package/dist/assets/delete-confirm-BtLdya8P.js +0 -1
  211. package/dist/assets/domains-Ocd33WxK.js +0 -25
  212. package/dist/assets/emotion-react.browser.esm-BhrBe_SA.js +0 -1
  213. package/dist/assets/es-kQ6jQG-H.js +0 -7
  214. package/dist/assets/fr-Bf3jz4q5.js +0 -7
  215. package/dist/assets/getValidReactChildren-Cpt3JIPG.js +0 -1
  216. package/dist/assets/hi-DPdbGXyy.js +0 -5
  217. package/dist/assets/id-BqmT-cL5.js +0 -7
  218. package/dist/assets/index-BbQ_Eva9.js +0 -1
  219. package/dist/assets/index-CsRDH5PZ.js +0 -11
  220. package/dist/assets/index-DErkdWGS.js +0 -1
  221. package/dist/assets/index-Dk_ddRep.js +0 -20
  222. package/dist/assets/index-JQOci2IN.js +0 -1
  223. package/dist/assets/index-Smdhabbz.js +0 -102
  224. package/dist/assets/index-U3LqL5BU.js +0 -327
  225. package/dist/assets/is-path-prefix-equal-evPnCa54.js +0 -1
  226. package/dist/assets/ja-CyUU4_H1.js +0 -7
  227. package/dist/assets/ko-DWTxutv1.js +0 -7
  228. package/dist/assets/omit-CRVyfsPe.js +0 -1
  229. package/dist/assets/pt-BcsDG9H6.js +0 -5
  230. package/dist/assets/refType-DslaJ1jV.js +0 -1
  231. package/dist/assets/ru-BwH1q1F1.js +0 -5
  232. package/dist/assets/session-ZhuGZWu8.js +0 -1
  233. package/dist/assets/shorten-label-DOksnAtq.js +0 -1
  234. package/dist/assets/th-CNztcQMJ.js +0 -5
  235. package/dist/assets/toUpper-CxCsEo5T.js +0 -1
  236. package/dist/assets/vi-Bpl5HEj4.js +0 -5
  237. package/dist/assets/withStyles-oCXyS3DL.js +0 -1
  238. package/dist/assets/wrap-locale-C4NCfxhS.js +0 -1
  239. package/dist/assets/zh-tw-D6qZTlL3.js +0 -7
@@ -1,4 +1,4 @@
1
- import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y as L,r as f,f as Se,bP as qe,b as K,H as B,X as Bt,bO as He,t as Q,n as $,Y as le,kW as No,a5 as te,b8 as oo,k as oe,D as ft,bg as Lo,gM as Bo,gN as Oo,C as fe,fP as Mo,e0 as $o,w as Ao,az as An,a3 as ht,v as qo,kX as Go,kY as Wo,B as ce,kZ as zo,Z as Fo,$ as Vo,k_ as so,bC as io,U as je,dQ as Yo,aD as Ko,aE as Ho,k$ as Qo,kd as Zo,aF as Xo,aH as ee,aS as Jo,am as ro,cO as es,E as ao,by as ts,a0 as ns,N as at,aG as lo,bc as Gt,l0 as os,bd as Re,aC as qn,cM as ss,k0 as is,A as U,af as Ge,aO as co,c4 as Wt,cC as rs,L as gt,l1 as as,bn as ls,x as uo,aY as Ot,T as cs,aW as Ke,ax as It,W as ds,bQ as po,gL as us,cw as ps,aK as ms,bI as fs,aV as hs,b0 as gs,fZ as Gn,l2 as Wn,hb as zn,V as Fn,G as lt,cL as xs,hc as ys,c3 as Cs,k1 as vs}from"./index-Db1NmfnY.js";import{d as js}from"./Add-CaztVzCy.js";import{E as bs}from"./index-bYp_tt8z.js";import{c as Rs,e as Ss,f as ws,u as zt,a as Es}from"./actions-COYCVGfV.js";import{S as Ts}from"./switch-control-DonG73Yn.js";import{u as he}from"./blocklet-DJBGGeZX.js";import{P as Mt,w as xt}from"./permission-CWRNDCfb.js";import{d as mo}from"./Edit-DeW-Raa6.js";import{T as ks,M as Ps,t as _s}from"./table-icons-BHel_001.js";import{C as Vn}from"./click-to-copy-DMnzmGmb.js";import{d as Ft}from"./Link-9GZNaOgm.js";import{c as Is,C as Ds,b as Us,s as fo,e as Ns,M as Ls,d as ho,a as Bs,A as Os,B as Ms,f as $s,S as As}from"./item-C_feFNJE.js";import{u as qs,a as Gs,P as go,L as Yn,A as Ws,S as zs}from"./index-B-gpi2ba.js";import{u as Fs,C as Vs,D as Ys,a as Ks,b as Hs}from"./connect-to-CLKjNArl.js";import{C as Qs,u as Zs,A as Xs}from"./agreement-CvnU-wvl.js";import{R as dt,F as Js,L as ei,d as ti,B as ni}from"./preference-Bu7eUUWY.js";import{d as oi}from"./Done-B07f5HKr.js";import{C as si,L as ii}from"./LockIcon-BNPULy1Y.js";import{I as ri,a as ai,f as li,B as ci}from"./install-from-url-CctlVaYm.js";import{a as Kn}from"./api-DLD170qt.js";import{v as xo,e as di,a as ut}from"./util-7WcGgtM2.js";import{u as yo}from"./use-mobile-ccyNEJKq.js";import{d as ui}from"./ArrowDropDown-DVC5NCF_.js";import{_ as pi}from"./useLocalStorage-CM3CvKLy.js";import{d as yt}from"./Delete-lfXEd_sD.js";import{d as Co}from"./Launch-VrwX5mL6.js";import{D as mi}from"./delete-confirm-BtLdya8P.js";import{W as Qe,R as fi,a as Hn}from"./url-evaluation-gByE9zMg.js";import{B as vo}from"./status-IJGTdR69.js";import{A as jo}from"./actions-rKZA5Yl3.js";import{I as Dt}from"./index-CwQRP9vW.js";import{t as hi}from"./toUpper-CxCsEo5T.js";import{a as gi}from"./index-H4oRzuHX.js";import{a as xi}from"./team-B791iWfh.js";import"./MoreVert-Dsx1svGJ.js";import"./get-safe-url-CVvG2J9I.js";import"./ButtonGroup-BwBRy_Vd.js";import"./getValidReactChildren-Cpt3JIPG.js";import"./session-ZhuGZWu8.js";import"./raf-schd.esm-CHbi2ex4.js";import"./index-DMyuQ6gX.js";import"./ViewColumn-1pLOayu5.js";import"./CSSTransition-B2MHWQVG.js";import"./index-C7M3KjDN.js";import"./Clear-DnKBhMMz.js";import"./ChevronRight-CmLzNb37.js";import"./ChevronLeft-BLMagiOR.js";import"./Search-Cy1sS0Ys.js";import"./index-DacB9LlP.js";import"./Autocomplete-BvgGgwn-.js";import"./ListSubheader-CXoRyaHI.js";import"./Verified-DEPnoVi2.js";import"./VerifiedUser-CtMfrkOq.js";import"./DeleteOutline-CpHx956r.js";import"./url-join-D1f7RCcb.js";import"./Close-z9azgP87.js";import"./index-D5tFxfO4.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-PjbpgGnS.js";import"./index-Ca2ykS6T.js";import"./spaces-BTXS6Yjp.js";import"./index-CoenHBJL.js";import"./index-B_8fIevk.js";import"./iframe-BtkIGcLr.js";import"./cloneDeep-B9FR8YvV.js";import"./schema-v7IiGTwK.js";import"./index-D1AcZBxv.js";import"./ListItemButton-UrtScDNv.js";import"./Stepper-D00G8whg.js";import"./is-path-prefix-equal-evPnCa54.js";import"./shorten-label-DOksnAtq.js";import"./MoreHoriz-BGho5EZt.js";const yi=Uo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Vt={},Ci=qt;Object.defineProperty(Vt,"__esModule",{value:!0});var bo=Vt.default=void 0,vi=Ci(At()),ji=e;bo=Vt.default=(0,vi.default)((0,ji.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Yt={},bi=qt;Object.defineProperty(Yt,"__esModule",{value:!0});var Kt=Yt.default=void 0,Ri=bi(At()),Si=e;Kt=Yt.default=(0,Ri.default)((0,Si.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Ht({children:t,...s}){var x;const{t:o}=W(),{api:a}=Z(),{blocklet:n}=he(),r=(x=n==null?void 0:n.settings)==null?void 0:x.autoCheckUpdate,h=async g=>{await a.updateAutoCheckUpdate({input:{did:n.meta.did,autoCheckUpdate:g}})},d=async()=>{try{const g=!(r!=null&&r.enabled);await h({enabled:g}),L.success(o(g?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(g){L.error(g.message)}},m=!!(r!=null&&r.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(be,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ts,{checked:m,onChange:d,name:"enableWelcomePage",style:{...s.style,zoom:.8}})})})]})}Ht.propTypes={children:i.any};Ht.defaultProps={children:null};const wi=(t,s)=>{let{description:o}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||B.isEnvShareable(t))&&(o?o=`${o} (${s("blocklet.config.sharedToAllComponents")})`:o=s("blocklet.config.sharedToAllComponents")),o&&e.jsx("div",{style:{marginLeft:12},children:o})},Ut=(t,s,o=[])=>!(o!=null&&o.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!s.meta.environments.find(a=>a.name===t.key)&&s.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom,Qn=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),Nt=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Qt({blocklet:t,ancestors:s}){const o=Z(),{inService:a}=o,{t:n}=f.useContext(Se),r=[...s.map(c=>c.meta.did),t.meta.did],h=()=>L.success(n("blocklet.config.changedTip")),d=c=>Ut(c,t,s);if(qe(t.status)||t.status==="unknown"&&qe(t.status))return null;const m=c=>new Promise(async(w,p)=>{if(!c.key.trim()||!c.value.trim()){L.error(n("blocklet.config.environment.keyValueRequired")),p();return}if(Qn(c.key)===!1){L.error(n("blocklet.config.environment.invalidKey")),p();return}c.custom=Nt(c.key);try{const C=await o.api.configBlocklet({input:{did:r,configs:[c]}});h(C.blocklet),w()}catch(C){L.error(le(C)),p()}}),x=(c,w)=>new Promise(async(p,C)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){L.error(n("blocklet.config.environment.keyValueRequired")),C();return}if(Qn(c.key)===!1){L.error(n("blocklet.config.environment.invalidKey")),C();return}if(c.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const v=No(c);if(v){L.error(v),C();return}}const P=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==w.key){if(!Ut(c,t,s)){L.error("Only key of custom env can be changed"),C();return}P.push({key:w.key,custom:Nt(c.key)})}try{const v=await o.api.configBlocklet({input:{did:r,configs:P}});h(v.blocklet),p()}catch(v){L.error(le(v)),C()}}),g=c=>new Promise(async(w,p)=>{if(c.required){L.error(n("blocklet.config.environment.deleteForbidden")),p();return}if(!Ut(c,t,s)){L.error("Only key of custom env can be changed"),p();return}try{const C=await o.api.configBlocklet({input:{did:r,configs:[{key:c.key,custom:Nt(c.key)}]}});h(C.blocklet),w()}catch(C){L.error(le(C)),p()}}),l=(t.configs||[]).filter(c=>!K.BLOCKLET_CONFIGURABLE_KEY[c.key]||[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(c.key)),j=B.getSharedConfigObj(s[0],t),u=B.getComponentMissingConfigs(t,s[0]),E=l.map(c=>({...c,value:Object.values(K.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(j).includes(c.key)?j[c.key]:j[c.key]||c.value})),b=E.some(c=>c.key&&c.key.startsWith("BWA_")),R={onRowAdd:m,onRowUpdate:x,onRowDelete:g,isDeletable:d},I=()=>[{title:n("common.key"),field:"key",initialEditValue:"",width:"30%",render:c=>e.jsx(Vn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:w,rowData:p,onChange:C}=c;return e.jsx(Zn,{children:e.jsx(Q,{fullWidth:!0,size:"small",disabled:d(p)===!1,value:w,onChange:P=>C(P.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Vn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:w,rowData:p,onChange:C}=c;return e.jsxs(Zn,{children:[e.jsx(Q,{fullWidth:!0,size:"small",value:w==="__encrypted__"?"":w,onChange:P=>C(P.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense"}),wi(p,n)]})}}];return e.jsxs(Ei,{children:[!!u.length&&e.jsx(Bt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),b&&e.jsx(Bt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Mt,{permission:a?"":"mutate_blocklets",role:a?He:[],children:c=>e.jsx(ks,{className:"config-table",children:e.jsx(Ps,{title:e.jsx(y,{fontWeight:"bold",children:n("common.environments")}),columns:I(),icons:{...Rs,..._s},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:E,editable:c?R:{}})})})]})}Qt.propTypes={blocklet:i.object.isRequired,ancestors:i.array};Qt.defaultProps={ancestors:[]};const Ei=$.div`
1
+ import{bX as Uo,j as e,aP as At,aQ as qt,m as W,bq as Z,M as y,aB as be,P as r,y as L,r as f,f as Se,bF as qe,b as K,H as B,X as Bt,bE as He,t as Q,n as $,Y as le,kW as No,a5 as te,aZ as oo,k as oe,D as ft,b5 as Lo,gM as Bo,gN as Oo,C as fe,fO as Mo,d$ as $o,w as Ao,az as An,a3 as ht,v as qo,kX as Go,kY as Wo,B as ce,kZ as zo,Z as Fo,$ as Vo,k_ as so,br as ro,U as je,dP as Yo,aD as Ko,aE as Ho,k$ as Qo,kd as Zo,aF as Xo,aH as ee,aS as Jo,am as io,cN as es,E as ao,bn as ts,a0 as ns,N as at,aG as lo,b1 as Gt,l0 as os,b2 as Re,aC as qn,cL as ss,k0 as rs,A as U,af as Ge,aO as co,bW as Wt,cB as is,L as gt,l1 as as,bc as ls,x as uo,aY as Ot,T as cs,aW as Ke,ax as It,W as ds,bG as po,gL as us,cv as ps,aK as ms,by as fs,aV as hs,el as gs,fY as Gn,l2 as Wn,hb as zn,V as Fn,G as lt,cK as xs,hc as ys,bV as Cs,k1 as vs}from"./index-CiCEonKE.js";import{d as js}from"./Add-lby-WMVZ.js";import{E as bs}from"./index-DUWb27J9.js";import{c as Rs,e as Ss,f as Es,u as zt,a as ws}from"./actions-D_w-E3e-.js";import{S as Ts}from"./switch-control-Cpqmpl-t.js";import{u as he}from"./blocklet-DidLj2Zo.js";import{P as Mt,w as xt}from"./permission-KtOkmZK5.js";import{d as mo}from"./Edit-xi4J_eau.js";import{T as ks,M as Ps,t as _s}from"./table-icons-Wfa_TiY1.js";import{C as Vn}from"./click-to-copy-D9mVJ-RV.js";import{d as Ft}from"./Link-LyPYKPlx.js";import{c as Is,C as Ds,b as Us,s as fo,e as Ns,M as Ls,d as ho,a as Bs,A as Os,B as Ms,f as $s,S as As}from"./item-CmVxSSOE.js";import{u as qs,a as Gs,P as go,L as Yn,A as Ws,S as zs}from"./index-D3aHzIo4.js";import{u as Fs,C as Vs,D as Ys,a as Ks,b as Hs}from"./connect-to-P_JZVAGf.js";import{C as Qs,u as Zs,A as Xs}from"./agreement-CDVwTK7I.js";import{R as dt,F as Js,L as er,d as tr,B as nr}from"./preference-DioTxcDx.js";import{d as or}from"./Done-BjBoPP5g.js";import{C as sr,L as rr}from"./LockIcon-B45Spn4w.js";import{I as ir,a as ar,f as lr,B as cr}from"./install-from-url-xwgejqoQ.js";import{a as Kn}from"./api-DkiXYVLM.js";import{v as xo,e as dr,a as ut}from"./util-CdmIFTbh.js";import{u as yo}from"./use-mobile-BAkfxlsb.js";import{d as ur}from"./ArrowDropDown-DroHSHv1.js";import{_ as pr}from"./useLocalStorage-CX0bausV.js";import{d as yt}from"./Delete-Ce85Ql3S.js";import{d as Co}from"./Launch-DePFcprE.js";import{D as mr}from"./delete-confirm-CPbaWrD8.js";import{W as Qe,R as fr,a as Hn}from"./url-evaluation-C6gQAust.js";import{B as vo}from"./status-D__Gu7bb.js";import{A as jo}from"./actions-DWXi51xP.js";import{I as Dt}from"./index-CIOf_B3T.js";import{t as hr}from"./toUpper-B0N7bX3J.js";import{a as gr}from"./index-BJV-jbRZ.js";import{a as xr}from"./team-DLnveWtv.js";import"./MoreVert-CJEwAyrO.js";import"./get-safe-url-CofQV3ai.js";import"./ButtonGroup-KbsqQYLp.js";import"./getValidReactChildren-BNMVx0A0.js";import"./session-CDrB7OKD.js";import"./raf-schd.esm-DqWgvWp8.js";import"./index-Di0aMImb.js";import"./ViewColumn-dIIJ-TaZ.js";import"./CSSTransition-umLMVbSI.js";import"./index-Bqki_NGY.js";import"./Clear-BYnHnNAI.js";import"./ChevronRight-DbKKEEsR.js";import"./ChevronLeft-CF_uwgT0.js";import"./Search-DNO2mA1t.js";import"./index-peWL8owC.js";import"./Autocomplete-D4Jvroxg.js";import"./ListSubheader-xl2l5mXh.js";import"./Verified-QVVCTHQV.js";import"./VerifiedUser-DSfNrNs3.js";import"./DeleteOutline-C6TmcfH4.js";import"./url-join-BhaAJPg6.js";import"./Close-Dpq37qiZ.js";import"./index-C1TWTzPh.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-D375iS8p.js";import"./index-BIAPYyhR.js";import"./spaces-Dlk0tiHl.js";import"./index-rRNsJfpm.js";import"./index-CxfmUaF-.js";import"./iframe-DaFIiCmw.js";import"./cloneDeep-25ofqs0f.js";import"./schema-B-wPSL-T.js";import"./index-CkIbYyM0.js";import"./ListItemButton-CU1frsx_.js";import"./Stepper-ByBBXwpK.js";import"./is-path-prefix-equal-CH05cZsF.js";import"./MoreHoriz-BBPO3lYM.js";const yr=Uo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Vt={},Cr=qt;Object.defineProperty(Vt,"__esModule",{value:!0});var bo=Vt.default=void 0,vr=Cr(At()),jr=e;bo=Vt.default=(0,vr.default)((0,jr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Yt={},br=qt;Object.defineProperty(Yt,"__esModule",{value:!0});var Kt=Yt.default=void 0,Rr=br(At()),Sr=e;Kt=Yt.default=(0,Rr.default)((0,Sr.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Ht({children:t,...s}){var x;const{t:o}=W(),{api:a}=Z(),{blocklet:n}=he(),i=(x=n==null?void 0:n.settings)==null?void 0:x.autoCheckUpdate,h=async g=>{await a.updateAutoCheckUpdate({input:{did:n.meta.did,autoCheckUpdate:g}})},d=async()=>{try{const g=!(i!=null&&i.enabled);await h({enabled:g}),L.success(o(g?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(g){L.error(g.message)}},m=!!(i!=null&&i.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(be,{title:o("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(Ts,{checked:m,onChange:d,name:"enableWelcomePage",style:{...s.style,zoom:.8}})})})]})}Ht.propTypes={children:r.any};Ht.defaultProps={children:null};const Er=(t,s)=>{let{description:o}=t;return(Object.values(K.CHAIN_PROP_MAP).includes(t.key)||B.isEnvShareable(t))&&(o?o=`${o} (${s("blocklet.config.sharedToAllComponents")})`:o=s("blocklet.config.sharedToAllComponents")),o&&e.jsx("div",{style:{marginLeft:12},children:o})},Ut=(t,s,o=[])=>!(o!=null&&o.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!s.meta.environments.find(a=>a.name===t.key)&&s.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom,Qn=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),Nt=t=>[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function Qt({blocklet:t,ancestors:s}){const o=Z(),{inService:a}=o,{t:n}=f.useContext(Se),i=[...s.map(l=>l.meta.did),t.meta.did],h=()=>L.success(n("blocklet.config.changedTip")),d=l=>Ut(l,t,s);if(qe(t.status)||t.status==="unknown"&&qe(t.status))return null;const m=l=>new Promise(async(E,p)=>{if(!l.key.trim()||!l.value.trim()){L.error(n("blocklet.config.environment.keyValueRequired")),p();return}if(Qn(l.key)===!1){L.error(n("blocklet.config.environment.invalidKey")),p();return}l.custom=Nt(l.key);try{const C=await o.api.configBlocklet({input:{did:i,configs:[l]}});h(C.blocklet),E()}catch(C){L.error(le(C)),p()}}),x=(l,E)=>new Promise(async(p,C)=>{if(l.required&&(!l.key.trim()||!l.value.trim())){L.error(n("blocklet.config.environment.keyValueRequired")),C();return}if(Qn(l.key)===!1){L.error(n("blocklet.config.environment.invalidKey")),C();return}if(l.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const v=No(l);if(v){L.error(v),C();return}}const P=[{...l,value:l.secure&&l.value==="__encrypted__"?"":l.value}];if(l.key!==E.key){if(!Ut(l,t,s)){L.error("Only key of custom env can be changed"),C();return}P.push({key:E.key,custom:Nt(l.key)})}try{const v=await o.api.configBlocklet({input:{did:i,configs:P}});h(v.blocklet),p()}catch(v){L.error(le(v)),C()}}),g=l=>new Promise(async(E,p)=>{if(l.required){L.error(n("blocklet.config.environment.deleteForbidden")),p();return}if(!Ut(l,t,s)){L.error("Only key of custom env can be changed"),p();return}try{const C=await o.api.configBlocklet({input:{did:i,configs:[{key:l.key,custom:Nt(l.key)}]}});h(C.blocklet),E()}catch(C){L.error(le(C)),p()}}),c=(t.configs||[]).filter(l=>!K.BLOCKLET_CONFIGURABLE_KEY[l.key]||[K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(l.key)),j=B.getSharedConfigObj(s[0],t),u=B.getComponentMissingConfigs(t,s[0]),w=c.map(l=>({...l,value:Object.values(K.CHAIN_PROP_MAP).includes(l.key)&&Object.keys(j).includes(l.key)?j[l.key]:j[l.key]||l.value})),b=w.some(l=>l.key&&l.key.startsWith("BWA_")),R={onRowAdd:m,onRowUpdate:x,onRowDelete:g,isDeletable:d},I=()=>[{title:n("common.key"),field:"key",initialEditValue:"",width:"30%",render:l=>e.jsx(Vn,{value:l.value,style:{color:l.required&&!l.value?"#ff4436":"#222222",fontWeight:l.required?"bold":"normal"},children:l.key}),editComponent:l=>{const{value:E,rowData:p,onChange:C}=l;return e.jsx(Zn,{children:e.jsx(Q,{fullWidth:!0,size:"small",disabled:d(p)===!1,value:E,onChange:P=>C(P.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:l=>l.value?l.secure?"******":e.jsx(Vn,{unstyled:!0,value:l.value,style:{wordBreak:"break-all"},children:l.value}):null,editComponent:l=>{const{value:E,rowData:p,onChange:C}=l;return e.jsxs(Zn,{children:[e.jsx(Q,{fullWidth:!0,size:"small",value:E==="__encrypted__"?"":E,onChange:P=>C(P.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense"}),Er(p,n)]})}}];return e.jsxs(wr,{children:[!!u.length&&e.jsx(Bt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),b&&e.jsx(Bt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Mt,{permission:a?"":"mutate_blocklets",role:a?He:[],children:l=>e.jsx(ks,{className:"config-table",children:e.jsx(Ps,{title:e.jsx(y,{fontWeight:"bold",children:n("common.environments")}),columns:I(),icons:{...Rs,..._s},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:w,editable:l?R:{}})})})]})}Qt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};Qt.defaultProps={ancestors:[]};const wr=$.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -52,7 +52,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
52
52
  }
53
53
  `,Zn=$.div`
54
54
  height: 60px;
55
- `;function Ct({open:t,onClose:s,hiddenChildren:o,blocklet:a,ancestors:n,children:r}){const[h,d]=f.useState(!1),{t:m}=W(),x=m("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const g=()=>{s==null||s(),d(!1)},l=u=>{u.stopPropagation(),d(!0)};let j=null;return o||(j=typeof r=="function"?r({open:l}):e.jsx(te,{onClick:l,"data-cy":"action-config-component",children:e.jsx(mo,{})})),e.jsxs(e.Fragment,{children:[j,(t||h)&&e.jsx(Ti,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:g,PaperProps:{style:{minHeight:"auto"}},children:e.jsxs(oo,{gap:0,children:[e.jsx(oe,{sx:{fontSize:12,color:"text.disabled",mb:.5},children:m("description.environment",{name:B.getDisplayName(a,!0)})}),e.jsx(Qt,{blocklet:a,ancestors:n})]})})]})}Ct.propTypes={blocklet:i.object.isRequired,ancestors:i.array,children:i.any,open:i.bool,onClose:i.func,hiddenChildren:i.bool};Ct.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Ti=$(ft)`
55
+ `;function Ct({open:t,onClose:s,hiddenChildren:o,blocklet:a,ancestors:n,children:i}){const[h,d]=f.useState(!1),{t:m}=W(),x=m("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const g=()=>{s==null||s(),d(!1)},c=u=>{u.stopPropagation(),d(!0)};let j=null;return o||(j=typeof i=="function"?i({open:c}):e.jsx(te,{onClick:c,"data-cy":"action-config-component",children:e.jsx(mo,{})})),e.jsxs(e.Fragment,{children:[j,(t||h)&&e.jsx(Tr,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:g,PaperProps:{style:{minHeight:"auto"}},children:e.jsxs(oo,{gap:0,children:[e.jsx(oe,{sx:{fontSize:12,color:"text.disabled",mb:.5},children:m("description.environment",{name:B.getDisplayName(a,!0)})}),e.jsx(Qt,{blocklet:a,ancestors:n})]})})]})}Ct.propTypes={blocklet:r.object.isRequired,ancestors:r.array,children:r.any,open:r.bool,onClose:r.func,hiddenChildren:r.bool};Ct.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Tr=$(ft)`
56
56
  .MuiDialogContent-root {
57
57
  padding-top: 0;
58
58
  padding-bottom: 24px;
@@ -65,7 +65,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
65
65
  .ux-dialog_closeButton {
66
66
  margin: 0;
67
67
  }
68
- `,Zt={description:i.string,editing:i.bool,onChange:i.func,required:i.bool,value:i.any,componentProps:i.object,render:i.func,renderFormItem:i.func};function Xt({editing:t,value:s,onChange:o}){const[a,n]=f.useState(!1),r=f.useRef(),h=f.useRef(s);f.useEffect(()=>{let l=null;return t&&(l=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(l)}},[t]);const d=l=>{h.current=l,o(l)},m=()=>{n(!1),o(h.current)},x=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:m,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:r,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(Lo,{open:a,anchorEl:r.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(si,{color:s,onChange:l=>d(l.hex)})})]});return t?g:x}Xt.propTypes=Zt;function Jt({editing:t,description:s,value:o,onChange:a,componentProps:n,...r}){const{placeholder:h}=n,d=f.useRef(o),{t:m}=f.useContext(Se),x=l=>{l.key==="Enter"&&a(d.current,"confirm")},g=l=>{d.current=l,a(l)};return t?e.jsx(Q,{style:{flex:1},fullWidth:!0,value:o,onChange:l=>{l.persist(),g(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||h,onKeyDown:x,...r}):e.jsx(y,{px:1,className:"form-item-input slot",children:o||e.jsx("span",{className:"placeholder",children:m("common.requiredInputPlaceholder",{name:s||h})})})}Jt.propTypes=Zt;Jt.defaultProps={componentProps:{}};function en({editing:t,value:s,onChange:o,componentProps:a,...n}){const{blocklet:r}=a,h=s==="auto"?Bo.getPassportColorFromDid(r.appDid):s;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Oo({title:"Owner",issuer:B.getDisplayName(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:s||"auto"})}}),e.jsx(Xt,{...n,editing:t,value:t?h:s,onChange:o,componentProps:a})]})}en.propTypes={...Zt,componentProps:i.shape({blocklet:i.object.isRequired}).isRequired};en.defaultProps={};const ki=$o`
68
+ `,Zt={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function Xt({editing:t,value:s,onChange:o}){const[a,n]=f.useState(!1),i=f.useRef(),h=f.useRef(s);f.useEffect(()=>{let c=null;return t&&(c=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(c)}},[t]);const d=c=>{h.current=c,o(c)},m=()=>{n(!1),o(h.current)},x=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:m,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(Lo,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(sr,{color:s,onChange:c=>d(c.hex)})})]});return t?g:x}Xt.propTypes=Zt;function Jt({editing:t,description:s,value:o,onChange:a,componentProps:n,...i}){const{placeholder:h}=n,d=f.useRef(o),{t:m}=f.useContext(Se),x=c=>{c.key==="Enter"&&a(d.current,"confirm")},g=c=>{d.current=c,a(c)};return t?e.jsx(Q,{style:{flex:1},fullWidth:!0,value:o,onChange:c=>{c.persist(),g(c.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||h,onKeyDown:x,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:o||e.jsx("span",{className:"placeholder",children:m("common.requiredInputPlaceholder",{name:s||h})})})}Jt.propTypes=Zt;Jt.defaultProps={componentProps:{}};function en({editing:t,value:s,onChange:o,componentProps:a,...n}){const{blocklet:i}=a,h=s==="auto"?Bo.getPassportColorFromDid(i.appDid):s;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Oo({title:"Owner",issuer:B.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:s||"auto"})}}),e.jsx(Xt,{...n,editing:t,value:t?h:s,onChange:o,componentProps:a})]})}en.propTypes={...Zt,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};en.defaultProps={};const kr=$o`
69
69
  0%, 100% {
70
70
  transform: scale(1) translateX(0);
71
71
  }
@@ -75,7 +75,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
75
75
  25%, 75% {
76
76
  transform: scale(1.1) translateX(3px);
77
77
  }
78
- `,Pi={input:Jt,color:Xt,passport:en,uploader:t=>e.jsx(ei,{...t.componentProps})};function _i(t,{editing:s=!1}){const{componentType:o="input",render:a,renderFormItem:n}=t;return s&&n?n:!s&&a?a:Pi[o==null?void 0:o.toLowerCase()]}function tn({schema:t,loading:s,value:o,defaultValue:a,onChange:n,style:r,disabled:h}){const d=Object.prototype.toString.call(o)==="[object Object]",[m,x]=f.useState([]),[g,l]=f.useState(d?o:a),j=f.useMemo(()=>t.length===1,[t]),u=f.useCallback(p=>m.find(C=>C.key===p),[m]);f.useEffect(()=>{var p;j&&((p=t[0])!=null&&p.required)&&x([{key:t[0].key,editing:!0,initialValue:a[t[0].key]}])},[t,j,a]);const E=f.useCallback(p=>{x(C=>C.find(v=>v.key===p.key)?C.map(v=>v.key===p.key?p:{...v}):[p].concat(C))},[]),b=f.useCallback((p,C,P)=>{const{key:v,secure:N}=p,O=u(v)??{...p};O.editing=!0;const _=g[v]!==C;O.edited=C&&O.initialValue!==C,O.initialValue=a[v];const V={...g,[v]:C};_&&l(V),n({[v]:C},{allValues:V,action:P,currentItem:p}),P==="confirm"&&N&&l({...g,[v]:"__encrypted__"}),P==="confirm"&&(O.initialValue=g[v]),["confirm","cancel"].includes(P)&&(O.editing=!1,O.edited=!1),E(O)},[a,g,n,E,u]);function R(p,{editing:C=!1}){const{key:P}=p,v=d?o[P]:g[P];return v==="__encrypted__"?C?"":"******":v}const I=f.useCallback(p=>{const C=u(p.key);C&&b(p,C.initialValue,"cancel")},[u,b]),c=f.useCallback(p=>{const C=u(p.key);!C||!C.edited||(C.shaking=!0,E(C),setTimeout(()=>{C.shaking=!1,E(C)},500))},[u,E]),w=f.useCallback(p=>{const C=u(p.key);!C||!C.edited?I(p):c(p)},[u,c,I]);return e.jsx(Ii,{className:"form",style:r,children:t==null?void 0:t.map(p=>{const{key:C,description:P,required:v,solo:N=!1,hidden:O=!1,componentProps:H={},skipButtonDisabled:_=!1}=p;if(O)return null;const V=u(C),{editing:X,shaking:J}=V??{},de=R(p,{editing:X}),ge=_i(p,{editing:X}),xe={inputProps:{"data-cy":"schema-form-item-component"},key:C,description:P,editing:X,value:de,onChange:(k,se="change")=>b(p,k,se),componentProps:H,skipButtonDisabled:_,onBlur:()=>w(p)};return e.jsxs(y,{className:"form-item",children:[!N&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!de?"#ff0000":"#333"},children:[P,v&&e.jsx(dt,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:N?"center":"left"},style:{cursor:"text"},onClick:()=>{h||V!=null&&V.edited||_||b(p,g[C],"edit")},children:e.jsx(ge,{...xe})}),!N&&e.jsx(y,{className:"form-item-action",style:{marginLeft:0},children:X?e.jsxs(e.Fragment,{children:[V.edited?e.jsx(te,{"data-cy":"schema-form-item-confirm",onClick:()=>{b(p,de,"confirm")},disabled:h||s,sx:{animation:J?`${ki} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:s?e.jsx(fe,{size:24}):e.jsx(oi,{})}):null,e.jsx(te,{"data-cy":"schema-form-item-cancel",onClick:()=>I(p),style:{paddingLeft:V.edited?4:8},disabled:h||s,size:"large",children:e.jsx(Mo,{})})]}):null})]})]},C)})})}tn.propTypes={schema:i.array.isRequired,loading:i.bool,onChange:i.func.isRequired,value:i.object,defaultValue:i.object,style:i.object,disabled:i.bool};tn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Ii=$(Js)``;function nn({meta:t,onCancel:s,mode:o,handlePaySuccess:a}){const{t:n,locale:r}=W(),{info:h}=Z(),d=Ao(h),[m,x]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,l=B.getDisplayName({meta:t}),j=async(E,b)=>{const R=({downloadTokenList:w})=>{a({downloadTokenList:w})},I=w=>{L.error(w),s(w)};function c(w){return Wo(()=>Kn.get(w).then(async({data:p})=>{const C=p==null?void 0:p.downloadTokenList;if(p.status==="succeed"){if(C&&C.length)await R({downloadTokenList:C});else return await I(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return p.status==="error"?(console.error("vc error: ",p),await I(p==null?void 0:p.error),!0):!1}),{interval:1e3})}if(o==="purchase"&&m){const{statusUrl:w}=Go(m);await c(w)}else await R({downloadTokenList:E.downloadTokenList&&b(E.downloadTokenList)})};if(f.useEffect(()=>{if(o==="purchase"){const E=new URL(g);E.pathname="/api/did/verify-purchase-blocklet/token",E.searchParams.set("serverDid",h.did),E.searchParams.set("blockletDid",t==null?void 0:t.did);try{Kn.get(E.href).then(({data:b})=>{const R=`${b.url}`;x(R)})}catch(b){console.error("get next workflow url error: ",b)}}return()=>{x(null)}},[o]),o==="purchase"&&!m)return"";const u={verify:{action:"verify-purchase-blocklet",checkFn:An.create({baseURL:g}).get,extraParams:{serverDid:h.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:l}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:An.create({baseURL:ht(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:m},messages:{title:n("store.purchase.auth.title",{name:l}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(qo,{open:!0,locale:r,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:j,cancelWhenScanned:s,onClose:s,checkTimeout:60*5e3,webWalletUrl:d,disableClose:!0,showDownload:!1,...u[o]})}nn.propTypes={...Is,handlePaySuccess:i.func,mode:i.oneOf(["verify","purchase"]).isRequired};nn.defaultProps={handlePaySuccess:()=>{}};const on=f.forwardRef(({mode:t,...s},o)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[r,h]=f.useState(t!=="both"?2:1),d=x=>{x!==a&&n(x)},m=()=>{a&&r!==2&&h(2)};return f.useImperativeHandle(o,()=>({onNext:m,getCurrentStep:()=>r})),r===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(Ds,{action:a,onNext:null,onSelect:d})}):e.jsx(nn,{...s,mode:a})});on.propTypes={mode:i.oneOf(["both","verify","purchase"]).isRequired,ref:i.any};on.defaultProps={ref:{}};const Di=on;function Ui({...t}){return e.jsx(ce,{className:"bottom-button",variant:"contained",color:"primary",...t})}function sn({blocklet:t,onStartNow:s,children:o,disabled:a}){const{t:n}=W(),r=yo();return!t||zo(t.meta)?e.jsx(Ni,{children:o}):e.jsxs(Li,{isMobile:r,children:[e.jsx(Ui,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>s(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:o})]})}sn.propTypes={blocklet:i.object,onStartNow:i.func,children:i.any,disabled:i.bool};sn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Ni=$(y)`
78
+ `,Pr={input:Jt,color:Xt,passport:en,uploader:t=>e.jsx(er,{...t.componentProps})};function _r(t,{editing:s=!1}){const{componentType:o="input",render:a,renderFormItem:n}=t;return s&&n?n:!s&&a?a:Pr[o==null?void 0:o.toLowerCase()]}function tn({schema:t,loading:s,value:o,defaultValue:a,onChange:n,style:i,disabled:h}){const d=Object.prototype.toString.call(o)==="[object Object]",[m,x]=f.useState([]),[g,c]=f.useState(d?o:a),j=f.useMemo(()=>t.length===1,[t]),u=f.useCallback(p=>m.find(C=>C.key===p),[m]);f.useEffect(()=>{var p;j&&((p=t[0])!=null&&p.required)&&x([{key:t[0].key,editing:!0,initialValue:a[t[0].key]}])},[t,j,a]);const w=f.useCallback(p=>{x(C=>C.find(v=>v.key===p.key)?C.map(v=>v.key===p.key?p:{...v}):[p].concat(C))},[]),b=f.useCallback((p,C,P)=>{const{key:v,secure:N}=p,O=u(v)??{...p};O.editing=!0;const _=g[v]!==C;O.edited=C&&O.initialValue!==C,O.initialValue=a[v];const V={...g,[v]:C};_&&c(V),n({[v]:C},{allValues:V,action:P,currentItem:p}),P==="confirm"&&N&&c({...g,[v]:"__encrypted__"}),P==="confirm"&&(O.initialValue=g[v]),["confirm","cancel"].includes(P)&&(O.editing=!1,O.edited=!1),w(O)},[a,g,n,w,u]);function R(p,{editing:C=!1}){const{key:P}=p,v=d?o[P]:g[P];return v==="__encrypted__"?C?"":"******":v}const I=f.useCallback(p=>{const C=u(p.key);C&&b(p,C.initialValue,"cancel")},[u,b]),l=f.useCallback(p=>{const C=u(p.key);!C||!C.edited||(C.shaking=!0,w(C),setTimeout(()=>{C.shaking=!1,w(C)},500))},[u,w]),E=f.useCallback(p=>{const C=u(p.key);!C||!C.edited?I(p):l(p)},[u,l,I]);return e.jsx(Ir,{className:"form",style:i,children:t==null?void 0:t.map(p=>{const{key:C,description:P,required:v,solo:N=!1,hidden:O=!1,componentProps:H={},skipButtonDisabled:_=!1}=p;if(O)return null;const V=u(C),{editing:X,shaking:J}=V??{},de=R(p,{editing:X}),ge=_r(p,{editing:X}),xe={inputProps:{"data-cy":"schema-form-item-component"},key:C,description:P,editing:X,value:de,onChange:(k,se="change")=>b(p,k,se),componentProps:H,skipButtonDisabled:_,onBlur:()=>E(p)};return e.jsxs(y,{className:"form-item",children:[!N&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!de?"#ff0000":"#333"},children:[P,v&&e.jsx(dt,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:N?"center":"left"},style:{cursor:"text"},onClick:()=>{h||V!=null&&V.edited||_||b(p,g[C],"edit")},children:e.jsx(ge,{...xe})}),!N&&e.jsx(y,{className:"form-item-action",style:{marginLeft:0},children:X?e.jsxs(e.Fragment,{children:[V.edited?e.jsx(te,{"data-cy":"schema-form-item-confirm",onClick:()=>{b(p,de,"confirm")},disabled:h||s,sx:{animation:J?`${kr} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:s?e.jsx(fe,{size:24}):e.jsx(or,{})}):null,e.jsx(te,{"data-cy":"schema-form-item-cancel",onClick:()=>I(p),style:{paddingLeft:V.edited?4:8},disabled:h||s,size:"large",children:e.jsx(Mo,{})})]}):null})]})]},C)})})}tn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};tn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Ir=$(Js)``;function nn({meta:t,onCancel:s,mode:o,handlePaySuccess:a}){const{t:n,locale:i}=W(),{info:h}=Z(),d=Ao(h),[m,x]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,c=B.getDisplayName({meta:t}),j=async(w,b)=>{const R=({downloadTokenList:E})=>{a({downloadTokenList:E})},I=E=>{L.error(E),s(E)};function l(E){return Wo(()=>Kn.get(E).then(async({data:p})=>{const C=p==null?void 0:p.downloadTokenList;if(p.status==="succeed"){if(C&&C.length)await R({downloadTokenList:C});else return await I(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return p.status==="error"?(console.error("vc error: ",p),await I(p==null?void 0:p.error),!0):!1}),{interval:1e3})}if(o==="purchase"&&m){const{statusUrl:E}=Go(m);await l(E)}else await R({downloadTokenList:w.downloadTokenList&&b(w.downloadTokenList)})};if(f.useEffect(()=>{if(o==="purchase"){const w=new URL(g);w.pathname="/api/did/verify-purchase-blocklet/token",w.searchParams.set("serverDid",h.did),w.searchParams.set("blockletDid",t==null?void 0:t.did);try{Kn.get(w.href).then(({data:b})=>{const R=`${b.url}`;x(R)})}catch(b){console.error("get next workflow url error: ",b)}}return()=>{x(null)}},[o]),o==="purchase"&&!m)return"";const u={verify:{action:"verify-purchase-blocklet",checkFn:An.create({baseURL:g}).get,extraParams:{serverDid:h.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:c}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:An.create({baseURL:ht(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:m},messages:{title:n("store.purchase.auth.title",{name:c}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(qo,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:j,cancelWhenScanned:s,onClose:s,checkTimeout:60*5e3,webWalletUrl:d,disableClose:!0,showDownload:!1,...u[o]})}nn.propTypes={...Is,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};nn.defaultProps={handlePaySuccess:()=>{}};const on=f.forwardRef(({mode:t,...s},o)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,h]=f.useState(t!=="both"?2:1),d=x=>{x!==a&&n(x)},m=()=>{a&&i!==2&&h(2)};return f.useImperativeHandle(o,()=>({onNext:m,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(Ds,{action:a,onNext:null,onSelect:d})}):e.jsx(nn,{...s,mode:a})});on.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};on.defaultProps={ref:{}};const Dr=on;function Ur({...t}){return e.jsx(ce,{className:"bottom-button",variant:"contained",color:"primary",...t})}function sn({blocklet:t,onStartNow:s,children:o,disabled:a}){const{t:n}=W(),i=yo();return!t||zo(t.meta)?e.jsx(Nr,{children:o}):e.jsxs(Lr,{isMobile:i,children:[e.jsx(Ur,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>s(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:o})]})}sn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};sn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Nr=$(y)`
79
79
  width: 100%;
80
80
  margin-top: auto;
81
81
  padding-top: 24px;
@@ -90,7 +90,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
90
90
  width: 100%;
91
91
  }
92
92
  }
93
- `,Li=$(y)`
93
+ `,Lr=$(y)`
94
94
  padding-top: 24px;
95
95
  margin-top: auto;
96
96
  width: 100%;
@@ -120,12 +120,12 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
120
120
  justify-content: space-between;
121
121
  gap: '32px',
122
122
  }}
123
- `;function rn({blockletMeta:t,onEndpointUpdate:s}){var d;const o=yo(),{blocklet:a}=he(),{updateSpaceGateway:n,loading:r,hasStorageEndpoint:h}=Fs();return f.useEffect(()=>{s==null||s()},[a]),r?e.jsx(Fo,{relative:"parent",children:e.jsx(fe,{})}):e.jsxs(Bi,{children:[e.jsx(y,{width:o?"360px":"720px",children:h?e.jsx(Vs,{}):e.jsx(Ys,{})}),((d=t==null?void 0:t.capabilities)==null?void 0:d.didSpace)==="required"&&e.jsx(sn,{mt:8,children:e.jsx(Ks,{onConnect:n})})]})}rn.propTypes={blockletMeta:i.any.isRequired,onEndpointUpdate:Vo.func};rn.defaultProps={onEndpointUpdate:()=>{}};const Bi=$(Qs)`
123
+ `;function rn({blockletMeta:t,onEndpointUpdate:s}){var d;const o=yo(),{blocklet:a}=he(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:h}=Fs();return f.useEffect(()=>{s==null||s()},[a]),i?e.jsx(Fo,{relative:"parent",children:e.jsx(fe,{})}):e.jsxs(Br,{children:[e.jsx(y,{width:o?"360px":"720px",children:h?e.jsx(Vs,{}):e.jsx(Ys,{})}),((d=t==null?void 0:t.capabilities)==null?void 0:d.didSpace)==="required"&&e.jsx(sn,{mt:8,children:e.jsx(Ks,{onConnect:n})})]})}rn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Vo.func};rn.defaultProps={onEndpointUpdate:()=>{}};const Br=$(Qs)`
124
124
  height: 100%;
125
125
  overflow-y: auto;
126
126
  padding-bottom: 32px;
127
127
  overflow-x: hidden;
128
- `;function an({onChange:t,loading:s,children:o,extra:a,stores:n,storageKey:r}){const{t:h}=W(),{info:d,inService:m}=Z(),{blocklet:x}=he(),[g,l]=f.useState(!1),j=f.useRef(null),[u,E]=f.useState(),[b,R]=pi(r||"tmp"),[I,c]=r?[b,R]:[u,E],{storeList:w,teamDid:p}=so({fromBlocklet:m,blocklet:x,nodeInfo:d}),C=io([...n.map(v=>({...v,protected:!0})),...w],"url"),P=I&&C.find(v=>I===v.url)||C[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Oi,{children:[e.jsx(ce,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(ui,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:e.jsx(oe,{color:"primary",children:P.name})}),e.jsx(oe,{color:"primary",children:a})]}),e.jsxs(Q,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:P,autoFocus:!0,onChange:v=>{const N=v.target.value;c(N.url),t(N)},SelectProps:{open:g,MenuProps:{anchorEl:j.current},renderValue:v=>v==null?void 0:v.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[C==null?void 0:C.map(v=>e.jsx(je,{sx:{width:"400px",maxWidth:"90vw"},value:v,"data-cy":v.url,children:e.jsx(Us,{teamDid:p,store:v,onDelete:()=>{var N;I===v.url&&c((N=C[0])==null?void 0:N.url)}})},v.url)),!fo.isInServerlessMode(d)&&e.jsx(Ns,{disabled:s,storeList:C,teamDid:p,onAdd:v=>{c(v)}})]}),o({currentRegistry:P})]})}an.propTypes={onChange:i.func,loading:i.bool,children:i.any.isRequired,extra:i.node,storageKey:i.string,stores:i.arrayOf(i.shape({name:i.string.isRequired,url:i.string.isRequired}))};an.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Oi=$.div`
128
+ `;function an({onChange:t,loading:s,children:o,extra:a,stores:n,storageKey:i}){const{t:h}=W(),{info:d,inService:m}=Z(),{blocklet:x}=he(),[g,c]=f.useState(!1),j=f.useRef(null),[u,w]=f.useState(),[b,R]=pr(i||"tmp"),[I,l]=i?[b,R]:[u,w],{storeList:E,teamDid:p}=so({fromBlocklet:m,blocklet:x,nodeInfo:d}),C=ro([...n.map(v=>({...v,protected:!0})),...E],"url"),P=I&&C.find(v=>I===v.url)||C[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Or,{children:[e.jsx(ce,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(ur,{color:"primary"}),onClick:()=>{c(!0)},style:{padding:"0 2px"},children:e.jsx(oe,{color:"primary",children:P.name})}),e.jsx(oe,{color:"primary",children:a})]}),e.jsxs(Q,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:h("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:P,autoFocus:!0,onChange:v=>{const N=v.target.value;l(N.url),t(N)},SelectProps:{open:g,MenuProps:{anchorEl:j.current},renderValue:v=>v==null?void 0:v.name,onClose:()=>{c(!1)}},style:{display:"none"},margin:"normal",children:[C==null?void 0:C.map(v=>e.jsx(je,{sx:{width:"400px",maxWidth:"90vw"},value:v,"data-cy":v.url,children:e.jsx(Us,{teamDid:p,store:v,onDelete:()=>{var N;I===v.url&&l((N=C[0])==null?void 0:N.url)}})},v.url)),!fo.isInServerlessMode(d)&&e.jsx(Ns,{disabled:s,storeList:C,teamDid:p,onAdd:v=>{l(v)}})]}),o({currentRegistry:P})]})}an.propTypes={onChange:r.func,loading:r.bool,children:r.any.isRequired,extra:r.node,storageKey:r.string,stores:r.arrayOf(r.shape({name:r.string.isRequired,url:r.string.isRequired}))};an.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Or=$.div`
129
129
  display: flex;
130
130
  justify-content: space-between;
131
131
  align-items: center;
@@ -136,13 +136,13 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
136
136
  color: ${t=>t.theme.palette.common.black};
137
137
  // font-weight: bold;
138
138
  }
139
- `,Mi={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"/>'},$i={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>'},Ai={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"/>'},qi=Qo({...Zo,disableBlockletTheme:!0}),Gi=(t,s)=>ht(s,`/blocklets/${t.did}`),Xn=({blocklet:t,attribute:s,value:o})=>t._formatted?t._formatted[s]:o,Wi=t=>t.inStore&&B.isFreeBlocklet(t)===!1;function ln({blocklet:t,blocklets:s,handleButtonClick:o,endpoint:a,serverVersion:n}){var R,I;const{t:r}=W();let h=ht(a,Xo(t.did,t.logo||""));try{const c=new URL(h);c.searchParams.set("v",t.version||+new Date),h=c.href}catch{}const[d,m]=f.useState(!1),x=async()=>{try{m(!0),await o({meta:t,registryUrl:a,blocklets:s})}catch(c){L.error(c.message)}finally{m(!1)}},{blocklet:g}=he(),l=()=>((g==null?void 0:g.children)||[]).find(p=>p.meta.bundleDid===t.did).meta.version,u=(()=>{const c=((g==null?void 0:g.children)||[]).find(w=>w.meta.bundleDid===t.did);if(c){try{const w=c.meta.version,p=t.version;if(Jo.gt(p,w))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),E=(R=t.requirements)==null?void 0:R.server,b=[];return u==="upgrade"?b.push({key:"upgrade",icon:e.jsx(ee,{icon:Ai,color:"success.light",width:20,height:20},"version"),title:`${l()} -> ${t.version}`,align:"right",color:"success.light",maxWidth:300,text:e.jsx(y,{sx:{fontWeight:"bold"},children:r("blocklet.component.upgradeAvailable")})}):u==="disable"?b.push({key:"disable",icon:e.jsx(ee,{icon:Mi,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:r("blocklet.component.installed")}):Wi(t)&&b.push({key:"purchase",icon:e.jsx(ee,{icon:$i,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:r("blocklet.component.needBuy")}),e.jsx(zi,{title:Xn({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:Xn({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?h:"",version:t.version,onButtonClick:null,"data-cy":"install-blocklet",sx:u!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:u==="disable"?void 0:x,icons:(I=t.docker)!=null&&I.image?[{key:"docker",icon:e.jsx(y,{display:"flex",color:"primary.main",children:e.jsx(ee,{icon:ho})}),title:r("blocklet.dockerImage")}]:[],official:t.isOfficial?{tooltip:r("blocklet.component.isOfficial")}:void 0,download:t.stats.downloads,status:b,button:e.jsx(Bs,{serverVersion:n,requirementVersion:E,size:"small",children:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Os,{children:e.jsx(ce,{size:"small",disabled:d,variant:"outlined",color:"primary",onClick:c=>{c.preventDefault(),c.stopPropagation();const w=Gi(t,a);w&&window.open(w,"_blank","noopener,noreferrer")},children:r("common.detail")},t.did)})})})})}ln.propTypes={blocklet:i.object.isRequired,blocklets:i.array,handleButtonClick:i.func,endpoint:i.string,serverVersion:i.string};ln.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function cn({handleButtonClick:t,handleSearchSelect:s,storeUrl:o,handleBlockletRender:a,extraFilter:n,serverVersion:r,resourceType:h,resourceDid:d,showResourcesSwitch:m,showCategory:x,compact:g,...l}){const{locale:j}=W(),[u,E]=f.useState(!1),[b,R]=f.useState({}),I=w=>{R(w)},c=o;return f.useEffect(()=>{R({showResources:!0,resourceType:h,resourceDid:d})},[c,h,d]),f.useEffect(()=>{E(!0),R({showResources:!0,resourceType:h,resourceDid:d})},[]),e.jsx(Yo,{theme:qi,children:e.jsx(Ko,{FallbackComponent:Ho,resetKeys:[c],children:e.jsxs(y,{...l,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(l.sx)?l.sx:[l.sx]],children:[u&&e.jsx(Ls,{showCategory:x,showResourcesSwitch:m,blockletRender:w=>{const p={...w,handleButtonClick:t,endpoint:c};return a({...w,defaultRender:e.jsx(ln,{...p})})},compact:g,minItemWidth:300,baseSearch:!0,endpoint:c,locale:j,onFilterChange:I,onSearchSelect:s,filters:b,extraFilter:n,serverVersion:r,fetchCategoryDelay:500}),e.jsx(y,{sx:{mt:2},children:" "})]})})})}cn.propTypes={storeUrl:i.string.isRequired,handleButtonClick:i.func,handleSearchSelect:i.func,handleBlockletRender:i.func,extraFilter:i.func,serverVersion:i.string,resourceType:i.string,resourceDid:i.string,showResourcesSwitch:i.bool,showCategory:i.bool,compact:i.bool};cn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const zi=$(Ms)`
139
+ `,Mr={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"/>'},$r={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>'},Ar={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"/>'},qr=Qo({...Zo,disableBlockletTheme:!0}),Gr=(t,s)=>ht(s,`/blocklets/${t.did}`),Xn=({blocklet:t,attribute:s,value:o})=>t._formatted?t._formatted[s]:o,Wr=t=>t.inStore&&B.isFreeBlocklet(t)===!1;function ln({blocklet:t,blocklets:s,handleButtonClick:o,endpoint:a,serverVersion:n}){var R,I;const{t:i}=W();let h=ht(a,Xo(t.did,t.logo||""));try{const l=new URL(h);l.searchParams.set("v",t.version||+new Date),h=l.href}catch{}const[d,m]=f.useState(!1),x=async()=>{try{m(!0),await o({meta:t,registryUrl:a,blocklets:s})}catch(l){L.error(l.message)}finally{m(!1)}},{blocklet:g}=he(),c=()=>((g==null?void 0:g.children)||[]).find(p=>p.meta.bundleDid===t.did).meta.version,u=(()=>{const l=((g==null?void 0:g.children)||[]).find(E=>E.meta.bundleDid===t.did);if(l){try{const E=l.meta.version,p=t.version;if(Jo.gt(p,E))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),w=(R=t.requirements)==null?void 0:R.server,b=[];return u==="upgrade"?b.push({key:"upgrade",icon:e.jsx(ee,{icon:Ar,color:"success.light",width:20,height:20},"version"),title:`${c()} -> ${t.version}`,align:"right",color:"success.light",maxWidth:300,text:e.jsx(y,{sx:{fontWeight:"bold"},children:i("blocklet.component.upgradeAvailable")})}):u==="disable"?b.push({key:"disable",icon:e.jsx(ee,{icon:Mr,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:i("blocklet.component.installed")}):Wr(t)&&b.push({key:"purchase",icon:e.jsx(ee,{icon:$r,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:i("blocklet.component.needBuy")}),e.jsx(zr,{title:Xn({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:Xn({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?h:"",version:t.version,onButtonClick:null,"data-cy":"install-blocklet",sx:u!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:u==="disable"?void 0:x,icons:(I=t.docker)!=null&&I.image?[{key:"docker",icon:e.jsx(y,{display:"flex",color:"primary.main",children:e.jsx(ee,{icon:ho})}),title:i("blocklet.dockerImage")}]:[],official:t.isOfficial?{tooltip:i("blocklet.component.isOfficial")}:void 0,download:t.stats.downloads,status:b,button:e.jsx(Bs,{serverVersion:n,requirementVersion:w,size:"small",children:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Os,{children:e.jsx(ce,{size:"small",disabled:d,variant:"outlined",color:"primary",onClick:l=>{l.preventDefault(),l.stopPropagation();const E=Gr(t,a);E&&window.open(E,"_blank","noopener,noreferrer")},children:i("common.detail")},t.did)})})})})}ln.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string,serverVersion:r.string};ln.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function cn({handleButtonClick:t,handleSearchSelect:s,storeUrl:o,handleBlockletRender:a,extraFilter:n,serverVersion:i,resourceType:h,resourceDid:d,showResourcesSwitch:m,showCategory:x,compact:g,...c}){const{locale:j}=W(),[u,w]=f.useState(!1),[b,R]=f.useState({}),I=E=>{R(E)},l=o;return f.useEffect(()=>{R({showResources:!0,resourceType:h,resourceDid:d})},[l,h,d]),f.useEffect(()=>{w(!0),R({showResources:!0,resourceType:h,resourceDid:d})},[]),e.jsx(Yo,{theme:qr,children:e.jsx(Ko,{FallbackComponent:Ho,resetKeys:[l],children:e.jsxs(y,{...c,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(c.sx)?c.sx:[c.sx]],children:[u&&e.jsx(Ls,{showCategory:x,showResourcesSwitch:m,blockletRender:E=>{const p={...E,handleButtonClick:t,endpoint:l};return a({...E,defaultRender:e.jsx(ln,{...p})})},compact:g,minItemWidth:300,baseSearch:!0,endpoint:l,locale:j,onFilterChange:I,onSearchSelect:s,filters:b,extraFilter:n,serverVersion:i,fetchCategoryDelay:500}),e.jsx(y,{sx:{mt:2},children:" "})]})})})}cn.propTypes={storeUrl:r.string.isRequired,handleButtonClick:r.func,handleSearchSelect:r.func,handleBlockletRender:r.func,extraFilter:r.func,serverVersion:r.string,resourceType:r.string,resourceDid:r.string,showResourcesSwitch:r.bool,showCategory:r.bool,compact:r.bool};cn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const zr=$(Ms)`
140
140
  .ms-highlight {
141
141
  color: ${t=>t.theme.palette.primary.main};
142
142
  }
143
- `,dn=f.forwardRef(({meta:t,isMobile:s,onStepChange:o},a)=>{const n=ro(),{steps:r,activeStep:h,setActiveStepByKey:d,setActiveStepByIndex:m}=qs(),{t:x,locale:g}=W(),l=r[h];return f.useEffect(()=>{o(h)},[o,h]),f.useImperativeHandle(a,()=>({setActiveStepByKey:d,setActiveStepByIndex:m})),e.jsx(Vi,{component:"div",className:s?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:e.jsx(Gs,{locale:g,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?es({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,theme:n,stepTip:x("blocklet.component.add"),children:e.jsx(Fi,{children:typeof(l==null?void 0:l.body)=="function"?l.body():l==null?void 0:l.body})})})});dn.propTypes={meta:i.any,onStepChange:i.func.isRequired,isMobile:i.bool.isRequired};dn.defaultProps={meta:null};const Jn=t=>t.isMobile?`
143
+ `,dn=f.forwardRef(({meta:t,isMobile:s,onStepChange:o},a)=>{const n=io(),{steps:i,activeStep:h,setActiveStepByKey:d,setActiveStepByIndex:m}=qs(),{t:x,locale:g}=W(),c=i[h];return f.useEffect(()=>{o(h)},[o,h]),f.useImperativeHandle(a,()=>({setActiveStepByKey:d,setActiveStepByIndex:m})),e.jsx(Vr,{component:"div",className:s?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:e.jsx(Gs,{locale:g,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?es({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,theme:n,stepTip:x("blocklet.component.add"),children:e.jsx(Fr,{children:typeof(c==null?void 0:c.body)=="function"?c.body():c==null?void 0:c.body})})})});dn.propTypes={meta:r.any,onStepChange:r.func.isRequired,isMobile:r.bool.isRequired};dn.defaultProps={meta:null};const Jn=t=>t.isMobile?`
144
144
  height: calc(100vh - 56px - 64px - 48px);
145
- `:"",Fi=$.div`
145
+ `:"",Fr=$.div`
146
146
  width: 100%;
147
147
  height: 100%;
148
148
  display: flex;
@@ -158,7 +158,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
158
158
  aside {
159
159
  width: 140px;
160
160
  }
161
- `,Vi=$(y)`
161
+ `,Vr=$(y)`
162
162
  ${({className:t})=>t==="mobileStyle"?`
163
163
  & > div{
164
164
  height: 100%;
@@ -276,7 +276,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
276
276
  & .connect {
277
277
  background: white;
278
278
  }
279
- `,Yi=dn,Ki=t=>t.inStore&&B.isFreeBlocklet(t)===!1,Hi=t=>{var s;return[K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((s=t==null?void 0:t.capabilities)==null?void 0:s.didSpace)},Lt=t=>{var s,o;return((o=(s=t==null?void 0:t.configs)==null?void 0:s.find(a=>a.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:o.value)||null},Qi=t=>(t.environments||[]).some(s=>s.required),eo=(t,s)=>t==null?void 0:t.some(o=>o.required&&!s[o.key]),Zi=({params:t,blocklet:s,t:o})=>{const a=t.title||t.name;return a?((s==null?void 0:s.children)||[]).find(r=>r.meta.bundleDid===t.bundleDid)?o("blocklet.component.upgradeNext",{name:a}):o("blocklet.component.addNext",{name:a}):o("common.next")},to=({componentDid:t,timeout:s=1e3,manual:o=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:o},"*")},s)};function un({onClose:t,mode:s,stores:o,resourceType:a,resourceDid:n,storageKey:r,inDialog:h,selectedMeta:d,storeUrl:m,showResourcesSwitch:x,showFromUrl:g,enableRunBackground:l,showCategory:j}){var kn,Pn,_n,In,Je,Dn,et,Un,Nn,Ln;const{t:u,locale:E}=W(),[b,R]=f.useState(!1),[I,c]=f.useState(null),[w,p]=f.useState(""),[C,P]=f.useState(""),{api:v,ws:{useSubscription:N},inService:O,info:H}=Z(),{blocklet:_,actions:{refreshBlocklet:V}}=he(),[X,J]=f.useState(null),[de,ge]=f.useState(!1),xe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[k,se]=f.useState(xe),[G,ye]=f.useState(0),A=f.useRef({}),Pe=f.useRef({}),ue=f.useRef({}),_e=ao(T=>T.breakpoints.down("md")),S=ts(),[Y,pe]=f.useState(!0),{meta:z}=A.current,ne=Zs(z),we=f.useRef(!1),F=T=>se(D=>({...D,...T}));f.useEffect(()=>{if(k.pathPrefix){const{errMsg:T}=Tn({...k,pathPrefix:k.pathPrefix,locale:E});p(T)}},[k.pathPrefix]),f.useEffect(()=>{G===0&&se(xe)},[G]);const Ie=()=>{const T=Lt(_)??"";F({didSpaceEndpoint:T})},Ee=()=>{var T;return(T=A==null?void 0:A.current)!=null&&T.meta?B.getDisplayName(A.current):""},We=()=>{R(!1),se({}),we.current=!1,A.current={},t()},Le=T=>{const D=M=>{F({installResultProps:{variant:"error",title:Ee(),subTitle:T,footer:e.jsx(ce,{className:"bottom-button",disabled:M,"data-cy":"retry-install-component",onClick:async()=>{D(!0),await En(A.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[M&&e.jsx(fe,{size:16,style:{marginRight:8}}),u("common.retry")]})})}})};D()},Xe=T=>D=>{var M,q;(((M=D==null?void 0:D.meta)==null?void 0:M.did)||(D==null?void 0:D.meta))===((q=_==null?void 0:_.meta)==null?void 0:q.did)&&T(D)},To=()=>{to({timeout:0,componentDid:S.componentDid,manual:!0}),We(),setTimeout(()=>{const T=document.getElementsByClassName("dashboard-main")[0];T&&(T.scrollTop=T.scrollHeight)},200)};N(K.BlockletEvents.componentInstalled,Xe(()=>{F({installResultProps:{variant:"success",title:Ee(),subTitle:u("blocklet.component.installSuccessTip")}}),to({componentDid:S.componentDid})}),[(kn=_==null?void 0:_.meta)==null?void 0:kn.did]),N(K.BlockletEvents.statusChange,Xe(()=>{const T=Lt(_);F(D=>({...D,didSpaceEndpoint:T}))}),[(Pn=_==null?void 0:_.meta)==null?void 0:Pn.did]),N(K.BlockletEvents.downloadFailed,Xe(()=>{we.current=!1,Le(u("blocklet.component.installComponentError"))}),[(_n=_==null?void 0:_.meta)==null?void 0:_n.did]),N(K.BlockletEvents.installFailed,Xe(()=>{we.current=!1,Le(u("blocklet.component.installComponentError"))}),[(In=_==null?void 0:_.meta)==null?void 0:In.did]);const me=[],wn=T=>((_==null?void 0:_.children)||[]).find(D=>D.meta.did===T),En=async T=>{var Oe,Me;we.current=!0;const{pathPrefix:D,bundleDid:M,title:q,componentName:De="",componentDid:Be=""}=k,Ue=((Oe=A.current)==null?void 0:Oe.meta)||{},{configs:Te=[],registryUrl:ke,inStore:Fe,inputUrl:Ve,dist:Et}=Ue,Ye=(Me=A.current)==null?void 0:Me.downloadTokenList,re=Ve||(Fe?qn(ke,M,Et):"");R(!0);const tt={rootDid:_.meta.did,url:re,mountPoint:D?Re(D):`/${Re(Ue.title||Ue.name)}`,title:q,name:De,did:Be,onlyRequired:!Y,...k.hasEnvironmentsStep&&Te.length>0?{configs:Te.map(ve=>({...ve,value:k.configsValue[ve.key]||""}))}:{},...Ye?{downloadTokenList:Ye}:{},...T};try{if(await v.installComponent({input:tt}),ke){const{teamDid:ve,storeList:$e}=so({fromBlocklet:O,nodeInfo:H,blocklet:_}),{isNew:Tt,decoded:nt}=ss(ke,$e);Tt&&await v.addBlockletStore({input:{teamDid:ve,url:nt}})}F({installResultProps:{}}),V({showError:!1,attachRuntimeInfo:!1})}catch(ve){const $e=le(ve);L.error($e),console.error("installComponent error: ",ve),Le($e)}finally{R(!1),A.current.installInput=tt}},Tn=T=>{const D=xo({params:{...T,did:T.bundleDid},blocklets:[_],blocklet:_,locale:E});if(D){const M=wn(T.bundleDid),q=di({params:{...T,did:T.bundleDid},blocklet:_});if(M&&M.mountPoint===q)return{errMsg:""}}return{errMsg:D}},Ce=async T=>{var M,q;const{errMsg:D}=Tn({...k,locale:E});p(D),G===me.length-2&&!we.current&&await En(T),(q=(M=Pe.current)==null?void 0:M.setActiveStepByIndex)==null||q.call(M,De=>De+1)},ze=()=>{var T,D;(D=(T=Pe.current)==null?void 0:T.setActiveStepByIndex)==null||D.call(T,M=>M-1)},ko=()=>{const{pathPrefix:T,bundleDid:D,title:M,componentName:q="",componentDid:De=""}=k,{meta:Be={}}=A.current||{},{registryUrl:Ue,inStore:Te,inputUrl:ke,dist:Fe}=Be,Ve=Te?qn(Ue,D,Fe):ke;J({meta:Be,installOpts:{type:"component",rootDid:_.meta.did,mountPoint:T,url:Ve,title:M,name:q,did:De}})},Po=T=>{ge(!1),F({purchaseResultProps:{variant:"error",title:Ee(),subTitle:T,style:{paddingTop:120},footer:e.jsx(ce,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{F({purchaseResultProps:{}})},children:u("common.retry")})}})},_o=({downloadTokenList:T})=>{A.current.downloadTokenList=T,ge(!1),Ce()},wt=({chooseParams:T=A.current,componentDid:D,isInit:M=!1})=>{var nt,Bn,On,Mn;const{meta:q,registryUrl:De,inStore:Be,inputUrl:Ue}=T,{did:Te,title:ke,name:Fe}=q,Ve=(((nt=_.settings)==null?void 0:nt.children)||[]).filter(ae=>ae.status==="deleted"&&ae.meta.bundleDid===Te),Et=D||"",Ye=(Bn=q.environments)==null?void 0:Bn.map(ae=>{const{name:kt,validation:ot,...st}=ae,Pt={validation:is(ot)?"":ot};return{...st,key:kt,...Pt}});A.current={...T,meta:{...q,configs:Ye,registryUrl:De,inStore:Be,inputUrl:Ue}};let re={};if(M){const ae=[_],kt=Ye||[],ot=[],st=io(os([...kt,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,it)=>Ae.required&&!it.required?-1:it.required&&!Ae.required?1:0),Pt=B.getSharedConfigObj(ae[0],{configs:st}),_t={},$n=st.map(Ae=>{const{default:it,key:rt,...Do}=Ae;return _t[rt]=Pt[rt]||it,{...Do,key:rt,hidden:!!K.BLOCKLET_CONFIGURABLE_KEY[rt]}});re={...re,configsList:$n,configsValue:_t,hasMissRequiredConfigs:eo($n,_t)}}const tt=_.children.some(ae=>ae.mountPoint==="/"),Oe=Ve.find(ae=>ae.meta.bundleDid===Te),Me=_.children.find(ae=>ae.meta.bundleDid===Te);re.title=ke||"",Oe?re={...re,pathPrefix:Oe.mountPoint||"",componentName:Oe.meta.name,hasEnvironmentsStep:!1}:Me?re={...re,pathPrefix:Me.mountPoint||"",componentName:Me.meta.name,hasEnvironmentsStep:!1}:re={...re,pathPrefix:tt?`/${Re(ke)||Re(Fe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(On=A.current.meta)==null?void 0:On.environments)==null?void 0:Mn.length)>0};const ve=Ki(A.current.meta),$e=Hi(A.current.meta),Tt=Lt(_);F({bundleDid:Te,componentDid:Et,...re,hasRequiredEnvironments:Qi(A.current.meta),requirePurchase:ve,didSpaceIsRequiredSetup:$e,didSpaceEndpoint:Tt}),M&&ve&&ko()};f.useEffect(()=>{!d||G!==0||!_||(wt({chooseParams:{blocklets:[d],meta:d,registryUrl:m||d.homepage,inStore:!0},isInit:!0}),F({showFromUrlDialog:!1}),Ce())},[d,G,_]),me.push({key:"selectComponent",name:u("blocklet.component.selectComponent"),body:e.jsxs(Ne,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[g&&k.showFromUrlDialog&&e.jsx(ri,{mode:"component",onCancel:()=>{F({showFromUrlDialog:!1})},onSuccess:({meta:T,inputUrl:D,inStore:M,registryUrl:q})=>{wt({chooseParams:{meta:T,inputUrl:D,inStore:M,registryUrl:q},isInit:!0}),F({showFromUrlDialog:!1}),Ce()},handleText:{title:u("blocklet.component.addComponentTip.fromUrl"),confirm:u("blocklet.component.choose")}}),e.jsx(an,{stores:o,extra:fo.isInServerlessMode(H)?null:g?e.jsxs(ce,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{F({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Ft,{style:{fontSize:20,marginRight:4}}),u("blocklet.component.addComponentTip.fromUrl")]}):null,loading:b,onChange:()=>{se({}),A.current={}},storageKey:r,children:({currentRegistry:T})=>e.jsx(cn,{showResourcesSwitch:x,showCategory:j,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:T.url,resourceType:a,resourceDid:n,handleButtonClick:D=>{wt({chooseParams:{...D,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:D,defaultRender:M})=>{const q=(k==null?void 0:k.bundleDid)&&(k==null?void 0:k.bundleDid)===(D==null?void 0:D.did);return e.jsxs(Ji,{children:[e.jsx(y,{className:q?"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",...q?{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:M}),q&&e.jsx(y,{className:"check-container",children:e.jsx(ns,{className:"check-icon"})})]})}})})]}),cancel:s==="embed"?void 0:u("common.cancel"),confirm:Zi({params:k,blocklet:_,t:u}),onCancel:We,onConfirm:()=>{Ce()}}),me.push({key:"agreement",name:u("launchBlocklet.introduction"),body:e.jsxs(Ne,{component:"div",className:"agreement-wrapper",children:[e.jsx(go,{title:u("launchBlocklet.introduction"),subTitle:u("blocklet.component.addComponentTip.introduction")}),e.jsx(Xs,{meta:z,onClickNext:Ce,installRelated:Y,onChangeInstallRelated:pe,handleDescEle:e.jsx("p",{children:u("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:d?void 0:u("common.pre"),disabled:!ne,confirm:u(ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:d?We:ze,onConfirm:()=>{ge(!1),Ce()}}),z&&k.requirePurchase&&me.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[u("common.verifyNFT"),e.jsx(dt,{})]}),body:e.jsxs(Ne,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Dn=(Je=ue.current)==null?void 0:Je.getCurrentStep)==null?void 0:Dn.call(Je))===2||de)&&e.jsx(ct,{title:u("common.verifyNFT"),subTitle:u("blocklet.component.addComponentTip.verifyNFT")}),at(k.purchaseResultProps)?X&&e.jsx(Di,{ref:ue,meta:X.meta,mode:k.componentDid?"verify":"both",onCancel:Po,installOpts:X.installOpts,handlePaySuccess:_o}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Yn,{...k.purchaseResultProps})})]}),disabled:((Un=(et=ue.current)==null?void 0:et.getCurrentStep)==null?void 0:Un.call(et))===2||de,cancel:u("common.pre"),confirm:u("common.next"),onConfirm:()=>{typeof ue.current.onNext=="function"&&(ue.current.onNext(),ge(!0))},onCancel:()=>{ze()}}),B.hasStartEngine(z)&&lo.hasMountPoint(z)?me.push({key:"config",name:u("common.config"),error:w,body:e.jsxs(Ne,{component:"div",children:[e.jsx(ct,{title:u("common.config"),subTitle:u("blocklet.component.addComponentTip.config")}),e.jsx(Q,{label:u("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:C||u("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:k.pathPrefix,onChange:T=>{const D=T.target.value;F({pathPrefix:D}),P(u("common.slugifyHint",{value:Gt(D)}))}}),!!w&&e.jsx(Bt,{severity:"error",style:{width:"100%",marginTop:8},children:w})]}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:()=>{Ce()}}):z&&(k.pathPrefix=((Ln=(Nn=z.interfaces)==null?void 0:Nn[0])==null?void 0:Ln.path)||`/${z.did}`),z&&(k!=null&&k.hasEnvironmentsStep)&&me.push({key:"environment",name:e.jsxs(e.Fragment,{children:[u("common.environment")," ",k.hasRequiredEnvironments&&e.jsx(dt,{})]}),disabled:!!I||(k==null?void 0:k.hasMissRequiredConfigs),body:()=>e.jsxs(Ne,{component:"div",style:{overflowY:"auto"},children:[e.jsx(ct,{title:u("common.environment"),subTitle:u("blocklet.component.addComponentTip.environment")}),e.jsx(tn,{style:{marginTop:-12,width:"100%"},schema:k.configsList,defaultValue:k.configsValue,onChange:(T,{action:D,currentItem:M,allValues:q})=>{D==="confirm"&&F({hasMissRequiredConfigs:eo(k.configsList,q),configsValue:q}),D==="edit"?c(M):["cancel","confirm"].includes(D)&&c(null)}})]}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:Ce}),z&&(k!=null&&k.didSpaceIsRequiredSetup)&&me.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[u("blocklet.component.didSpaceConfig")," ",k.didSpaceIsRequiredSetup==="required"&&e.jsx(dt,{})]}),disabled:(k==null?void 0:k.didSpaceIsRequiredSetup)&&!k.didSpaceEndpoint,body:()=>e.jsx(Hs,{children:e.jsxs(Ne,{component:"div",children:[e.jsx(ct,{title:u("blocklet.component.didSpaceConfig"),subTitle:u("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(rn,{blockletMeta:A.current.meta,onNext:()=>{Ce()},onEndpointUpdate:Ie})})]})}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:Ce}),me.push({key:"install",name:wn(z==null?void 0:z.did)?u("common.upgrade"):u("common.install"),disabled:l?!1:at(k.installResultProps),loading:l?!1:at(k.installResultProps),body:e.jsx(Ne,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(k.installResultProps)?e.jsx(Ws,{message:e.jsx(er,{children:u(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Yn,{...k.installResultProps})})}),confirm:u("common.complete"),onConfirm:To});const ie=me[G]||{},Io=()=>b||ie.error||!k.bundleDid?!0:G>1?!k.pathPrefix:!1;return _?e.jsxs(Xi,{sx:h?{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:[e.jsx(zs,{steps:me,mode:"memory",children:e.jsx(Yi,{ref:Pe,meta:z,isMobile:_e,onStepChange:T=>{ye(T)}})}),e.jsxs(y,{className:"action-bar",children:[ie.cancel&&e.jsx(ce,{onClick:T=>{T.stopPropagation(),ie.onCancel()},disabled:G===me.length-2&&b,color:"inherit",children:ie.cancel||u("common.cancel")}),ie.confirm&&e.jsx(ce,{onClick:T=>{T.stopPropagation(),ie.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:b||(typeof ie.disabled=="boolean"?ie.disabled:Io()),variant:"contained",autoFocus:!0,title:ie.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof ie.loading=="boolean"?ie.loading:b)&&e.jsx(fe,{style:{marginRight:8},size:16}),e.jsx(y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ie.confirm})]})})]})]}):null}un.propTypes={onClose:i.func,mode:i.oneOf(["normal","embed"]),inDialog:i.bool,stores:i.arrayOf(i.string),storeUrl:i.string,resourceType:i.string,resourceDid:i.string,storageKey:i.string,selectedMeta:i.object,showResourcesSwitch:i.bool,showFromUrl:i.bool,enableRunBackground:i.bool,showCategory:i.bool};un.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Xi=$(y)`
279
+ `,Yr=dn,Kr=t=>t.inStore&&B.isFreeBlocklet(t)===!1,Hr=t=>{var s;return[K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,K.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((s=t==null?void 0:t.capabilities)==null?void 0:s.didSpace)},Lt=t=>{var s,o;return((o=(s=t==null?void 0:t.configs)==null?void 0:s.find(a=>a.key===K.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:o.value)||null},Qr=t=>(t.environments||[]).some(s=>s.required),eo=(t,s)=>t==null?void 0:t.some(o=>o.required&&!s[o.key]),Zr=({params:t,blocklet:s,t:o})=>{const a=t.title||t.name;return a?((s==null?void 0:s.children)||[]).find(i=>i.meta.bundleDid===t.bundleDid)?o("blocklet.component.upgradeNext",{name:a}):o("blocklet.component.addNext",{name:a}):o("common.next")},to=({componentDid:t,timeout:s=1e3,manual:o=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:o},"*")},s)};function un({onClose:t,mode:s,stores:o,resourceType:a,resourceDid:n,storageKey:i,inDialog:h,selectedMeta:d,storeUrl:m,showResourcesSwitch:x,showFromUrl:g,enableRunBackground:c,showCategory:j}){var kn,Pn,_n,In,Je,Dn,et,Un,Nn,Ln;const{t:u,locale:w}=W(),[b,R]=f.useState(!1),[I,l]=f.useState(null),[E,p]=f.useState(""),[C,P]=f.useState(""),{api:v,ws:{useSubscription:N},inService:O,info:H}=Z(),{blocklet:_,actions:{refreshBlocklet:V}}=he(),[X,J]=f.useState(null),[de,ge]=f.useState(!1),xe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[k,se]=f.useState(xe),[G,ye]=f.useState(0),A=f.useRef({}),Pe=f.useRef({}),ue=f.useRef({}),_e=ao(T=>T.breakpoints.down("md")),S=ts(),[Y,pe]=f.useState(!0),{meta:z}=A.current,ne=Zs(z),Ee=f.useRef(!1),F=T=>se(D=>({...D,...T}));f.useEffect(()=>{if(k.pathPrefix){const{errMsg:T}=Tn({...k,pathPrefix:k.pathPrefix,locale:w});p(T)}},[k.pathPrefix]),f.useEffect(()=>{G===0&&se(xe)},[G]);const Ie=()=>{const T=Lt(_)??"";F({didSpaceEndpoint:T})},we=()=>{var T;return(T=A==null?void 0:A.current)!=null&&T.meta?B.getDisplayName(A.current):""},We=()=>{R(!1),se({}),Ee.current=!1,A.current={},t()},Le=T=>{const D=M=>{F({installResultProps:{variant:"error",title:we(),subTitle:T,footer:e.jsx(ce,{className:"bottom-button",disabled:M,"data-cy":"retry-install-component",onClick:async()=>{D(!0),await wn(A.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[M&&e.jsx(fe,{size:16,style:{marginRight:8}}),u("common.retry")]})})}})};D()},Xe=T=>D=>{var M,q;(((M=D==null?void 0:D.meta)==null?void 0:M.did)||(D==null?void 0:D.meta))===((q=_==null?void 0:_.meta)==null?void 0:q.did)&&T(D)},To=()=>{to({timeout:0,componentDid:S.componentDid,manual:!0}),We(),setTimeout(()=>{const T=document.getElementsByClassName("dashboard-main")[0];T&&(T.scrollTop=T.scrollHeight)},200)};N(K.BlockletEvents.componentInstalled,Xe(()=>{F({installResultProps:{variant:"success",title:we(),subTitle:u("blocklet.component.installSuccessTip")}}),to({componentDid:S.componentDid})}),[(kn=_==null?void 0:_.meta)==null?void 0:kn.did]),N(K.BlockletEvents.statusChange,Xe(()=>{const T=Lt(_);F(D=>({...D,didSpaceEndpoint:T}))}),[(Pn=_==null?void 0:_.meta)==null?void 0:Pn.did]),N(K.BlockletEvents.downloadFailed,Xe(()=>{Ee.current=!1,Le(u("blocklet.component.installComponentError"))}),[(_n=_==null?void 0:_.meta)==null?void 0:_n.did]),N(K.BlockletEvents.installFailed,Xe(()=>{Ee.current=!1,Le(u("blocklet.component.installComponentError"))}),[(In=_==null?void 0:_.meta)==null?void 0:In.did]);const me=[],En=T=>((_==null?void 0:_.children)||[]).find(D=>D.meta.did===T),wn=async T=>{var Oe,Me;Ee.current=!0;const{pathPrefix:D,bundleDid:M,title:q,componentName:De="",componentDid:Be=""}=k,Ue=((Oe=A.current)==null?void 0:Oe.meta)||{},{configs:Te=[],registryUrl:ke,inStore:Fe,inputUrl:Ve,dist:wt}=Ue,Ye=(Me=A.current)==null?void 0:Me.downloadTokenList,ie=Ve||(Fe?qn(ke,M,wt):"");R(!0);const tt={rootDid:_.meta.did,url:ie,mountPoint:D?Re(D):`/${Re(Ue.title||Ue.name)}`,title:q,name:De,did:Be,onlyRequired:!Y,...k.hasEnvironmentsStep&&Te.length>0?{configs:Te.map(ve=>({...ve,value:k.configsValue[ve.key]||""}))}:{},...Ye?{downloadTokenList:Ye}:{},...T};try{if(await v.installComponent({input:tt}),ke){const{teamDid:ve,storeList:$e}=so({fromBlocklet:O,nodeInfo:H,blocklet:_}),{isNew:Tt,decoded:nt}=ss(ke,$e);Tt&&await v.addBlockletStore({input:{teamDid:ve,url:nt}})}F({installResultProps:{}}),V({showError:!1,attachRuntimeInfo:!1})}catch(ve){const $e=le(ve);L.error($e),console.error("installComponent error: ",ve),Le($e)}finally{R(!1),A.current.installInput=tt}},Tn=T=>{const D=xo({params:{...T,did:T.bundleDid},blocklets:[_],blocklet:_,locale:w});if(D){const M=En(T.bundleDid),q=dr({params:{...T,did:T.bundleDid},blocklet:_});if(M&&M.mountPoint===q)return{errMsg:""}}return{errMsg:D}},Ce=async T=>{var M,q;const{errMsg:D}=Tn({...k,locale:w});p(D),G===me.length-2&&!Ee.current&&await wn(T),(q=(M=Pe.current)==null?void 0:M.setActiveStepByIndex)==null||q.call(M,De=>De+1)},ze=()=>{var T,D;(D=(T=Pe.current)==null?void 0:T.setActiveStepByIndex)==null||D.call(T,M=>M-1)},ko=()=>{const{pathPrefix:T,bundleDid:D,title:M,componentName:q="",componentDid:De=""}=k,{meta:Be={}}=A.current||{},{registryUrl:Ue,inStore:Te,inputUrl:ke,dist:Fe}=Be,Ve=Te?qn(Ue,D,Fe):ke;J({meta:Be,installOpts:{type:"component",rootDid:_.meta.did,mountPoint:T,url:Ve,title:M,name:q,did:De}})},Po=T=>{ge(!1),F({purchaseResultProps:{variant:"error",title:we(),subTitle:T,style:{paddingTop:120},footer:e.jsx(ce,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{F({purchaseResultProps:{}})},children:u("common.retry")})}})},_o=({downloadTokenList:T})=>{A.current.downloadTokenList=T,ge(!1),Ce()},Et=({chooseParams:T=A.current,componentDid:D,isInit:M=!1})=>{var nt,Bn,On,Mn;const{meta:q,registryUrl:De,inStore:Be,inputUrl:Ue}=T,{did:Te,title:ke,name:Fe}=q,Ve=(((nt=_.settings)==null?void 0:nt.children)||[]).filter(ae=>ae.status==="deleted"&&ae.meta.bundleDid===Te),wt=D||"",Ye=(Bn=q.environments)==null?void 0:Bn.map(ae=>{const{name:kt,validation:ot,...st}=ae,Pt={validation:rs(ot)?"":ot};return{...st,key:kt,...Pt}});A.current={...T,meta:{...q,configs:Ye,registryUrl:De,inStore:Be,inputUrl:Ue}};let ie={};if(M){const ae=[_],kt=Ye||[],ot=[],st=ro(os([...kt,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,rt)=>Ae.required&&!rt.required?-1:rt.required&&!Ae.required?1:0),Pt=B.getSharedConfigObj(ae[0],{configs:st}),_t={},$n=st.map(Ae=>{const{default:rt,key:it,...Do}=Ae;return _t[it]=Pt[it]||rt,{...Do,key:it,hidden:!!K.BLOCKLET_CONFIGURABLE_KEY[it]}});ie={...ie,configsList:$n,configsValue:_t,hasMissRequiredConfigs:eo($n,_t)}}const tt=_.children.some(ae=>ae.mountPoint==="/"),Oe=Ve.find(ae=>ae.meta.bundleDid===Te),Me=_.children.find(ae=>ae.meta.bundleDid===Te);ie.title=ke||"",Oe?ie={...ie,pathPrefix:Oe.mountPoint||"",componentName:Oe.meta.name,hasEnvironmentsStep:!1}:Me?ie={...ie,pathPrefix:Me.mountPoint||"",componentName:Me.meta.name,hasEnvironmentsStep:!1}:ie={...ie,pathPrefix:tt?`/${Re(ke)||Re(Fe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(On=A.current.meta)==null?void 0:On.environments)==null?void 0:Mn.length)>0};const ve=Kr(A.current.meta),$e=Hr(A.current.meta),Tt=Lt(_);F({bundleDid:Te,componentDid:wt,...ie,hasRequiredEnvironments:Qr(A.current.meta),requirePurchase:ve,didSpaceIsRequiredSetup:$e,didSpaceEndpoint:Tt}),M&&ve&&ko()};f.useEffect(()=>{!d||G!==0||!_||(Et({chooseParams:{blocklets:[d],meta:d,registryUrl:m||d.homepage,inStore:!0},isInit:!0}),F({showFromUrlDialog:!1}),Ce())},[d,G,_]),me.push({key:"selectComponent",name:u("blocklet.component.selectComponent"),body:e.jsxs(Ne,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[g&&k.showFromUrlDialog&&e.jsx(ir,{mode:"component",onCancel:()=>{F({showFromUrlDialog:!1})},onSuccess:({meta:T,inputUrl:D,inStore:M,registryUrl:q})=>{Et({chooseParams:{meta:T,inputUrl:D,inStore:M,registryUrl:q},isInit:!0}),F({showFromUrlDialog:!1}),Ce()},handleText:{title:u("blocklet.component.addComponentTip.fromUrl"),confirm:u("blocklet.component.choose")}}),e.jsx(an,{stores:o,extra:fo.isInServerlessMode(H)?null:g?e.jsxs(ce,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{F({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Ft,{style:{fontSize:20,marginRight:4}}),u("blocklet.component.addComponentTip.fromUrl")]}):null,loading:b,onChange:()=>{se({}),A.current={}},storageKey:i,children:({currentRegistry:T})=>e.jsx(cn,{showResourcesSwitch:x,showCategory:j,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:T.url,resourceType:a,resourceDid:n,handleButtonClick:D=>{Et({chooseParams:{...D,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:D,defaultRender:M})=>{const q=(k==null?void 0:k.bundleDid)&&(k==null?void 0:k.bundleDid)===(D==null?void 0:D.did);return e.jsxs(Jr,{children:[e.jsx(y,{className:q?"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",...q?{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:M}),q&&e.jsx(y,{className:"check-container",children:e.jsx(ns,{className:"check-icon"})})]})}})})]}),cancel:s==="embed"?void 0:u("common.cancel"),confirm:Zr({params:k,blocklet:_,t:u}),onCancel:We,onConfirm:()=>{Ce()}}),me.push({key:"agreement",name:u("launchBlocklet.introduction"),body:e.jsxs(Ne,{component:"div",className:"agreement-wrapper",children:[e.jsx(go,{title:u("launchBlocklet.introduction"),subTitle:u("blocklet.component.addComponentTip.introduction")}),e.jsx(Xs,{meta:z,onClickNext:Ce,installRelated:Y,onChangeInstallRelated:pe,handleDescEle:e.jsx("p",{children:u("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:d?void 0:u("common.pre"),disabled:!ne,confirm:u(ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:d?We:ze,onConfirm:()=>{ge(!1),Ce()}}),z&&k.requirePurchase&&me.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[u("common.verifyNFT"),e.jsx(dt,{})]}),body:e.jsxs(Ne,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Dn=(Je=ue.current)==null?void 0:Je.getCurrentStep)==null?void 0:Dn.call(Je))===2||de)&&e.jsx(ct,{title:u("common.verifyNFT"),subTitle:u("blocklet.component.addComponentTip.verifyNFT")}),at(k.purchaseResultProps)?X&&e.jsx(Dr,{ref:ue,meta:X.meta,mode:k.componentDid?"verify":"both",onCancel:Po,installOpts:X.installOpts,handlePaySuccess:_o}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Yn,{...k.purchaseResultProps})})]}),disabled:((Un=(et=ue.current)==null?void 0:et.getCurrentStep)==null?void 0:Un.call(et))===2||de,cancel:u("common.pre"),confirm:u("common.next"),onConfirm:()=>{typeof ue.current.onNext=="function"&&(ue.current.onNext(),ge(!0))},onCancel:()=>{ze()}}),B.hasStartEngine(z)&&lo.hasMountPoint(z)?me.push({key:"config",name:u("common.config"),error:E,body:e.jsxs(Ne,{component:"div",children:[e.jsx(ct,{title:u("common.config"),subTitle:u("blocklet.component.addComponentTip.config")}),e.jsx(Q,{label:u("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:C||u("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:k.pathPrefix,onChange:T=>{const D=T.target.value;F({pathPrefix:D}),P(u("common.slugifyHint",{value:Gt(D)}))}}),!!E&&e.jsx(Bt,{severity:"error",style:{width:"100%",marginTop:8},children:E})]}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:()=>{Ce()}}):z&&(k.pathPrefix=((Ln=(Nn=z.interfaces)==null?void 0:Nn[0])==null?void 0:Ln.path)||`/${z.did}`),z&&(k!=null&&k.hasEnvironmentsStep)&&me.push({key:"environment",name:e.jsxs(e.Fragment,{children:[u("common.environment")," ",k.hasRequiredEnvironments&&e.jsx(dt,{})]}),disabled:!!I||(k==null?void 0:k.hasMissRequiredConfigs),body:()=>e.jsxs(Ne,{component:"div",style:{overflowY:"auto"},children:[e.jsx(ct,{title:u("common.environment"),subTitle:u("blocklet.component.addComponentTip.environment")}),e.jsx(tn,{style:{marginTop:-12,width:"100%"},schema:k.configsList,defaultValue:k.configsValue,onChange:(T,{action:D,currentItem:M,allValues:q})=>{D==="confirm"&&F({hasMissRequiredConfigs:eo(k.configsList,q),configsValue:q}),D==="edit"?l(M):["cancel","confirm"].includes(D)&&l(null)}})]}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:Ce}),z&&(k!=null&&k.didSpaceIsRequiredSetup)&&me.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[u("blocklet.component.didSpaceConfig")," ",k.didSpaceIsRequiredSetup==="required"&&e.jsx(dt,{})]}),disabled:(k==null?void 0:k.didSpaceIsRequiredSetup)&&!k.didSpaceEndpoint,body:()=>e.jsx(Hs,{children:e.jsxs(Ne,{component:"div",children:[e.jsx(ct,{title:u("blocklet.component.didSpaceConfig"),subTitle:u("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(rn,{blockletMeta:A.current.meta,onNext:()=>{Ce()},onEndpointUpdate:Ie})})]})}),cancel:u("common.pre"),confirm:u("common.next"),onCancel:ze,onConfirm:Ce}),me.push({key:"install",name:En(z==null?void 0:z.did)?u("common.upgrade"):u("common.install"),disabled:c?!1:at(k.installResultProps),loading:c?!1:at(k.installResultProps),body:e.jsx(Ne,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(k.installResultProps)?e.jsx(Ws,{message:e.jsx(ei,{children:u(c?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Yn,{...k.installResultProps})})}),confirm:u("common.complete"),onConfirm:To});const re=me[G]||{},Io=()=>b||re.error||!k.bundleDid?!0:G>1?!k.pathPrefix:!1;return _?e.jsxs(Xr,{sx:h?{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:[e.jsx(zs,{steps:me,mode:"memory",children:e.jsx(Yr,{ref:Pe,meta:z,isMobile:_e,onStepChange:T=>{ye(T)}})}),e.jsxs(y,{className:"action-bar",children:[re.cancel&&e.jsx(ce,{onClick:T=>{T.stopPropagation(),re.onCancel()},disabled:G===me.length-2&&b,color:"inherit",children:re.cancel||u("common.cancel")}),re.confirm&&e.jsx(ce,{onClick:T=>{T.stopPropagation(),re.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:b||(typeof re.disabled=="boolean"?re.disabled:Io()),variant:"contained",autoFocus:!0,title:re.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof re.loading=="boolean"?re.loading:b)&&e.jsx(fe,{style:{marginRight:8},size:16}),e.jsx(y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:re.confirm})]})})]})]}):null}un.propTypes={onClose:r.func,mode:r.oneOf(["normal","embed"]),inDialog:r.bool,stores:r.arrayOf(r.string),storeUrl:r.string,resourceType:r.string,resourceDid:r.string,storageKey:r.string,selectedMeta:r.object,showResourcesSwitch:r.bool,showFromUrl:r.bool,enableRunBackground:r.bool,showCategory:r.bool};un.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Xr=$(y)`
280
280
  .action-bar {
281
281
  display: flex;
282
282
  justify-content: flex-end;
@@ -293,7 +293,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
293
293
  height: 100%;
294
294
  `,ct=$(go)`
295
295
  margin-bottom: 24px;
296
- `,Ji=$.div`
296
+ `,Jr=$.div`
297
297
  position: relative;
298
298
 
299
299
  .choose-blocklet {
@@ -337,7 +337,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
337
337
  transition: all ease 0.2s;
338
338
  }
339
339
  }
340
- `,er=$.div`
340
+ `,ei=$.div`
341
341
  color: ${t=>t.theme.palette.primary.main};
342
342
  .msg-before {
343
343
  display: inline-block;
@@ -345,10 +345,10 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
345
345
  font-size: 14px;
346
346
  margin-right: 6px;
347
347
  }
348
- `;function vt({blocklet:t,showDialog:s,setShowDialog:o,selectedMeta:a}){const{t:n}=W(),r=ao(m=>m.breakpoints.down("md")),{inService:h}=Z(),d=()=>{o(!1)};return s?e.jsx(tr,{title:n("blocklet.component.addWithName",{name:B.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:r?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(m,x)=>{x!=="backdropClick"&&d()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(un,{selectedMeta:a,onClose:d,storageKey:h?$s:As})}):null}vt.propTypes={selectedMeta:i.object,showDialog:i.bool.isRequired,setShowDialog:i.func.isRequired,blocklet:i.object.isRequired};vt.defaultProps={selectedMeta:null};const tr=$(ft)`
348
+ `;function vt({blocklet:t,showDialog:s,setShowDialog:o,selectedMeta:a}){const{t:n}=W(),i=ao(m=>m.breakpoints.down("md")),{inService:h}=Z(),d=()=>{o(!1)};return s?e.jsx(ti,{title:n("blocklet.component.addWithName",{name:B.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:i?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(m,x)=>{x!=="backdropClick"&&d()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(un,{selectedMeta:a,onClose:d,storageKey:h?$s:As})}):null}vt.propTypes={selectedMeta:r.object,showDialog:r.bool.isRequired,setShowDialog:r.func.isRequired,blocklet:r.object.isRequired};vt.defaultProps={selectedMeta:null};const ti=$(ft)`
349
349
  .MuiDialogContent-root {
350
350
  }
351
- `;function pn({blocklet:t,children:s}){const{t:o}=W(),[a,n]=f.useState(!1),r=h=>{h.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({open:r}):e.jsxs(je,{onClick:r,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Ft,{style:{fontSize:18,marginRight:5}}),o("blocklet.component.add")]}),e.jsx(vt,{showDialog:a,setShowDialog:n,blocklet:t})]})}pn.propTypes={children:i.any,blocklet:i.object.isRequired};pn.defaultProps={children:null};const nr=t=>t.children.filter(s=>s.meta.interfaces.find(o=>o.type===K.BLOCKLET_INTERFACE_TYPE_WEB));function jt({params:t,setParams:s,setError:o,serviceTypes:a}){const{t:n}=W(),{blocklet:r}=he(),h=r.meta.did,d=nr(r),[m,x]=f.useState([]),g={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return f.useEffect(()=>{if(t.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const l=d.find(E=>E.meta.did===t.componentId),j=B.findWebInterface(l.meta),u=(Array.isArray(j==null?void 0:j.pageGroups)?j.pageGroups:[]).map(E=>({value:E,label:`${E} pages`}));u.length&&u.unshift({value:"",label:"All pages"}),x(u),t.pageGroup&&u.find(E=>E.value===t.pageGroup)===!1&&s({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(Q,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:l=>{o(""),s({...t,type:l.target.value,did:l.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?h:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:l,value:j})=>e.jsx(je,{value:j,children:l},j))}),t.type===U.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:l=>s({...t,redirectCode:l.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(l=>e.jsx(je,{value:l,children:`${g[l]} - ${l}`},l))},"redirectCode"),e.jsx(Q,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{s({...t,url:l.target.value,__disableConfirm:!l.target.value.trim()}),l.target.value.trim()?o(""):o(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===U.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:l=>{s({...t,componentId:l.target.value})},style:{marginBottom:32},SelectProps:{},children:d.map(l=>e.jsx(je,{value:l.meta.did,selected:l.meta.did===t.componentId,children:B.getDisplayName(l,!0)},l.meta.did))},"componentId"),m.length?e.jsx(Q,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:l=>{s({...t,pageGroup:l.target.value})},SelectProps:{},children:m.map(l=>e.jsx(je,{value:l.value,selected:l.value===t.pageGroup,children:l.label},l.label))},"pageGroup"):null].filter(Boolean),t.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Q,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{const j=l.target.value.trim();s({...t,url:l.target.value,__disableConfirm:!j}),o(j?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(Q,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:l=>s({...t,responseType:l.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(l=>e.jsx(je,{value:l.value,children:l.text},l.value))},"responseType"),e.jsx(Q,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:l=>{const j=l.target.value.trim();s({...t,responseBody:l.target.value,__disableConfirm:!j}),o(j?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}jt.propTypes={params:i.object,serviceTypes:i.array,setParams:i.func,setError:i.func};jt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function mn({children:t,hiddenChildren:s,open:o,onClose:a}){const{t:n}=W(),{api:r}=Z(),{blocklet:h}=he(),[d,m]=f.useState(!1),[x,g]=f.useState(!1),l=h.meta.did,j=h.site.id,u=()=>{a==null||a(),m(!1),g(!1)},E=async c=>{try{const w=await ut(c,n);if(w)throw w;m(!0);const p={from:{pathPrefix:Re(c.pathPrefix)},to:{type:c.type}};c.type===U.ROUTING_RULE_TYPES.REDIRECT&&(p.to.url=c.url.trim(),p.to.redirectCode=c.redirectCode),c.type===U.ROUTING_RULE_TYPES.COMPONENT&&(p.to.did=l,p.to.componentId=c.componentId,p.to.pageGroup=c.pageGroup),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(p.to.url=Re(c.url)),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(p.to.response={status:200,contentType:c.responseType,body:c.responseBody}),await r.addRoutingRule({input:{id:j,rule:p,teamDid:l}}),a==null||a()}catch(w){L.error(w.message)}finally{m(!1),g(!1)}},b={title:n("router.rule.add.title"),description:(c,w,p)=>{const C=P=>{if(p(null),ut(P,n)){w({...P,__disableConfirm:!0});return}w({...P})};return e.jsxs(oe,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:c.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:c.pathPrefix,onChange:P=>{let v=!1;const N=xo({params:{...c,pathPrefix:P.target.value},blocklets:[h]});p(N),c.type===U.ROUTING_RULE_TYPES.BLOCKLET&&N&&(v=!0),c.type===U.ROUTING_RULE_TYPES.REDIRECT&&!c.url&&(v=!0),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!c.url&&(v=!0),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!c.responseType||!c.responseBody)&&(v=!0),P.target.value.trim()||(v=!0,p(n("router.validation.pathPrefixRequired"))),v||p("");const O=n("common.slugifyHint",{value:Gt(P.target.value)});w({...c,pathPrefix:P.target.value,pathPrefixHint:O,__disableConfirm:v})}}),e.jsx(jt,{params:c,setParams:C,setError:p})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:E,onCancel:u},R=c=>{c.stopPropagation(),g(!0)};let I=null;return s||(I=typeof t=="function"?t({open:R}):e.jsxs(je,{onClick:R,className:"rule-action","data-cy":"action-add-rule",children:[d?e.jsx(fe,{size:16}):e.jsx(Ft,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[I,(o||x)&&e.jsx(Ge,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel,color:"primary"})]})}mn.propTypes={children:i.any,onClose:i.func,hiddenChildren:i.bool,open:i.bool};mn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Ze({depth:t,className:s}){return e.jsx(y,{ml:Math.max((t-1)*2,0),className:s,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Ze.propTypes={depth:i.number,className:i.string};Ze.defaultProps={depth:1,className:""};function fn({id:t,from:s,children:o}){const{t:a}=W(),{api:n}=Z(),{blocklet:r}=he(),[h,d]=f.useState(!1),[m,x]=f.useState(null),g=r.meta.did,l=r.site.id,j=s.pathPrefix,u=()=>{d(!1),x(null)},E=async()=>{d(!0);try{await n.deleteRoutingRule({input:{id:l,ruleId:t,teamDid:g}})}catch(I){L.error(I.message)}finally{x(null),d(!1)}},b={keyName:j,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${j}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:j}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:E,onCancel:u},R=I=>{I.stopPropagation(),x(b)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:h,open:R}):e.jsxs(je,{onClick:R,className:"rule-action","data-cy":"action-delete-rule",children:[h?e.jsx(fe,{size:16}):e.jsx(yt,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),m&&e.jsx(mi,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}fn.propTypes={id:i.string.isRequired,from:i.object.isRequired,children:i.any};fn.defaultProps={children:null};function hn({id:t,from:s,to:o,children:a}){var c,w;const{t:n}=W(),{api:r}=Z(),{blocklet:h}=he(),[d,m]=f.useState(!1),[x,g]=f.useState(null),l=h.meta.did,j=h.site.id,u=s.pathPrefix,E=()=>{m(!1),g(null)},b=async p=>{try{const C=await ut(p,n);if(C)throw C;m(!0);const P={id:t,from:{pathPrefix:Re(p.pathPrefix)},to:{type:p.type}};p.type===U.ROUTING_RULE_TYPES.REDIRECT&&(P.to.url=p.url,P.to.redirectCode=p.redirectCode),p.type===U.ROUTING_RULE_TYPES.COMPONENT&&(P.to.did=l,P.to.componentId=p.componentId,P.to.pageGroup=p.pageGroup),p.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(P.to.url=Re(p.url)),p.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(P.to.response={status:200,contentType:p.responseType,body:p.responseBody}),await r.updateRoutingRule({input:{id:j,rule:P,teamDid:l}})}catch(C){L.error(C.message)}finally{m(!1),g(null)}},R={title:n("router.rule.update.title"),description:(p,C,P)=>{const v=N=>{if(ut(N,n)){C({...N,__disableConfirm:!0});return}C({...N})};return e.jsxs(oe,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:p.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:p.pathPrefix,onChange:N=>{let O=!1;p.type===U.ROUTING_RULE_TYPES.REDIRECT&&!p.url&&(O=!0),p.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!p.url&&(O=!0),p.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!p.responseType||!p.responseBody)&&(O=!0),N.target.value.trim()||(O=!0,P(n("router.validation.pathPrefixRequired"))),O||P("");const H=n("common.slugifyHint",{value:Gt(N.target.value)});C({...p,pathPrefix:N.target.value,helperText:H,__disableConfirm:O})}}),e.jsx(jt,{params:p,setParams:v,setError:P})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:o.did||"",pathPrefix:u==="/"?u:u.replace(/^\/+/,"").replace(/\/+$/,""),type:o.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:o.redirectCode||302,componentId:o.componentId||"",pageGroup:o.pageGroup||"",url:o.url||"",responseType:((c=o.response)==null?void 0:c.contentType)||"",responseBody:(((w=o.response)==null?void 0:w.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:b,onCancel:E},I=p=>{p.stopPropagation(),g(R)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:d,open:I}):e.jsxs(je,{onClick:I,className:"rule-action","data-cy":"action-update-rule",children:[d?e.jsx(fe,{size:16}):e.jsx(mo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),x&&e.jsx(Ge,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}hn.propTypes={id:i.string.isRequired,from:i.object.isRequired,to:i.object.isRequired,children:i.any};hn.defaultProps={children:null};function gn(t){const{locale:s}=W(),{blocklet:o,recommendedDomain:a}=he(),n=co(a,t.from.pathPrefix,Wt(o,s));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx(te,{size:"small",children:e.jsx(Co,{})})}),e.jsx(hn,{...t,children:({open:r})=>e.jsx(te,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(ti,{})})}),e.jsx(fn,{...t,children:({open:r})=>e.jsx(te,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(yt,{})})})]})}gn.propTypes={isProtected:i.bool};gn.defaultProps={isProtected:!1};function Ro({group:t,...s}){return t?e.jsx(Qe,{type:"reverse",...s,children:t}):null}Ro.propTypes={group:i.string.isRequired};function pt({domain:t,isHttps:s,toUrl:o}){const a=s?"https":"http";let n=o;return ls(n)||(n=`${a}://${t}${o}`),e.jsx(gt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:o},n)}pt.propTypes={domain:i.string.isRequired,toUrl:i.string.isRequired,isHttps:i.bool};pt.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:s,locale:o}=W(),a=ro(),{blocklet:n,recommendedDomain:r}=he();return n.site.rules.filter(d=>d.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(d=>{var l;let m=null,x=null;d.to.type===U.ROUTING_RULE_TYPES.NONE?m="404":d.to.type===U.ROUTING_RULE_TYPES.REDIRECT?m=d.to.redirectCode:d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?m="R":d.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?m=e.jsx(yi,{sx:{color:"text.secondary",fontSize:"45px"}}):d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(x=n.children.find(j=>j.meta.did===d.to.componentId),m="C");const g=d.isProtected?e.jsx(be,{title:s("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx(te,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(ii,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(gn,{...d});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof m=="object"?m:e.jsx(rs,{children:m}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[d.to.type===U.ROUTING_RULE_TYPES.NONE&&s("common.page404"),d.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&s("common.redirect"),d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&s("common.rewrite"),d.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((l=U.ROUTING_RESPONSE_TYPES.find(j=>j.value===d.to.response.contentType))==null?void 0:l.text),d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[d.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(pt,{domain:r,toUrl:d.to.url}),d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(pt,{domain:r,toUrl:d.to.url}),d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(Ro,{group:d.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(gt,{href:co(r,d.from.pathPrefix,Wt(n,o)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:as(d.from.pathPrefix,"/")||"/"})},d.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),e.jsx(Ze,{},"divider")]})}bt.propTypes={hasPermission:i.bool};bt.defaultProps={hasPermission:!1};const or=xt(bt,"mutate_blocklets"),sr=xt(bt,"",He);function ir(t){const{inService:s}=Z();return s?e.jsx(sr,{...t}):e.jsx(or,{...t})}function rr(t,s){const o=f.useRef(s);f.useEffect(()=>{const a=n=>o.current(n.detail);return window.addEventListener(t,a),()=>window.removeEventListener(t,a)},[t])}function ar(t){const s=uo(),{t:o}=W(),a=()=>{const n=new URLSearchParams(window.location.search);n.get("checkUpdate")&&(n.delete("checkUpdate"),s(n.toString()),t(),L.success(o("notification.checkingForUpdates")))};f.useEffect(a,[]),rr("checkUpdate",a)}function lr({blocklet:t,scrollToComponent:s}={blocklet:null,scrollToComponent:!1}){const o=uo(),{t:a}=W(),n=f.useRef(null),r=f.useMemo(()=>{if(!t||!t.optionalComponents)return null;const h=new URLSearchParams(window.location.search),d=h.get("install-component");if(d){n.current=d,h.delete("install-component"),o(h.toString());const m=t.optionalComponents.find(g=>g.meta.did===d);if(!m)return L.success(a("notification.installComponentError",{did:d})),null;const{meta:x}=m;if(s){const g=document.getElementById(`optional-component-${d}`),l=document.querySelector(".dashboard-main");if(g){const j=g.getBoundingClientRect(),u=l.getBoundingClientRect();l.scrollTo({top:j.top-u.top+l.scrollTop,behavior:"smooth"})}}return x}return null},[t,o,a,s]);return f.useEffect(()=>{var h;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(h=window.blocklet)==null?void 0:h.appUrl)},[t]),r}function Rt({open:t,onClose:s,blocklet:o,ancestors:a}){var x;const{t:n}=W(),r=[...(a||[]).map(g=>{var l;return((l=g==null?void 0:g.meta)==null?void 0:l.did)||""}),((x=o==null?void 0:o.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),h=n("preferencesFor",{name:B.getDisplayName(o,!0)}),d=f.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(o.status)||o.status==="unknown"&&qe(o.status))return null;const m=()=>{s==null||s()};return e.jsx(cr,{open:t,fullWidth:!0,maxWidth:"md",title:h,onClose:m,PaperProps:{style:{minHeight:"500px"}},children:e.jsxs(oo,{gap:1,children:[e.jsx(oe,{sx:{fontSize:12,color:"text.disabled",mb:.5},children:n("description.preferences",{name:B.getDisplayName(o,!0)})}),e.jsx(ni,{id:r,styles:d})]})})}Rt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,open:i.bool,onClose:i.func};Rt.defaultProps={ancestors:[],open:!1,onClose:null};const cr=$(ft)`
351
+ `;function pn({blocklet:t,children:s}){const{t:o}=W(),[a,n]=f.useState(!1),i=h=>{h.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({open:i}):e.jsxs(je,{onClick:i,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Ft,{style:{fontSize:18,marginRight:5}}),o("blocklet.component.add")]}),e.jsx(vt,{showDialog:a,setShowDialog:n,blocklet:t})]})}pn.propTypes={children:r.any,blocklet:r.object.isRequired};pn.defaultProps={children:null};const ni=t=>t.children.filter(s=>s.meta.interfaces.find(o=>o.type===K.BLOCKLET_INTERFACE_TYPE_WEB));function jt({params:t,setParams:s,setError:o,serviceTypes:a}){const{t:n}=W(),{blocklet:i}=he(),h=i.meta.did,d=ni(i),[m,x]=f.useState([]),g={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return f.useEffect(()=>{if(t.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const c=d.find(w=>w.meta.did===t.componentId),j=B.findWebInterface(c.meta),u=(Array.isArray(j==null?void 0:j.pageGroups)?j.pageGroups:[]).map(w=>({value:w,label:`${w} pages`}));u.length&&u.unshift({value:"",label:"All pages"}),x(u),t.pageGroup&&u.find(w=>w.value===t.pageGroup)===!1&&s({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(Q,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:c=>{o(""),s({...t,type:c.target.value,did:c.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?h:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:c,value:j})=>e.jsx(je,{value:j,children:c},j))}),t.type===U.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:c=>s({...t,redirectCode:c.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(g).map(c=>e.jsx(je,{value:c,children:`${g[c]} - ${c}`},c))},"redirectCode"),e.jsx(Q,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:c=>{s({...t,url:c.target.value,__disableConfirm:!c.target.value.trim()}),c.target.value.trim()?o(""):o(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===U.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:c=>{s({...t,componentId:c.target.value})},style:{marginBottom:32},SelectProps:{},children:d.map(c=>e.jsx(je,{value:c.meta.did,selected:c.meta.did===t.componentId,children:B.getDisplayName(c,!0)},c.meta.did))},"componentId"),m.length?e.jsx(Q,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:c=>{s({...t,pageGroup:c.target.value})},SelectProps:{},children:m.map(c=>e.jsx(je,{value:c.value,selected:c.value===t.pageGroup,children:c.label},c.label))},"pageGroup"):null].filter(Boolean),t.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Q,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:c=>{const j=c.target.value.trim();s({...t,url:c.target.value,__disableConfirm:!j}),o(j?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(Q,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:c=>s({...t,responseType:c.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(c=>e.jsx(je,{value:c.value,children:c.text},c.value))},"responseType"),e.jsx(Q,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:c=>{const j=c.target.value.trim();s({...t,responseBody:c.target.value,__disableConfirm:!j}),o(j?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}jt.propTypes={params:r.object,serviceTypes:r.array,setParams:r.func,setError:r.func};jt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function mn({children:t,hiddenChildren:s,open:o,onClose:a}){const{t:n}=W(),{api:i}=Z(),{blocklet:h}=he(),[d,m]=f.useState(!1),[x,g]=f.useState(!1),c=h.meta.did,j=h.site.id,u=()=>{a==null||a(),m(!1),g(!1)},w=async l=>{try{const E=await ut(l,n);if(E)throw E;m(!0);const p={from:{pathPrefix:Re(l.pathPrefix)},to:{type:l.type}};l.type===U.ROUTING_RULE_TYPES.REDIRECT&&(p.to.url=l.url.trim(),p.to.redirectCode=l.redirectCode),l.type===U.ROUTING_RULE_TYPES.COMPONENT&&(p.to.did=c,p.to.componentId=l.componentId,p.to.pageGroup=l.pageGroup),l.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(p.to.url=Re(l.url)),l.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(p.to.response={status:200,contentType:l.responseType,body:l.responseBody}),await i.addRoutingRule({input:{id:j,rule:p,teamDid:c}}),a==null||a()}catch(E){L.error(E.message)}finally{m(!1),g(!1)}},b={title:n("router.rule.add.title"),description:(l,E,p)=>{const C=P=>{if(p(null),ut(P,n)){E({...P,__disableConfirm:!0});return}E({...P})};return e.jsxs(oe,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:l.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:l.pathPrefix,onChange:P=>{let v=!1;const N=xo({params:{...l,pathPrefix:P.target.value},blocklets:[h]});p(N),l.type===U.ROUTING_RULE_TYPES.BLOCKLET&&N&&(v=!0),l.type===U.ROUTING_RULE_TYPES.REDIRECT&&!l.url&&(v=!0),l.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!l.url&&(v=!0),l.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!l.responseType||!l.responseBody)&&(v=!0),P.target.value.trim()||(v=!0,p(n("router.validation.pathPrefixRequired"))),v||p("");const O=n("common.slugifyHint",{value:Gt(P.target.value)});E({...l,pathPrefix:P.target.value,pathPrefixHint:O,__disableConfirm:v})}}),e.jsx(jt,{params:l,setParams:C,setError:p})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:w,onCancel:u},R=l=>{l.stopPropagation(),g(!0)};let I=null;return s||(I=typeof t=="function"?t({open:R}):e.jsxs(je,{onClick:R,className:"rule-action","data-cy":"action-add-rule",children:[d?e.jsx(fe,{size:16}):e.jsx(Ft,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[I,(o||x)&&e.jsx(Ge,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel,color:"primary"})]})}mn.propTypes={children:r.any,onClose:r.func,hiddenChildren:r.bool,open:r.bool};mn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Ze({depth:t,className:s}){return e.jsx(y,{ml:Math.max((t-1)*2,0),className:s,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Ze.propTypes={depth:r.number,className:r.string};Ze.defaultProps={depth:1,className:""};function fn({id:t,from:s,children:o}){const{t:a}=W(),{api:n}=Z(),{blocklet:i}=he(),[h,d]=f.useState(!1),[m,x]=f.useState(null),g=i.meta.did,c=i.site.id,j=s.pathPrefix,u=()=>{d(!1),x(null)},w=async()=>{d(!0);try{await n.deleteRoutingRule({input:{id:c,ruleId:t,teamDid:g}})}catch(I){L.error(I.message)}finally{x(null),d(!1)}},b={keyName:j,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${j}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:j}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:w,onCancel:u},R=I=>{I.stopPropagation(),x(b)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:h,open:R}):e.jsxs(je,{onClick:R,className:"rule-action","data-cy":"action-delete-rule",children:[h?e.jsx(fe,{size:16}):e.jsx(yt,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),m&&e.jsx(mr,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}fn.propTypes={id:r.string.isRequired,from:r.object.isRequired,children:r.any};fn.defaultProps={children:null};function hn({id:t,from:s,to:o,children:a}){var l,E;const{t:n}=W(),{api:i}=Z(),{blocklet:h}=he(),[d,m]=f.useState(!1),[x,g]=f.useState(null),c=h.meta.did,j=h.site.id,u=s.pathPrefix,w=()=>{m(!1),g(null)},b=async p=>{try{const C=await ut(p,n);if(C)throw C;m(!0);const P={id:t,from:{pathPrefix:Re(p.pathPrefix)},to:{type:p.type}};p.type===U.ROUTING_RULE_TYPES.REDIRECT&&(P.to.url=p.url,P.to.redirectCode=p.redirectCode),p.type===U.ROUTING_RULE_TYPES.COMPONENT&&(P.to.did=c,P.to.componentId=p.componentId,P.to.pageGroup=p.pageGroup),p.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(P.to.url=Re(p.url)),p.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(P.to.response={status:200,contentType:p.responseType,body:p.responseBody}),await i.updateRoutingRule({input:{id:j,rule:P,teamDid:c}})}catch(C){L.error(C.message)}finally{m(!1),g(null)}},R={title:n("router.rule.update.title"),description:(p,C,P)=>{const v=N=>{if(ut(N,n)){C({...N,__disableConfirm:!0});return}C({...N})};return e.jsxs(oe,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:p.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:p.pathPrefix,onChange:N=>{let O=!1;p.type===U.ROUTING_RULE_TYPES.REDIRECT&&!p.url&&(O=!0),p.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!p.url&&(O=!0),p.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!p.responseType||!p.responseBody)&&(O=!0),N.target.value.trim()||(O=!0,P(n("router.validation.pathPrefixRequired"))),O||P("");const H=n("common.slugifyHint",{value:Gt(N.target.value)});C({...p,pathPrefix:N.target.value,helperText:H,__disableConfirm:O})}}),e.jsx(jt,{params:p,setParams:v,setError:P})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:o.did||"",pathPrefix:u==="/"?u:u.replace(/^\/+/,"").replace(/\/+$/,""),type:o.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:o.redirectCode||302,componentId:o.componentId||"",pageGroup:o.pageGroup||"",url:o.url||"",responseType:((l=o.response)==null?void 0:l.contentType)||"",responseBody:(((E=o.response)==null?void 0:E.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:b,onCancel:w},I=p=>{p.stopPropagation(),g(R)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:d,open:I}):e.jsxs(je,{onClick:I,className:"rule-action","data-cy":"action-update-rule",children:[d?e.jsx(fe,{size:16}):e.jsx(mo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),x&&e.jsx(Ge,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}hn.propTypes={id:r.string.isRequired,from:r.object.isRequired,to:r.object.isRequired,children:r.any};hn.defaultProps={children:null};function gn(t){const{locale:s}=W(),{blocklet:o,recommendedDomain:a}=he(),n=co(a,t.from.pathPrefix,Wt(o,s));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx(te,{size:"small",children:e.jsx(Co,{})})}),e.jsx(hn,{...t,children:({open:i})=>e.jsx(te,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(tr,{})})}),e.jsx(fn,{...t,children:({open:i})=>e.jsx(te,{size:"small",onClick:i,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(yt,{})})})]})}gn.propTypes={isProtected:r.bool};gn.defaultProps={isProtected:!1};function Ro({group:t,...s}){return t?e.jsx(Qe,{type:"reverse",...s,children:t}):null}Ro.propTypes={group:r.string.isRequired};function pt({domain:t,isHttps:s,toUrl:o}){const a=s?"https":"http";let n=o;return ls(n)||(n=`${a}://${t}${o}`),e.jsx(gt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:o},n)}pt.propTypes={domain:r.string.isRequired,toUrl:r.string.isRequired,isHttps:r.bool};pt.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:s,locale:o}=W(),a=io(),{blocklet:n,recommendedDomain:i}=he();return n.site.rules.filter(d=>d.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(d=>{var c;let m=null,x=null;d.to.type===U.ROUTING_RULE_TYPES.NONE?m="404":d.to.type===U.ROUTING_RULE_TYPES.REDIRECT?m=d.to.redirectCode:d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?m="R":d.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?m=e.jsx(yr,{sx:{color:"text.secondary",fontSize:"45px"}}):d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(x=n.children.find(j=>j.meta.did===d.to.componentId),m="C");const g=d.isProtected?e.jsx(be,{title:s("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx(te,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(rr,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(gn,{...d});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof m=="object"?m:e.jsx(is,{children:m}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[d.to.type===U.ROUTING_RULE_TYPES.NONE&&s("common.page404"),d.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&s("common.redirect"),d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&s("common.rewrite"),d.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((c=U.ROUTING_RESPONSE_TYPES.find(j=>j.value===d.to.response.contentType))==null?void 0:c.text),d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[d.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(pt,{domain:i,toUrl:d.to.url}),d.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(pt,{domain:i,toUrl:d.to.url}),d.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(Ro,{group:d.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(gt,{href:co(i,d.from.pathPrefix,Wt(n,o)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:as(d.from.pathPrefix,"/")||"/"})},d.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:g})},"actions")]},"rule"),e.jsx(Ze,{},"divider")]})}bt.propTypes={hasPermission:r.bool};bt.defaultProps={hasPermission:!1};const oi=xt(bt,"mutate_blocklets"),si=xt(bt,"",He);function ri(t){const{inService:s}=Z();return s?e.jsx(si,{...t}):e.jsx(oi,{...t})}function ii(t,s){const o=f.useRef(s);f.useEffect(()=>{const a=n=>o.current(n.detail);return window.addEventListener(t,a),()=>window.removeEventListener(t,a)},[t])}function ai(t){const s=uo(),{t:o}=W(),a=()=>{const n=new URLSearchParams(window.location.search);n.get("checkUpdate")&&(n.delete("checkUpdate"),s(n.toString()),t(),L.success(o("notification.checkingForUpdates")))};f.useEffect(a,[]),ii("checkUpdate",a)}function li({blocklet:t,scrollToComponent:s}={blocklet:null,scrollToComponent:!1}){const o=uo(),{t:a}=W(),n=f.useRef(null),i=f.useMemo(()=>{if(!t||!t.optionalComponents)return null;const h=new URLSearchParams(window.location.search),d=h.get("install-component");if(d){n.current=d,h.delete("install-component"),o(h.toString());const m=t.optionalComponents.find(g=>g.meta.did===d);if(!m)return L.success(a("notification.installComponentError",{did:d})),null;const{meta:x}=m;if(s){const g=document.getElementById(`optional-component-${d}`),c=document.querySelector(".dashboard-main");if(g){const j=g.getBoundingClientRect(),u=c.getBoundingClientRect();c.scrollTo({top:j.top-u.top+c.scrollTop,behavior:"smooth"})}}return x}return null},[t,o,a,s]);return f.useEffect(()=>{var h;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(h=window.blocklet)==null?void 0:h.appUrl)},[t]),i}function Rt({open:t,onClose:s,blocklet:o,ancestors:a}){var x;const{t:n}=W(),i=[...(a||[]).map(g=>{var c;return((c=g==null?void 0:g.meta)==null?void 0:c.did)||""}),((x=o==null?void 0:o.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),h=n("preferencesFor",{name:B.getDisplayName(o,!0)}),d=f.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(o.status)||o.status==="unknown"&&qe(o.status))return null;const m=()=>{s==null||s()};return e.jsx(ci,{open:t,fullWidth:!0,maxWidth:"md",title:h,onClose:m,PaperProps:{style:{minHeight:"500px"}},children:e.jsxs(oo,{gap:1,children:[e.jsx(oe,{sx:{fontSize:12,color:"text.disabled",mb:.5},children:n("description.preferences",{name:B.getDisplayName(o,!0)})}),e.jsx(nr,{id:i,styles:d})]})})}Rt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,open:r.bool,onClose:r.func};Rt.defaultProps={ancestors:[],open:!1,onClose:null};const ci=$(ft)`
352
352
  .MuiDialogContent-root {
353
353
  padding-top: 0;
354
354
  padding-bottom: 24px;
@@ -361,15 +361,15 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
361
361
  .ux-dialog_closeButton {
362
362
  margin: 0;
363
363
  }
364
- `;function xn({component:t,remove:s,disabled:o,tip:a,showConfirm:n,hideBtn:r,onCancel:h}){const{t:d}=f.useContext(Se),[m,x]=f.useState(!1),[g,l]=f.useState(null),j=async I=>{x(!0),await s(I.component,I.removeType),x(!1),l(null)},u=o||m,E=()=>{l({title:`${d("common.delete")} ${t.meta.title||t.meta.name}`,description:(I,c)=>e.jsxs(oe,{component:"div",children:[e.jsx(oe,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),e.jsxs(fi,{name:"removeType",value:I.removeType,onChange:w=>c({...I,removeType:w.target.value}),children:[e.jsx(Ot,{value:"keepData",control:e.jsx(Hn,{}),label:d("blocklet.action.removeComponentKeepData")}),e.jsx(Ot,{value:"complete",control:e.jsx(Hn,{}),label:d("blocklet.action.removeComponentComplete")})]})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:j,onCancel:()=>{l(null),h()}})};f.useEffect(()=>{n?E():(x(!1),l(null))},[n]);const b=e.jsx(dr,{size:"small",disabled:u,onClick:()=>E,"data-cy":"delete-component-btn",children:e.jsx(yt,{disabled:u})}),R=e.jsx(be,{title:a||d("common.delete"),children:e.jsx("span",{children:b})});return e.jsxs(e.Fragment,{children:[!r&&R,g&&e.jsx(Ge,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}xn.propTypes={component:i.object.isRequired,remove:i.func,onCancel:i.func,disabled:i.bool,showConfirm:i.bool,hideBtn:i.bool,tip:i.string};xn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const dr=$(te)`
364
+ `;function xn({component:t,remove:s,disabled:o,tip:a,showConfirm:n,hideBtn:i,onCancel:h}){const{t:d}=f.useContext(Se),[m,x]=f.useState(!1),[g,c]=f.useState(null),j=async I=>{x(!0),await s(I.component,I.removeType),x(!1),c(null)},u=o||m,w=()=>{c({title:`${d("common.delete")} ${t.meta.title||t.meta.name}`,description:(I,l)=>e.jsxs(oe,{component:"div",children:[e.jsx(oe,{gutterBottom:!0,children:d("blocklet.action.removeComponentDescription")}),e.jsxs(fr,{name:"removeType",value:I.removeType,onChange:E=>l({...I,removeType:E.target.value}),children:[e.jsx(Ot,{value:"keepData",control:e.jsx(Hn,{}),label:d("blocklet.action.removeComponentKeepData")}),e.jsx(Ot,{value:"complete",control:e.jsx(Hn,{}),label:d("blocklet.action.removeComponentComplete")})]})]}),confirm:d("common.confirm"),cancel:d("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:j,onCancel:()=>{c(null),h()}})};f.useEffect(()=>{n?w():(x(!1),c(null))},[n]);const b=e.jsx(di,{size:"small",disabled:u,onClick:()=>w,"data-cy":"delete-component-btn",children:e.jsx(yt,{disabled:u})}),R=e.jsx(be,{title:a||d("common.delete"),children:e.jsx("span",{children:b})});return e.jsxs(e.Fragment,{children:[!i&&R,g&&e.jsx(Ge,{title:g.title,description:g.description,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}xn.propTypes={component:r.object.isRequired,remove:r.func,onCancel:r.func,disabled:r.bool,showConfirm:r.bool,hideBtn:r.bool,tip:r.string};xn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const di=$(te)`
365
365
  &.Mui-disabled {
366
366
  opacity: 0.5;
367
367
  }
368
- `;function yn({component:t,onStart:s,onStop:o,disabled:a,tip:n}){const{t:r}=f.useContext(Se),[h,d]=f.useState(!1),[m,x]=f.useState(),g=async()=>{d(!0);try{await s(t)}catch(R){L.error(R.message)}d(!1)},l=async()=>{d(!0);try{await o(t)}catch(R){L.error(R.message)}d(!1)},j=a||h,u=["starting","running","stopping"].includes(t.status),E=u?Ss:ws,b=e.jsx(ur,{disabled:j,onClick:()=>{var R;u?x({title:`${r("common.stop")} ${(R=t==null?void 0:t.meta)==null?void 0:R.title}`,description:r("blocklet.action.stopComponentDescription"),confirm:r("blocklet.action.confirmStop"),cancel:r("common.cancel"),onConfirm:()=>(x(null),l()),onCancel:()=>x(null)}):g()},"data-cy":`${u?"stop":"start"}-component-btn`,children:e.jsx(E,{disabled:j,fontSize:"small"})});return[e.jsx(be,{title:n||r(`common.${u?"stop":"start"}`),children:e.jsx("span",{children:b})},"btn"),m&&e.jsx(Ge,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel},"connect")]}yn.propTypes={component:i.object.isRequired,onStart:i.func,onStop:i.func,disabled:i.bool,tip:i.string};yn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ur=$(te)`
368
+ `;function yn({component:t,onStart:s,onStop:o,disabled:a,tip:n}){const{t:i}=f.useContext(Se),[h,d]=f.useState(!1),[m,x]=f.useState(),g=async()=>{d(!0);try{await s(t)}catch(R){L.error(R.message)}d(!1)},c=async()=>{d(!0);try{await o(t)}catch(R){L.error(R.message)}d(!1)},j=a||h,u=["starting","running","stopping"].includes(t.status),w=u?Ss:Es,b=e.jsx(ui,{disabled:j,onClick:()=>{var R;u?x({title:`${i("common.stop")} ${(R=t==null?void 0:t.meta)==null?void 0:R.title}`,description:i("blocklet.action.stopComponentDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:()=>(x(null),c()),onCancel:()=>x(null)}):g()},"data-cy":`${u?"stop":"start"}-component-btn`,children:e.jsx(w,{disabled:j,fontSize:"small"})});return[e.jsx(be,{title:n||i(`common.${u?"stop":"start"}`),children:e.jsx("span",{children:b})},"btn"),m&&e.jsx(Ge,{title:m.title,description:m.description,confirm:m.confirm,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel},"connect")]}yn.propTypes={component:r.object.isRequired,onStart:r.func,onStop:r.func,disabled:r.bool,tip:r.string};yn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const ui=$(te)`
369
369
  &.Mui-disabled {
370
370
  opacity: 0.5;
371
371
  }
372
- `;function Cn({sourceInfo:t,blocklet:s}){var n;const{t:o}=f.useContext(Se);let{source:a}=t;return a==="registry"&&(a="Blocklet Store"),e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(cs,{type:"success",children:hi(a)},"source"),t.source==="registry"&&e.jsx(gt,{href:ht(t.deployedFrom,"blocklets",((n=s==null?void 0:s.meta)==null?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:o("blocklet.overview.viewInStore")})]})}Cn.propTypes={sourceInfo:i.shape({source:i.string,deployedFrom:i.string}),blocklet:i.object};Cn.defaultProps={sourceInfo:{},blocklet:{}};var vn={},pr=qt;Object.defineProperty(vn,"__esModule",{value:!0});var So=vn.default=void 0,mr=pr(At()),fr=e;So=vn.default=(0,mr.default)((0,fr.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function St({blocklet:t,checkUpgrade:s,hasPermission:o,...a}){const{api:n}=Z(),{t:r}=f.useContext(Se),[h,d]=f.useState(!1),[m,x]=f.useState(""),[g,l]=f.useState(null),[j,u]=f.useState(null);f.useEffect(()=>{l(null),s&&(t.mode,K.BLOCKLET_MODES.DEVELOPMENT)},[t,s]);const E=()=>{d(!1),u(null)},b=async()=>{d(!0);try{const I={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await n.upgradeBlocklet({input:I})}catch(I){L.error(`Blocklet upgrade failed: ${le(I)}`)}finally{d(!1),u(null)}},R={title:`${r("common.upgrade")} ${r("common.blocklet")} ${B.getDisplayName(t)}`,description:r("blocklet.action.upgradeDescription"),confirm:r("blocklet.action.confirmUpgrade"),cancel:r("common.cancel"),onConfirm:b,onCancel:E};return o&&g&&!B.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{...a,children:t.meta.version}),e.jsx(be,{title:r("common.updateAvailable",{version:g.version}),children:e.jsx(te,{size:"small",style:{marginLeft:8},disabled:h,onClick:()=>u(R),children:h?e.jsx(fe,{size:16}):e.jsx(So,{style:{fontSize:16,color:"red"}})})}),!!m&&e.jsx(L,{variant:"error",message:m,onClose:()=>x("")}),j&&e.jsx(Ge,{title:j.title,description:j.description,confirm:j.confirm,cancel:j.cancel,params:j.params,onConfirm:j.onConfirm,onCancel:j.onCancel})]}):e.jsx(Qe,{...a,children:t.meta.version})}St.propTypes={blocklet:i.object.isRequired,checkUpgrade:i.bool,hasPermission:i.bool};St.defaultProps={checkUpgrade:!1,hasPermission:!1};const hr=xt(St,"mutate_blocklets"),gr=xt(St,"",He);function xr(t){const{inService:s}=Z();return s?e.jsx(gr,{...t}):e.jsx(hr,{...t})}const yr=t=>{var s;return!((s=t==null?void 0:t.meta)!=null&&s.group)},Cr=(t,s)=>t?[{name:s("common.name"),value:t.displayName},{name:s("common.description"),value:t.description},{name:s("common.version"),value:e.jsx(Qe,{children:t.version})}]:[],vr=t=>{const{source:s,deployedFrom:o,bundleSource:a}=t;if(s)return{source:s,deployedFrom:o};if(!a)return{source:"upload",deployedFrom:o};if(a.url){const n=o||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:n,link:n}}if(a.store){const n=o||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:n,link:n}}return{}},jr=(t,s)=>{const o=t.split("/").slice(1);let a=s,n=0;const r=[];for(;a&&n<o.length;){const h=a.children.find(d=>d.meta.did===o[n]);a=h,n++,h&&r.push(h.meta.title)}return r.join(" / ")};function jn({blocklet:t,depth:s,componentInfo:o,app:a,onClose:n}){var u,E;const{t:r,locale:h}=f.useContext(Se),{deletingBlocklets:d}=zt();let{status:m}=t;s===1&&d.includes(t.meta.did)&&(m="deleting");const x=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=b=>b.map(R=>R.name===r("common.did")||R.name===r("blocklet.appId")?e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:R.name,nameFormatter:()=>R.name,children:R.value},R.name):e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:R.name,children:R.link?e.jsx(gt,{href:R.link,target:"_blank",className:"page-link",underline:"hover",children:R.value}):R.value},R.name)),l=o?vr(o):{},j=o?[{name:r("common.name"),value:B.getDisplayName(o,!0)},{name:r("common.version"),value:e.jsx(xr,{blocklet:o,checkUpgrade:!1})},{name:r("common.status"),value:e.jsx(vo,{isResource:yr(t),status:m,source:o.source,progress:t.progress})},t.status==="running"?{name:r("blocklet.startedAt"),value:It(t.startedAt,h)}:null,t.status!=="running"?{name:r("blocklet.stoppedAt"),value:It(t.stoppedAt,h)}:null,t.installedAt?{name:r("blocklet.installedAt"),value:It(t.installedAt,h)}:null,B.hasStartEngine(t.meta)?{name:r("common.mountPoint"),value:x}:null,o.meta.group?{name:r("common.group"),value:e.jsx(Qe,{type:"success",children:o.meta.group})}:null,{name:r("blocklet.overview.source"),value:e.jsx(Cn,{sourceInfo:l,blocklet:t})},{name:r("blocklet.overview.deployedFrom"),value:l.deployedFrom||"-",link:l.link??""},{name:r("common.did"),value:e.jsx(ds,{did:o.meta.did,showQrcode:!0})},{name:r("common.author"),value:o.meta.owner?e.jsx(ai,{owner:o.meta.owner,locale:h}):li.formatPerson(o.meta.author)},{name:r("common.engine"),value:Cr(o.engine,r).map(({name:b,value:R})=>e.jsx(Dt,{style:{marginBottom:4},nameWidth:120,name:b,children:R},b))},(u=t.dependents)!=null&&u.length?{name:r("common.dependents"),value:e.jsx(y,{children:t.dependents.map(b=>e.jsx(y,{children:`${jr(b.id,a)} ${b.required?`(${r("common.required")})`:""}`},b.id))})}:null,(E=t.meta.resources)!=null&&E.length?{name:r("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return o?e.jsx(ft,{open:!0,title:r("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(j)},"dialog-wrapper")},"base-info-dialog"):null}jn.propTypes={blocklet:i.object.isRequired,depth:i.number,app:i.object,componentInfo:i.object,onClose:i.func.isRequired};jn.defaultProps={depth:0,app:null,componentInfo:null};$(po)`
372
+ `;function Cn({sourceInfo:t,blocklet:s}){var n;const{t:o}=f.useContext(Se);let{source:a}=t;return a==="registry"&&(a="Blocklet Store"),e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(cs,{type:"success",children:hr(a)},"source"),t.source==="registry"&&e.jsx(gt,{href:ht(t.deployedFrom,"blocklets",((n=s==null?void 0:s.meta)==null?void 0:n.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:o("blocklet.overview.viewInStore")})]})}Cn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};Cn.defaultProps={sourceInfo:{},blocklet:{}};var vn={},pi=qt;Object.defineProperty(vn,"__esModule",{value:!0});var So=vn.default=void 0,mi=pi(At()),fi=e;So=vn.default=(0,mi.default)((0,fi.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function St({blocklet:t,checkUpgrade:s,hasPermission:o,...a}){const{api:n}=Z(),{t:i}=f.useContext(Se),[h,d]=f.useState(!1),[m,x]=f.useState(""),[g,c]=f.useState(null),[j,u]=f.useState(null);f.useEffect(()=>{c(null),s&&(t.mode,K.BLOCKLET_MODES.DEVELOPMENT)},[t,s]);const w=()=>{d(!1),u(null)},b=async()=>{d(!0);try{const I={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ke(2e3),await n.upgradeBlocklet({input:I})}catch(I){L.error(`Blocklet upgrade failed: ${le(I)}`)}finally{d(!1),u(null)}},R={title:`${i("common.upgrade")} ${i("common.blocklet")} ${B.getDisplayName(t)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:b,onCancel:w};return o&&g&&!B.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{...a,children:t.meta.version}),e.jsx(be,{title:i("common.updateAvailable",{version:g.version}),children:e.jsx(te,{size:"small",style:{marginLeft:8},disabled:h,onClick:()=>u(R),children:h?e.jsx(fe,{size:16}):e.jsx(So,{style:{fontSize:16,color:"red"}})})}),!!m&&e.jsx(L,{variant:"error",message:m,onClose:()=>x("")}),j&&e.jsx(Ge,{title:j.title,description:j.description,confirm:j.confirm,cancel:j.cancel,params:j.params,onConfirm:j.onConfirm,onCancel:j.onCancel})]}):e.jsx(Qe,{...a,children:t.meta.version})}St.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};St.defaultProps={checkUpgrade:!1,hasPermission:!1};const hi=xt(St,"mutate_blocklets"),gi=xt(St,"",He);function xi(t){const{inService:s}=Z();return s?e.jsx(gi,{...t}):e.jsx(hi,{...t})}const yi=t=>{var s;return!((s=t==null?void 0:t.meta)!=null&&s.group)},Ci=(t,s)=>t?[{name:s("common.name"),value:t.displayName},{name:s("common.description"),value:t.description},{name:s("common.version"),value:e.jsx(Qe,{children:t.version})}]:[],vi=t=>{const{source:s,deployedFrom:o,bundleSource:a}=t;if(s)return{source:s,deployedFrom:o};if(!a)return{source:"upload",deployedFrom:o};if(a.url){const n=o||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:n,link:n}}if(a.store){const n=o||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:n,link:n}}return{}},ji=(t,s)=>{const o=t.split("/").slice(1);let a=s,n=0;const i=[];for(;a&&n<o.length;){const h=a.children.find(d=>d.meta.did===o[n]);a=h,n++,h&&i.push(h.meta.title)}return i.join(" / ")};function jn({blocklet:t,depth:s,componentInfo:o,app:a,onClose:n}){var u,w;const{t:i,locale:h}=f.useContext(Se),{deletingBlocklets:d}=zt();let{status:m}=t;s===1&&d.includes(t.meta.did)&&(m="deleting");const x=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=b=>b.map(R=>R.name===i("common.did")||R.name===i("blocklet.appId")?e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:R.name,nameFormatter:()=>R.name,children:R.value},R.name):e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:R.name,children:R.link?e.jsx(gt,{href:R.link,target:"_blank",className:"page-link",underline:"hover",children:R.value}):R.value},R.name)),c=o?vi(o):{},j=o?[{name:i("common.name"),value:B.getDisplayName(o,!0)},{name:i("common.version"),value:e.jsx(xi,{blocklet:o,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(vo,{isResource:yi(t),status:m,source:o.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:It(t.startedAt,h)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:It(t.stoppedAt,h)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:It(t.installedAt,h)}:null,B.hasStartEngine(t.meta)?{name:i("common.mountPoint"),value:x}:null,o.meta.group?{name:i("common.group"),value:e.jsx(Qe,{type:"success",children:o.meta.group})}:null,{name:i("blocklet.overview.source"),value:e.jsx(Cn,{sourceInfo:c,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:c.deployedFrom||"-",link:c.link??""},{name:i("common.did"),value:e.jsx(ds,{did:o.meta.did,showQrcode:!0})},{name:i("common.author"),value:o.meta.owner?e.jsx(ar,{owner:o.meta.owner,locale:h}):lr.formatPerson(o.meta.author)},{name:i("common.engine"),value:Ci(o.engine,i).map(({name:b,value:R})=>e.jsx(Dt,{style:{marginBottom:4},nameWidth:120,name:b,children:R},b))},(u=t.dependents)!=null&&u.length?{name:i("common.dependents"),value:e.jsx(y,{children:t.dependents.map(b=>e.jsx(y,{children:`${ji(b.id,a)} ${b.required?`(${i("common.required")})`:""}`},b.id))})}:null,(w=t.meta.resources)!=null&&w.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return o?e.jsx(ft,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(j)},"dialog-wrapper")},"base-info-dialog"):null}jn.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};jn.defaultProps={depth:0,app:null,componentInfo:null};$(po)`
373
373
  .BaseBadge-badge {
374
374
  top: ${t=>t.top*8||6}px;
375
375
  right: ${t=>t.right*8||6}px;
@@ -391,7 +391,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
391
391
  margin-left: 4px;
392
392
  transform: translateY(-1px);
393
393
  }
394
- `;function wo({blocklet:t,ancestors:s,mountPoint:o,href:a}){const[n,r]=f.useState(!1),[h,d]=f.useState(!1),[m,x]=f.useState(!1),[g,l]=f.useState(o),{api:j}=Z(),u=!s.length,E=u?t.meta.did:s.map(v=>v.meta.did)[0],{t:b}=W(),{confirmApi:R,confirmHolder:I}=us();f.useEffect(()=>{d(!1),r(!1),x(!1)},[o]);const c=()=>{r(!1),d(!1),l(o)},w=async()=>{x(!0),r(!1);try{const v={rootDid:E,mountPoint:Re(g)};u||(v.did=t.meta.did),await j.updateComponentMountPoint({input:v})}catch(v){throw v.message=le(v),L.error(v.message),v}finally{c()}},p=ps(()=>{R.open({title:b("common.noticeTitle"),content:e.jsxs(y,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[e.jsx(oe,{sx:{mb:1.5},children:b("blocklet.mountPoint.description1")}),e.jsx(oe,{component:"li",children:b("blocklet.mountPoint.case1")}),e.jsx(oe,{component:"li",children:b("blocklet.mountPoint.case2")}),e.jsx(oe,{sx:{mt:1.5},children:b("blocklet.mountPoint.description2")})]}),confirmButtonText:b("common.confirm"),cancelButtonText:b("common.cancel"),async onConfirm(v){await w(),v()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),C=v=>{v==null||v.preventDefault(),Re(g)!==o?p():d(!1)},P=h?e.jsxs(y,{sx:{ml:1},children:[e.jsx(te,{size:"medium",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),"data-cy":"edit-mount-point-submit",onClick:C,children:e.jsx(y,{component:ee,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx(te,{size:"medium",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onClick:c,children:e.jsx(y,{component:ee,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx(te,{size:"medium",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onClick:()=>d(!0),children:e.jsx(y,{component:ee,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[I,h?e.jsx("form",{onSubmit:C,children:e.jsx(Q,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:v=>l(v.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:o})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:ms(o)})}),m?e.jsx(fe,{size:20,sx:{ml:1}}):P]},o)}wo.propTypes={mountPoint:i.string.isRequired,href:i.string.isRequired,blocklet:i.object.isRequired,ancestors:i.array.isRequired};const br=t=>{var s;return!((s=t==null?void 0:t.meta)!=null&&s.group)},no=(t,s)=>{const o=t.split("/").slice(1);let a=s,n=0;const r=[];for(;a&&n<o.length;){const h=a.children.find(d=>d.meta.did===o[n]);a=h,n++,h&&r.push(h.meta.title)}return r.join(" / ")};function mt({blocklet:t,ancestors:s,depth:o,onRemove:a,onStart:n,onStop:r,onRestart:h,getComponentUrl:d,app:m}){var xe,k,se;const{t:x}=f.useContext(Se),[g,l]=f.useState(),[j,u]=f.useState(!1),[E,b]=f.useState(!1),[R,I]=f.useState(null),{info:c}=Z(),[w,p]=f.useState(!1),[C,P]=f.useState(!1),{deletingBlocklets:v}=zt();let{status:N}=t;o===1&&v.includes(t.meta.did)&&(N="deleting");const O=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),H=d(O),_=B.isInProgress(m.status),V=B.isInProgress(t.status);let X="";if(_||V||o===1&&v.includes(t.meta.did))X=x("blocklet.component.tip.stopBlocklet");else if((xe=t.dependents)!=null&&xe.length){const G=t.dependents.filter(ye=>ye.required);if(G.length){const ye=G.map(A=>no(A.id,m));X=x("blocklet.component.tip.requiredBy",{name:ye.join(", ")})}}const J=async(...G)=>{b(!0);try{await a(...G)}catch{}b(!1),u(!1)},{usingDocker:de,usingIsolation:ge}=f.useMemo(()=>{var ue,_e;if(!t.meta.group||t.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const G=!!c.enableDocker||((ue=window.blocklet)==null?void 0:ue.enableDocker),ye=[...m.configs,...t.configs].find(S=>S.key==="SKIP_DOCKER"&&S.value),A=[...m.configs,...t.configs].find(S=>S.key==="USE_DOCKER"&&S.value),Pe=[...m.configs,...t.configs].find(S=>S.key==="SKIP_DOCKER_NETWORK"&&S.value);return{usingDocker:G?!ye:!!A,usingIsolation:G&&!Pe&&(c.enableDockerNetwork||((_e=window.blocklet)==null?void 0:_e.enableDockerNetwork))}},[t.configs,c.enableDocker,c.enableDockerNetwork,m.configs,t.meta.group]);return e.jsxs(e.Fragment,{children:[e.jsxs(bn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(fs,{blocklet:t,ancestors:s}),e.jsxs(y,{ml:"16px",sx:{minWidth:0},children:[e.jsxs(y,{className:"component-header",onClick:()=>l(t),children:[e.jsx(y,{className:"component-name",children:B.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(k=t==null?void 0:t.meta)==null?void 0:k.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&e.jsx(vo,{style:{marginLeft:4},status:N,source:t.source,progress:t.progress}),e.jsx(ci,{style:{marginLeft:4},mode:t.mode||""}),t.mode!=="development"&&de&&e.jsx(be,{title:x("blocklet.usingDocker"),children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:ho})})}),t.mode!=="development"&&ge&&e.jsx(be,{title:x("blocklet.usingIsolation"),children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"streamline:network"})})}),!!((se=t.dependents)!=null&&se.length)&&e.jsx(be,{title:[`${x("common.dependents")}: `,t.dependents.map(G=>e.jsx(y,{pl:1,children:`${no(G.id,m)} ${G.required?`(${x("common.required")})`:""}`},G.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"octicon:package-dependents-16"})})})]})]})]},t),lo.hasMountPoint(t.meta)&&e.jsx(wo,{blocklet:t,ancestors:s,mountPoint:O,href:H},O),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[B.hasStartEngine(t.meta)&&e.jsx(be,{title:x("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:H,rel:"noopener noreferrer",children:e.jsx(te,{size:"small",children:e.jsx(Co,{})})})}),e.jsx(yn,{blocklet:m,component:t,onStart:n,onStop:r,disabled:!["starting","stopping"].includes(m.status)&&B.isInProgress(m.status)}),e.jsx(te,{onClick:()=>P(!0),disabled:_||V,children:e.jsx(Kt,{fontSize:"small"})}),e.jsx($t,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(t,s[0]).length,children:e.jsx(jo,{"data-cy":"component-actions",actions:[B.hasStartEngine(t.meta)||br(t)?{icon:e.jsx(hs,{}),text:x("common.detail"),onClick:()=>{l(t)}}:null,{icon:e.jsx(Es,{}),text:x("common.restart"),onClick:()=>{I({title:`${x("common.restart")} ${t.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{b(!0),await h(t),b(!1),I(null)},onCancel:()=>I(null)})},disabled:E||_||V||t.status!=="running"},{icon:e.jsx(yt,{}),text:x("common.delete"),onClick:()=>{u(!0)},disabled:_||V||!!X,tip:X},{separator:!0},{icon:e.jsx(ee,{icon:"mdi:variable"}),onClick:()=>{p(!0)},text:e.jsx($t,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(t,s[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:x("common.environments")})}),disabled:_||V}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Ze,{},"line"),e.jsx(jn,{componentInfo:g,onClose:l,blocklet:t,app:m,depth:o}),e.jsx(xn,{blocklet:m,component:t,remove:J,onCancel:()=>u(!1),hideBtn:!0,showConfirm:j},"delete-component"),R&&e.jsx(Ge,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel},"confirm-setting"),w&&e.jsx(Ct,{open:!0,hiddenChildren:!0,onClose:()=>p(!1),blocklet:t,ancestors:s}),C&&e.jsx(Rt,{open:!0,onClose:()=>P(!1),blocklet:t,ancestors:s})]})}mt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,depth:i.number,onRemove:i.func,onStart:i.func,onStop:i.func,onRestart:i.func,getComponentUrl:i.func,app:i.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const $t=$(po)`
394
+ `;function Eo({blocklet:t,ancestors:s,mountPoint:o,href:a}){const[n,i]=f.useState(!1),[h,d]=f.useState(!1),[m,x]=f.useState(!1),[g,c]=f.useState(o),{api:j}=Z(),u=!s.length,w=u?t.meta.did:s.map(v=>v.meta.did)[0],{t:b}=W(),{confirmApi:R,confirmHolder:I}=us();f.useEffect(()=>{d(!1),i(!1),x(!1)},[o]);const l=()=>{i(!1),d(!1),c(o)},E=async()=>{x(!0),i(!1);try{const v={rootDid:w,mountPoint:Re(g)};u||(v.did=t.meta.did),await j.updateComponentMountPoint({input:v})}catch(v){throw v.message=le(v),L.error(v.message),v}finally{l()}},p=ps(()=>{R.open({title:b("common.noticeTitle"),content:e.jsxs(y,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[e.jsx(oe,{sx:{mb:1.5},children:b("blocklet.mountPoint.description1")}),e.jsx(oe,{component:"li",children:b("blocklet.mountPoint.case1")}),e.jsx(oe,{component:"li",children:b("blocklet.mountPoint.case2")}),e.jsx(oe,{sx:{mt:1.5},children:b("blocklet.mountPoint.description2")})]}),confirmButtonText:b("common.confirm"),cancelButtonText:b("common.cancel"),async onConfirm(v){await E(),v()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),C=v=>{v==null||v.preventDefault(),Re(g)!==o?p():d(!1)},P=h?e.jsxs(y,{sx:{ml:1},children:[e.jsx(te,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:C,children:e.jsx(y,{component:ee,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx(te,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:l,children:e.jsx(y,{component:ee,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx(te,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>d(!0),children:e.jsx(y,{component:ee,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[I,h?e.jsx("form",{onSubmit:C,children:e.jsx(Q,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:v=>c(v.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:o})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:ms(o)})}),m?e.jsx(fe,{size:20,sx:{ml:1}}):P]},o)}Eo.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const bi=t=>{var s;return!((s=t==null?void 0:t.meta)!=null&&s.group)},no=(t,s)=>{const o=t.split("/").slice(1);let a=s,n=0;const i=[];for(;a&&n<o.length;){const h=a.children.find(d=>d.meta.did===o[n]);a=h,n++,h&&i.push(h.meta.title)}return i.join(" / ")};function mt({blocklet:t,ancestors:s,depth:o,onRemove:a,onStart:n,onStop:i,onRestart:h,getComponentUrl:d,app:m}){var xe,k,se;const{t:x}=f.useContext(Se),[g,c]=f.useState(),[j,u]=f.useState(!1),[w,b]=f.useState(!1),[R,I]=f.useState(null),{info:l}=Z(),[E,p]=f.useState(!1),[C,P]=f.useState(!1),{deletingBlocklets:v}=zt();let{status:N}=t;o===1&&v.includes(t.meta.did)&&(N="deleting");const O=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),H=d(O),_=B.isInProgress(m.status),V=B.isInProgress(t.status);let X="";if(_||V||o===1&&v.includes(t.meta.did))X=x("blocklet.component.tip.stopBlocklet");else if((xe=t.dependents)!=null&&xe.length){const G=t.dependents.filter(ye=>ye.required);if(G.length){const ye=G.map(A=>no(A.id,m));X=x("blocklet.component.tip.requiredBy",{name:ye.join(", ")})}}const J=async(...G)=>{b(!0);try{await a(...G)}catch{}b(!1),u(!1)},{usingDocker:de,usingIsolation:ge}=f.useMemo(()=>{var ue,_e;if(!t.meta.group||t.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const G=!!(l!=null&&l.enableDocker)||((ue=window.blocklet)==null?void 0:ue.enableDocker),ye=[...m.configs,...t.configs].find(S=>S.key==="SKIP_DOCKER"&&S.value),A=[...m.configs,...t.configs].find(S=>S.key==="USE_DOCKER"&&S.value),Pe=[...m.configs,...t.configs].find(S=>S.key==="SKIP_DOCKER_NETWORK"&&S.value);return{usingDocker:G?!ye:!!A,usingIsolation:G&&!Pe&&((l==null?void 0:l.enableDockerNetwork)||((_e=window.blocklet)==null?void 0:_e.enableDockerNetwork))}},[t.configs,l==null?void 0:l.enableDocker,l==null?void 0:l.enableDockerNetwork,m.configs,t.meta.group]);return e.jsxs(e.Fragment,{children:[e.jsxs(bn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(fs,{blocklet:t,ancestors:s}),e.jsxs(y,{ml:"16px",sx:{minWidth:0},children:[e.jsxs(y,{className:"component-header",onClick:()=>c(t),children:[e.jsx(y,{className:"component-name",children:B.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(k=t==null?void 0:t.meta)==null?void 0:k.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&e.jsx(vo,{style:{marginLeft:4},status:N,source:t.source,progress:t.progress}),e.jsx(cr,{style:{marginLeft:4},mode:t.mode||""}),t.mode!=="development"&&de&&e.jsx(be,{title:x("blocklet.usingDocker"),children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:ho})})}),t.mode!=="development"&&ge&&e.jsx(be,{title:x("blocklet.usingIsolation"),children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"streamline:network"})})}),!!((se=t.dependents)!=null&&se.length)&&e.jsx(be,{title:[`${x("common.dependents")}: `,t.dependents.map(G=>e.jsx(y,{pl:1,children:`${no(G.id,m)} ${G.required?`(${x("common.required")})`:""}`},G.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"octicon:package-dependents-16"})})})]})]})]},t),lo.hasMountPoint(t.meta)&&e.jsx(Eo,{blocklet:t,ancestors:s,mountPoint:O,href:H},O),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[B.hasStartEngine(t.meta)&&e.jsx(be,{title:x("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:H,rel:"noopener noreferrer",children:e.jsx(te,{size:"small",children:e.jsx(Co,{})})})}),e.jsx(yn,{blocklet:m,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(m.status)&&B.isInProgress(m.status)}),e.jsx(te,{onClick:()=>P(!0),disabled:_||V,children:e.jsx(Kt,{fontSize:"small"})}),e.jsx($t,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(t,s[0]).length,children:e.jsx(jo,{"data-cy":"component-actions",actions:[B.hasStartEngine(t.meta)||bi(t)?{icon:e.jsx(hs,{}),text:x("common.detail"),onClick:()=>{c(t)}}:null,{icon:e.jsx(ws,{}),text:x("common.restart"),onClick:()=>{I({title:`${x("common.restart")} ${t.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{b(!0),await h(t),b(!1),I(null)},onCancel:()=>I(null)})},disabled:w||_||V||t.status!=="running"},{icon:e.jsx(yt,{}),text:x("common.delete"),onClick:()=>{u(!0)},disabled:_||V||!!X,tip:X},{separator:!0},{icon:e.jsx(ee,{icon:"mdi:variable"}),onClick:()=>{p(!0)},text:e.jsx($t,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(t,s[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:x("common.environments")})}),disabled:_||V}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Ze,{},"line"),e.jsx(jn,{componentInfo:g,onClose:c,blocklet:t,app:m,depth:o}),e.jsx(xn,{blocklet:m,component:t,remove:J,onCancel:()=>u(!1),hideBtn:!0,showConfirm:j},"delete-component"),R&&e.jsx(Ge,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel},"confirm-setting"),E&&e.jsx(Ct,{open:!0,hiddenChildren:!0,onClose:()=>p(!1),blocklet:t,ancestors:s}),C&&e.jsx(Rt,{open:!0,onClose:()=>P(!1),blocklet:t,ancestors:s})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array,depth:r.number,onRemove:r.func,onStart:r.func,onStop:r.func,onRestart:r.func,getComponentUrl:r.func,app:r.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const $t=$(po)`
395
395
  .BaseBadge-badge {
396
396
  top: ${t=>t.top*8||6}px;
397
397
  right: ${t=>t.right*8||6}px;
@@ -420,7 +420,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
420
420
  margin-left: 4px;
421
421
  transform: translateY(-1px);
422
422
  }
423
- `;function Rn({meta:t,dependencies:s,logoUrl:o,setInstallComponentMeta:a}){const n=Z(),{t:r}=W(),h=()=>{a(t)},d=40;return e.jsxs(Rr,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:o,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:d,height:d}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(be,{title:[`${r("common.dependents")}: `,s.map(m=>e.jsx(y,{pl:1,children:`${m.parentTitle} ${m.required?`(${r("common.required")})`:""}`},m.parentName+m.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:e.jsx(gs,{onClick:h,startIcon:e.jsx(ee,{icon:"ph:download-simple-bold"}),children:r("common.install")})})]}),e.jsx(Ze,{class:"line"},"line")]})}Rn.propTypes={meta:i.object.isRequired,logoUrl:i.string,setInstallComponentMeta:i.func.isRequired,dependencies:i.arrayOf(i.shape({parentDid:i.string,parentName:i.string,parentPoint:i.string,required:i.bool}))};Rn.defaultProps={logoUrl:"",dependencies:[]};const Rr=$(bn)`
423
+ `;function Rn({meta:t,dependencies:s,logoUrl:o,setInstallComponentMeta:a}){const n=Z(),{t:i}=W(),h=()=>{a(t)},d=40;return e.jsxs(Ri,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:o,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:d,height:d}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(be,{title:[`${i("common.dependents")}: `,s.map(m=>e.jsx(y,{pl:1,children:`${m.parentTitle} ${m.required?`(${i("common.required")})`:""}`},m.parentName+m.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(ee,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:e.jsx(gs,{onClick:h,startIcon:e.jsx(ee,{icon:"ph:download-simple-bold"}),children:i("common.install")})})]}),e.jsx(Ze,{class:"line"},"line")]})}Rn.propTypes={meta:r.object.isRequired,logoUrl:r.string,setInstallComponentMeta:r.func.isRequired,dependencies:r.arrayOf(r.shape({parentDid:r.string,parentName:r.string,parentPoint:r.string,required:r.bool}))};Rn.defaultProps={logoUrl:"",dependencies:[]};const Ri=$(bn)`
424
424
  .line {
425
425
  opacity: 0.5;
426
426
  }
@@ -470,7 +470,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
470
470
  margin-left: 4px;
471
471
  transform: translateY(-1px);
472
472
  }
473
- `;function Sn({blocklet:t,onUpdate:s,getComponentUrl:o,...a}){var _e;const{t:n}=f.useContext(Se),{api:r,inService:h,info:d}=Z(),{addDeletingDid:m,removeDeletingDid:x,matchDeletingDid:g}=zt(),[l,j]=f.useState(!1),[u,E]=f.useState(null),[b,R]=f.useState(null),[I,c]=f.useState(!1),[w,p]=f.useState(!1),[C,P]=f.useState(!1),[v,N]=f.useState(!1),[O,H]=f.useState(null),_=t&&t.structVersion!==U.APP_STRUCT_VERSION,[V,X]=f.useState(!1),J=[...t.children];t.meta.group!=="gateway"&&J.unshift(t),g(J.map(S=>S.meta.did));const de=async()=>{if(!l){j(!0);try{const{updateId:S,updateList:Y}=(await r.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(j(!1),!S){L.info(n("blocklet.component.noUpdate"));return}const pe=[];B.forEachChildSync(t,(ne,{id:we,ancestors:F})=>{const Ie=Y.find(Ee=>Ee.id===we);if(Ie){const Ee=F.slice(1).concat(ne).map(Le=>Le.meta.title||Le.meta.name).join(" / "),We=(F[1]||ne).meta.did;pe.push({groupId:We,name:Ee,version:ne.meta.version,newVersion:Ie.meta.version})}});const z={};pe.forEach(ne=>{z[ne.groupId]?ne.disabled=!0:z[ne.groupId]=!0}),E({params:{updateId:S},list:pe,checks:z,hasChecks:!0})}catch(S){j(!1),L.error(le(S))}}},ge=async()=>{if(!l)try{j(!0);const S=Object.keys(u.checks).filter(pe=>u.checks[pe]),Y={updateId:u.params.updateId,rootDid:t.meta.did,selectedComponents:S};await r.upgradeComponents({input:Y}),j(!1),E(null),X(null)}catch(S){j(!1),L.error(le(S))}},xe=async(S,Y)=>{m(S.meta.did);try{await r.deleteComponent({input:{did:S.meta.did,keepData:Y==="keepData",rootDid:t.meta.did}}),await Ke(800)}catch(pe){L.error(le(pe)),x(S.meta.did)}},k=async S=>{try{await r.startBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},se=async S=>{try{await r.stopBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},G=async S=>{try{await r.restartBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},ye=(S,Y)=>{const{checked:pe}=S.target;E(z=>{const ne=Object.entries(z.checks).reduce((F,[Ie,Ee])=>(F[Ie]=Y===Ie||Y==="all"?pe:Ee,F),{}),we=Object.values(ne).includes(!0);return{...z,checks:ne,hasChecks:we}})},A=f.useMemo(()=>u==null?void 0:u.list.filter(S=>!S.disabled).every(S=>u.checks[S.groupId]),[u]);ar(de);const Pe=lr({blocklet:t,scrollToComponent:!0}),ue=O||Pe;return e.jsxs(Sr,{component:"div",...a,children:[e.jsxs(wr,{display:"flex",children:[e.jsxs(Er,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[J!=null&&J.length?`${n("common.components")} (${J.length})`:`${n("common.components")}`,!_&&e.jsx(Mt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:e.jsx(Ht,{children:e.jsx($t,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!V,children:e.jsxs(ce,{disabled:l||B.isInProgress(t.status),onClick:()=>{de()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:l?e.jsx(fe,{size:16}):e.jsx(bo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Mt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!_&&e.jsx(pn,{blocklet:t,serverVersion:d.version,children:({open:S})=>e.jsxs(ce,{disabled:l||B.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:S,children:[e.jsx(js,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(jo,{"data-cy":"component-actions",actions:[{icon:e.jsx(ee,{icon:"fluent:link-20-filled"}),onClick:()=>p(!0),text:n("router.rule.add.title"),disabled:l||B.isInProgress(t.status)},..._?[]:[{icon:e.jsx(ee,{icon:"mdi:variable"}),onClick:()=>{P(!0)},text:n("common.environments")},{icon:e.jsx(Kt,{}),onClick:()=>{N(!0)},text:n("common.preferences")}]].filter(Boolean)})]})})]}),J!=null&&J.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(mt,{blocklet:t,app:t,onRemove:xe,onStart:k,onStop:se,onRestart:G,getComponentUrl:o},`0-${t.meta.did}`),t.children.map(S=>e.jsx(mt,{depth:1,blocklet:S,ancestors:[t],app:t,onRemove:xe,onStart:k,onStop:se,onRestart:G,getComponentUrl:o},`1-${S.meta.did}`))]},`top-blocklet-${t.meta.did}`),(_e=t.optionalComponents)==null?void 0:_e.map(S=>e.jsx(bn,{children:e.jsx(Rn,{setInstallComponentMeta:H,...S})},S.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(bs,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(ir,{})}),!!u&&e.jsx(Gn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Wn,{children:n("blocklet.component.updateTitle")}),e.jsxs(y,{component:zn,py:4,children:[u.list.filter(S=>!S.disabled).length>1&&e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(Fn,{checked:A,onChange:S=>ye(S,"all")}),e.jsx(y,{children:n(A?"common.unselectAll":"common.selectAll")})]}),u.list.map(S=>e.jsxs(y,{display:"flex",alignItems:"center",mb:1,children:[e.jsx(Fn,{checked:u.checks[S.groupId],onChange:Y=>ye(Y,S.groupId),style:{marginLeft:S.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:S.disabled}),e.jsxs(y,{flexGrow:1,children:[e.jsx(y,{pt:1,xs:8,children:S.name}),S.version&&e.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(lt,{item:!0,xs:3,children:S.version}),e.jsx(lt,{item:!0,xs:1,children:e.jsx(xs,{style:{fontSize:"0.9em"}})}),e.jsx(lt,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:S.newVersion})})]})]},`${S.name}-${S.newVersion}`)]},S.name))]}),e.jsxs(ys,{style:{padding:"8px 24px 24px"},children:[e.jsx(ce,{onClick:()=>{E(null)},children:n("common.cancel")}),e.jsxs(ce,{onClick:S=>{S.stopPropagation(),ge()},color:"primary",disabled:l||!u.hasChecks,variant:"contained",autoFocus:!0,children:[l&&e.jsx(fe,{size:16}),n("common.update")]})]})]})}),!!b&&e.jsx(Gn,{open:!0,fullWidth:!0,onClose:()=>R(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Wn,{children:n("common.configuration")}),e.jsx(zn,{children:e.jsx(y,{py:2,children:e.jsx(Ot,{control:e.jsx(gi,{checked:I,onChange:S=>c(!!S.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(vt,{selectedMeta:ue,blocklet:t,showDialog:!!ue,setShowDialog:()=>H(null)}),w&&e.jsx(mn,{hiddenChildren:!0,open:!0,onClose:()=>p(!1)}),C&&e.jsx(Ct,{open:!0,onClose:()=>P(!1),hiddenChildren:!0,blocklet:t,ancestors:[]}),v&&e.jsx(Rt,{open:!0,onClose:()=>N(!1),blocklet:t,ancestors:[]})]})}Sn.propTypes={blocklet:i.object.isRequired,onUpdate:i.func,getComponentUrl:i.func};Sn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Sr=$.div`
473
+ `;function Sn({blocklet:t,onUpdate:s,getComponentUrl:o,...a}){var _e;const{t:n}=f.useContext(Se),{api:i,inService:h,info:d}=Z(),{addDeletingDid:m,removeDeletingDid:x,matchDeletingDid:g}=zt(),[c,j]=f.useState(!1),[u,w]=f.useState(null),[b,R]=f.useState(null),[I,l]=f.useState(!1),[E,p]=f.useState(!1),[C,P]=f.useState(!1),[v,N]=f.useState(!1),[O,H]=f.useState(null),_=t&&t.structVersion!==U.APP_STRUCT_VERSION,[V,X]=f.useState(!1),J=[...t.children];t.meta.group!=="gateway"&&J.unshift(t),g(J.map(S=>S.meta.did));const de=async()=>{if(!c){j(!0);try{const{updateId:S,updateList:Y}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(j(!1),!S){L.info(n("blocklet.component.noUpdate"));return}const pe=[];B.forEachChildSync(t,(ne,{id:Ee,ancestors:F})=>{const Ie=Y.find(we=>we.id===Ee);if(Ie){const we=F.slice(1).concat(ne).map(Le=>Le.meta.title||Le.meta.name).join(" / "),We=(F[1]||ne).meta.did;pe.push({groupId:We,name:we,version:ne.meta.version,newVersion:Ie.meta.version})}});const z={};pe.forEach(ne=>{z[ne.groupId]?ne.disabled=!0:z[ne.groupId]=!0}),w({params:{updateId:S},list:pe,checks:z,hasChecks:!0})}catch(S){j(!1),L.error(le(S))}}},ge=async()=>{if(!c)try{j(!0);const S=Object.keys(u.checks).filter(pe=>u.checks[pe]),Y={updateId:u.params.updateId,rootDid:t.meta.did,selectedComponents:S};await i.upgradeComponents({input:Y}),j(!1),w(null),X(null)}catch(S){j(!1),L.error(le(S))}},xe=async(S,Y)=>{m(S.meta.did);try{await i.deleteComponent({input:{did:S.meta.did,keepData:Y==="keepData",rootDid:t.meta.did}}),await Ke(800)}catch(pe){L.error(le(pe)),x(S.meta.did)}},k=async S=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},se=async S=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},G=async S=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[S.meta.did]}}),await Ke(800)}catch(Y){L.error(le(Y))}},ye=(S,Y)=>{const{checked:pe}=S.target;w(z=>{const ne=Object.entries(z.checks).reduce((F,[Ie,we])=>(F[Ie]=Y===Ie||Y==="all"?pe:we,F),{}),Ee=Object.values(ne).includes(!0);return{...z,checks:ne,hasChecks:Ee}})},A=f.useMemo(()=>u==null?void 0:u.list.filter(S=>!S.disabled).every(S=>u.checks[S.groupId]),[u]);ai(de);const Pe=li({blocklet:t,scrollToComponent:!0}),ue=O||Pe;return e.jsxs(Si,{component:"div",...a,children:[e.jsxs(Ei,{display:"flex",children:[e.jsxs(wi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[J!=null&&J.length?`${n("common.components")} (${J.length})`:`${n("common.components")}`,!_&&e.jsx(Mt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:e.jsx(Ht,{children:e.jsx($t,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!V,children:e.jsxs(ce,{disabled:c||B.isInProgress(t.status),onClick:()=>{de()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:c?e.jsx(fe,{size:16}):e.jsx(bo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Mt,{permission:h?"":"mutate_blocklets",role:h?He:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!_&&e.jsx(pn,{blocklet:t,serverVersion:d.version,children:({open:S})=>e.jsxs(ce,{disabled:c||B.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:S,children:[e.jsx(js,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(jo,{"data-cy":"component-actions",actions:[{icon:e.jsx(ee,{icon:"fluent:link-20-filled"}),onClick:()=>p(!0),text:n("router.rule.add.title"),disabled:c||B.isInProgress(t.status)},..._?[]:[{icon:e.jsx(ee,{icon:"mdi:variable"}),onClick:()=>{P(!0)},text:n("common.environments")},{icon:e.jsx(Kt,{}),onClick:()=>{N(!0)},text:n("common.preferences")}]].filter(Boolean)})]})})]}),J!=null&&J.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(mt,{blocklet:t,app:t,onRemove:xe,onStart:k,onStop:se,onRestart:G,getComponentUrl:o},`0-${t.meta.did}`),t.children.map(S=>e.jsx(mt,{depth:1,blocklet:S,ancestors:[t],app:t,onRemove:xe,onStart:k,onStop:se,onRestart:G,getComponentUrl:o},`1-${S.meta.did}`))]},`top-blocklet-${t.meta.did}`),(_e=t.optionalComponents)==null?void 0:_e.map(S=>e.jsx(bn,{children:e.jsx(Rn,{setInstallComponentMeta:H,...S})},S.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(bs,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(ri,{})}),!!u&&e.jsx(Gn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Wn,{children:n("blocklet.component.updateTitle")}),e.jsxs(y,{component:zn,py:4,children:[u.list.filter(S=>!S.disabled).length>1&&e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(Fn,{checked:A,onChange:S=>ye(S,"all")}),e.jsx(y,{children:n(A?"common.unselectAll":"common.selectAll")})]}),u.list.map(S=>e.jsxs(y,{display:"flex",alignItems:"center",mb:1,children:[e.jsx(Fn,{checked:u.checks[S.groupId],onChange:Y=>ye(Y,S.groupId),style:{marginLeft:S.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:S.disabled}),e.jsxs(y,{flexGrow:1,children:[e.jsx(y,{pt:1,xs:8,children:S.name}),S.version&&e.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(lt,{item:!0,xs:3,children:S.version}),e.jsx(lt,{item:!0,xs:1,children:e.jsx(xs,{style:{fontSize:"0.9em"}})}),e.jsx(lt,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:S.newVersion})})]})]},`${S.name}-${S.newVersion}`)]},S.name))]}),e.jsxs(ys,{style:{padding:"8px 24px 24px"},children:[e.jsx(ce,{onClick:()=>{w(null)},children:n("common.cancel")}),e.jsxs(ce,{onClick:S=>{S.stopPropagation(),ge()},color:"primary",disabled:c||!u.hasChecks,variant:"contained",autoFocus:!0,children:[c&&e.jsx(fe,{size:16}),n("common.update")]})]})]})}),!!b&&e.jsx(Gn,{open:!0,fullWidth:!0,onClose:()=>R(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Wn,{children:n("common.configuration")}),e.jsx(zn,{children:e.jsx(y,{py:2,children:e.jsx(Ot,{control:e.jsx(gr,{checked:I,onChange:S=>l(!!S.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(vt,{selectedMeta:ue,blocklet:t,showDialog:!!ue,setShowDialog:()=>H(null)}),E&&e.jsx(mn,{hiddenChildren:!0,open:!0,onClose:()=>p(!1)}),C&&e.jsx(Ct,{open:!0,onClose:()=>P(!1),hiddenChildren:!0,blocklet:t,ancestors:[]}),v&&e.jsx(Rt,{open:!0,onClose:()=>N(!1),blocklet:t,ancestors:[]})]})}Sn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Sn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Si=$.div`
474
474
  .title {
475
475
  font-size: 1.2rem;
476
476
  font-weight: bold;
@@ -489,7 +489,7 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
489
489
  .component-item {
490
490
  animation: showDelay 0.75s ease 1;
491
491
  }
492
- `,wr=$(y)`
492
+ `,Ei=$(y)`
493
493
  ${t=>t.theme.breakpoints.up("sm")} {
494
494
  flex-direction: row;
495
495
  justify-content: space-between;
@@ -503,9 +503,9 @@ import{c5 as Uo,j as e,aP as At,aQ as qt,m as W,bB as Z,M as y,aB as be,P as i,y
503
503
  display: none;
504
504
  }
505
505
  }
506
- `,Er=$(y)`
506
+ `,wi=$(y)`
507
507
  ${t=>t.theme.breakpoints.down("sm")} {
508
508
  width: 100%;
509
509
  justify-content: space-between;
510
510
  }
511
- `;function Eo(t){const{locale:s}=f.useContext(Se),{blocklet:o,recommendedDomain:a}=xi(),n=r=>Cs({blocklet:o,domain:{value:a||`${vs.encode(o.appPid)}.${U.DEFAULT_DID_DOMAIN}`},mountPoint:r,params:Wt(o,s)});return e.jsx(Sn,{blocklet:o,getComponentUrl:n,...t})}Eo.propTypes={};Eo.defaultProps={};export{Eo as default};
511
+ `;function wo(t){const{locale:s}=f.useContext(Se),{blocklet:o,recommendedDomain:a}=xr(),n=i=>Cs({blocklet:o,domain:{value:a||`${vs.encode(o.appPid)}.${U.DEFAULT_DID_DOMAIN}`},mountPoint:i,params:Wt(o,s)});return e.jsx(Sn,{blocklet:o,getComponentUrl:n,...t})}wo.propTypes={};wo.defaultProps={};export{wo as default};