@abtnode/webapp 1.16.51-beta-20250904-031834-c611f059 → 1.16.51-beta-20250905-023351-70af144b

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 (199) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-B454wUKi.js → AdapterDayjs-V7RXKqyP.js} +1 -1
  4. package/dist/assets/{Add-CobzoIKJ.js → Add-7-eXJOKT.js} +1 -1
  5. package/dist/assets/ArrowDropDown-B9aDIKPi.js +1 -0
  6. package/dist/assets/{Autocomplete-C06SKe4H.js → Autocomplete-CWbaCMBc.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-BWQdjcIC.js → Breadcrumbs-BeUS9EzN.js} +1 -1
  8. package/dist/assets/{ButtonGroup-D2nbA04k.js → ButtonGroup-88wnT1Nl.js} +1 -1
  9. package/dist/assets/{CSSTransition-BIUxaspZ.js → CSSTransition-BhKCAa_k.js} +1 -1
  10. package/dist/assets/{CallMerge-Dkt7zPa_.js → CallMerge-DyslC22y.js} +1 -1
  11. package/dist/assets/{CardContent-B-jtI1ie.js → CardContent-CWjONtVx.js} +1 -1
  12. package/dist/assets/{ChevronLeft-T8dPGT4o.js → ChevronLeft-DsCa_2Hj.js} +1 -1
  13. package/dist/assets/{ChevronRight-BmNY6NuE.js → ChevronRight-Dh1NhSQh.js} +1 -1
  14. package/dist/assets/{Clear-DSDAa0M4.js → Clear-vz3__EK4.js} +1 -1
  15. package/dist/assets/{DeleteOutline-BRh_jEgm.js → DeleteOutline-BQz9po9Q.js} +1 -1
  16. package/dist/assets/{Done-DQFntFgi.js → Done-Bk5S0dZ-.js} +1 -1
  17. package/dist/assets/{Edit-CvtjYyT4.js → Edit-ZWYQTIT_.js} +1 -1
  18. package/dist/assets/{ErrorOutline-jpwCi-bt.js → ErrorOutline-CWTup7vD.js} +1 -1
  19. package/dist/assets/{FilterList-DcOJVDM2.js → FilterList-DOLZBYMl.js} +1 -1
  20. package/dist/assets/{Google-DEgZE56h.js → Google-DjCWLWBZ.js} +1 -1
  21. package/dist/assets/{HelpOutline-RoslCWCH.js → HelpOutline-BIIJduw6.js} +1 -1
  22. package/dist/assets/{Launch-L3zM7z2U.js → Launch-DOQcWt9h.js} +1 -1
  23. package/dist/assets/{Link-DHlqc6YG.js → Link-D0HMFRxo.js} +1 -1
  24. package/dist/assets/{ListItemButton-D_ncPLiT.js → ListItemButton-hdq-8LOD.js} +1 -1
  25. package/dist/assets/{ListSubheader-CtIfn5EF.js → ListSubheader-OXmzqw9E.js} +1 -1
  26. package/dist/assets/{LoadingButton-Dw3__mtY.js → LoadingButton-Dd30R6FK.js} +1 -1
  27. package/dist/assets/{MoreVert-DH4Y2k9h.js → MoreVert-CRSB-gtE.js} +1 -1
  28. package/dist/assets/{OpenInNew-MxPsaq-U.js → OpenInNew-nb9brzvh.js} +1 -1
  29. package/dist/assets/{Refresh-DMoyFjzc.js → Refresh-DpCUQ-hQ.js} +1 -1
  30. package/dist/assets/{Search-BvWmcM2k.js → Search-Caj8zEyB.js} +1 -1
  31. package/dist/assets/{Stepper-DNM_ADcd.js → Stepper-xU4PwGHV.js} +1 -1
  32. package/dist/assets/{Switch-CAccGI-e.js → Switch-Cr0eK23s.js} +1 -1
  33. package/dist/assets/{TableSearch-BuzsZxHI.js → TableSearch-BVy-Zwre.js} +1 -1
  34. package/dist/assets/{ToggleButtonGroup-DuGWJmyI.js → ToggleButtonGroup-DfdLS7WR.js} +1 -1
  35. package/dist/assets/{Verified-CfeEGfMV.js → Verified-QBG89RkJ.js} +1 -1
  36. package/dist/assets/{VerifiedUser-BBYo9Pc2.js → VerifiedUser-DRV2TIup.js} +1 -1
  37. package/dist/assets/{ViewList-CPmudwlq.js → ViewList-D3SEslCd.js} +1 -1
  38. package/dist/assets/{_createAggregator-DeRGH35v.js → _createAggregator-C1jyyLx1.js} +1 -1
  39. package/dist/assets/{actions-DkMO_r4a.js → actions-BhT4KCkB.js} +1 -1
  40. package/dist/assets/{actions-N_sfYn6F.js → actions-PgvlZmiV.js} +1 -1
  41. package/dist/assets/{agreement-DJUZzBc6.js → agreement-DA33xTFi.js} +1 -1
  42. package/dist/assets/api-BMlRo0OB.js +1 -0
  43. package/dist/assets/{appearance-BHLySBfx.js → appearance-BPq1UJTg.js} +1 -1
  44. package/dist/assets/{audit-logs-D-nTmyPS.js → audit-logs-Ctg35AJy.js} +2 -2
  45. package/dist/assets/{base-chart-DQ401Lk6.js → base-chart-Dx4PwDO4.js} +1 -1
  46. package/dist/assets/bedrock-yFRPpe__.png +0 -0
  47. package/dist/assets/{blocklet-DISJHp6B.js → blocklet-CdI4-ak7.js} +1 -1
  48. package/dist/assets/chain-CXX76TQL.js +6 -0
  49. package/dist/assets/{click-to-copy-DX5jjk2s.js → click-to-copy-C8Sc78ZH.js} +1 -1
  50. package/dist/assets/client-ChcYsV1G.js +1 -0
  51. package/dist/assets/cloneDeep-CQZK-s_V.js +1 -0
  52. package/dist/assets/{collapse-D0TcL3yf.js → collapse-BmNnb9sz.js} +1 -1
  53. package/dist/assets/config-navigation-8rTODeF1.js +457 -0
  54. package/dist/assets/{connect-to-2qqraFvt.js → connect-to-DfZIDYiw.js} +5 -5
  55. package/dist/assets/{cssMode-Cgd7qVp_.js → cssMode-BF4q4okU.js} +1 -1
  56. package/dist/assets/deepseek-C3x42pq3.png +0 -0
  57. package/dist/assets/{delete-confirm-B_vil0gb.js → delete-confirm-D-z4OiCT.js} +1 -1
  58. package/dist/assets/{depsEqual-D6ZeS2iD.js → depsEqual-Cr14y622.js} +1 -1
  59. package/dist/assets/{detail-BHQbwbfp.js → detail-DST4nwih.js} +3 -3
  60. package/dist/assets/{domains-BLJOV5Qw.js → domains-DrwaxbvS.js} +1 -1
  61. package/dist/assets/doubao-yPqHSkLx.png +0 -0
  62. package/dist/assets/{download-C8Jsk4ZH.js → download-OPjh7Dhu.js} +1 -1
  63. package/dist/assets/{edit.svg-C6CO_uuX.js → edit.svg-BhoBkiKe.js} +1 -1
  64. package/dist/assets/emotion-cache.browser.esm-JDbaITlA.js +1 -0
  65. package/dist/assets/engine-siiM_CrH.js +1 -0
  66. package/dist/assets/{freemarker2-C40Z2ucU.js → freemarker2-CsYcx0mG.js} +1 -1
  67. package/dist/assets/gemini-DffKpc81.png +0 -0
  68. package/dist/assets/{get-safe-url-CMpu7B-v.js → get-safe-url-D4QANS7R.js} +1 -1
  69. package/dist/assets/getValidReactChildren-BK9M6ULL.js +1 -0
  70. package/dist/assets/google-DT1VSJ0m.png +0 -0
  71. package/dist/assets/{graphqlMode-3TdkToR6.js → graphqlMode-CEuXGwU0.js} +2 -2
  72. package/dist/assets/{handlebars-CsECaVWw.js → handlebars-UHGxvaSD.js} +1 -1
  73. package/dist/assets/{html-CSc4ZJZE.js → html-C1vTBkRn.js} +1 -1
  74. package/dist/assets/{html-title-Cx_lv4tS.js → html-title-CMu--CLy.js} +1 -1
  75. package/dist/assets/{htmlMode-BeKAEeTT.js → htmlMode-BggN4Rb6.js} +1 -1
  76. package/dist/assets/ideogram-REIjy0Er.png +0 -0
  77. package/dist/assets/{iframe-DYiNwxlH.js → iframe-CvI--k7K.js} +1 -1
  78. package/dist/assets/{index-BGD5220j.js → index-6cB3i_74.js} +1 -1
  79. package/dist/assets/{index-CNz77lZT.js → index-B1mp7zTp.js} +1 -1
  80. package/dist/assets/{index-aJIykGoH.js → index-B8SKOyVZ.js} +1 -1
  81. package/dist/assets/{index-BvAtsQd5.js → index-BCjznEDD.js} +103 -103
  82. package/dist/assets/{index-5KlKCCpC.js → index-BEUFNuBP.js} +1 -1
  83. package/dist/assets/{index-CB69gPUu.js → index-BNMMf79b.js} +1 -1
  84. package/dist/assets/{index-CxDumZ3y.js → index-BVkuT-iA.js} +9 -9
  85. package/dist/assets/{index-f3wFrDOj.js → index-BcCAYOEg.js} +1 -1
  86. package/dist/assets/{index-BW4Ntw6W.js → index-BcZW_Njr.js} +1 -1
  87. package/dist/assets/{index-DBip_c5f.js → index-BrouHktD.js} +5 -5
  88. package/dist/assets/{index-CYZ78qFI.js → index-BwjlL2Kh.js} +1 -1
  89. package/dist/assets/{index-Cn-6wztm.js → index-C5Qu9Vfw.js} +1 -1
  90. package/dist/assets/{index-DyeX_qg7.js → index-CIUJRz-P.js} +1 -1
  91. package/dist/assets/{index-S7znBZmC.js → index-CIYlTEmt.js} +7 -7
  92. package/dist/assets/{index-C1LQFMVr.js → index-CJBx_cpm.js} +1 -1
  93. package/dist/assets/{index-Bi0nnFEo.js → index-COelK26a.js} +1 -1
  94. package/dist/assets/{index-BitxghdI.js → index-CXFs83DK.js} +18 -18
  95. package/dist/assets/index-CaVHeI69.js +363 -0
  96. package/dist/assets/{index-B4sphWdh.js → index-Cbv8PaaQ.js} +1 -1
  97. package/dist/assets/{index-bvnJ1qfi.js → index-CcPSAXJC.js} +1 -1
  98. package/dist/assets/{index-CqgcvSrI.js → index-Cfv8rye0.js} +1 -1
  99. package/dist/assets/{index-Cg9PrZFL.js → index-Cjda8MxV.js} +1 -1
  100. package/dist/assets/{index-CDf35iqn.js → index-CwJTlpdS.js} +2 -2
  101. package/dist/assets/index-D2gjCQvJ.js +177 -0
  102. package/dist/assets/{index-CvPFmloQ.js → index-DFNWDU08.js} +1 -1
  103. package/dist/assets/{index-KMm33XHL.js → index-DJt0P9UZ.js} +1 -1
  104. package/dist/assets/{index-hrs7Mhjt.js → index-DN15vW-d.js} +1 -1
  105. package/dist/assets/{index-JGiTsamG.js → index-DVP4mis5.js} +1 -1
  106. package/dist/assets/{index-DPRVx4ek.js → index-DWNLuD8k.js} +3 -3
  107. package/dist/assets/{index-Dsoqycrd.js → index-D_HvYLZX.js} +2 -2
  108. package/dist/assets/{index-BynKznHT.js → index-DlumR6-r.js} +1 -1
  109. package/dist/assets/{index-CKY6mjuF.js → index-DxswKF4l.js} +1 -1
  110. package/dist/assets/{index-Pr52m2qZ.js → index-JPRaNDiB.js} +1 -1
  111. package/dist/assets/{index-BpFBX3ml.js → index-KlyXfxtH.js} +1 -1
  112. package/dist/assets/{index-Dv-ACCVn.js → index-PupDr-tS.js} +1 -1
  113. package/dist/assets/{index-CZ8jsJu9.js → index-TD9tpMf3.js} +1 -1
  114. package/dist/assets/{index-Dqnz6VXa.js → index-UUvY9lTK.js} +1 -1
  115. package/dist/assets/{index-CKv8PhTc.js → index-e4cQdlVT.js} +1 -1
  116. package/dist/assets/index-ee21MdrR.js +1 -0
  117. package/dist/assets/{index-BSljJZ1V.js → index-fVX8tL-Q.js} +3 -3
  118. package/dist/assets/{index-BmTUrmH1.js → index-gFJpaRWb.js} +1 -1
  119. package/dist/assets/{index-Bo967wkH.js → index-gXZxZJIx.js} +1 -1
  120. package/dist/assets/{index-BIgUqZXA.js → index-hwjSVkr9.js} +1 -1
  121. package/dist/assets/{index-BWDsxii_.js → index-oN0VLX7B.js} +1 -1
  122. package/dist/assets/{index-C2JKqeAe.js → index-zmLURVwA.js} +1 -1
  123. package/dist/assets/{index.esm-LjN1Hm60.js → index.esm-BMMBbvkk.js} +1 -1
  124. package/dist/assets/{install-from-url-CCmRaPIQ.js → install-from-url-BVVKjfjP.js} +1 -1
  125. package/dist/assets/{invitation-DNn6S4p1.js → invitation-COAlxja2.js} +1 -1
  126. package/dist/assets/{is-path-prefix-equal-DceJmX9J.js → is-path-prefix-equal-DXaCbZpO.js} +1 -1
  127. package/dist/assets/{item-Bg87F2Pj.js → item-C-IQVzix.js} +9 -9
  128. package/dist/assets/{javascript-CImnwSoz.js → javascript-Bgq9DttZ.js} +1 -1
  129. package/dist/assets/{jsonMode-Bj5PmjjW.js → jsonMode-gicj4lsZ.js} +1 -1
  130. package/dist/assets/{liquid-CmLkJX3a.js → liquid-Ci2GleTa.js} +1 -1
  131. package/dist/assets/{list-header-C3WTZrdD.js → list-header-Bimu_qjE.js} +1 -1
  132. package/dist/assets/{log-Dy47Mxwd.js → log-Do7yF-hd.js} +1 -1
  133. package/dist/assets/{lottie-react.esm-DxER1I_l.js → lottie-react.esm-DfMKPb7z.js} +1 -1
  134. package/dist/assets/{mdx-BtCUya4x.js → mdx-eB0FmO6P.js} +1 -1
  135. package/dist/assets/{memory-Ca4JR3KI.js → memory-BCE6QiNB.js} +1 -1
  136. package/dist/assets/{metric-CDR_xfqd.js → metric-Bk0iXTai.js} +1 -1
  137. package/dist/assets/ollama-C7MZn2d_.png +0 -0
  138. package/dist/assets/omit-DZngMfUZ.js +1 -0
  139. package/dist/assets/openai-DlpqJdrb.png +0 -0
  140. package/dist/assets/{overview-Bvtmyxun.js → overview-DltjzkWj.js} +1 -1
  141. package/dist/assets/{permission-EJYXw2v1.js → permission-nS6Be9Zz.js} +1 -1
  142. package/dist/assets/poe-B588TgZu.png +0 -0
  143. package/dist/assets/{preference-CXe14Osu.js → preference-BcV3F-Xa.js} +3 -3
  144. package/dist/assets/{python-CLcFjgec.js → python-EI0UxD3D.js} +1 -1
  145. package/dist/assets/{raf-schd.esm-9isuMxk8.js → raf-schd.esm-D8Xvrzgn.js} +1 -1
  146. package/dist/assets/{razor-BgYyruii.js → razor-BSy3NnVc.js} +1 -1
  147. package/dist/assets/rotate-session-key-6xIXKXc3.js +1 -0
  148. package/dist/assets/{runtime-B6StkUNa.js → runtime-Dxydq6o1.js} +1 -1
  149. package/dist/assets/schema-BYsNslfD.js +1 -0
  150. package/dist/assets/sdk-BLZzaYH6.js +1 -0
  151. package/dist/assets/{service-BAFeuouA.js → service-BiVWc9jf.js} +1 -1
  152. package/dist/assets/{shorten-label-B0m7WWm_.js → shorten-label-1yenXb9Y.js} +1 -1
  153. package/dist/assets/{simple-select-D5DhspLn.js → simple-select-Bt3Ltwm7.js} +1 -1
  154. package/dist/assets/{spaces-BkLlvJlV.js → spaces-BnSCxjeY.js} +1 -1
  155. package/dist/assets/{status-D7zoO7lM.js → status-BYLk6wlC.js} +1 -1
  156. package/dist/assets/{status-5TKR4Tl2.js → status-CXAtxXK1.js} +1 -1
  157. package/dist/assets/{switch-control-BJ9fbw3I.js → switch-control-D5SPzkUx.js} +1 -1
  158. package/dist/assets/{table-icons-DLsn7GMI.js → table-icons-BGs1mthN.js} +1 -1
  159. package/dist/assets/{team-16Ujfno4.js → team-BlgLSbQd.js} +1 -1
  160. package/dist/assets/{toLower-CS_hmd2O.js → toLower-BiqFoOo1.js} +1 -1
  161. package/dist/assets/toUpper-BMdlX8ly.js +1 -0
  162. package/dist/assets/{traffic-BxsvLDRQ.js → traffic-d8ue0hO5.js} +1 -1
  163. package/dist/assets/{tsMode-CN8rErtn.js → tsMode-DFSmR0ZD.js} +1 -1
  164. package/dist/assets/{typescript-DSffZA-5.js → typescript-Dvh-IrHb.js} +1 -1
  165. package/dist/assets/{url-evaluation-DFMzofgY.js → url-evaluation-DFEEqTh-.js} +1 -1
  166. package/dist/assets/{url-join-D3PSxY2b.js → url-join-Dra-Zi4G.js} +1 -1
  167. package/dist/assets/{use-mobile-fMZ70tR1.js → use-mobile-BOq_qktK.js} +1 -1
  168. package/dist/assets/{use-mobile-DNj1DdUP.js → use-mobile-FV0M1ZqW.js} +1 -1
  169. package/dist/assets/{useAsync-BD45gcWH.js → useAsync-B7FuCRJD.js} +1 -1
  170. package/dist/assets/{useAsyncRetry-D0_e0qFz.js → useAsyncRetry-C1rqgcS3.js} +1 -1
  171. package/dist/assets/{useLocalStorage-bjVpdIUp.js → useLocalStorage-BjyUhOL-.js} +1 -1
  172. package/dist/assets/{useThemeProps-BqbmQYZm.js → useThemeProps-BZz8f5dF.js} +1 -1
  173. package/dist/assets/{util-DwHVn3ka.js → util-vH7l3iJe.js} +1 -1
  174. package/dist/assets/{wait-container-BI50IOrN.js → wait-container-4i1AkyPx.js} +1 -1
  175. package/dist/assets/{without-wallet-CmBFe6LE.js → without-wallet-CG4TWMeN.js} +1 -1
  176. package/dist/assets/{wrap-locale-C-kUviiw.js → wrap-locale-CCw957fx.js} +1 -1
  177. package/dist/assets/{xml-DlNxIUrd.js → xml-7zq5MXwn.js} +1 -1
  178. package/dist/assets/{yaml-kJOY6oFY.js → yaml-DdyDZl-6.js} +1 -1
  179. package/dist/index.html +1 -1
  180. package/dist/service-worker.js +1 -1
  181. package/package.json +1 -1
  182. package/dist/assets/ArrowDropDown-wCDjkm6N.js +0 -1
  183. package/dist/assets/Slider-CaQ4_HVa.js +0 -1
  184. package/dist/assets/api-BmtVyz86.js +0 -1
  185. package/dist/assets/chain-H_ZkBTRb.js +0 -6
  186. package/dist/assets/client-mu06Cy2w.js +0 -1
  187. package/dist/assets/cloneDeep-DuTUFwXr.js +0 -1
  188. package/dist/assets/config-navigation-BUN_bn5b.js +0 -457
  189. package/dist/assets/emotion-cache.browser.esm-Cm-YvbUu.js +0 -1
  190. package/dist/assets/engine-0m3b2g2H.js +0 -1
  191. package/dist/assets/getValidReactChildren-CFOO2Xyb.js +0 -1
  192. package/dist/assets/index-CPqsIwYV.js +0 -161
  193. package/dist/assets/index-CmKeQSLC.js +0 -1
  194. package/dist/assets/index-Cst_GbVp.js +0 -363
  195. package/dist/assets/omit-Cwb_YFfu.js +0 -1
  196. package/dist/assets/rotate-session-key-CQB3pXN4.js +0 -1
  197. package/dist/assets/schema-Wv54HyG9.js +0 -1
  198. package/dist/assets/sdk-B2qcFc0E.js +0 -1
  199. package/dist/assets/toUpper-BiLpQm9G.js +0 -1
@@ -1 +1 @@
1
- import{eG as D}from"./index-BvAtsQd5.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){G(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,F):G(w[0][2],u)}function z(u){I("next",u)}function F(u){I("throw",u)}function G(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:F=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:G=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:U,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof D<"u"?T=D.WebSocket||D.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,j=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await F(j),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});j++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function B(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},U)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),B()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?B():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,j=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||j>=z||!G(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const B=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},U)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},U)),k--,o=!0,x()},await _.finally(B);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
1
+ import{eG as D}from"./index-BCjznEDD.js";function f(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function $(e){return f(e)==="object"}function re(e){return Array.isArray(e)&&e.length>0&&e.every(m=>"message"in m)}function Y(e,m){return e.length<124?e:m}const ne="graphql-transport-ws";var g;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(g||(g={}));var c;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(c||(c={}));function v(e){if(!$(e))throw new Error(`Message is expected to be an object, but got ${f(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${f(e.type)}`);switch(e.type){case c.ConnectionInit:case c.ConnectionAck:case c.Ping:case c.Pong:{if(e.payload!=null&&!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case c.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${f(e.payload.query)}`);if(e.payload.variables!=null&&!$(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${f(e.payload.variables)}`);if(e.payload.operationName!=null&&f(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${f(e.payload.operationName)}`);if(e.payload.extensions!=null&&!$(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${f(e.payload.extensions)}`);break}case c.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${f(e.payload)}`);break}case c.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!re(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case c.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${f(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function oe(e,m){return v(typeof e=="string"?JSON.parse(e,m):e)}function W(e,m){return v(e),JSON.stringify(e,m)}var A=function(e){return this instanceof A?(this.v=e,this):new A(e)},ie=function(e,m,R){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=R.apply(e,m||[]),b,w=[];return b={},E("next"),E("throw"),E("return"),b[Symbol.asyncIterator]=function(){return this},b;function E(u){M[u]&&(b[u]=function(r){return new Promise(function(S,L){w.push([u,r,S,L])>1||I(u,r)})})}function I(u,r){try{q(M[u](r))}catch(S){G(w[0][3],S)}}function q(u){u.value instanceof A?Promise.resolve(u.value.v).then(z,F):G(w[0][2],u)}function z(u){I("next",u)}function F(u){I("throw",u)}function G(u,r){u(r),w.shift(),w.length&&I(w[0][0],w[0][1])}};function pe(e){const{url:m,connectionParams:R,lazy:M=!0,onNonLazyError:b=console.error,lazyCloseTimeout:w=0,keepAlive:E=0,disablePong:I,connectionAckWaitTimeout:q=0,retryAttempts:z=5,retryWait:F=async function(a){let t=1e3;for(let o=0;o<a;o++)t*=2;await new Promise(o=>setTimeout(o,t+Math.floor(Math.random()*2700+300)))},shouldRetry:G=J,isFatalConnectionProblem:u,on:r,webSocketImpl:S,generateID:L=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{const t=Math.random()*16|0;return(a=="x"?t:t&3|8).toString(16)})},jsonMessageReplacer:U,jsonMessageReviver:ee}=e;let T;if(S){if(!ae(S))throw new Error("Invalid WebSocket implementation provided");T=S}else typeof WebSocket<"u"?T=WebSocket:typeof D<"u"?T=D.WebSocket||D.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=T,d=(()=>{const n=(()=>{const t={};return{on(o,s){return t[o]=s,()=>{delete t[o]}},emit(o){var s;"id"in o&&((s=t[o.id])===null||s===void 0||s.call(t,o))}}})(),a={connecting:r?.connecting?[r.connecting]:[],opened:r?.opened?[r.opened]:[],connected:r?.connected?[r.connected]:[],ping:r?.ping?[r.ping]:[],pong:r?.pong?[r.pong]:[],message:r?.message?[n.emit,r.message]:[n.emit],closed:r?.closed?[r.closed]:[],error:r?.error?[r.error]:[]};return{onMessage:n.on,on(t,o){const s=a[t];return s.push(o),()=>{s.splice(s.indexOf(o),1)}},emit(t,...o){for(const s of[...a[t]])s(...o)}}})();function Q(n){const a=[d.on("error",t=>{a.forEach(o=>o()),n(t)}),d.on("closed",t=>{a.forEach(o=>o()),n(t)})]}let h,k=0,H,O=!1,j=0,C=!1;async function K(){clearTimeout(H);const[n,a]=await(h??(h=new Promise((s,y)=>(async()=>{if(O){if(await F(j),!k)return h=void 0,y({code:1e3,reason:"All Subscriptions Gone"});j++}d.emit("connecting",O);const i=new N(typeof m=="function"?await m():m,ne);let x,_;function B(){isFinite(E)&&E>0&&(clearTimeout(_),_=setTimeout(()=>{i.readyState===N.OPEN&&(i.send(W({type:c.Ping})),d.emit("ping",!1,void 0))},E))}Q(l=>{h=void 0,clearTimeout(x),clearTimeout(_),y(l),l instanceof Z&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=l=>d.emit("error",l),i.onclose=l=>d.emit("closed",l),i.onopen=async()=>{try{d.emit("opened",i);const l=typeof R=="function"?await R():R;if(i.readyState!==N.OPEN)return;i.send(W(l?{type:c.ConnectionInit,payload:l}:{type:c.ConnectionInit},U)),isFinite(q)&&q>0&&(x=setTimeout(()=>{i.close(g.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},q)),B()}catch(l){d.emit("error",l),i.close(g.InternalClientError,Y(l instanceof Error?l.message:new Error(l).message,"Internal client error"))}};let P=!1;i.onmessage=({data:l})=>{try{const p=oe(l,ee);if(d.emit("message",p),p.type==="ping"||p.type==="pong"){d.emit(p.type,!0,p.payload),p.type==="pong"?B():I||(i.send(W(p.payload?{type:c.Pong,payload:p.payload}:{type:c.Pong})),d.emit("pong",!1,p.payload));return}if(P)return;if(p.type!==c.ConnectionAck)throw new Error(`First message cannot be of type ${p.type}`);clearTimeout(x),P=!0,d.emit("connected",i,p.payload,O),O=!1,j=0,s([i,new Promise((ce,te)=>Q(te))])}catch(p){i.onmessage=null,d.emit("error",p),i.close(g.BadResponse,Y(p instanceof Error?p.message:new Error(p).message,"Bad response"))}}})())));n.readyState===N.CLOSING&&await a;let t=()=>{};const o=new Promise(s=>t=s);return[n,t,Promise.race([o.then(()=>{if(!k){const s=()=>n.close(1e3,"Normal Closure");isFinite(w)&&w>0?H=setTimeout(()=>{n.readyState===N.OPEN&&s()},w):s()}}),a])]}function V(n){if(J(n)&&(se(n.code)||[g.InternalServerError,g.InternalClientError,g.BadRequest,g.BadResponse,g.Unauthorized,g.SubprotocolNotAcceptable,g.SubscriberAlreadyExists,g.TooManyInitialisationRequests].includes(n.code)))throw n;if(C)return!1;if(J(n)&&n.code===1e3)return k>0;if(!z||j>=z||!G(n)||u?.(n))throw n;return O=!0}M||(async()=>{for(k++;;)try{const[,,n]=await K();await n}catch(n){try{if(!V(n))return}catch(a){return b?.(a)}}})();function X(n,a){const t=L(n);let o=!1,s=!1,y=()=>{k--,o=!0};return(async()=>{for(k++;;)try{const[i,x,_]=await K();if(o)return x();const B=d.onMessage(t,P=>{switch(P.type){case c.Next:{a.next(P.payload);return}case c.Error:{s=!0,o=!0,a.error(P.payload),y();return}case c.Complete:{o=!0,y();return}}});i.send(W({id:t,type:c.Subscribe,payload:n},U)),y=()=>{!o&&i.readyState===N.OPEN&&i.send(W({id:t,type:c.Complete},U)),k--,o=!0,x()},await _.finally(B);return}catch(i){if(!V(i))return}})().then(()=>{s||a.complete()}).catch(i=>{a.error(i)}),()=>{o||y()}}return{on:d.on,subscribe:X,iterate(n){const a=[],t={done:!1,error:null,resolve:()=>{}},o=X(n,{next(y){a.push(y),t.resolve()},error(y){t.done=!0,t.error=y,t.resolve()},complete(){t.done=!0,t.resolve()}}),s=function(){return ie(this,arguments,function*(){for(;;){for(a.length||(yield A(new Promise(x=>t.resolve=x)));a.length;)yield yield A(a.shift());if(t.error)throw t.error;if(t.done)return yield A(void 0)}})}();return s.throw=async y=>(t.done||(t.done=!0,t.error=y,t.resolve()),{done:!0,value:void 0}),s.return=async()=>(o(),{done:!0,value:void 0}),s},async dispose(){if(C=!0,h){const[n]=await h;n.close(1e3,"Normal Closure")}},terminate(){h&&d.emit("closed",new Z)}}}class Z extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function J(e){return $(e)&&"code"in e&&"reason"in e}function se(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function ae(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}export{g as CloseCode,ne as GRAPHQL_TRANSPORT_WS_PROTOCOL,c as MessageType,Z as TerminatedCloseEvent,pe as createClient,oe as parseMessage,W as stringifyMessage,v as validateMessage};
@@ -1,4 +1,4 @@
1
- import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-BvAtsQd5.js";function w({name:t,nameFormatter:r=e=>typeof e=="string"?e.split(" ").map(c=>d(x(c))).join(" "):e,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return o.jsxs(p,{layout:n,width:m,...s,children:[o.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&o.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const p=f("div")`
1
+ import{j as o,T as i,dl as d,dm as x,dd as f}from"./index-BCjznEDD.js";function w({name:t,nameFormatter:r=e=>typeof e=="string"?e.split(" ").map(c=>d(x(c))).join(" "):e,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return o.jsxs(p,{layout:n,width:m,...s,children:[o.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&o.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const p=f("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1,4 +1,4 @@
1
- import{r as a,u as U,j as e,T as k,be as Q,N as i,s as D,b2 as X,o as l,g as $,i as M,d2 as Y,bk as ee,d as te,Z as re,C as ne,m as se,J as v,a as h,E as L,b,d3 as oe,M as ie,bt as ae,aE as le,d4 as me,G as C,H as R,k as ce,l as ue,A as de,bm as pe}from"./index-BvAtsQd5.js";import{u as fe,T as xe}from"./html-title-Cx_lv4tS.js";import{T as ge}from"./traffic-BxsvLDRQ.js";import{H as he}from"./index-C2JKqeAe.js";import{x as V}from"./index-DRYJ0xIl.js";import{C as ye,M as T}from"./memory-Ca4JR3KI.js";import{C as ve}from"./CardContent-B-jtI1ie.js";import{u as Ce}from"./useLocalStorage-bjVpdIUp.js";import{T as je,a as Ie}from"./ToggleButtonGroup-DuGWJmyI.js";import"./iframe-DYiNwxlH.js";import"./ChevronLeft-T8dPGT4o.js";import"./ChevronRight-BmNY6NuE.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./base-chart-DQ401Lk6.js";import"./index-Pr52m2qZ.js";import"./AdapterDayjs-B454wUKi.js";import"./useThemeProps-BqbmQYZm.js";import"./CSSTransition-BIUxaspZ.js";import"./visuallyHidden-Dan1xhjv.js";import"./FilterList-DcOJVDM2.js";import"./emotion-cache.browser.esm-Cm-YvbUu.js";import"./index-JGiTsamG.js";import"./redux-DfszZyTl.js";import"./depsEqual-D6ZeS2iD.js";import"./index-CB69gPUu.js";import"./TableSearch-BuzsZxHI.js";import"./Search-BvWmcM2k.js";import"./Clear-DSDAa0M4.js";import"./MoreVert-DH4Y2k9h.js";import"./getValidReactChildren-CFOO2Xyb.js";const be=o=>a.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...o},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08295 3.2C2.08295 2.58144 2.58439 2.08 3.20295 2.08H28.8029C29.4215 2.08 29.9229 2.58144 29.9229 3.2V13.44C29.9229 14.0586 29.4215 14.56 28.8029 14.56H3.20295C2.58439 14.56 2.08295 14.0586 2.08295 13.44V3.2ZM4.32295 4.32V12.32H27.6829V4.32H4.32295ZM2.08295 18.56C2.08295 17.9414 2.58439 17.44 3.20295 17.44H28.8029C29.4215 17.44 29.9229 17.9414 29.9229 18.56V28.8C29.9229 29.4186 29.4215 29.92 28.8029 29.92H3.20295C2.58439 29.92 2.08295 29.4186 2.08295 28.8V18.56ZM4.32295 19.68V27.68H27.6829V19.68H4.32295Z",fill:"currentColor"}),a.createElement("path",{d:"M8.96297 7.04001H7.68297C7.51323 7.04001 7.35044 7.10744 7.23042 7.22746C7.1104 7.34748 7.04297 7.51027 7.04297 7.68001V8.96001C7.04297 9.12975 7.1104 9.29253 7.23042 9.41256C7.35044 9.53258 7.51323 9.60001 7.68297 9.60001H8.96297C9.13271 9.60001 9.29549 9.53258 9.41552 9.41256C9.53554 9.29253 9.60297 9.12975 9.60297 8.96001V7.68001C9.60297 7.51027 9.53554 7.34748 9.41552 7.22746C9.29549 7.10744 9.13271 7.04001 8.96297 7.04001ZM8.96297 22.4H7.68297C7.51323 22.4 7.35044 22.4674 7.23042 22.5875C7.1104 22.7075 7.04297 22.8703 7.04297 23.04V24.32C7.04297 24.4897 7.1104 24.6525 7.23042 24.7726C7.35044 24.8926 7.51323 24.96 7.68297 24.96H8.96297C9.13271 24.96 9.29549 24.8926 9.41552 24.7726C9.53554 24.6525 9.60297 24.4897 9.60297 24.32V23.04C9.60297 22.8703 9.53554 22.7075 9.41552 22.5875C9.29549 22.4674 9.13271 22.4 8.96297 22.4ZM14.083 7.04001H12.803C12.6332 7.04001 12.4704 7.10744 12.3504 7.22746C12.2304 7.34748 12.163 7.51027 12.163 7.68001V8.96001C12.163 9.12975 12.2304 9.29253 12.3504 9.41256C12.4704 9.53258 12.6332 9.60001 12.803 9.60001H14.083C14.2527 9.60001 14.4155 9.53258 14.5355 9.41256C14.6555 9.29253 14.723 9.12975 14.723 8.96001V7.68001C14.723 7.51027 14.6555 7.34748 14.5355 7.22746C14.4155 7.10744 14.2527 7.04001 14.083 7.04001ZM14.083 22.4H12.803C12.6332 22.4 12.4704 22.4674 12.3504 22.5875C12.2304 22.7075 12.163 22.8703 12.163 23.04V24.32C12.163 24.4897 12.2304 24.6525 12.3504 24.7726C12.4704 24.8926 12.6332 24.96 12.803 24.96H14.083C14.2527 24.96 14.4155 24.8926 14.5355 24.7726C14.6555 24.6525 14.723 24.4897 14.723 24.32V23.04C14.723 22.8703 14.6555 22.7075 14.5355 22.5875C14.4155 22.4674 14.2527 22.4 14.083 22.4Z",fill:"currentColor"}));function Me(){const{api:o,info:s}=U();return e.jsx(ge,{client:o,did:s.did})}function P({style:o={},title:s=null,value:m=null,graph:c=null,description:p=null,empty:f=null}){return e.jsx(ke,{children:e.jsxs(ve,{style:{...o},children:[e.jsx(k,{sx:{color:"text.secondary",fontSize:14},children:s}),f&&Q.isValidElement(f)?e.jsx(i,{style:{height:150},sx:{color:"text.secondary",display:"flex",justifyContent:"center",alignItems:"center"},children:f}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"h5",component:"div",sx:{mt:1},children:m}),c,!!p&&e.jsx(i,{sx:{display:"flex",color:"text.secondary",fontSize:12,marginTop:3},children:p})]})]})})}P.propTypes={style:l.object,title:l.node,value:l.node,graph:l.node,description:l.any,empty:l.node};const ke=D(X)`
1
+ import{r as a,u as U,j as e,T as k,be as Q,N as i,s as D,b2 as X,o as l,g as $,i as M,d2 as Y,bk as ee,d as te,Z as re,C as ne,m as se,J as v,a as h,E as L,b,d3 as oe,M as ie,bt as ae,aE as le,d4 as me,G as C,H as R,k as ce,l as ue,A as de,bm as pe}from"./index-BCjznEDD.js";import{u as fe,T as xe}from"./html-title-CMu--CLy.js";import{T as ge}from"./traffic-d8ue0hO5.js";import{H as he}from"./index-zmLURVwA.js";import{x as V}from"./index-DRYJ0xIl.js";import{C as ye,M as T}from"./memory-BCE6QiNB.js";import{C as ve}from"./CardContent-CWjONtVx.js";import{u as Ce}from"./useLocalStorage-BjyUhOL-.js";import{T as je,a as Ie}from"./ToggleButtonGroup-DfdLS7WR.js";import"./iframe-CvI--k7K.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./index-DBii9-f-.js";import"./typeof-QjJsDpFa.js";import"./base-chart-Dx4PwDO4.js";import"./index-JPRaNDiB.js";import"./AdapterDayjs-V7RXKqyP.js";import"./useThemeProps-BZz8f5dF.js";import"./CSSTransition-BhKCAa_k.js";import"./visuallyHidden-Dan1xhjv.js";import"./FilterList-DOLZBYMl.js";import"./emotion-cache.browser.esm-JDbaITlA.js";import"./index-DVP4mis5.js";import"./redux-DfszZyTl.js";import"./depsEqual-Cr14y622.js";import"./index-BNMMf79b.js";import"./TableSearch-BVy-Zwre.js";import"./Search-Caj8zEyB.js";import"./Clear-vz3__EK4.js";import"./MoreVert-CRSB-gtE.js";import"./getValidReactChildren-BK9M6ULL.js";const be=o=>a.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...o},a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.08295 3.2C2.08295 2.58144 2.58439 2.08 3.20295 2.08H28.8029C29.4215 2.08 29.9229 2.58144 29.9229 3.2V13.44C29.9229 14.0586 29.4215 14.56 28.8029 14.56H3.20295C2.58439 14.56 2.08295 14.0586 2.08295 13.44V3.2ZM4.32295 4.32V12.32H27.6829V4.32H4.32295ZM2.08295 18.56C2.08295 17.9414 2.58439 17.44 3.20295 17.44H28.8029C29.4215 17.44 29.9229 17.9414 29.9229 18.56V28.8C29.9229 29.4186 29.4215 29.92 28.8029 29.92H3.20295C2.58439 29.92 2.08295 29.4186 2.08295 28.8V18.56ZM4.32295 19.68V27.68H27.6829V19.68H4.32295Z",fill:"currentColor"}),a.createElement("path",{d:"M8.96297 7.04001H7.68297C7.51323 7.04001 7.35044 7.10744 7.23042 7.22746C7.1104 7.34748 7.04297 7.51027 7.04297 7.68001V8.96001C7.04297 9.12975 7.1104 9.29253 7.23042 9.41256C7.35044 9.53258 7.51323 9.60001 7.68297 9.60001H8.96297C9.13271 9.60001 9.29549 9.53258 9.41552 9.41256C9.53554 9.29253 9.60297 9.12975 9.60297 8.96001V7.68001C9.60297 7.51027 9.53554 7.34748 9.41552 7.22746C9.29549 7.10744 9.13271 7.04001 8.96297 7.04001ZM8.96297 22.4H7.68297C7.51323 22.4 7.35044 22.4674 7.23042 22.5875C7.1104 22.7075 7.04297 22.8703 7.04297 23.04V24.32C7.04297 24.4897 7.1104 24.6525 7.23042 24.7726C7.35044 24.8926 7.51323 24.96 7.68297 24.96H8.96297C9.13271 24.96 9.29549 24.8926 9.41552 24.7726C9.53554 24.6525 9.60297 24.4897 9.60297 24.32V23.04C9.60297 22.8703 9.53554 22.7075 9.41552 22.5875C9.29549 22.4674 9.13271 22.4 8.96297 22.4ZM14.083 7.04001H12.803C12.6332 7.04001 12.4704 7.10744 12.3504 7.22746C12.2304 7.34748 12.163 7.51027 12.163 7.68001V8.96001C12.163 9.12975 12.2304 9.29253 12.3504 9.41256C12.4704 9.53258 12.6332 9.60001 12.803 9.60001H14.083C14.2527 9.60001 14.4155 9.53258 14.5355 9.41256C14.6555 9.29253 14.723 9.12975 14.723 8.96001V7.68001C14.723 7.51027 14.6555 7.34748 14.5355 7.22746C14.4155 7.10744 14.2527 7.04001 14.083 7.04001ZM14.083 22.4H12.803C12.6332 22.4 12.4704 22.4674 12.3504 22.5875C12.2304 22.7075 12.163 22.8703 12.163 23.04V24.32C12.163 24.4897 12.2304 24.6525 12.3504 24.7726C12.4704 24.8926 12.6332 24.96 12.803 24.96H14.083C14.2527 24.96 14.4155 24.8926 14.5355 24.7726C14.6555 24.6525 14.723 24.4897 14.723 24.32V23.04C14.723 22.8703 14.6555 22.7075 14.5355 22.5875C14.4155 22.4674 14.2527 22.4 14.083 22.4Z",fill:"currentColor"}));function Me(){const{api:o,info:s}=U();return e.jsx(ge,{client:o,did:s.did})}function P({style:o={},title:s=null,value:m=null,graph:c=null,description:p=null,empty:f=null}){return e.jsx(ke,{children:e.jsxs(ve,{style:{...o},children:[e.jsx(k,{sx:{color:"text.secondary",fontSize:14},children:s}),f&&Q.isValidElement(f)?e.jsx(i,{style:{height:150},sx:{color:"text.secondary",display:"flex",justifyContent:"center",alignItems:"center"},children:f}):e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"h5",component:"div",sx:{mt:1},children:m}),c,!!p&&e.jsx(i,{sx:{display:"flex",color:"text.secondary",fontSize:12,marginTop:3},children:p})]})]})})}P.propTypes={style:l.object,title:l.node,value:l.node,graph:l.node,description:l.any,empty:l.node};const ke=D(X)`
2
2
  .card-content {
3
3
  height: 150px;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{dG as C,r as o,U as d,j as e,dH as c,b5 as b,dI as I,bu as E,dJ as z,dd as u,dK as A}from"./index-BvAtsQd5.js";import{B as L}from"./ButtonGroup-D2nbA04k.js";function P({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=C,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},M=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:m,size:p,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(b,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(E,{onClickAway:k,children:e.jsx(z,{onClick:M,children:g})})})})]})}P.Item=d;const v=u(L)`
1
+ import{dG as C,r as o,U as d,j as e,dH as c,b5 as b,dI as I,bu as E,dJ as z,dd as u,dK as A}from"./index-BCjznEDD.js";import{B as L}from"./ButtonGroup-88wnT1Nl.js";function P({...r}){const{size:p="medium",color:i="primary",menu:a=[],children:s=null,variant:m="contained",onClick:x=C,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,B)=>o.isValidElement(t)?t:o.createElement(d,{...t,key:B})):a,y=()=>{l(t=>!t)},k=t=>{n.current&&n.current.contains(t.target)||l(!1)},M=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:m,size:p,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:y,color:i,...f,"aria-label":"more functions",children:e.jsx(b,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(I,{children:e.jsx(E,{onClickAway:k,children:e.jsx(z,{onClick:M,children:g})})})})]})}P.Item=d;const v=u(L)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -1,5 +1,5 @@
1
- import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as $e,cb as J,b$ as Ye,bU as He,cd as qe,aG as he,O as q,bn as A,cq as Ce,H as B,Y as V,bf as E,fB as we,aQ as Be,b as N,j0 as Ve,m as D,gz as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j1 as X,hX as Z,j2 as ot,N as S,aV as G,E as T,L as nt,p as H,dk as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dH as it,gp as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-BvAtsQd5.js";import{T as ut}from"./html-title-Cx_lv4tS.js";import{u as L}from"./blocklet-DISJHp6B.js";import{u as mt}from"./use-mobile-DNj1DdUP.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-2qqraFvt.js";import"./index-Cg9PrZFL.js";import"./index-BojVbZw0.js";import"./api-BmtVyz86.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-BkLlvJlV.js";import{v as Rt}from"./index-bvnJ1qfi.js";import{E as zt}from"./index-Pr52m2qZ.js";import{H as vt}from"./HelpOutline-RoslCWCH.js";import{H as Pt}from"./index-C2JKqeAe.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-DkMO_r4a.js";import{D as Lt}from"./DeleteOutline-BRh_jEgm.js";import{g as ke}from"./get-safe-url-CMpu7B-v.js";import{S as Ot}from"./switch-control-BJ9fbw3I.js";import{L as je}from"./list-header-C3WTZrdD.js";import"./OpenInNew-MxPsaq-U.js";import"./ButtonGroup-D2nbA04k.js";import"./getValidReactChildren-CFOO2Xyb.js";import"./FilterList-DcOJVDM2.js";import"./CSSTransition-BIUxaspZ.js";import"./emotion-cache.browser.esm-Cm-YvbUu.js";import"./index-JGiTsamG.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-D6ZeS2iD.js";import"./index-CB69gPUu.js";import"./TableSearch-BuzsZxHI.js";import"./Search-BvWmcM2k.js";import"./Clear-DSDAa0M4.js";import"./MoreVert-DH4Y2k9h.js";import"./useLocalStorage-bjVpdIUp.js";import"./url-evaluation-DFMzofgY.js";import"./permission-EJYXw2v1.js";import"./Switch-CAccGI-e.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return Ye(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(He(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(qe()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!q(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function Ht({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:qt,Consumer:Ys}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=Ht({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(qt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
2
- `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(H,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(q(t))return e.jsx(H,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(H,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(H,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>q(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||q(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):q(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
1
+ import{bX as Ge,bW as Fe,r as h,bY as Ke,j as e,b8 as ee,b_ as $e,cb as J,b$ as Ye,bU as qe,cd as He,aG as he,O as H,bn as A,cq as Ce,H as B,Y as V,bf as E,fC as we,aQ as Be,b as N,i$ as Ve,m as D,gA as Qe,o as m,x as Xe,ax as De,y as fe,al as Ze,g as Je,C as U,T as j,i as et,s as tt,f as st,j0 as X,hY as Z,j1 as ot,N as S,aV as G,E as T,L as nt,p as q,dk as at,az as Se,U as K,aF as $,a9 as Y,a5 as rt,dH as it,gq as ct,a$ as lt,v as pe,w as dt,G as be,Z as Ee,by as xe,B as pt}from"./index-BCjznEDD.js";import{T as ut}from"./html-title-CMu--CLy.js";import{u as L}from"./blocklet-CdI4-ak7.js";import{u as mt}from"./use-mobile-FV0M1ZqW.js";import{c as Ie,d as ft,e as xt,f as gt,g as ue,h as ht,b as St,u as yt,C as bt,D as kt,a as jt}from"./connect-to-DfZIDYiw.js";import"./index-Cjda8MxV.js";import"./index-BojVbZw0.js";import"./api-BMlRo0OB.js";import{d as Ct,a as wt,g as Bt,i as Dt,e as ge,f as Et,h as It,j as Tt}from"./spaces-BnSCxjeY.js";import{v as Rt}from"./index-CcPSAXJC.js";import{E as zt}from"./index-JPRaNDiB.js";import{H as vt}from"./HelpOutline-BIIJduw6.js";import{H as Pt}from"./index-zmLURVwA.js";import{x as At}from"./index-DRYJ0xIl.js";import{c as Ut}from"./actions-BhT4KCkB.js";import{D as Lt}from"./DeleteOutline-BQz9po9Q.js";import{g as ke}from"./get-safe-url-D4QANS7R.js";import{S as Ot}from"./switch-control-D5SPzkUx.js";import{L as je}from"./list-header-Bimu_qjE.js";import"./OpenInNew-nb9brzvh.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";import"./FilterList-DOLZBYMl.js";import"./CSSTransition-BhKCAa_k.js";import"./emotion-cache.browser.esm-JDbaITlA.js";import"./index-DVP4mis5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Cr14y622.js";import"./index-BNMMf79b.js";import"./TableSearch-BVy-Zwre.js";import"./Search-Caj8zEyB.js";import"./Clear-vz3__EK4.js";import"./MoreVert-CRSB-gtE.js";import"./useLocalStorage-BjyUhOL-.js";import"./url-evaluation-DFEEqTh-.js";import"./permission-nS6Be9Zz.js";import"./Switch-Cr0eK23s.js";function Mt(t){return Ge("MuiIcon",t)}Fe("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Nt=t=>{const{color:s,fontSize:n,classes:o}=t,r={root:["root",s!=="inherit"&&`color${J(s)}`,`fontSize${J(n)}`]};return Ye(r,Mt,o)},_t=ee("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.color!=="inherit"&&s[`color${J(n.color)}`],s[`fontSize${J(n.fontSize)}`]]}})(qe(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(He()).map(([s])=>({props:{color:s},style:{color:(t.vars||t).palette[s].main}}))]}))),ye=h.forwardRef(function(s,n){const o=Ke({props:s,name:"MuiIcon"}),{baseClassName:r="material-icons",className:a,color:c="inherit",component:i="span",fontSize:d="medium",...l}=o,p={...o,baseClassName:r,color:c,component:i,fontSize:d},f=Nt(p);return e.jsx(_t,{as:i,className:$e(r,"notranslate",f.root,a),ownerState:p,"aria-hidden":!0,ref:n,...l})});ye.muiName="Icon";const Wt=he(e.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"})),Gt=he(e.jsx("path",{d:"M14.69 2.21 4.33 11.49c-.64.58-.28 1.65.58 1.73L13 14l-4.85 6.76c-.22.31-.19.74.08 1.01.3.3.77.31 1.08.02l10.36-9.28c.64-.58.28-1.65-.58-1.73L11 10l4.85-6.76c.22-.31.19-.74-.08-1.01-.3-.3-.77-.31-1.08-.02"})),Ft=he(e.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}));async function Kt({blockletDid:t,nodeApi:s,spaceGateways:n}){let o=!1;const r=await Promise.all(n.map(async a=>{let{name:c}=a;const i=await Ct(a.endpoint);return!H(i)&&i!==c&&(c=i,o=!0),{...a,name:c}}));return o&&await Promise.all(r.filter(a=>a.did).map(a=>s.updateBlockletSpaceGateway({input:{did:t,where:{did:a.did},spaceGateway:{...a}}}))),r}function $t({refresh:t}={}){const{blocklet:s}=L(),n=s?.meta?.did,{api:o}=A();return Ce(async()=>{if(!n)return[];const{spaceGateways:r}=await o.getBlockletSpaceGateways({input:{did:n}});return await Kt({blockletDid:n,nodeApi:o,spaceGateways:r})??[]},{refreshDeps:[n,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(V(r)))}})}function Te({deps:t,setLoading:s,backupDate:n}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:o}=L(),[r,a]=h.useState([]),{api:c}=A(),[i,d]=h.useMemo(()=>n?[E(n).startOf("day").toISOString(),E(n).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[n]),l=we(async()=>{try{if(s(!0),!o){a([]);return}const{backups:p}=await c.getBlockletBackups({input:{did:o.meta.did,startTime:i,endTime:d}});a(p??[])}catch(p){console.error(p),B.error(V(p))}finally{s(!1)}},1e3);return Be(async()=>{l()},[o?.meta?.did].concat(t)),{backups:r}}function Yt({appDid:t}){const{backups:s}=Te(),[n,o]=h.useState({message:"",progress:0,completed:!1}),r=A(),{ws:{useSubscription:a}}=r;return a(N.BlockletEvents.backupProgress,c=>{t===c?.appDid&&o(()=>({...c}))},[t]),h.useEffect(()=>{if(s?.length&&Ve(s[0]?.status)){const[c]=s;o(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[s]),n}function qt({deps:t=[],setLoading:s=()=>{}}={}){const{blocklet:n}=L(),[o,r]=h.useState([]),{api:a}=A(),c=h.useCallback(we(async()=>{if(!a||!n?.meta?.did){r([]);return}try{s(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await a.getBlockletBackupSummary({input:{did:n.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}});r(Array.isArray(l)?l:[])}catch(i){console.error("Failed to fetch backup summary:",i),B.error(V(i)),r([])}finally{s(!1)}},1e3),[]);return Be(async()=>(await c(),()=>{c.cancel()}),[n?.meta?.did].concat(t)),{backupSummary:o}}const Re=h.createContext({}),{Provider:Ht,Consumer:Ys}=Re;function ze({children:t}){const{t:s}=D(),{api:n}=A(),{blocklet:o}=L(),[r,a]=h.useState(null),[c,i]=h.useState(!1),{data:d,loading:l,mutate:p}=$t({refresh:c}),f=Qe(d),x=Yt({appDid:o?.appDid}),u=h.useMemo(()=>wt(o?.environments),[o?.environments]),[k,w]=h.useState(!1),[y,b]=h.useState(0),{backups:te}=Te({deps:[y,r],setLoading:w,backupDate:r}),[se,oe]=h.useState(0),{backupSummary:ne}=qt({deps:[se]}),[_,M]=h.useState(d?.find(g=>g.endpoint===u)),I=o?.settings?.autoBackup,z=()=>{i(g=>!g)},ae=()=>{oe(g=>g+1)},re=()=>{b(g=>g+1)},F=async g=>{await n.updateAutoBackup({input:{did:o.meta.did,autoBackup:g}})},Q=async()=>{await n.abortBlockletBackup({input:{appPid:o.meta.did}})},ie=async(g,P)=>{try{p(R=>{const v=[...R];return v.push({...g,loading:!0}),v}),await n.addBlockletSpaceGateway({input:{did:o.meta.did,spaceGateway:g}}),u!==P&&await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:P}]}}),M(g),z(),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),p(v=>[...v].filter(W=>W.did!==g.did)),R}},ce=async g=>{g&&(g.endpoint===u&&(await n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),I?.enabled&&await F({enabled:!1})),await n.deleteBlockletSpaceGateway({input:{did:o.meta.did,spaceGatewayDid:g?.did}}),p(P=>{const R=[...P];return R.splice(R.indexOf(g),1),R}),M(g),z())},le=async g=>{await Promise.all([n.updateBlockletSpaceGateway({input:{did:o.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&n.configBlocklet({input:{did:[o.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(s("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),z()},C=g=>g?.endpoint===u;return e.jsx(Ht,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ie,deleteSpaceGateway:ce,updateSpaceGateway:le,refreshSpaceGateways:z,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:f,spaceGatewayIsSelected:C,updateAutoBackup:F,abortBlockletBackup:Q,backupEndpoint:u,backupProgress:x,backups:te,backupSummary:ne,refreshBackupSummary:ae,refreshBackups:re,setBackupDate:a,backupsLoading:k,autoBackup:I},children:t})}ze.propTypes={children:m.any.isRequired};function O(){return h.useContext(Re)}function ve({...t}){const{blocklet:s}=L(),{info:n}=A(),{t:o}=D(),r=Ie({blocklet:s}),a=Xe(n),{spaceGateways:c,addSpaceGateway:i}=O(),d={checkFn:De.create({baseURL:fe(window.location.origin,Ze())}).get,webWalletUrl:a,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:n.did}},l=async({endpoint:f,name:x,did:u})=>{const k=await Bt(f);if(!await Dt(k)){B.error(o("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(b=>b.endpoint===f)){B.error(o("storage.spaces.gateway.add.duplicate",{name:x}));return}await i({name:x,did:u,url:k,endpoint:f},f)},p=async({spaceGateway:f})=>{try{await l(f)}catch(x){console.error(x),B.error(V(x))}};return e.jsx(ft,{...t,connectScope:"app",options:d,onSuccess:p})}function Vt(){const{api:t}=A(),{blocklet:s}=L(),{data:n,loading:o}=Ce(()=>t.getBlocklet({input:{did:s?.meta?.did,attachDiskInfo:!0,attachRuntimeInfo:!0}}),{ready:!!s?.meta?.did,refreshDeps:[s?.meta?.did]});return{blocklet:n?.blocklet??null,loading:o}}function Pe({...t}){const{t:s}=h.useContext(Je),{blocklet:n,loading:o}=Vt();if(n?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?et(d):"empty"})]}),a=n.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:s("blocklet.diskInfo.appDir"),value:r(a.BLOCKLET_APP_DIR,n.diskInfo.app)},{key:"dataDir",name:s("blocklet.diskInfo.dataDir"),value:r(a.BLOCKLET_DATA_DIR,n.diskInfo.data)},{key:"logDir",name:s("blocklet.diskInfo.logDir"),value:r(a.BLOCKLET_LOG_DIR,n.diskInfo.log)},{key:"cacheDir",name:s("blocklet.diskInfo.cacheDir"),value:r(a.BLOCKLET_CACHE_DIR,n.diskInfo.cache)}];return e.jsx(Qt,{component:"div",...t,children:c.map(i=>e.jsx(Rt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return o?e.jsx(U,{}):e.jsx(j,{children:s("blocklet.diskInfo.empty")})}const Qt=tt(j)``;function Ae(){const{t}=D(),{setBackupDate:s,backupSummary:n}=O(),o=xt({key:"lg"}),r=h.useRef(null),a=st(),c=h.useCallback(l=>{s(l)},[s]),i=h.useMemo(()=>{const l=E().add(1,"day"),p=l.subtract(1,"year"),f=new Map(n.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),x=[];for(let u=p.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");x.push(f.get(k)||{date:k,successCount:0,errorCount:0})}return x},[n]),d=h.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:y,errorCount:b}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${y}</div>`,`<div>${t("common.failed")}: ${b}</div>`].join(`
2
+ `)},backgroundColor:a.palette.background.paper,borderColor:a.palette.divider,textStyle:{color:a.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${a.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:a.palette.grey[200]},{min:1,max:3,color:Z[300]},{min:3,max:6,color:Z[400]},{min:6,max:9,color:Z[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:Z[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:a.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,color:a.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:a.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:a.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:a.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:ot[200],color:"inherit"}}}}),[i,t,a]);return e.jsxs(e.Fragment,{children:[e.jsx(S,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(S,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(zt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(S,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:o?2:5,mb:2},children:e.jsxs(G,{direction:o?"column":"row",spacing:o?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:o?"flex-start":"center"},children:[e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(G,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(S,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Xt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ue({status:t,message:s="",createdAt:n}){const{t:o}=D(),r=t===T.BACKUPS.STATUS.PROGRESS&&E().diff(n,"hours")>=T.BACKUPS.TIMEOUT_HOURS,a=r&&o("common.timeoutError"),c=t===T.BACKUPS.STATUS.PROGRESS&&!r,i=t===T.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),o("common.progress")]}):i?e.jsx(q,{type:"success",children:o("common.succeeded")}):e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:o("common.failed")}),e.jsx(Se,{style:{display:"flex",alignItems:"center",flexShrink:0},title:s||a,children:e.jsx(ye,{children:e.jsx(vt,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ue.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function Le({metadata:t={}}){const{t:s}=D();if(H(t))return e.jsx(q,{type:"success",children:s("common.succeeded")});const n=t.count||0,o=t.size||0,r=At(o,{iec:!0}),a=e.jsxs(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[s("common.fileCount"),": ",n]}),e.jsxs(j,{variant:"body2",children:[s("common.fileSize"),": ",r]})]});return e.jsxs(S,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:s("common.succeeded")}),e.jsx(Xt,{title:a,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(ye,{children:e.jsx(at,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}Le.propTypes={metadata:m.object};function Oe(){const{t,locale:s}=D(),{spaceGateways:n,backups:o,backupsLoading:r}=O(),a=h.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:p,createdAt:f}=o[i],x=p===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,u=p===T.BACKUPS.STATUS.SUCCEEDED&&!x,k=l||n.find(w=>d?.includes(ge(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(nt,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=o?.[i]??{},{status:l,message:p,createdAt:f,metadata:x}=d,u=l===T.BACKUPS.STATUS.PROGRESS&&E().diff(f,"hours")>=T.BACKUPS.TIMEOUT_HOURS,k=l===T.BACKUPS.STATUS.PROGRESS&&!u,w=l===T.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(U,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(Le,{metadata:x}):e.jsx(Ue,{status:l,message:p,createdAt:f})}}}],[o,n,t]),c=h.useMemo(()=>!o?.length,[o]);return e.jsx(e.Fragment,{children:c?e.jsx(S,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(Pt,{title:"",loading:r,data:o,columns:a,emptyNode:t("storage.spaces.record.emptyData",s),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function Zt(){const{t}=D();return e.jsxs(S,{children:[e.jsxs(S,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(gt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(ve,{})]}),e.jsxs(S,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Ae,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function Me({spaceGateway:t,onConfirm:s=()=>{},onCancel:n=()=>{}}){const{t:o}=D(),[r,a]=h.useState(!1),[c,i]=h.useState(!1),d=(f,x)=>{f?.preventDefault(),f?.stopPropagation(),a(x)},l=async f=>{try{f?.stopPropagation(),i(!0),await s?.(t),a(!1)}catch(x){console.error(x),B.error(`${o("storage.space.gateway.delete.failed")}: ${V(x)}`)}finally{a(!1),i(!1)}},p=f=>{d(f,!1),n?.(f)};return e.jsxs(e.Fragment,{children:[e.jsxs(K,{color:"red",onClick:f=>d(f,!0),children:[e.jsx($,{style:{minWidth:24,color:"red"},children:e.jsx(Lt,{fontSize:"small"})}),e.jsx(Y,{style:{color:"red"},children:o("common.disconnect")})]}),e.jsx(rt,{title:o("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:o("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:o("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:p,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:o("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}Me.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ne({spaceGateway:t,selected:s,onDelete:n=()=>{},onConnect:o=()=>{},enableSwitchToSpace:r=!0,backupInProgress:a=!1,...c}){const{abortBlockletBackup:i}=O(),[d,l]=h.useState(null),{t:p}=D(),[f,x]=h.useState(!1),u=(y,b)=>{y.stopPropagation(),y.preventDefault(),l(b&&y.currentTarget)},k=async y=>{try{x(!0),u(y,!1),await o(t)}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}},w=async y=>{try{x(!0),u(y,!1),await i()}catch(b){console.error(b),B.error(b.message)}finally{x(!1)}};return e.jsxs(e.Fragment,{children:[f||t?.loading?e.jsx(U,{sx:{ml:1},size:"24px"}):e.jsx(it,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:y=>u(y,!0),...c,children:e.jsx(ct,{})}),e.jsxs(lt,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:y=>u(y,!1),children:[e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(t.endpoint?Et(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Wt,{fontSize:"small"})}),e.jsx(Y,{children:p("common.open")})]}),e.jsxs(K,{onClick:y=>{u(y,!1),window.open(ke(It(t.endpoint),{allowDomains:null}))},children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ft,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.strategy.viewBackupFiles")})]}),!s&&r&&e.jsxs(K,{onClick:k,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Gt,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.switchToSpace")})]}),a&&e.jsxs(K,{onClick:w,children:[e.jsx($,{style:{minWidth:24},children:e.jsx(Ut,{fontSize:"small"})}),e.jsx(Y,{children:p("storage.spaces.connect.abortBlockletBackup")})]}),!a&&e.jsx(Me,{spaceGateway:t,onConfirm:async()=>{l(null),await n?.(t)},onCancel:()=>l(null)})]})]})}Ne.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Jt=ee(({className:t,...s})=>e.jsx(Se,{...s,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function _e({spaceGateway:t,spaceStatus:s,selected:n,onConnected:o=()=>{},onDeleted:r=()=>{},onBackedUp:a=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=L(),{api:l,info:{did:p}}=A(),{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y}=Ie({blocklet:d}),{backupProgress:b,updateSpaceGateway:te,deleteSpaceGateway:se,refreshBackupSummary:oe,refreshBackups:ne}=O(),[_,M]=h.useState(!1),[I,z]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:x},i),scan:c("storage.spaces.authorize.scan",{appName:x},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{z(C=>({...C,open:!1}))}}),ae=n&&!_&&s===ue.DISCONNECTED,re=n&&!_&&!t.loading&&s===ue.CONNECTED,F=n&&_&&s===ue.CONNECTED&&b?.progress>=0,Q=async()=>{try{if(await Tt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:N.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),o?.(null,t);return}}catch(C){console.error(C),o?.(C,t);return}z(C=>({...C,open:!0,prefix:fe(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:De.create({baseURL:fe(t.url,"space")}).get,extraParams:{appDid:f,appName:x,appDescription:u,scopes:k,appUrl:w,referrer:y,nodeDid:p,spaceDid:t.did}}))},ie=async(C,g)=>{const P=g(C.endpoint),R=ge(P),v=C.space?g(C.space):{};if(t.did&&R!==t.did){z(We=>({...We,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:v?.name?v.name:""});B.error(W),o?.(new Error(W),t);return}const de={...t,name:v.name??"DID Space",did:v.did??ge(P),endpoint:P};await te(de),z(W=>({...W,open:!1})),o?.(null,de)},ce=async()=>{try{if(_)return;M(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),a?.(C,t)}finally{M(!0)}},le=async()=>{try{await se(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return h.useEffect(()=>{b?.completed?(n&&(b?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),a?.(null,t)):b.message&&a?.(new Error(b?.message),t),b.progress=0,b.message=""),M(!1),oe(),ne()):b.progress&&M(!0)},[b]),e.jsxs(e.Fragment,{children:[e.jsxs(S,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[re&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:ce,children:c("storage.spaces.strategy.backupNow")}),ae&&e.jsx(pe,{className:"action-btn",variant:"outlined",size:"small",onClick:Q,children:c("storage.spaces.disconnected.reconnectNow")}),F&&e.jsx(Jt,{title:b?.message&&e.jsx(S,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:b.message})}),children:e.jsxs(pe,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(U,{variant:"determinate",value:b?.progress,size:14,sx:{mr:1}}),b?.progress,"%"]})}),e.jsx(dt,{forceConnected:!1,saveConnect:!1,prefix:I.prefix,open:I.open,popup:!0,action:I.action,baseUrl:I.baseUrl,checkFn:I.checkFn,onSuccess:ie,onClose:I.onClose,checkTimeout:I.checkTimeout,extraParams:I.extraParams,messages:I.messages,locale:i},"get-endpoint")]}),e.jsx(Ne,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:n,onDelete:le,onConnect:Q,enableSwitchToSpace:b?.completed||H(b?.message),backupInProgress:F})]})}_e.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function es({...t}){const{t:s}=D();return e.jsxs(S,{...t,children:[e.jsx(S,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("storage.spaces.backup.records")})}),e.jsx(Ae,{}),e.jsx(Oe,{})]})}function ts({...t}){const{t:s}=D(),{autoBackup:n,updateAutoBackup:o}=O(),r=async()=>{try{const a=!n?.enabled;await o({enabled:a}),B.success(s(a?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(a){B.error(a.message)}};return e.jsx(Ot,{checked:!!n?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:s("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function ss(){const{t}=D(),{spaceGateways:s,spaceGatewaysLoading:n,spaceGatewayIsSelected:o}=O(),r=n&&!s?.length,a=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(_e,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:p=>p&&l()});return e.jsxs(S,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(S,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(ts,{}),e.jsx(ve,{})]}),e.jsx(S,{sx:{mt:2},children:r?e.jsx(S,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(U,{})}):e.jsx(be,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:s.map(c=>e.jsx(be,{size:{xs:12,md:6},children:e.jsx(ht,{endpoint:c.endpoint,selected:o(c),action:a},c.endpoint)},c.endpoint))})})}),e.jsx(es,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Pe,{})]})}function os(){const{spaceGatewaysFirstLoading:t,spaceGateways:s}=O();return t?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):H(s)?e.jsx(Zt,{}):e.jsx(ss,{})}function ns(){return e.jsx(ze,{children:e.jsx(os,{})})}function as(){const{spaceGateway:t,settingStorageEndpoint:s,updateSpaceGateway:n,hasStorageEndpoint:o,loading:r,storageEndpoint:a}=yt(),c=xe(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(Ee,{relative:"parent",children:e.jsx(U,{})}):e.jsxs(S,{sx:{maxWidth:"md",position:"relative"},children:[o?e.jsx(bt,{spaceGateway:t,settingStorageEndpoint:s}):e.jsx(kt,{}),e.jsx(S,{sx:c,children:e.jsx(jt,{onConnect:n,storageEndpoint:a})})]})}function rs(){const{t}=D();return e.jsxs(St,{children:[e.jsxs(G,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(as,{})]})}function is({navOrientation:t="vertical",...s}){const{t:n,locale:o}=D(),{blocklet:r}=L(),a=mt({key:"md"}),[c,i]=pt(),d=c.get("tab")||"backup",l=a?"horizontal":t,p=xe(()=>{const w=[{label:n("common.backup"),value:"backup"}],y=r?.capabilities?.didSpace;return(y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||y===N.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:n("common.storage"),value:"storage"}),w},[o,l]),x=xe(()=>({backup:e.jsx(ns,{}),storage:e.jsx(rs,{})}))[d],u=w=>{i(y=>(w==="backup"?y.delete("tab"):y.set("tab",w),y))};if(p.length<=1)return e.jsx(me,{children:x});const k=e.jsx(ut,{tabs:p,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(S,{...s,children:e.jsxs(G,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(S,{sx:{flexShrink:0},children:e.jsx(je,{left:k})}),e.jsx(S,{sx:{flexGrow:1,minWidth:0},children:e.jsx(me,{sx:{mt:1},children:x})})]})});if(l==="horizontal")return e.jsxs(S,{...s,children:[e.jsx(je,{left:k}),e.jsx(me,{sx:{mt:2},children:x})]})}is.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const me=ee(S)`
3
3
  position: relative;
4
4
  min-height: 66vh;
5
5
  overflow: hidden;
@@ -0,0 +1,177 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lottie-react.esm-DfMKPb7z.js","./index-BCjznEDD.js","./index-DGkT7afN.css"])))=>i.map(i=>d[i]);
2
+ import{c0 as ht,r as se,ct as dt,aG as Ze,j as B,hk as Ct,aP as De,fc as xt,N as K,T as pe,t as Et,Q as Rt,S as mt,U as yt,dH as We,s as ce,dn as ct,a4 as bt,dp as wt,bE as he,f as vt,aQ as St,G as le,f4 as It,fS as ft,ey as Fe,bd as Lt,je as Bt,cq as Tt,C as _t}from"./index-BCjznEDD.js";import{D as Ht}from"./url-evaluation-DFEEqTh-.js";import{k as Ot,m as Nt}from"./index-CXFs83DK.js";import{r as je}from"./index-TD9tpMf3.js";import"./url-join-Dra-Zi4G.js";import"./_createAggregator-C1jyyLx1.js";import"./depsEqual-Cr14y622.js";import"./index-hwjSVkr9.js";import"./index-DRYJ0xIl.js";import"./toUpper-BMdlX8ly.js";function Qt(g){var u=ht(se.useState(g),2),y=u[0],R=u[1],x=dt(y),b=se.useCallback(function(){return x.current},[]);return[y,R,b]}const qt=Ze([B.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m-2 13-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z",opacity:".3"},"0"),B.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"},"1")]),Mt=Ze(B.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),Wt=Ze(B.jsx("path",{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2m-2-1h8v-2H5zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5m4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94z"})),pt=se.createContext({}),At=()=>se.useContext(pt);function Zt({children:g,restrictions:u,i18n:y,theme:R}){const[x,b]=Qt({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=se.useMemo(()=>({...x,onLoading:n,restrictions:u,i18n:y}),[x]);return B.jsx(Ct,{theme:R,children:B.jsx(pt.Provider,{value:e,children:g})})}const Dt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCC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7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",jt=""+new URL("bedrock-yFRPpe__.png",import.meta.url).href,Gt=""+new URL("deepseek-C3x42pq3.png",import.meta.url).href,Vt=""+new URL("doubao-yPqHSkLx.png",import.meta.url).href,Ft=""+new URL("gemini-DffKpc81.png",import.meta.url).href,kt=""+new URL("google-DT1VSJ0m.png",import.meta.url).href,Yt=""+new URL("ideogram-REIjy0Er.png",import.meta.url).href,Pt=""+new URL("ollama-C7MZn2d_.png",import.meta.url).href,Ut=""+new URL("openai-DlpqJdrb.png",import.meta.url).href,zt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0dSURBVHgB7d1Nb1XXucDxlahAogQUUi6VSG+iQCT7CmJyS0FB5WYQRreT209wP1w7yqhpB3QSKrUgEYWQFkIlLCW4aTASxrGRbRryIqX7OXBSILzY2Od4P2v9ftIRBKkDv5x/13r23us89V2nACTwdAFIQrCANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CAN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EAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Dt,bedrock:jt,deepseek:Gt,doubao:Vt,gemini:Ft,google:kt,ideogram:Yt,ollama:Pt,openai:Ut,openrouter:zt,poe:Kt,xai:Xt},ke={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function $t({onSubmit:g,models:u}){const{loading:y,i18n:R}=At(),x=De({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&g(t)},{run:n}=xt(b,{wait:500}),e=se.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(Jt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(K,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(K,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(Et,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(K,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(Rt,{fullWidth:!0,size:"small",children:B.jsx(mt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=u.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(K,{component:"img",src:ge[a.provider],alt:a.provider,style:ke}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:u.map(t=>B.jsx(yt,{value:`${t.provider}/${t.model}`,children:B.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(K,{component:"img",src:ge[t.provider],alt:t.provider,style:ke}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(We,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:y||e,children:R(y?"aiImageGenerating":"aiImageGenerate")},y?"loading-submit":"submit")]})}const Jt=ce(K)`
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ overflow: hidden;
7
+
8
+ .title {
9
+ padding: 0 0 4px 1px;
10
+ }
11
+
12
+ .label {
13
+ font-weight: 500;
14
+ font-size: 15px;
15
+ line-height: 100%;
16
+ margin: 0;
17
+ word-wrap: break-word;
18
+ text-align: left;
19
+ }
20
+
21
+ .submit-ai {
22
+ height: 40px;
23
+ background: linear-gradient(90deg, #45e4fa 0%, #8a45fa 52.08%, #fa45bc 100%);
24
+ color: #fff;
25
+ border-radius: 30px;
26
+ box-shadow: none;
27
+ text-transform: none;
28
+
29
+ &.Mui-disabled {
30
+ color: ${({theme:g})=>g.palette.text.disabled} !important;
31
+ background: ${({theme:g})=>g.palette.action.disabledBackground} !important;
32
+ }
33
+ }
34
+
35
+ .MuiFormHelperText-root {
36
+ font-style: normal;
37
+ font-weight: 500;
38
+ font-size: 12px;
39
+ line-height: 14px;
40
+ margin: 0;
41
+ margin-top: 4px;
42
+ }
43
+
44
+ .MuiOutlinedInput-root {
45
+ border-radius: 4px;
46
+ padding: 0;
47
+
48
+ textarea {
49
+ padding: 8.5px 14px;
50
+ }
51
+
52
+ fieldset {
53
+ }
54
+
55
+ &:hover fieldset {
56
+ }
57
+ }
58
+ `,er=({onDelete:g,selected:u,onLoad:y,src:R,alt:x,...b})=>{const n=De({loading:!0});return B.jsxs("div",{style:{position:"relative"},children:[B.jsx(K,{className:"lazy-image-wrapper",sx:{visibility:n.loading?"hidden":"visible",bgcolor:"background.paper",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:B.jsx("img",{alt:x,src:R,...b,onLoad:()=>{n.loading=!1;try{y?.()}catch(e){console.error("image onLoad error: ",e)}},loading:"eager"})}),n.loading&&B.jsx(ct,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{position:"absolute",top:0}}),B.jsx(rr,{onClick:()=>g(R),sx:{position:"absolute",left:10,bottom:10},children:B.jsx(Ht,{sx:{fontSize:20}})}),x&&B.jsxs(tr,{unstyled:!0,tip:x,sx:{position:"absolute",right:10,bottom:10,fontSize:14,width:"calc(100% - 20px - 10px - 36px)",display:"flex",alignItems:"center"},arrow:!0,tipPlacement:"top",PopperProps:{disablePortal:!0},children:[B.jsx(Wt,{sx:{fontSize:20,mr:.5}}),B.jsx(pe,{sx:{fontSize:14,overflowX:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x})]}),B.jsx(K,{sx:{position:"absolute",right:8,top:8},onClick:b?.onClick,children:u?B.jsx(nr,{sx:{fontSize:30}}):B.jsx(Mt,{sx:{fontSize:30,color:"#fff"}})})]})},tr=ce(wt)`
59
+ height: 36px;
60
+ padding: 8px;
61
+ background: rgba(0, 0, 0, 0.42);
62
+ color: #f7f8f8;
63
+ display: flex;
64
+ justify-content: center;
65
+ align-items: center;
66
+ border-radius: 6px;
67
+ color: #fff;
68
+ transition: all 0.3s;
69
+
70
+ &:hover {
71
+ background: rgba(0, 0, 0, 0.69);
72
+ }
73
+ `,rr=ce(bt)`
74
+ height: 36px;
75
+ width: 36px;
76
+ padding: 0;
77
+ background: rgba(0, 0, 0, 0.42);
78
+ color: #f7f8f8;
79
+ display: flex;
80
+ justify-content: center;
81
+ align-items: center;
82
+ border-radius: 6px;
83
+ transition: all 0.3s;
84
+
85
+ &:hover {
86
+ background: rgba(0, 0, 0, 0.69);
87
+ }
88
+ `,nr=ce(qt)`
89
+ & path:first-of-type {
90
+ fill: ${({theme:g})=>g.palette?.primary?.main||"#1976d2"};
91
+ opacity: 1;
92
+ }
93
+ & path:last-child {
94
+ fill: white;
95
+ }
96
+ `,sr=se.lazy(()=>he(()=>import("./lottie-react.esm-DfMKPb7z.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(g=>({default:g.Player})));function Re({src:g}){return B.jsx(sr,{src:g,loop:!0,autoplay:!0})}function ar({options:g,handleApi:u,onSelect:y,onFinish:R,onClose:x,isMobile:b}){const{loading:n,onLoading:e,restrictions:t,i18n:a}=At(),[i,E]=se.useState([]),[s,_]=se.useState(),T=vt(),M=t?.maxNumberOfFiles,[d,A]=se.useState({}),w=De({}),r=Object.keys(w).filter(h=>w[h]);se.useEffect(()=>{s&&!d.error&&he(()=>import("./lottie-error-DeJ4jU66.js"),[],import.meta.url).then(h=>{A(I=>({...I,error:h.default}))}),g&&!i.length&&!d.loading&&he(()=>import("./lottie-loading-Npqo86wA.js"),[],import.meta.url).then(h=>{A(I=>({...I,loading:h.default}))}),!g&&!d.welcome&&he(()=>import("./lottie-welcome-oyMgXGo-.js"),[],import.meta.url).then(h=>{A(I=>({...I,welcome:h.default}))})},[s,g,i.length,d]),St(async()=>{if(g){_(void 0),e(!0);try{const h=await u({...g,responseFormat:"base64"});if(h.images){const H=(h.images||[]).map(N=>({src:N.url||`data:image/png;base64,${N.base64}`,alt:g.prompt}));E(i?[...H,...i]:H)}else _(h)}catch(h){console.error("AIImage generate error: ",h),_(h?.response?.data||h)}finally{e(!1),R()}}},[g?.number,g?.prompt]);const C=h=>{const I=Object.keys(w).filter(N=>w[N]);if(M?I.length<M:!0)w[h]?w[h]=!1:w[h]=!0;else{const N=I.pop();N!==h&&(w[N]=!1),w[h]=!w[h]}},l=h=>{if(i){const I=i.findIndex(H=>H.src===h);I>-1&&(w[h]=!1,i.splice(I,1),E([...i]))}},v=()=>{const h={width:document.querySelector(".photo-item img")?.offsetWidth||0,height:document.querySelector(".photo-item img")?.offsetHeight||0};return B.jsx(B.Fragment,{children:Array.from({length:g?.number||1}).map((I,H)=>B.jsx(le,{children:B.jsx(ct,{className:"lazy-image-skeleton",animation:"wave",variant:"rectangular",style:{borderRadius:"12px",...h}})},H))})},p=()=>s?B.jsxs(K,{sx:{width:300,height:300,m:"auto"},children:[d.error&&B.jsx(Re,{src:d.error},"error"),B.jsx(K,{sx:{textAlign:"center",color:"#25292F",wordBreak:"break-all"},children:s?.message})]}):i&&Array.isArray(i)&&i.length>0?B.jsxs(B.Fragment,{children:[B.jsx(K,{sx:{flexGrow:1,height:0,overflowX:"hidden",overflowY:"auto"},children:B.jsx(or,{sx:b?{p:0,border:"none !important"}:{p:2},children:B.jsxs(le,{spacing:2,container:!0,className:"photo-wrapper",children:[n&&B.jsx(v,{}),i.map((h,I)=>B.jsx(le,{className:"photo-item",children:B.jsx(er,{...h,selected:w[h.src],style:{objectFit:"cover",cursor:"pointer",transition:"all 0.3s",border:w[h.src]?`2px solid ${T.palette.primary.main}`:"2px solid transparent",WebkitUserDrag:"none",width:"100%",height:"100%"},onClick:()=>{C(h.src)},onDelete:()=>{l(h.src)}})},h.src))]})})}),B.jsxs(K,{sx:{mt:2,display:"flex",justifyContent:x?"space-between":"flex-end",button:{borderRadius:"30px",height:40,textTransform:"none"}},children:[x&&typeof x=="function"&&B.jsx(We,{color:"primary",variant:"outlined",onClick:x,children:B.jsx(It,{})}),B.jsx(We,{color:"primary",variant:"contained",disabled:!r.length||n,onClick:()=>{const h=Ot(i,"src");y(r.map(I=>h[I]))},children:r.length?a("aiImageSelectedUse"):a("aiImageSelectedTip")})]})]}):g?B.jsx(K,{sx:{width:220,height:220,m:"auto"},children:d.loading&&B.jsx(Re,{src:d.loading},"loading")}):B.jsx(K,{sx:{width:300,height:300,m:"auto"},children:d.welcome&&B.jsx(Re,{src:d.welcome},"welcome")});return B.jsx(ir,{children:p()})}const ir=ce(K)`
97
+ min-height: 100%;
98
+ display: flex;
99
+ flex-direction: column;
100
+
101
+ .lazy-image-wrapper {
102
+ border-radius: 12px;
103
+
104
+ img {
105
+ border-radius: 12px;
106
+ }
107
+ }
108
+
109
+ .tips {
110
+ overflow: hidden;
111
+ display: -webkit-box;
112
+ -webkit-box-orient: vertical;
113
+ -webkit-line-clamp: 3;
114
+ }
115
+ `,or=ce(K)`
116
+ display: flex;
117
+ flex-direction: column;
118
+
119
+ border: 1px solid;
120
+ border-color: ${({theme:g})=>g.palette.divider};
121
+ border-radius: 12px;
122
+ min-height: 100%;
123
+
124
+ &:has(.Mui-focused) {
125
+ border: 1px solid #a482fe;
126
+ }
127
+
128
+ > .input {
129
+ padding: 12px;
130
+ font-weight: 500;
131
+ font-size: 16px;
132
+ line-height: 19px;
133
+ color: #25292f;
134
+ }
135
+
136
+ > .footer {
137
+ display: flex;
138
+ align-items: center;
139
+ justify-content: flex-end;
140
+ padding: 0 12px 12px;
141
+
142
+ > .counter {
143
+ flex: 1;
144
+ overflow: hidden;
145
+ text-overflow: ellipsis;
146
+ white-space: nowrap;
147
+ font-weight: 400;
148
+ font-size: 12px;
149
+ line-height: 14px;
150
+ color: #9397a1;
151
+ }
152
+
153
+ > .copy {
154
+ height: 25px;
155
+ width: 25px;
156
+ min-width: 0;
157
+ padding: 0;
158
+ color: #9397a1;
159
+ }
160
+ }
161
+ `;var me={},Ye;function Ge(){return Ye||(Ye=1,function(g){g.isInteger=u=>typeof u=="number"?Number.isInteger(u):typeof u=="string"&&u.trim()!==""?Number.isInteger(Number(u)):!1,g.find=(u,y)=>u.nodes.find(R=>R.type===y),g.exceedsLimit=(u,y,R=1,x)=>x===!1||!g.isInteger(u)||!g.isInteger(y)?!1:(Number(y)-Number(u))/Number(R)>=x,g.escapeNode=(u,y=0,R)=>{const x=u.nodes[y];x&&(R&&x.type===R||x.type==="open"||x.type==="close")&&x.escaped!==!0&&(x.value="\\"+x.value,x.escaped=!0)},g.encloseBrace=u=>u.type!=="brace"?!1:u.commas>>0+u.ranges>>0===0?(u.invalid=!0,!0):!1,g.isInvalidBrace=u=>u.type!=="brace"?!1:u.invalid===!0||u.dollar?!0:u.commas>>0+u.ranges>>0===0||u.open!==!0||u.close!==!0?(u.invalid=!0,!0):!1,g.isOpenOrClose=u=>u.type==="open"||u.type==="close"?!0:u.open===!0||u.close===!0,g.reduce=u=>u.reduce((y,R)=>(R.type==="text"&&y.push(R.value),R.type==="range"&&(R.type="text"),y),[]),g.flatten=(...u)=>{const y=[],R=x=>{for(let b=0;b<x.length;b++){const n=x[b];if(Array.isArray(n)){R(n);continue}n!==void 0&&y.push(n)}return y};return R(u),y}}(me)),me}var ye,Pe;function Ve(){if(Pe)return ye;Pe=1;const g=Ge();return ye=(u,y={})=>{const R=(x,b={})=>{const n=y.escapeInvalid&&g.isInvalidBrace(b),e=x.invalid===!0&&y.escapeInvalid===!0;let t="";if(x.value)return(n||e)&&g.isOpenOrClose(x)?"\\"+x.value:x.value;if(x.value)return x.value;if(x.nodes)for(const a of x.nodes)t+=R(a);return t};return R(u)},ye}/*!
162
+ * is-number <https://github.com/jonschlinkert/is-number>
163
+ *
164
+ * Copyright (c) 2014-present, Jon Schlinkert.
165
+ * Released under the MIT License.
166
+ */var be,Ue;function ur(){return Ue||(Ue=1,be=function(g){return typeof g=="number"?g-g===0:typeof g=="string"&&g.trim()!==""?Number.isFinite?Number.isFinite(+g):isFinite(+g):!1}),be}/*!
167
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
168
+ *
169
+ * Copyright (c) 2015-present, Jon Schlinkert.
170
+ * Released under the MIT License.
171
+ */var we,ze;function lr(){if(ze)return we;ze=1;const g=ur(),u=(d,A,w)=>{if(g(d)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(A===void 0||d===A)return String(d);if(g(A)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...w};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let C=String(r.relaxZeros),l=String(r.shorthand),v=String(r.capture),p=String(r.wrap),h=d+":"+A+"="+C+l+v+p;if(u.cache.hasOwnProperty(h))return u.cache[h].result;let I=Math.min(d,A),H=Math.max(d,A);if(Math.abs(I-H)===1){let Z=d+"|"+A;return r.capture?`(${Z})`:r.wrap===!1?Z:`(?:${Z})`}let N=T(d)||T(A),Q={min:d,max:A,a:I,b:H},m=[],V=[];if(N&&(Q.isPadded=N,Q.maxLen=String(Q.max).length),I<0){let Z=H<0?Math.abs(H):1;V=b(Z,Math.abs(I),Q,r),I=Q.a=0}return H>=0&&(m=b(I,H,Q,r)),Q.negatives=V,Q.positives=m,Q.result=y(V,m),r.capture===!0?Q.result=`(${Q.result})`:r.wrap!==!1&&m.length+V.length>1&&(Q.result=`(?:${Q.result})`),u.cache[h]=Q,Q.result};function y(d,A,w){let r=n(d,A,"-",!1)||[],C=n(A,d,"",!1)||[],l=n(d,A,"-?",!0)||[];return r.concat(l).concat(C).join("|")}function R(d,A){let w=1,r=1,C=i(d,w),l=new Set([A]);for(;d<=C&&C<=A;)l.add(C),w+=1,C=i(d,w);for(C=E(A+1,r)-1;d<C&&C<=A;)l.add(C),r+=1,C=E(A+1,r)-1;return l=[...l],l.sort(t),l}function x(d,A,w){if(d===A)return{pattern:d,count:[],digits:0};let r=e(d,A),C=r.length,l="",v=0;for(let p=0;p<C;p++){let[h,I]=r[p];h===I?l+=h:h!=="0"||I!=="9"?l+=_(h,I):v++}return v&&(l+=w.shorthand===!0?"\\d":"[0-9]"),{pattern:l,count:[v],digits:C}}function b(d,A,w,r){let C=R(d,A),l=[],v=d,p;for(let h=0;h<C.length;h++){let I=C[h],H=x(String(v),String(I),r),N="";if(!w.isPadded&&p&&p.pattern===H.pattern){p.count.length>1&&p.count.pop(),p.count.push(H.count[0]),p.string=p.pattern+s(p.count),v=I+1;continue}w.isPadded&&(N=M(I,w,r)),H.string=N+H.pattern+s(H.count),l.push(H),v=I+1,p=H}return l}function n(d,A,w,r,C){let l=[];for(let v of d){let{string:p}=v;!r&&!a(A,"string",p)&&l.push(w+p),r&&a(A,"string",p)&&l.push(w+p)}return l}function e(d,A){let w=[];for(let r=0;r<d.length;r++)w.push([d[r],A[r]]);return w}function t(d,A){return d>A?1:A>d?-1:0}function a(d,A,w){return d.some(r=>r[A]===w)}function i(d,A){return Number(String(d).slice(0,-A)+"9".repeat(A))}function E(d,A){return d-d%Math.pow(10,A)}function s(d){let[A=0,w=""]=d;return w||A>1?`{${A+(w?","+w:"")}}`:""}function _(d,A,w){return`[${d}${A-d===1?"":"-"}${A}]`}function T(d){return/^-?(0+)\d/.test(d)}function M(d,A,w){if(!A.isPadded)return d;let r=Math.abs(A.maxLen-String(d).length),C=w.relaxZeros!==!1;switch(r){case 0:return"";case 1:return C?"0?":"0";case 2:return C?"0{0,2}":"00";default:return C?`0{0,${r}}`:`0{${r}}`}}return u.cache={},u.clearCache=()=>u.cache={},we=u,we}/*!
172
+ * fill-range <https://github.com/jonschlinkert/fill-range>
173
+ *
174
+ * Copyright (c) 2014-present, Jon Schlinkert.
175
+ * Licensed under the MIT License.
176
+ */var ve,Ke;function gt(){if(Ke)return ve;Ke=1;const g=ft(),u=lr(),y=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),R=r=>C=>r===!0?Number(C):String(C),x=r=>typeof r=="number"||typeof r=="string"&&r!=="",b=r=>Number.isInteger(+r),n=r=>{let C=`${r}`,l=-1;if(C[0]==="-"&&(C=C.slice(1)),C==="0")return!1;for(;C[++l]==="0";);return l>0},e=(r,C,l)=>typeof r=="string"||typeof C=="string"?!0:l.stringify===!0,t=(r,C,l)=>{if(C>0){let v=r[0]==="-"?"-":"";v&&(r=r.slice(1)),r=v+r.padStart(v?C-1:C,"0")}return l===!1?String(r):r},a=(r,C)=>{let l=r[0]==="-"?"-":"";for(l&&(r=r.slice(1),C--);r.length<C;)r="0"+r;return l?"-"+r:r},i=(r,C,l)=>{r.negatives.sort((H,N)=>H<N?-1:H>N?1:0),r.positives.sort((H,N)=>H<N?-1:H>N?1:0);let v=C.capture?"":"?:",p="",h="",I;return r.positives.length&&(p=r.positives.map(H=>a(String(H),l)).join("|")),r.negatives.length&&(h=`-(${v}${r.negatives.map(H=>a(String(H),l)).join("|")})`),p&&h?I=`${p}|${h}`:I=p||h,C.wrap?`(${v}${I})`:I},E=(r,C,l,v)=>{if(l)return u(r,C,{wrap:!1,...v});let p=String.fromCharCode(r);if(r===C)return p;let h=String.fromCharCode(C);return`[${p}-${h}]`},s=(r,C,l)=>{if(Array.isArray(r)){let v=l.wrap===!0,p=l.capture?"":"?:";return v?`(${p}${r.join("|")})`:r.join("|")}return u(r,C,l)},_=(...r)=>new RangeError("Invalid range arguments: "+g.inspect(...r)),T=(r,C,l)=>{if(l.strictRanges===!0)throw _([r,C]);return[]},M=(r,C)=>{if(C.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},d=(r,C,l=1,v={})=>{let p=Number(r),h=Number(C);if(!Number.isInteger(p)||!Number.isInteger(h)){if(v.strictRanges===!0)throw _([r,C]);return[]}p===0&&(p=0),h===0&&(h=0);let I=p>h,H=String(r),N=String(C),Q=String(l);l=Math.max(Math.abs(l),1);let m=n(H)||n(N)||n(Q),V=m?Math.max(H.length,N.length,Q.length):0,Z=m===!1&&e(r,C,v)===!1,j=v.transform||R(Z);if(v.toRegex&&l===1)return E(a(r,V),a(C,V),!0,v);let q={negatives:[],positives:[]},k=c=>q[c<0?"negatives":"positives"].push(Math.abs(c)),ae=[],P=0;for(;I?p>=h:p<=h;)v.toRegex===!0&&l>1?k(p):ae.push(t(j(p,P),V,Z)),p=I?p-l:p+l,P++;return v.toRegex===!0?l>1?i(q,v,V):s(ae,null,{wrap:!1,...v}):ae},A=(r,C,l=1,v={})=>{if(!b(r)&&r.length>1||!b(C)&&C.length>1)return T(r,C,v);let p=v.transform||(Z=>String.fromCharCode(Z)),h=`${r}`.charCodeAt(0),I=`${C}`.charCodeAt(0),H=h>I,N=Math.min(h,I),Q=Math.max(h,I);if(v.toRegex&&l===1)return E(N,Q,!1,v);let m=[],V=0;for(;H?h>=I:h<=I;)m.push(p(h,V)),h=H?h-l:h+l,V++;return v.toRegex===!0?s(m,null,{wrap:!1,options:v}):m},w=(r,C,l,v={})=>{if(C==null&&x(r))return[r];if(!x(r)||!x(C))return T(r,C,v);if(typeof l=="function")return w(r,C,1,{transform:l});if(y(l))return w(r,C,0,l);let p={...v};return p.capture===!0&&(p.wrap=!0),l=l||p.step||1,b(l)?b(r)&&b(C)?d(r,C,l,p):A(r,C,Math.max(Math.abs(l),1),p):l!=null&&!y(l)?M(l,p):w(r,C,1,l)};return ve=w,ve}var Se,Xe;function cr(){if(Xe)return Se;Xe=1;const g=gt(),u=Ge();return Se=(R,x={})=>{const b=(n,e={})=>{const t=u.isInvalidBrace(e),a=n.invalid===!0&&x.escapeInvalid===!0,i=t===!0||a===!0,E=x.escapeInvalid===!0?"\\":"";let s="";if(n.isOpen===!0)return E+n.value;if(n.isClose===!0)return console.log("node.isClose",E,n.value),E+n.value;if(n.type==="open")return i?E+n.value:"(";if(n.type==="close")return i?E+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":i?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const _=u.reduce(n.nodes),T=g(..._,{...x,wrap:!1,toRegex:!0,strictZeros:!0});if(T.length!==0)return _.length>1&&T.length>1?`(${T})`:T}if(n.nodes)for(const _ of n.nodes)s+=b(_,n);return s};return b(R)},Se}var Ie,$e;function fr(){if($e)return Ie;$e=1;const g=gt(),u=Ve(),y=Ge(),R=(b="",n="",e=!1)=>{const t=[];if(b=[].concat(b),n=[].concat(n),!n.length)return b;if(!b.length)return e?y.flatten(n).map(a=>`{${a}}`):n;for(const a of b)if(Array.isArray(a))for(const i of a)t.push(R(i,n,e));else for(let i of n)e===!0&&typeof i=="string"&&(i=`{${i}}`),t.push(Array.isArray(i)?R(a,i,e):a+i);return y.flatten(t)};return Ie=(b,n={})=>{const e=n.rangeLimit===void 0?1e3:n.rangeLimit,t=(a,i={})=>{a.queue=[];let E=i,s=i.queue;for(;E.type!=="brace"&&E.type!=="root"&&E.parent;)E=E.parent,s=E.queue;if(a.invalid||a.dollar){s.push(R(s.pop(),u(a,n)));return}if(a.type==="brace"&&a.invalid!==!0&&a.nodes.length===2){s.push(R(s.pop(),["{}"]));return}if(a.nodes&&a.ranges>0){const d=y.reduce(a.nodes);if(y.exceedsLimit(...d,n.step,e))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let A=g(...d,n);A.length===0&&(A=u(a,n)),s.push(R(s.pop(),A)),a.nodes=[];return}const _=y.encloseBrace(a);let T=a.queue,M=a;for(;M.type!=="brace"&&M.type!=="root"&&M.parent;)M=M.parent,T=M.queue;for(let d=0;d<a.nodes.length;d++){const A=a.nodes[d];if(A.type==="comma"&&a.type==="brace"){d===1&&T.push(""),T.push("");continue}if(A.type==="close"){s.push(R(s.pop(),T,_));continue}if(A.value&&A.type!=="open"){T.push(R(T.pop(),A.value));continue}A.nodes&&t(A,a)}return T};return y.flatten(t(b))},Ie}var Le,Je;function pr(){return Je||(Je=1,Le={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
177
+ `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),Le}var Be,et;function Ar(){if(et)return Be;et=1;const g=Ve(),{MAX_LENGTH:u,CHAR_BACKSLASH:y,CHAR_BACKTICK:R,CHAR_COMMA:x,CHAR_DOT:b,CHAR_LEFT_PARENTHESES:n,CHAR_RIGHT_PARENTHESES:e,CHAR_LEFT_CURLY_BRACE:t,CHAR_RIGHT_CURLY_BRACE:a,CHAR_LEFT_SQUARE_BRACKET:i,CHAR_RIGHT_SQUARE_BRACKET:E,CHAR_DOUBLE_QUOTE:s,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:T,CHAR_ZERO_WIDTH_NOBREAK_SPACE:M}=pr();return Be=(A,w={})=>{if(typeof A!="string")throw new TypeError("Expected a string");const r=w||{},C=typeof r.maxLength=="number"?Math.min(u,r.maxLength):u;if(A.length>C)throw new SyntaxError(`Input length (${A.length}), exceeds max characters (${C})`);const l={type:"root",input:A,nodes:[]},v=[l];let p=l,h=l,I=0;const H=A.length;let N=0,Q=0,m;const V=()=>A[N++],Z=j=>{if(j.type==="text"&&h.type==="dot"&&(h.type="text"),h&&h.type==="text"&&j.type==="text"){h.value+=j.value;return}return p.nodes.push(j),j.parent=p,j.prev=h,h=j,j};for(Z({type:"bos"});N<H;)if(p=v[v.length-1],m=V(),!(m===M||m===T)){if(m===y){Z({type:"text",value:(w.keepEscaping?m:"")+V()});continue}if(m===E){Z({type:"text",value:"\\"+m});continue}if(m===i){I++;let j;for(;N<H&&(j=V());){if(m+=j,j===i){I++;continue}if(j===y){m+=V();continue}if(j===E&&(I--,I===0))break}Z({type:"text",value:m});continue}if(m===n){p=Z({type:"paren",nodes:[]}),v.push(p),Z({type:"text",value:m});continue}if(m===e){if(p.type!=="paren"){Z({type:"text",value:m});continue}p=v.pop(),Z({type:"text",value:m}),p=v[v.length-1];continue}if(m===s||m===_||m===R){const j=m;let q;for(w.keepQuotes!==!0&&(m="");N<H&&(q=V());){if(q===y){m+=q+V();continue}if(q===j){w.keepQuotes===!0&&(m+=q);break}m+=q}Z({type:"text",value:m});continue}if(m===t){Q++;const q={type:"brace",open:!0,close:!1,dollar:h.value&&h.value.slice(-1)==="$"||p.dollar===!0,depth:Q,commas:0,ranges:0,nodes:[]};p=Z(q),v.push(p),Z({type:"open",value:m});continue}if(m===a){if(p.type!=="brace"){Z({type:"text",value:m});continue}const j="close";p=v.pop(),p.close=!0,Z({type:j,value:m}),Q--,p=v[v.length-1];continue}if(m===x&&Q>0){if(p.ranges>0){p.ranges=0;const j=p.nodes.shift();p.nodes=[j,{type:"text",value:g(p)}]}Z({type:"comma",value:m}),p.commas++;continue}if(m===b&&Q>0&&p.commas===0){const j=p.nodes;if(Q===0||j.length===0){Z({type:"text",value:m});continue}if(h.type==="dot"){if(p.range=[],h.value+=m,h.type="range",p.nodes.length!==3&&p.nodes.length!==5){p.invalid=!0,p.ranges=0,h.type="text";continue}p.ranges++,p.args=[];continue}if(h.type==="range"){j.pop();const q=j[j.length-1];q.value+=h.value+m,h=q,p.ranges--;continue}Z({type:"dot",value:m});continue}Z({type:"text",value:m})}do if(p=v.pop(),p.type!=="root"){p.nodes.forEach(k=>{k.nodes||(k.type==="open"&&(k.isOpen=!0),k.type==="close"&&(k.isClose=!0),k.nodes||(k.type="text"),k.invalid=!0)});const j=v[v.length-1],q=j.nodes.indexOf(p);j.nodes.splice(q,1,...p.nodes)}while(v.length>0);return Z({type:"eos"}),l},Be}var Te,tt;function gr(){if(tt)return Te;tt=1;const g=Ve(),u=cr(),y=fr(),R=Ar(),x=(b,n={})=>{let e=[];if(Array.isArray(b))for(const t of b){const a=x.create(t,n);Array.isArray(a)?e.push(...a):e.push(a)}else e=[].concat(x.create(b,n));return n&&n.expand===!0&&n.nodupes===!0&&(e=[...new Set(e)]),e};return x.parse=(b,n={})=>R(b,n),x.stringify=(b,n={})=>g(typeof b=="string"?x.parse(b,n):b,n),x.compile=(b,n={})=>(typeof b=="string"&&(b=x.parse(b,n)),u(b,n)),x.expand=(b,n={})=>{typeof b=="string"&&(b=x.parse(b,n));let e=y(b,n);return n.noempty===!0&&(e=e.filter(Boolean)),n.nodupes===!0&&(e=[...new Set(e)]),e},x.create=(b,n={})=>b===""||b.length<3?[b]:n.expand!==!0?x.compile(b,n):x.expand(b,n),Te=x,Te}var _e={},He,rt;function de(){if(rt)return He;rt=1;const g=je(),u="\\\\/",y=`[^${u}]`,R="\\.",x="\\+",b="\\?",n="\\/",e="(?=.)",t="[^/]",a=`(?:${n}|$)`,i=`(?:^|${n})`,E=`${R}{1,2}${a}`,s=`(?!${R})`,_=`(?!${i}${E})`,T=`(?!${R}{0,1}${a})`,M=`(?!${E})`,d=`[^.${n}]`,A=`${t}*?`,w={DOT_LITERAL:R,PLUS_LITERAL:x,QMARK_LITERAL:b,SLASH_LITERAL:n,ONE_CHAR:e,QMARK:t,END_ANCHOR:a,DOTS_SLASH:E,NO_DOT:s,NO_DOTS:_,NO_DOT_SLASH:T,NO_DOTS_SLASH:M,QMARK_NO_DOT:d,STAR:A,START_ANCHOR:i},r={...w,SLASH_LITERAL:`[${u}]`,QMARK:y,STAR:`${y}*?`,DOTS_SLASH:`${R}{1,2}(?:[${u}]|$)`,NO_DOT:`(?!${R})`,NO_DOTS:`(?!(?:^|[${u}])${R}{1,2}(?:[${u}]|$))`,NO_DOT_SLASH:`(?!${R}{0,1}(?:[${u}]|$))`,NO_DOTS_SLASH:`(?!${R}{1,2}(?:[${u}]|$))`,QMARK_NO_DOT:`[^.${u}]`,START_ANCHOR:`(?:^|[${u}])`,END_ANCHOR:`(?:[${u}]|$)`},C={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return He={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:C,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:g.sep,extglobChars(l){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${l.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(l){return l===!0?r:w}},He}var nt;function Ce(){return nt||(nt=1,function(g){const u=je(),y=Fe.platform==="win32",{REGEX_BACKSLASH:R,REGEX_REMOVE_BACKSLASH:x,REGEX_SPECIAL_CHARS:b,REGEX_SPECIAL_CHARS_GLOBAL:n}=de();g.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),g.hasRegexChars=e=>b.test(e),g.isRegexChar=e=>e.length===1&&g.hasRegexChars(e),g.escapeRegex=e=>e.replace(n,"\\$1"),g.toPosixSlashes=e=>e.replace(R,"/"),g.removeBackslashes=e=>e.replace(x,t=>t==="\\"?"":t),g.supportsLookbehinds=()=>{const e=Fe.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10},g.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:y===!0||u.sep==="\\",g.escapeLast=(e,t,a)=>{const i=e.lastIndexOf(t,a);return i===-1?e:e[i-1]==="\\"?g.escapeLast(e,t,i-1):`${e.slice(0,i)}\\${e.slice(i)}`},g.removePrefix=(e,t={})=>{let a=e;return a.startsWith("./")&&(a=a.slice(2),t.prefix="./"),a},g.wrapOutput=(e,t={},a={})=>{const i=a.contains?"":"^",E=a.contains?"":"$";let s=`${i}(?:${e})${E}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}}(_e)),_e}var Oe,st;function hr(){if(st)return Oe;st=1;const g=Ce(),{CHAR_ASTERISK:u,CHAR_AT:y,CHAR_BACKWARD_SLASH:R,CHAR_COMMA:x,CHAR_DOT:b,CHAR_EXCLAMATION_MARK:n,CHAR_FORWARD_SLASH:e,CHAR_LEFT_CURLY_BRACE:t,CHAR_LEFT_PARENTHESES:a,CHAR_LEFT_SQUARE_BRACKET:i,CHAR_PLUS:E,CHAR_QUESTION_MARK:s,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:T,CHAR_RIGHT_SQUARE_BRACKET:M}=de(),d=r=>r===e||r===R,A=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)};return Oe=(r,C)=>{const l=C||{},v=r.length-1,p=l.parts===!0||l.scanToEnd===!0,h=[],I=[],H=[];let N=r,Q=-1,m=0,V=0,Z=!1,j=!1,q=!1,k=!1,ae=!1,P=!1,c=!1,ee=!1,ie=!1,J=!1,o=0,f,D,W={value:"",depth:0,isGlob:!1};const ne=()=>Q>=v,ue=()=>N.charCodeAt(Q+1),U=()=>(f=D,N.charCodeAt(++Q));for(;Q<v;){D=U();let O;if(D===R){c=W.backslashes=!0,D=U(),D===t&&(P=!0);continue}if(P===!0||D===t){for(o++;ne()!==!0&&(D=U());){if(D===R){c=W.backslashes=!0,U();continue}if(D===t){o++;continue}if(P!==!0&&D===b&&(D=U())===b){if(Z=W.isBrace=!0,q=W.isGlob=!0,J=!0,p===!0)continue;break}if(P!==!0&&D===x){if(Z=W.isBrace=!0,q=W.isGlob=!0,J=!0,p===!0)continue;break}if(D===_&&(o--,o===0)){P=!1,Z=W.isBrace=!0,J=!0;break}}if(p===!0)continue;break}if(D===e){if(h.push(Q),I.push(W),W={value:"",depth:0,isGlob:!1},J===!0)continue;if(f===b&&Q===m+1){m+=2;continue}V=Q+1;continue}if(l.noext!==!0&&(D===E||D===y||D===u||D===s||D===n)===!0&&ue()===a){if(q=W.isGlob=!0,k=W.isExtglob=!0,J=!0,D===n&&Q===m&&(ie=!0),p===!0){for(;ne()!==!0&&(D=U());){if(D===R){c=W.backslashes=!0,D=U();continue}if(D===T){q=W.isGlob=!0,J=!0;break}}continue}break}if(D===u){if(f===u&&(ae=W.isGlobstar=!0),q=W.isGlob=!0,J=!0,p===!0)continue;break}if(D===s){if(q=W.isGlob=!0,J=!0,p===!0)continue;break}if(D===i){for(;ne()!==!0&&(O=U());){if(O===R){c=W.backslashes=!0,U();continue}if(O===M){j=W.isBracket=!0,q=W.isGlob=!0,J=!0;break}}if(p===!0)continue;break}if(l.nonegate!==!0&&D===n&&Q===m){ee=W.negated=!0,m++;continue}if(l.noparen!==!0&&D===a){if(q=W.isGlob=!0,p===!0){for(;ne()!==!0&&(D=U());){if(D===a){c=W.backslashes=!0,D=U();continue}if(D===T){J=!0;break}}continue}break}if(q===!0){if(J=!0,p===!0)continue;break}}l.noext===!0&&(k=!1,q=!1);let z=N,fe="",oe="";m>0&&(fe=N.slice(0,m),N=N.slice(m),V-=m),z&&q===!0&&V>0?(z=N.slice(0,V),oe=N.slice(V)):q===!0?(z="",oe=N):z=N,z&&z!==""&&z!=="/"&&z!==N&&d(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),l.unescape===!0&&(oe&&(oe=g.removeBackslashes(oe)),z&&c===!0&&(z=g.removeBackslashes(z)));const te={prefix:fe,input:r,start:m,base:z,glob:oe,isBrace:Z,isBracket:j,isGlob:q,isExtglob:k,isGlobstar:ae,negated:ee,negatedExtglob:ie};if(l.tokens===!0&&(te.maxDepth=0,d(D)||I.push(W),te.tokens=I),l.parts===!0||l.tokens===!0){let O;for(let X=0;X<h.length;X++){const xe=O?O+1:m,L=h[X],F=r.slice(xe,L);l.tokens&&(X===0&&m!==0?(I[X].isPrefix=!0,I[X].value=fe):I[X].value=F,A(I[X]),te.maxDepth+=I[X].depth),(X!==0||F!=="")&&H.push(F),O=L}if(O&&O+1<r.length){const X=r.slice(O+1);H.push(X),l.tokens&&(I[I.length-1].value=X,A(I[I.length-1]),te.maxDepth+=I[I.length-1].depth)}te.slashes=h,te.parts=H}return te},Oe}var Ne,at;function dr(){if(at)return Ne;at=1;const g=de(),u=Ce(),{MAX_LENGTH:y,POSIX_REGEX_SOURCE:R,REGEX_NON_SPECIAL_CHARS:x,REGEX_SPECIAL_CHARS_BACKREF:b,REPLACEMENTS:n}=g,e=(i,E)=>{if(typeof E.expandRange=="function")return E.expandRange(...i,E);i.sort();const s=`[${i.join("-")}]`;try{new RegExp(s)}catch{return i.map(T=>u.escapeRegex(T)).join("..")}return s},t=(i,E)=>`Missing ${i}: "${E}" - use "\\\\${E}" to match literal characters`,a=(i,E)=>{if(typeof i!="string")throw new TypeError("Expected a string");i=n[i]||i;const s={...E},_=typeof s.maxLength=="number"?Math.min(y,s.maxLength):y;let T=i.length;if(T>_)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${_}`);const M={type:"bos",value:"",output:s.prepend||""},d=[M],A=s.capture?"":"?:",w=u.isWindows(E),r=g.globChars(w),C=g.extglobChars(r),{DOT_LITERAL:l,PLUS_LITERAL:v,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:I,NO_DOT:H,NO_DOT_SLASH:N,NO_DOTS_SLASH:Q,QMARK:m,QMARK_NO_DOT:V,STAR:Z,START_ANCHOR:j}=r,q=L=>`(${A}(?:(?!${j}${L.dot?I:l}).)*?)`,k=s.dot?"":H,ae=s.dot?m:V;let P=s.bash===!0?q(s):Z;s.capture&&(P=`(${P})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const c={input:i,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:d};i=u.removePrefix(i,c),T=i.length;const ee=[],ie=[],J=[];let o=M,f;const D=()=>c.index===T-1,W=c.peek=(L=1)=>i[c.index+L],ne=c.advance=()=>i[++c.index]||"",ue=()=>i.slice(c.index+1),U=(L="",F=0)=>{c.consumed+=L,c.index+=F},z=L=>{c.output+=L.output!=null?L.output:L.value,U(L.value)},fe=()=>{let L=1;for(;W()==="!"&&(W(2)!=="("||W(3)==="?");)ne(),c.start++,L++;return L%2===0?!1:(c.negated=!0,c.start++,!0)},oe=L=>{c[L]++,J.push(L)},te=L=>{c[L]--,J.pop()},O=L=>{if(o.type==="globstar"){const F=c.braces>0&&(L.type==="comma"||L.type==="brace"),S=L.extglob===!0||ee.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!F&&!S&&(c.output=c.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=P,c.output+=o.output)}if(ee.length&&L.type!=="paren"&&(ee[ee.length-1].inner+=L.value),(L.value||L.output)&&z(L),o&&o.type==="text"&&L.type==="text"){o.value+=L.value,o.output=(o.output||"")+L.value;return}L.prev=o,d.push(L),o=L},X=(L,F)=>{const S={...C[F],conditions:1,inner:""};S.prev=o,S.parens=c.parens,S.output=c.output;const G=(s.capture?"(":"")+S.open;oe("parens"),O({type:L,value:F,output:c.output?"":h}),O({type:"paren",extglob:!0,value:ne(),output:G}),ee.push(S)},xe=L=>{let F=L.close+(s.capture?")":""),S;if(L.type==="negate"){let G=P;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(G=q(s)),(G!==P||D()||/^\)+$/.test(ue()))&&(F=L.close=`)$))${G}`),L.inner.includes("*")&&(S=ue())&&/^\.[^\\/.]+$/.test(S)){const Y=a(S,{...E,fastpaths:!1}).output;F=L.close=`)${Y})${G})`}L.prev.type==="bos"&&(c.negatedExtglob=!0)}O({type:"paren",extglob:!0,value:f,output:F}),te("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(i)){let L=!1,F=i.replace(b,(S,G,Y,re,$,Ee)=>re==="\\"?(L=!0,S):re==="?"?G?G+re+($?m.repeat($.length):""):Ee===0?ae+($?m.repeat($.length):""):m.repeat(Y.length):re==="."?l.repeat(Y.length):re==="*"?G?G+re+($?P:""):P:G?S:`\\${S}`);return L===!0&&(s.unescape===!0?F=F.replace(/\\/g,""):F=F.replace(/\\+/g,S=>S.length%2===0?"\\\\":S?"\\":"")),F===i&&s.contains===!0?(c.output=i,c):(c.output=u.wrapOutput(F,c,E),c)}for(;!D();){if(f=ne(),f==="\0")continue;if(f==="\\"){const S=W();if(S==="/"&&s.bash!==!0||S==="."||S===";")continue;if(!S){f+="\\",O({type:"text",value:f});continue}const G=/^\\+/.exec(ue());let Y=0;if(G&&G[0].length>2&&(Y=G[0].length,c.index+=Y,Y%2!==0&&(f+="\\")),s.unescape===!0?f=ne():f+=ne(),c.brackets===0){O({type:"text",value:f});continue}}if(c.brackets>0&&(f!=="]"||o.value==="["||o.value==="[^")){if(s.posix!==!1&&f===":"){const S=o.value.slice(1);if(S.includes("[")&&(o.posix=!0,S.includes(":"))){const G=o.value.lastIndexOf("["),Y=o.value.slice(0,G),re=o.value.slice(G+2),$=R[re];if($){o.value=Y+$,c.backtrack=!0,ne(),!M.output&&d.indexOf(o)===1&&(M.output=h);continue}}}(f==="["&&W()!==":"||f==="-"&&W()==="]")&&(f=`\\${f}`),f==="]"&&(o.value==="["||o.value==="[^")&&(f=`\\${f}`),s.posix===!0&&f==="!"&&o.value==="["&&(f="^"),o.value+=f,z({value:f});continue}if(c.quotes===1&&f!=='"'){f=u.escapeRegex(f),o.value+=f,z({value:f});continue}if(f==='"'){c.quotes=c.quotes===1?0:1,s.keepQuotes===!0&&O({type:"text",value:f});continue}if(f==="("){oe("parens"),O({type:"paren",value:f});continue}if(f===")"){if(c.parens===0&&s.strictBrackets===!0)throw new SyntaxError(t("opening","("));const S=ee[ee.length-1];if(S&&c.parens===S.parens+1){xe(ee.pop());continue}O({type:"paren",value:f,output:c.parens?")":"\\)"}),te("parens");continue}if(f==="["){if(s.nobracket===!0||!ue().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(t("closing","]"));f=`\\${f}`}else oe("brackets");O({type:"bracket",value:f});continue}if(f==="]"){if(s.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){O({type:"text",value:f,output:`\\${f}`});continue}if(c.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(t("opening","["));O({type:"text",value:f,output:`\\${f}`});continue}te("brackets");const S=o.value.slice(1);if(o.posix!==!0&&S[0]==="^"&&!S.includes("/")&&(f=`/${f}`),o.value+=f,z({value:f}),s.literalBrackets===!1||u.hasRegexChars(S))continue;const G=u.escapeRegex(o.value);if(c.output=c.output.slice(0,-o.value.length),s.literalBrackets===!0){c.output+=G,o.value=G;continue}o.value=`(${A}${G}|${o.value})`,c.output+=o.value;continue}if(f==="{"&&s.nobrace!==!0){oe("braces");const S={type:"brace",value:f,output:"(",outputIndex:c.output.length,tokensIndex:c.tokens.length};ie.push(S),O(S);continue}if(f==="}"){const S=ie[ie.length-1];if(s.nobrace===!0||!S){O({type:"text",value:f,output:f});continue}let G=")";if(S.dots===!0){const Y=d.slice(),re=[];for(let $=Y.length-1;$>=0&&(d.pop(),Y[$].type!=="brace");$--)Y[$].type!=="dots"&&re.unshift(Y[$].value);G=e(re,s),c.backtrack=!0}if(S.comma!==!0&&S.dots!==!0){const Y=c.output.slice(0,S.outputIndex),re=c.tokens.slice(S.tokensIndex);S.value=S.output="\\{",f=G="\\}",c.output=Y;for(const $ of re)c.output+=$.output||$.value}O({type:"brace",value:f,output:G}),te("braces"),ie.pop();continue}if(f==="|"){ee.length>0&&ee[ee.length-1].conditions++,O({type:"text",value:f});continue}if(f===","){let S=f;const G=ie[ie.length-1];G&&J[J.length-1]==="braces"&&(G.comma=!0,S="|"),O({type:"comma",value:f,output:S});continue}if(f==="/"){if(o.type==="dot"&&c.index===c.start+1){c.start=c.index+1,c.consumed="",c.output="",d.pop(),o=M;continue}O({type:"slash",value:f,output:p});continue}if(f==="."){if(c.braces>0&&o.type==="dot"){o.value==="."&&(o.output=l);const S=ie[ie.length-1];o.type="dots",o.output+=f,o.value+=f,S.dots=!0;continue}if(c.braces+c.parens===0&&o.type!=="bos"&&o.type!=="slash"){O({type:"text",value:f,output:l});continue}O({type:"dot",value:f,output:l});continue}if(f==="?"){if(!(o&&o.value==="(")&&s.noextglob!==!0&&W()==="("&&W(2)!=="?"){X("qmark",f);continue}if(o&&o.type==="paren"){const G=W();let Y=f;if(G==="<"&&!u.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(o.value==="("&&!/[!=<:]/.test(G)||G==="<"&&!/<([!=]|\w+>)/.test(ue()))&&(Y=`\\${f}`),O({type:"text",value:f,output:Y});continue}if(s.dot!==!0&&(o.type==="slash"||o.type==="bos")){O({type:"qmark",value:f,output:V});continue}O({type:"qmark",value:f,output:m});continue}if(f==="!"){if(s.noextglob!==!0&&W()==="("&&(W(2)!=="?"||!/[!=<:]/.test(W(3)))){X("negate",f);continue}if(s.nonegate!==!0&&c.index===0){fe();continue}}if(f==="+"){if(s.noextglob!==!0&&W()==="("&&W(2)!=="?"){X("plus",f);continue}if(o&&o.value==="("||s.regex===!1){O({type:"plus",value:f,output:v});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||c.parens>0){O({type:"plus",value:f});continue}O({type:"plus",value:v});continue}if(f==="@"){if(s.noextglob!==!0&&W()==="("&&W(2)!=="?"){O({type:"at",extglob:!0,value:f,output:""});continue}O({type:"text",value:f});continue}if(f!=="*"){(f==="$"||f==="^")&&(f=`\\${f}`);const S=x.exec(ue());S&&(f+=S[0],c.index+=S[0].length),O({type:"text",value:f});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=f,o.output=P,c.backtrack=!0,c.globstar=!0,U(f);continue}let L=ue();if(s.noextglob!==!0&&/^\([^?]/.test(L)){X("star",f);continue}if(o.type==="star"){if(s.noglobstar===!0){U(f);continue}const S=o.prev,G=S.prev,Y=S.type==="slash"||S.type==="bos",re=G&&(G.type==="star"||G.type==="globstar");if(s.bash===!0&&(!Y||L[0]&&L[0]!=="/")){O({type:"star",value:f,output:""});continue}const $=c.braces>0&&(S.type==="comma"||S.type==="brace"),Ee=ee.length&&(S.type==="pipe"||S.type==="paren");if(!Y&&S.type!=="paren"&&!$&&!Ee){O({type:"star",value:f,output:""});continue}for(;L.slice(0,3)==="/**";){const Ae=i[c.index+4];if(Ae&&Ae!=="/")break;L=L.slice(3),U("/**",3)}if(S.type==="bos"&&D()){o.type="globstar",o.value+=f,o.output=q(s),c.output=o.output,c.globstar=!0,U(f);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&!re&&D()){c.output=c.output.slice(0,-(S.output+o.output).length),S.output=`(?:${S.output}`,o.type="globstar",o.output=q(s)+(s.strictSlashes?")":"|$)"),o.value+=f,c.globstar=!0,c.output+=S.output+o.output,U(f);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&L[0]==="/"){const Ae=L[1]!==void 0?"|$":"";c.output=c.output.slice(0,-(S.output+o.output).length),S.output=`(?:${S.output}`,o.type="globstar",o.output=`${q(s)}${p}|${p}${Ae})`,o.value+=f,c.output+=S.output+o.output,c.globstar=!0,U(f+ne()),O({type:"slash",value:"/",output:""});continue}if(S.type==="bos"&&L[0]==="/"){o.type="globstar",o.value+=f,o.output=`(?:^|${p}|${q(s)}${p})`,c.output=o.output,c.globstar=!0,U(f+ne()),O({type:"slash",value:"/",output:""});continue}c.output=c.output.slice(0,-o.output.length),o.type="globstar",o.output=q(s),o.value+=f,c.output+=o.output,c.globstar=!0,U(f);continue}const F={type:"star",value:f,output:P};if(s.bash===!0){F.output=".*?",(o.type==="bos"||o.type==="slash")&&(F.output=k+F.output),O(F);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&s.regex===!0){F.output=f,O(F);continue}(c.index===c.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(c.output+=N,o.output+=N):s.dot===!0?(c.output+=Q,o.output+=Q):(c.output+=k,o.output+=k),W()!=="*"&&(c.output+=h,o.output+=h)),O(F)}for(;c.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(t("closing","]"));c.output=u.escapeLast(c.output,"["),te("brackets")}for(;c.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(t("closing",")"));c.output=u.escapeLast(c.output,"("),te("parens")}for(;c.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(t("closing","}"));c.output=u.escapeLast(c.output,"{"),te("braces")}if(s.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&O({type:"maybe_slash",value:"",output:`${p}?`}),c.backtrack===!0){c.output="";for(const L of c.tokens)c.output+=L.output!=null?L.output:L.value,L.suffix&&(c.output+=L.suffix)}return c};return a.fastpaths=(i,E)=>{const s={...E},_=typeof s.maxLength=="number"?Math.min(y,s.maxLength):y,T=i.length;if(T>_)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${_}`);i=n[i]||i;const M=u.isWindows(E),{DOT_LITERAL:d,SLASH_LITERAL:A,ONE_CHAR:w,DOTS_SLASH:r,NO_DOT:C,NO_DOTS:l,NO_DOTS_SLASH:v,STAR:p,START_ANCHOR:h}=g.globChars(M),I=s.dot?l:C,H=s.dot?v:C,N=s.capture?"":"?:",Q={negated:!1,prefix:""};let m=s.bash===!0?".*?":p;s.capture&&(m=`(${m})`);const V=k=>k.noglobstar===!0?m:`(${N}(?:(?!${h}${k.dot?r:d}).)*?)`,Z=k=>{switch(k){case"*":return`${I}${w}${m}`;case".*":return`${d}${w}${m}`;case"*.*":return`${I}${m}${d}${w}${m}`;case"*/*":return`${I}${m}${A}${w}${H}${m}`;case"**":return I+V(s);case"**/*":return`(?:${I}${V(s)}${A})?${H}${w}${m}`;case"**/*.*":return`(?:${I}${V(s)}${A})?${H}${m}${d}${w}${m}`;case"**/.*":return`(?:${I}${V(s)}${A})?${d}${w}${m}`;default:{const ae=/^(.*?)\.(\w+)$/.exec(k);if(!ae)return;const P=Z(ae[1]);return P?P+d+ae[2]:void 0}}},j=u.removePrefix(i,Q);let q=Z(j);return q&&s.strictSlashes!==!0&&(q+=`${A}?`),q},Ne=a,Ne}var Qe,it;function Cr(){if(it)return Qe;it=1;const g=je(),u=hr(),y=dr(),R=Ce(),x=de(),b=e=>e&&typeof e=="object"&&!Array.isArray(e),n=(e,t,a=!1)=>{if(Array.isArray(e)){const A=e.map(r=>n(r,t,a));return r=>{for(const C of A){const l=C(r);if(l)return l}return!1}}const i=b(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");const E=t||{},s=R.isWindows(t),_=i?n.compileRe(e,t):n.makeRe(e,t,!1,!0),T=_.state;delete _.state;let M=()=>!1;if(E.ignore){const A={...t,ignore:null,onMatch:null,onResult:null};M=n(E.ignore,A,a)}const d=(A,w=!1)=>{const{isMatch:r,match:C,output:l}=n.test(A,_,t,{glob:e,posix:s}),v={glob:e,state:T,regex:_,posix:s,input:A,output:l,match:C,isMatch:r};return typeof E.onResult=="function"&&E.onResult(v),r===!1?(v.isMatch=!1,w?v:!1):M(A)?(typeof E.onIgnore=="function"&&E.onIgnore(v),v.isMatch=!1,w?v:!1):(typeof E.onMatch=="function"&&E.onMatch(v),w?v:!0)};return a&&(d.state=T),d};return n.test=(e,t,a,{glob:i,posix:E}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const s=a||{},_=s.format||(E?R.toPosixSlashes:null);let T=e===i,M=T&&_?_(e):e;return T===!1&&(M=_?_(e):e,T=M===i),(T===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?T=n.matchBase(e,t,a,E):T=t.exec(M)),{isMatch:!!T,match:T,output:M}},n.matchBase=(e,t,a,i=R.isWindows(a))=>(t instanceof RegExp?t:n.makeRe(t,a)).test(g.basename(e)),n.isMatch=(e,t,a)=>n(t,a)(e),n.parse=(e,t)=>Array.isArray(e)?e.map(a=>n.parse(a,t)):y(e,{...t,fastpaths:!1}),n.scan=(e,t)=>u(e,t),n.compileRe=(e,t,a=!1,i=!1)=>{if(a===!0)return e.output;const E=t||{},s=E.contains?"":"^",_=E.contains?"":"$";let T=`${s}(?:${e.output})${_}`;e&&e.negated===!0&&(T=`^(?!${T}).*$`);const M=n.toRegex(T,t);return i===!0&&(M.state=e),M},n.makeRe=(e,t={},a=!1,i=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let E={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(E.output=y.fastpaths(e,t)),E.output||(E=y(e,t)),n.compileRe(E,t,a,i)},n.toRegex=(e,t)=>{try{const a=t||{};return new RegExp(e,a.flags||(a.nocase?"i":""))}catch(a){if(t&&t.debug===!0)throw a;return/$^/}},n.constants=x,Qe=n,Qe}var qe,ot;function xr(){return ot||(ot=1,qe=Cr()),qe}var Me,ut;function Er(){if(ut)return Me;ut=1;const g=ft(),u=gr(),y=xr(),R=Ce(),x=e=>e===""||e==="./",b=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},n=(e,t,a)=>{t=[].concat(t),e=[].concat(e);let i=new Set,E=new Set,s=new Set,_=0,T=A=>{s.add(A.output),a&&a.onResult&&a.onResult(A)};for(let A=0;A<t.length;A++){let w=y(String(t[A]),{...a,onResult:T},!0),r=w.state.negated||w.state.negatedExtglob;r&&_++;for(let C of e){let l=w(C,!0);(r?!l.isMatch:l.isMatch)&&(r?i.add(l.output):(i.delete(l.output),E.add(l.output)))}}let d=(_===t.length?[...s]:[...E]).filter(A=>!i.has(A));if(a&&d.length===0){if(a.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(a.nonull===!0||a.nullglob===!0)return a.unescape?t.map(A=>A.replace(/\\/g,"")):t}return d};return n.match=n,n.matcher=(e,t)=>y(e,t),n.isMatch=(e,t,a)=>y(t,a)(e),n.any=n.isMatch,n.not=(e,t,a={})=>{t=[].concat(t).map(String);let i=new Set,E=[],s=T=>{a.onResult&&a.onResult(T),E.push(T.output)},_=new Set(n(e,t,{...a,onResult:s}));for(let T of E)_.has(T)||i.add(T);return[...i]},n.contains=(e,t,a)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${g.inspect(e)}"`);if(Array.isArray(t))return t.some(i=>n.contains(e,i,a));if(typeof t=="string"){if(x(e)||x(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return n.isMatch(e,t,{...a,contains:!0})},n.matchKeys=(e,t,a)=>{if(!R.isObject(e))throw new TypeError("Expected the first argument to be an object");let i=n(Object.keys(e),t,a),E={};for(let s of i)E[s]=e[s];return E},n.some=(e,t,a)=>{let i=[].concat(e);for(let E of[].concat(t)){let s=y(String(E),a);if(i.some(_=>s(_)))return!0}return!1},n.every=(e,t,a)=>{let i=[].concat(e);for(let E of[].concat(t)){let s=y(String(E),a);if(!i.every(_=>s(_)))return!1}return!0},n.all=(e,t,a)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${g.inspect(e)}"`);return[].concat(t).every(i=>y(i,a)(e))},n.capture=(e,t,a)=>{let i=R.isWindows(a),s=y.makeRe(String(e),{...a,capture:!0}).exec(i?R.toPosixSlashes(t):t);if(s)return s.slice(1).map(_=>_===void 0?"":_)},n.makeRe=(...e)=>y.makeRe(...e),n.scan=(...e)=>y.scan(...e),n.parse=(e,t)=>{let a=[];for(let i of[].concat(e||[]))for(let E of u(String(i),t))a.push(y.parse(E,t));return a},n.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!b(e)?[e]:u(e,t)},n.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return n.braces(e,{...t,expand:!0})},n.hasBraces=b,Me=n,Me}var Rr=Er();const lt=Lt(Rr);function mr(g){const u=(window.blocklet?.preferences?.supportModels||"").trim();if(!u)return g;const y=u.split(",").map(R=>R.trim()).filter(Boolean);return y.length===0?g:g.filter(R=>{const x=`${R.provider}/${R.model}`;return lt.isMatch(x,y)||lt.isMatch(R.model,y)})}function Hr({onSelect:g,api:u,restrictions:y,i18n:R,theme:x}){const[b,n]=se.useState(),[e,t]=se.useState(!1),a=()=>n(void 0),i=()=>t(!1),E=Bt(document.body);let s=!!(E&&E.width<768);const{data:_,loading:T}=Tt(async()=>{const w=await Nt.get("/api/image/models");return mr(w.data)}),M=!s||s&&!e,d=!s||s&&e,A=s?i:!1;return B.jsx(Zt,{restrictions:y,i18n:R,theme:x,children:B.jsxs(K,{sx:{display:"flex",width:"100%",height:"100%",bgcolor:"background.default"},children:[T&&B.jsx(K,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:B.jsx(_t,{})}),!T&&B.jsxs(le,{container:!0,sx:{flexGrow:1,height:"100%",overflow:"hidden"},children:[B.jsx(le,{sx:{borderRight:s?"none":w=>`1px solid ${w.palette.divider}`,display:M?"unset":"none",overflow:"hidden",height:"100%"},size:{xs:12,sm:4},children:B.jsx(K,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:B.jsx($t,{models:_||[],onSubmit:(...w)=>{t(!0),n(...w)}})})}),B.jsx(le,{sx:{height:"100%",overflow:"hidden",p:2,display:d?"unset":"none"},size:{xs:12,sm:8},children:B.jsx(ar,{isMobile:s,options:b,handleApi:u,onSelect:g,onFinish:a,onClose:A})})]})]})})}export{Hr as default};