@abtnode/blocklet-services 1.17.7-beta-20251225-073259-cb6ecf68 → 1.17.7-beta-20251229-085620-84f09930

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 (220) hide show
  1. package/api/index.js +16 -4
  2. package/api/libs/auth/adapters/apple.js +1 -1
  3. package/api/libs/auth/adapters/auth0.js +1 -1
  4. package/api/libs/auth/adapters/github.js +1 -1
  5. package/api/libs/auth/adapters/google.js +1 -1
  6. package/api/middlewares/serve-static-engine.js +179 -0
  7. package/api/routes/env.js +3 -4
  8. package/api/routes/oauth/client.js +7 -5
  9. package/api/services/notification/queue.js +2 -2
  10. package/api/socket/channel/component.js +19 -13
  11. package/api/socket/util.js +6 -1
  12. package/dist/assets/{AdapterDayjs-BUbxoXbD.js → AdapterDayjs-DYIVeXBV.js} +1 -1
  13. package/dist/assets/{Google-Cwpw9PRe.js → Google-D9N2NN29.js} +1 -1
  14. package/dist/assets/{access-control-DwlD3_cw.js → access-control-UTVMJtLa.js} +1 -1
  15. package/dist/assets/{add-component-core-BITgGwN0.js → add-component-core-Cu9Tohbt.js} +31 -31
  16. package/dist/assets/add-resource-CqOi5S87.js +1 -0
  17. package/dist/assets/{addon-C2qdiHVb.js → addon-DSFDYYiP.js} +1 -1
  18. package/dist/assets/{advanced-BosetBVE.js → advanced-CkJs81iC.js} +1 -1
  19. package/dist/assets/{aigne-DbMeOdg9.js → aigne-Dt8mwR8G.js} +1 -1
  20. package/dist/assets/api-FQQlzPOP.js +1 -0
  21. package/dist/assets/{appearance-DhUAX-xn.js → appearance-Bs9dCa2z.js} +1 -1
  22. package/dist/assets/ar-B4BSOV5G.js +7 -0
  23. package/dist/assets/{audit-logs-BHPPGieH.js → audit-logs-Bk0Y0aey.js} +3 -3
  24. package/dist/assets/{authorize-Dfo70g1t.js → authorize-C6B5tUkA.js} +1 -1
  25. package/dist/assets/{base-chart-Cs8rd9f2.js → base-chart-ChBZtUEG.js} +1 -1
  26. package/dist/assets/{base32-CXgP3JJ5.js → base32-BccrNIeO.js} +1 -1
  27. package/dist/assets/{bind-account-Drs3IDFN.js → bind-account-CLV9q3E3.js} +1 -1
  28. package/dist/assets/branding-BGRUKKNR.js +1 -0
  29. package/dist/assets/{branding-ByK6n-fM.js → branding-Cwk5a8ly.js} +1 -1
  30. package/dist/assets/{branding-BhvacExo.js → branding-JmTDNoIq.js} +1 -1
  31. package/dist/assets/{bundle-avatar-DVOaAXid.js → bundle-avatar-CLRiyhwo.js} +1 -1
  32. package/dist/assets/{button-D6RwAFss.js → button-Bfs8GG-V.js} +1 -1
  33. package/dist/assets/{click-to-copy-B2HIKJMV.js → click-to-copy-fgcvdv-u.js} +1 -1
  34. package/dist/assets/cloneDeep-C2rlAYcK.js +1 -0
  35. package/dist/assets/{complete-Djtuko3J.js → complete-Bb_Zgfxn.js} +2 -2
  36. package/dist/assets/{component-UsgyDUkb.js → component-BEiiKeGh.js} +2 -2
  37. package/dist/assets/{config-DuS3gx_m.js → config-CAUPVWd8.js} +2 -2
  38. package/dist/assets/{config-CUYR0yDP.js → config-Crd4mTZS.js} +2 -2
  39. package/dist/assets/{config-Co1ZhGgP.js → config-DEeSuJty.js} +1 -1
  40. package/dist/assets/{config-navigation-DjF2jJY9.js → config-navigation-DcFoMJlj.js} +7 -7
  41. package/dist/assets/{config-space-zEV0JkDF.js → config-space-DVE2CBUC.js} +1 -1
  42. package/dist/assets/{confirm-DTx9f3Ke.js → confirm-BSaTCzrs.js} +1 -1
  43. package/dist/assets/{connect-nknm0LHt.js → connect-B0W5gXFT.js} +1 -1
  44. package/dist/assets/connect-ChbbAHB_.js +5 -0
  45. package/dist/assets/{connect-to-eBtGI4_9.js → connect-to-D7rrqt6m.js} +1 -1
  46. package/dist/assets/{create-passport-svg-BQhmIwWD.js → create-passport-svg-BJX-WFnl.js} +1 -1
  47. package/dist/assets/{createClass-dudiLlP7.js → createClass-CH1sG4Vj.js} +1 -1
  48. package/dist/assets/dashboard-DDFp-UB6.js +103 -0
  49. package/dist/assets/de-EFAP4yzZ.js +7 -0
  50. package/dist/assets/{delete-confirm-HiRqbh9-.js → delete-confirm-BzmT7bQV.js} +1 -1
  51. package/dist/assets/{did-address-DqhneWXa.js → did-address-cHTriZHu.js} +1 -1
  52. package/dist/assets/{domain-Xaa2OTQZ.js → domain-CLaCd92M.js} +1 -1
  53. package/dist/assets/{domain-action-card-BzceZepB.js → domain-action-card-ClVrHE96.js} +2 -2
  54. package/dist/assets/domains-C5X5bi_z.js +1 -0
  55. package/dist/assets/edit-rounded-CnMn6J-D.js +1 -0
  56. package/dist/assets/{email-CaObtYNf.js → email-DddZUTON.js} +2 -2
  57. package/dist/assets/engine-CvmlyswD.js +1 -0
  58. package/dist/assets/es-BqFCfGn2.js +9 -0
  59. package/dist/assets/{exchange-passport-BA6t_lld.js → exchange-passport-CKEOdyU9.js} +1 -1
  60. package/dist/assets/{form-DNo4HCRt.js → form-poId1OU3.js} +1 -1
  61. package/dist/assets/{form-text-input-BjQKx89L.js → form-text-input-DwerOWgK.js} +1 -1
  62. package/dist/assets/fr-CksqMtzK.js +7 -0
  63. package/dist/assets/{fuel-Cr5W3cGy.js → fuel-Bly8lXId.js} +1 -1
  64. package/dist/assets/{gen-access-key-Bw62ox39.js → gen-access-key-5kekGzt_.js} +1 -1
  65. package/dist/assets/{gen-simple-access-key-QTWh5kxW.js → gen-simple-access-key-l4SGe3J5.js} +1 -1
  66. package/dist/assets/get-safe-url-D7ti-zln.js +1 -0
  67. package/dist/assets/hi-Bztwk-sg.js +5 -0
  68. package/dist/assets/{hi-DNSN9klG.js → hi-Cra5bbq9.js} +1 -1
  69. package/dist/assets/{home-iaPbLBtv.js → home-yA5fXQmP.js} +1 -1
  70. package/dist/assets/id-C5p-l7lp.js +7 -0
  71. package/dist/assets/{iframe-C8myLb4U.js → iframe-XKq6kg_r.js} +1 -1
  72. package/dist/assets/{index-CaQnmN3Y.js → index--Zp6K5Sp.js} +1 -1
  73. package/dist/assets/{index-C4nyPKIr.js → index-5haA_ZtH.js} +1 -1
  74. package/dist/assets/{index-9h1okNKA.js → index-9N4EluXF.js} +6 -6
  75. package/dist/assets/{index-D3g5TOJl.js → index-B0wPyjk9.js} +2 -2
  76. package/dist/assets/{index-SCaAOhtj.js → index-B1-cYl7K.js} +2 -2
  77. package/dist/assets/{index-DHvO7Oyu.js → index-BBwTMTLp.js} +1 -1
  78. package/dist/assets/{index-SACCniHf.js → index-BOWGgkTH.js} +4 -4
  79. package/dist/assets/{index-B7jV3her.js → index-BT901ij8.js} +1 -1
  80. package/dist/assets/index-BjqoIwBE.js +281 -0
  81. package/dist/assets/index-BotTPbWD.js +1 -0
  82. package/dist/assets/{index-C2HNVEZ0.js → index-Bt8QUMaz.js} +1 -1
  83. package/dist/assets/index-CGOBEhzW.js +1039 -0
  84. package/dist/assets/{index-BzU09Azd.js → index-CKhKxswY.js} +2 -2
  85. package/dist/assets/{index-CtJhxyJT.js → index-CQqn5TFD.js} +18 -18
  86. package/dist/assets/{index-DeG3Ee92.js → index-CSwcQdlI.js} +1 -1
  87. package/dist/assets/index-Ce9omzTp.js +1 -0
  88. package/dist/assets/{index-CzvNhDIJ.js → index-ChQX9ze3.js} +2 -2
  89. package/dist/assets/{index-BP_Fl0Mu.js → index-CiKhg0ut.js} +1 -1
  90. package/dist/assets/{index-BleAAm7x.js → index-Cu8TdzKM.js} +1 -1
  91. package/dist/assets/{index-YLno1Cst.js → index-CuC130U2.js} +3 -3
  92. package/dist/assets/{index-1azOxnKy.js → index-CvVZvUh7.js} +1 -1
  93. package/dist/assets/{index-CnWFrsC2.js → index-CzlJLWz5.js} +4 -4
  94. package/dist/assets/{index-B5vc0eG5.js → index-D1SIrheh.js} +1 -1
  95. package/dist/assets/{index-Dk6ZABgc.js → index-D95ZNJ3d.js} +1 -1
  96. package/dist/assets/{index-Dnd0o2ng.js → index-DA8b2Fwx.js} +3 -3
  97. package/dist/assets/{index-B8sa2W5r.js → index-DGd0GDc4.js} +6 -6
  98. package/dist/assets/{index-CHuKoofS.js → index-HU-v7OeI.js} +1 -1
  99. package/dist/assets/{index-Bxd7kK_i.js → index-_haoumSc.js} +1 -1
  100. package/dist/assets/{index-DURonUPJ.js → index-pm6H84lU.js} +1 -1
  101. package/dist/assets/index-tgy1TTjM.js +81 -0
  102. package/dist/assets/{index-seQ_ufVM.js → index-v9hCHxKp.js} +1 -1
  103. package/dist/assets/{invitation-DwMnPB2W.js → invitation-OInDimvS.js} +2 -2
  104. package/dist/assets/{invitations-mhxsPoWR.js → invitations-BFTtG6X1.js} +1 -1
  105. package/dist/assets/{invite-DpZe41tL.js → invite-sUgPlE4Z.js} +1 -1
  106. package/dist/assets/{isURL-CASPeQFe.js → isURL-CJrtALFi.js} +1 -1
  107. package/dist/assets/{issue-passport-ClIYXZHr.js → issue-passport-D779MB0S.js} +1 -1
  108. package/dist/assets/{item-B3LlwO_A.js → item-D0S77pRh.js} +1 -1
  109. package/dist/assets/ja-2cGMwCig.js +9 -0
  110. package/dist/assets/ko-DDVloIXx.js +9 -0
  111. package/dist/assets/{landing-page-Cv6belCa.js → landing-page-BoqVRFrg.js} +1 -1
  112. package/dist/assets/{layout-DkW-u1GX.js → layout-BumaOQ7l.js} +1 -1
  113. package/dist/assets/{list-CBP3Lj7-.js → list-Bcp4RDC0.js} +1 -1
  114. package/dist/assets/{list-Dqz9X41o.js → list-C0ACtiK5.js} +1 -1
  115. package/dist/assets/localization-DAkSbh2g.js +1 -0
  116. package/dist/assets/{log-Ch1_gOOt.js → log-CpIPOvLt.js} +1 -1
  117. package/dist/assets/logger-DUjWrC8_.js +1 -0
  118. package/dist/assets/{login-_zzURN5A.js → login-cMKzStm-.js} +1 -1
  119. package/dist/assets/{login-oauth-callback-BiIj9E0o.js → login-oauth-callback-I8wjhibA.js} +1 -1
  120. package/dist/assets/{logo-uploader-BmnoHisE.js → logo-uploader-CeXSNxdi.js} +1 -1
  121. package/dist/assets/{lost-passport-DYnJRD_t.js → lost-passport-VCPPPILz.js} +2 -2
  122. package/dist/assets/{cloneDeep-BbaR0xRl.js → omit-spWLSLbo.js} +1 -1
  123. package/dist/assets/{open-window-Btzsgc7g.js → open-window-DY3mWojp.js} +1 -1
  124. package/dist/assets/{over-due-invoice-payment-BFDFMUwK.js → over-due-invoice-payment-C9HTfbWA.js} +1 -1
  125. package/dist/assets/overview-Bv3cq2I0.js +116 -0
  126. package/dist/assets/passport-DMm48qRk.js +1 -0
  127. package/dist/assets/{passport-item-Dx140DTL.js → passport-item-DD8VG51j.js} +1 -1
  128. package/dist/assets/{permission-HtrJm1h2.js → permission-B3ddwA-4.js} +1 -1
  129. package/dist/assets/{preferences-Dri2a4fE.js → preferences-CmMbfbTw.js} +1 -1
  130. package/dist/assets/profile-embed-DAY5ZrDb.js +1 -0
  131. package/dist/assets/{pt-BPAfyek8.js → pt-BB0AKqMq.js} +1 -1
  132. package/dist/assets/pt-FIIPCfqU.js +5 -0
  133. package/dist/assets/{publish-resource-CruXcF2L.js → publish-resource-DJRigGuM.js} +1 -1
  134. package/dist/assets/{react-beautiful-dnd.esm-89LKdt03.js → react-beautiful-dnd.esm-Bn87vJFI.js} +1 -1
  135. package/dist/assets/ru-BjRgz8OF.js +5 -0
  136. package/dist/assets/{ru-CVlekA3F.js → ru-CnPeybtU.js} +1 -1
  137. package/dist/assets/{runtime-Ck_rDqm2.js → runtime-gljMK2qS.js} +1 -1
  138. package/dist/assets/{sanitize-DyRfEGVu.js → sanitize-yVk8VEIO.js} +1 -1
  139. package/dist/assets/sdk-Be-u0PfZ.js +1 -0
  140. package/dist/assets/security-b4k0fa20.js +22 -0
  141. package/dist/assets/{session-Cm8j8XeZ.js → session-vM0SwFQZ.js} +1 -1
  142. package/dist/assets/{setup-COruOAew.js → setup-BPnqbGIk.js} +1 -1
  143. package/dist/assets/simple-select-6nihrL7w.js +1 -0
  144. package/dist/assets/{spaces-BuZf3GoQ.js → spaces-ypzuCaPe.js} +1 -1
  145. package/dist/assets/{start-D_yHRXzR.js → start-CgUu2djm.js} +1 -1
  146. package/dist/assets/{starting-progress-DahUM5Xo.js → starting-progress-B15yvlvv.js} +1 -1
  147. package/dist/assets/{status-DVjLoqLm.js → status-Cy7fzuR3.js} +1 -1
  148. package/dist/assets/{step-actions-DkehnzsP.js → step-actions-D3sZvhKo.js} +1 -1
  149. package/dist/assets/{studio-D4hiQNwZ.js → studio-D9ZxOiyo.js} +1 -1
  150. package/dist/assets/{switch-CO2el_yA.js → switch-CjDalLJU.js} +1 -1
  151. package/dist/assets/{switch-control-Bw0oiZZh.js → switch-control-CioN_5qg.js} +1 -1
  152. package/dist/assets/{table-tips-C-6Sm2ed.js → table-tips-DEqFBQFt.js} +1 -1
  153. package/dist/assets/{team-DNuHMrzV.js → team-DHhtcW5C.js} +1 -1
  154. package/dist/assets/th-DKiwQ6t6.js +5 -0
  155. package/dist/assets/{traffic-B0WH67Yr.js → traffic-DDO0-htp.js} +1 -1
  156. package/dist/assets/{transfer-BpjPR3S_.js → transfer-CEk3StHa.js} +1 -1
  157. package/dist/assets/{unsubscribe-CzgQXfYP.js → unsubscribe-DZF4NKei.js} +1 -1
  158. package/dist/assets/{use-app-logo-CZWb8lrs.js → use-app-logo-DSdF3M62.js} +1 -1
  159. package/dist/assets/{use-window-close-DDL8fcOm.js → use-window-close-va-vKf7G.js} +1 -1
  160. package/dist/assets/{useAsync-VEqKX7rF.js → useAsync-DVl73fmG.js} +1 -1
  161. package/dist/assets/{useAsync-xXSiXzwr.js → useAsync-Dotoxibi.js} +1 -1
  162. package/dist/assets/{useAsyncRetry--1T7wYe2.js → useAsyncRetry-r8dEPb-x.js} +1 -1
  163. package/dist/assets/{useLocalStorage-BV1BIwfo.js → useLocalStorage-A7dcJ6ce.js} +1 -1
  164. package/dist/assets/{user-center-DndqALOV.js → user-center-C2hlh2we.js} +1 -1
  165. package/dist/assets/{user-follower-Bzb2ZR_9.js → user-follower-BmcrANUM.js} +1 -1
  166. package/dist/assets/{util-DIVJQVg1.js → util-C_d0oDd4.js} +1 -1
  167. package/dist/assets/{util-CVjlaHo_.js → util-D9UZY2ZN.js} +1 -1
  168. package/dist/assets/{vendor-arcblock-CPCSE54a.js → vendor-arcblock-Dr30TSIK.js} +1 -1
  169. package/dist/assets/{vendor-hooks-cYMUGE4V.js → vendor-hooks-qxhUUbW5.js} +1 -1
  170. package/dist/assets/vendor-utils-CxWN1dT3.js +213 -0
  171. package/dist/assets/{vendor-ux-DfSgTRg5.js → vendor-ux-7TwTLXf8.js} +19 -19
  172. package/dist/assets/vi-C4aNShnq.js +5 -0
  173. package/dist/assets/{wait-connect-Be1Dmt0P.js → wait-connect-B2sGoXaJ.js} +1 -1
  174. package/dist/assets/{wizard-components-D3PqSMGt.js → wizard-components-BRsabxoD.js} +2 -2
  175. package/dist/assets/{wizard-BhUdbQos.js → wizard-qaZ9pS3q.js} +1 -1
  176. package/dist/assets/wrap-locale-DGVkhpYh.js +1 -0
  177. package/dist/assets/zh-Cb0McG4r.js +10 -0
  178. package/dist/assets/{zh-B_cpka88.js → zh-D1XHANJI.js} +1 -1
  179. package/dist/assets/zh-tw-PfYv9beR.js +9 -0
  180. package/dist/index.html +1 -1
  181. package/package.json +49 -49
  182. package/dist/assets/add-resource-ENVSA34x.js +0 -1
  183. package/dist/assets/api-C_w0YD2j.js +0 -1
  184. package/dist/assets/ar-BBr9bsOg.js +0 -7
  185. package/dist/assets/branding-B-5oLD-k.js +0 -1
  186. package/dist/assets/connect-BX2QwOaU.js +0 -5
  187. package/dist/assets/dashboard-DbjH3qe4.js +0 -103
  188. package/dist/assets/de-CDBOH3k5.js +0 -7
  189. package/dist/assets/domains-D_GcYdME.js +0 -1
  190. package/dist/assets/engine-BzngvK61.js +0 -1
  191. package/dist/assets/es-BJ8CsIZi.js +0 -9
  192. package/dist/assets/fr-DSXQFpNy.js +0 -7
  193. package/dist/assets/get-safe-url-CqAaHb9L.js +0 -1
  194. package/dist/assets/hi-DLsQ4VdX.js +0 -5
  195. package/dist/assets/id-AzAQyOHL.js +0 -7
  196. package/dist/assets/index-BHa1_Bjz.js +0 -1039
  197. package/dist/assets/index-BNeXCm1B.js +0 -1
  198. package/dist/assets/index-Df4GSKx6.js +0 -1
  199. package/dist/assets/index-DoVbUHDU.js +0 -55
  200. package/dist/assets/index-pAjb_WaG.js +0 -281
  201. package/dist/assets/ja-C3ccbBe-.js +0 -9
  202. package/dist/assets/keyboard-arrow-down-rounded-8U0_i9QO.js +0 -1
  203. package/dist/assets/ko-9Vbo8tR2.js +0 -9
  204. package/dist/assets/localization-gLf4FT3Q.js +0 -1
  205. package/dist/assets/logger-CWnnO-wn.js +0 -1
  206. package/dist/assets/omit-BgmLPtMY.js +0 -1
  207. package/dist/assets/overview-Bf86Sw9l.js +0 -116
  208. package/dist/assets/passport-D6ZhqZ1F.js +0 -1
  209. package/dist/assets/profile-embed-BpG6-Rqz.js +0 -1
  210. package/dist/assets/pt-iqygmSLa.js +0 -5
  211. package/dist/assets/ru-BkfMvpq6.js +0 -5
  212. package/dist/assets/sdk-C3wBexZ2.js +0 -1
  213. package/dist/assets/security-Duf_ZEVi.js +0 -22
  214. package/dist/assets/simple-select-DbXWLzPn.js +0 -1
  215. package/dist/assets/th-D-pgFsDa.js +0 -5
  216. package/dist/assets/vendor-utils-drLlzTVq.js +0 -213
  217. package/dist/assets/vi-BuffIn3I.js +0 -5
  218. package/dist/assets/wrap-locale-DtcRIeKF.js +0 -1
  219. package/dist/assets/zh-CSl2KD_S.js +0 -10
  220. package/dist/assets/zh-tw-BiloxWNq.js +0 -9
@@ -1,22 +0,0 @@
1
- import{V as Z,z as O,aT as ee,H as z,aJ as ae,w as de,aO as ue,aW as _e}from"./vendor-ux-DfSgTRg5.js";import{g as oe,q as Y,b as w,a as me,h as ve}from"./vendor-hooks-cYMUGE4V.js";import{r as k}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as P,am as q,I as N,bn as K,W as v,D as te,z as D,A as We,Q as X,T as Fe,e1 as Ne,e2 as Le,M as Ve,y as L,b$ as J,bX as V,a5 as G,F as Me,U as Ue,c5 as Ze,a7 as $e,co as Xe,bW as ge,bY as Ce,b6 as Ge,at as Ye}from"./vendor-mui-core-DnR6WYuU.js";import{Y as se,Z as re,c as T,aD as fe,cs as Pe}from"./index-BHa1_Bjz.js";import{n as U,W as Q,I as $,aB as Ke,C as Je,G as je,aC as ye,c as M,o as be}from"./vendor-utils-drLlzTVq.js";import{u as pe,C as F}from"./index.esm-Co8ZxFyk.js";import{S as le}from"./simple-select-DbXWLzPn.js";import{b as Se}from"./team-DNuHMrzV.js";import{l as Qe}from"./arrow-down.svg-C4FUKwt4.js";import{A as we}from"./config-Co1ZhGgP.js";import{u as eo}from"./use-mobile-BINJTzMb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./session-Cm8j8XeZ.js";import"./isURL-CASPeQFe.js";import"./use-app-logo-CZWb8lrs.js";const oo={width:24,height:24,body:'<path fill="currentColor" d="M11 14.2V6q0-.425.288-.713T12 5q.425 0 .713.288T13 6v8.2l2.9-2.9q.275-.275.7-.275t.7.275q.275.275.275.7t-.275.7l-4.6 4.6q-.3.3-.7.3t-.7-.3l-4.6-4.6q-.275-.275-.275-.7t.275-.7q.275-.275.7-.275t.7.275l2.9 2.9Z"/>'},to={width:24,height:24,body:'<path fill="currentColor" d="m11 8.8l-2.9 2.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L13 8.8V17q0 .425-.288.713T12 18q-.425 0-.713-.288T11 17V8.8Z"/>'},he={width:24,height:24,body:'<path fill="currentColor" d="M7 21q-.825 0-1.413-.588T5 19V6q-.425 0-.713-.288T4 5q0-.425.288-.713T5 4h4q0-.425.288-.713T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6v13q0 .825-.588 1.413T17 21H7Zm2-4h2V8H9v9Zm4 0h2V8h-2v9Z"/>'},xe={width:24,height:24,body:'<path fill="currentColor" d="M4 21q-.425 0-.713-.288T3 20v-2.425q0-.4.15-.763t.425-.637L16.2 3.575q.3-.275.663-.425t.762-.15q.4 0 .775.15t.65.45L20.425 5q.3.275.437.65T21 6.4q0 .4-.138.763t-.437.662l-12.6 12.6q-.275.275-.638.425t-.762.15H4ZM17.6 7.8L19 6.4L17.6 5l-1.4 1.4l1.4 1.4Z"/>'};function He({enabled:o,showUp:t=!0,showDown:c=!0,showSwitch:n=!0,showDelete:s=!0,showEdit:i=!0,disableEdit:d=!1,disableSwitch:u=!1,onClickUp:l=()=>{},onClickDown:r=()=>{},onClickSwitch:f=()=>{},onClickDelete:h=()=>{},onClickEdit:H=()=>{}}){const{t:x}=Z();return e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:0},onClick:I=>I.stopPropagation(),children:[i?e.jsx(q,{title:x("common.edit"),children:e.jsx(N,{size:"small",onClick:H,color:"success",disabled:d,children:e.jsx(O,{icon:xe,fontSize:18})})}):null,s?e.jsx(q,{title:x("common.delete"),children:e.jsx(N,{size:"small",onClick:h,color:"error",children:e.jsx(O,{icon:he,fontSize:18})})}):null,n?e.jsx(q,{title:x(o?"common.enabled":"common.disabled"),children:e.jsx(K,{size:"small",checked:o,onClick:f,disabled:u})}):null,t?e.jsx(q,{title:x("common.moveUp"),children:e.jsx(N,{size:"small",onClick:l,disabled:d,children:e.jsx(O,{icon:to,fontSize:20})})}):null,c?e.jsx(q,{title:x("common.moveDown"),children:e.jsx(N,{size:"small",onClick:r,disabled:d,children:e.jsx(O,{icon:oo,fontSize:20})})}):null]})}He.propTypes={enabled:v.bool.isRequired,showUp:v.bool,showDown:v.bool,showSwitch:v.bool,showDelete:v.bool,showEdit:v.bool,disableEdit:v.bool,disableSwitch:v.bool,onClickUp:v.func,onClickDown:v.func,onClickSwitch:v.func,onClickDelete:v.func,onClickEdit:v.func};function Re({ref:o=null}){const{t}=k.useContext(ee),{blocklet:c}=se(),{api:n}=re(),s=c?.meta?.did,d=te()?.transitions?.duration?.leavingScreen||300,u=oe({mode:"add",show:!1,isDefaultRule:!1,callback:U,get dialogTitle(){return this.mode==="edit"?t("securityRule.edit"):this.mode==="view"?t("securityRule.view"):t("securityRule.add")}}),l=Y(async()=>{const{accessPolicies:y}=await n.getBlockletAccessPolicies({input:{did:s}});return Q(y,C=>C.isProtected?1:0)},{manual:!0}),r=Y(async()=>{const{responseHeaderPolicies:y}=await n.getBlockletResponseHeaderPolicies({input:{did:s}});return Q(y,C=>C.isProtected?1:0)},{manual:!0}),{handleSubmit:f,control:h,watch:H,setValue:x,getValues:I,reset:B,formState:{errors:A}}=pe({mode:"onChange",defaultValues:{componentDid:"",pathPattern:"",responseHeaderPolicyId:"",accessPolicyId:"",remark:""}}),_=w(()=>{B(),u.mode="add"}),S=w(()=>{u.show=!1,setTimeout(()=>{_()},d)}),j=w((y,C=null)=>{u.show=!0,C&&(u.isDefaultRule=C.id===T.SECURITY_RULE_DEFAULT_ID,u.mode="edit",x("componentDid",C.componentDid),x("pathPattern",C.pathPattern),x("responseHeaderPolicyId",C.responseHeaderPolicyId),x("accessPolicyId",C.accessPolicyId),x("remark",C.remark||"")),y?u.callback=y:u.mode="view",l.run(),r.run()});k.useImperativeHandle(o,()=>({open:j,close:S}),[j,S]);const m=w(()=>{const[y,C]=I(["accessPolicyId","responseHeaderPolicyId"]);return!y&&!C?t("securityRule.form.accessPolicyOrResponseHeaderPolicyRequired"):!0}),a=w(y=>{const C=m();if(C===!0){const ne=u.isDefaultRule?$(y,"componentDid"):y;u.callback(ne,S)}else z.error(C)}),b=H("componentDid"),E=w(y=>{const C=y?.trim();if(!C)return t("common.requiredErrorText",{name:t("securityRule.form.pathPattern")});if(b){if(C.startsWith("/"))return t("securityRule.form.pathPatternErrorText")}else if(!C.startsWith("/")&&C!=="*")return t("securityRule.form.pathPatternErrorText");return!0}),p=w(y=>y?.trim()?!0:t("common.requiredErrorText",{name:t("securityRule.form.accessPolicy")})),g=w(y=>y?.trim()?!0:t("common.requiredErrorText",{name:t("securityRule.form.responseHeaderPolicy")})),R=me(()=>{const C=(c?.children||[]).find(ne=>ne.meta.did===b);return C?.mountPoint?Ke(C.mountPoint):null},[c,b]);return e.jsx(ae,{open:u.show,title:u.dialogTitle,onClose:S,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(de,{color:"primary",autoFocus:!0,variant:"contained",onClick:f(a),children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[u.isDefaultRule?null:e.jsx(F,{name:"componentDid",control:h,render:({field:y})=>e.jsx(le,{fullWidth:!0,margin:"dense",size:"small",label:t("securityRule.form.component"),placeholer:t("securityRule.form.componentPlaceholder"),options:c.children.map(C=>({title:C.meta.title,value:C.meta.did,description:C.mountPoint})),error:!!A?.componentDid?.message,helperText:A?.componentDid?.message||"Choose belong to component",...$(y,"ref"),readOnly:u.mode==="view"})}),e.jsx(F,{name:"pathPattern",control:h,rules:{validate:E},render:({field:y})=>e.jsx(D,{fullWidth:!0,required:!0,margin:"dense",size:"small",placeholder:t("securityRule.form.pathPatternPlaceholder"),label:t("securityRule.form.pathPattern"),error:!!A?.pathPattern?.message,helperText:A?.pathPattern?.message||"/abc/bcd or /abc or /abc/*",...y,disabled:u.isDefaultRule||u.mode==="view",slotProps:{input:{startAdornment:R?e.jsx(We,{position:"start",children:R}):null}}})}),e.jsx(F,{name:"accessPolicyId",control:h,rules:{validate:u.isDefaultRule?p:U},render:({field:y})=>e.jsx(le,{fullWidth:!0,required:u.isDefaultRule,margin:"dense",size:"small",label:t("securityRule.form.accessPolicy"),placeholer:t("securityRule.form.accessPolicyPlaceholder"),options:(l.data||[]).map(C=>({value:C.id,title:C.name,description:C.description})),error:!!A?.accessPolicyId?.message,helperText:A?.accessPolicyId?.message||t("securityRule.form.accessPolicyHelperText"),...$(y,"ref"),disabled:u.mode==="view"})}),e.jsx(F,{name:"responseHeaderPolicyId",control:h,rules:{validate:u.isDefaultRule?g:U},render:({field:y})=>e.jsx(le,{fullWidth:!0,required:u.isDefaultRule,margin:"dense",size:"small",label:t("securityRule.form.responseHeaderPolicy"),placeholer:t("securityRule.form.responseHeaderPolicyPlaceholder"),options:(r.data||[]).map(C=>({title:C.name,value:C.id,description:C.description})),error:!!A?.responseHeaderPolicyId?.message,helperText:A?.responseHeaderPolicyId?.message||t("securityRule.form.responseHeaderPolicyHelperText"),...$(y,"ref"),disabled:u.mode==="view"})}),e.jsx(F,{name:"remark",control:h,render:({field:y})=>e.jsx(D,{fullWidth:!0,multiline:!0,minRows:3,maxRows:7,size:"small",margin:"dense",placeholder:t("securityRule.form.remarkPlaceholder"),label:t("securityRule.form.remark"),helperText:A?.message,...y,disabled:u.mode==="view"})})]})})}Re.propTypes={ref:v.any};const W=async(o,t="Failed to saved")=>{try{await o()}catch(c){z.error(c?.message||t)}};function so(){const{t:o,locale:t}=Z(),{blocklet:c}=se(),{api:n}=re(),s=c?.meta?.did,i=te(),d=k.useRef(null),u=k.useRef(null),{confirmApi:l,confirmHolder:r}=fe(),f=Y(async()=>{const{securityRules:p}=await n.getBlockletSecurityRules({input:{did:s,includeDisabled:!0}});return p}),h=p=>p.id===T.SECURITY_RULE_DEFAULT_ID,H=w(p=>(c?.children||[]).find(R=>R.meta.did===p)?.mountPoint),x=(f.data||[]).map(p=>{if(p.componentDid){const g=H(p.componentDid);p._disabled=g===void 0}return p}),I=x.filter(p=>!h(p)),B=(p,g)=>{W(async()=>{const R=p.target.checked;await n.updateBlockletSecurityRule({input:{did:s,data:{id:g.id,enabled:R}}}),z.success(o("common.succeeded")),f.run()})},A=(p,g,R)=>{W(async()=>{const y=R-1,C=x[y];await Promise.all([n.updateBlockletSecurityRule({input:{did:s,data:{id:g.id,priority:C.priority}}}),n.updateBlockletSecurityRule({input:{did:s,data:{id:C.id,priority:g.priority}}})]),z.success(o("common.succeeded")),f.run()})},_=(p,g,R)=>{W(async()=>{const y=R+1,C=x[y];await Promise.all([n.updateBlockletSecurityRule({input:{did:s,data:{id:g.id,priority:C.priority}}}),n.updateBlockletSecurityRule({input:{did:s,data:{id:C.id,priority:g.priority}}})]),z.success(o("common.succeeded")),f.run()})},S=()=>{d.current.open((p,g)=>{W(async()=>{await n.addBlockletSecurityRule({input:{did:s,data:p}}),z.success(o("common.succeeded")),f.run(),g()})})},j=(p,g)=>{d.current.open((R,y)=>{W(async()=>{await n.updateBlockletSecurityRule({input:{did:s,data:{...R,id:g.id}}}),z.success(o("common.succeeded")),f.run(),y()})},g)},m=(p,g)=>{l.open({title:o("securityRule.delete.title"),content:o("securityRule.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(R){W(async()=>{await n.deleteBlockletSecurityRule({input:{did:s,id:g.id}}),z.success(o("common.succeeded")),f.run(),R()})}})},a={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(p,{dataIndex:g},R){if(u.current?.contains(R.target)){const y=x[g];d.current.open(void 0,y)}},setRowProps:(p,g)=>x[g]._disabled?{title:o("securityRule.useless"),style:{backgroundColor:i.palette.action.disabledBackground,cursor:"default"}}:{}},b=[e.jsx(X,{size:"small",variant:"outlined",onClick:()=>{f.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(X,{size:"small",variant:"contained",onClick:S,children:o("common.add")})],E=[{label:o("securityRule.form.pathPattern"),name:"pathPattern",options:{customBodyRenderLite(p){const g=x[p];return e.jsx(P,{sx:{whiteSpace:"nowrap"},children:g.id===T.SECURITY_RULE_DEFAULT_ID?"Default":Je(H(g.componentDid),g.pathPattern)})}}},{label:o("responseHeaderPolicy.title"),name:"responseHeaderPolicy",options:{customBodyRenderLite(p){return x[p].responseHeaderPolicy?.name}}},{label:o("accessPolicy.title"),name:"accessPolicyId",options:{customBodyRenderLite(p){return x[p].accessPolicy?.name}}},{label:o("securityRule.form.remark"),name:"remark"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(p){const g=x[p],R=h(g);return e.jsx(He,{disableEdit:g._disabled,disableSwitch:g._disabled,enabled:g.enabled,showSwitch:!R,showDelete:!R,showUp:p>0&&!R,showDown:p<I.length-1&&!R,onClickSwitch:y=>{B(y,g)},onClickUp:y=>{A(y,g,p)},onClickDown:y=>{_(y,g,p)},onClickEdit:y=>{j(y,g)},onClickDelete:y=>{m(y,g)}})}}}].filter(Boolean);return e.jsxs(P,{sx:{display:"flex",flexDirection:"column",gap:2},ref:u,children:[e.jsx(ue,{verticalKeyWidth:100,locale:t,title:e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:1},children:[o("securityRule.title")," ",e.jsx(Fe,{variant:"body2",children:o("securityRule.sortByDescription")})]}),data:x,columns:E,customButtons:b,options:a,loading:f.loading}),e.jsx(Re,{ref:d}),r]})}const Te={width:24,height:24,body:'<path fill="currentColor" d="M5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm0-2h14V7H5v12Zm7-2q-2.05 0-3.663-1.113T6 13q.725-1.775 2.337-2.888T12 9q2.05 0 3.663 1.113T18 13q-.725 1.775-2.337 2.888T12 17Zm0-2.5q-.625 0-1.063-.438T10.5 13q0-.625.438-1.063T12 11.5q.625 0 1.063.438T13.5 13q0 .625-.438 1.063T12 14.5Zm0 1q1.05 0 1.775-.725T14.5 13q0-1.05-.725-1.775T12 10.5q-1.05 0-1.775.725T9.5 13q0 1.05.725 1.775T12 15.5Z"/>'};function ke({value:o,onChange:t,...c}){const n="roles",s="roles_reverse",{t:i,locale:d}=Z(),u=[...we,{value:n,icon:Ne,title:{zh:"指定通行证可访问",en:"Accessible to selected passports"},description:{zh:"只有指定的通行证可以访问",en:"Only specified passports can access"}},{value:s,icon:Le,title:{zh:"指定通行证不可以访问",en:"Accessible to not selected passports"},description:{zh:"只有指定的通行证不可以访问",en:"Only specified passports can't access"}}];return e.jsx(D,{...c,label:i("blocklet.config.access.description"),select:!0,fullWidth:!0,value:o,onChange:t,sx:{"& .MuiInputBase-input":{width:"calc(100% - 46px)","& > .MuiBox-root:first-of-type":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},slotProps:{select:{renderValue:l=>{const r=u.find(f=>f.value===l);return r?e.jsxs(P,{children:[e.jsx(P,{component:r.icon,sx:{mr:1,fontSize:18,verticalAlign:"text-bottom",color:"text.secondary"}}),r.title[d]||r.title.en]}):null},IconComponent:l=>e.jsx(Qe,{...l,width:20,height:20})}},children:u.map(l=>e.jsxs(Ve,{value:l.value,sx:{display:"block","& .tip":{fontSize:"12px",color:`${({theme:r})=>r.palette.text.secondary}`}},children:[e.jsxs(P,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(P,{component:l.icon,sx:{mr:1,fontSize:18,verticalAlign:"text-bottom",color:"text.secondary"}}),e.jsx(P,{children:l.title[d]||l.title.en})]}),e.jsx(P,{className:"tip",children:l.description[d]||l.description.en})]}))})}ke.propTypes={value:v.string,onChange:v.func};const Ae=o=>{const t={name:o.name,description:o.description},{roles:c=null,reverse:n}=o;return c===null?n===!1&&(t.whoCanAccess=T.WHO_CAN_ACCESS.ALL,t.roles=null):c.length===0&&n===!0?(t.whoCanAccess=T.WHO_CAN_ACCESS.INVITED,t.roles=[]):ye(c,[T.WHO_CAN_ACCESS.OWNER])&&n===!1?(t.whoCanAccess=T.WHO_CAN_ACCESS.OWNER,t.roles=[T.WHO_CAN_ACCESS.OWNER]):ye(c,[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN])&&n===!1?(t.whoCanAccess=T.WHO_CAN_ACCESS.ADMIN,t.roles=[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN]):(t.whoCanAccess=n?"roles_reverse":"roles",t.roles=c),t},ro=o=>{const t={name:o.name,description:o.description},{roles:c=null,whoCanAccess:n}=o;return n==="roles"?(t.roles=c,t.reverse=!1):n==="roles_reverse"?(t.roles=c,t.reverse=!0):n===T.WHO_CAN_ACCESS.ALL?(t.roles=null,t.reverse=!1):n===T.WHO_CAN_ACCESS.INVITED?(t.roles=[],t.reverse=!0):n===T.WHO_CAN_ACCESS.OWNER?(t.roles=[T.WHO_CAN_ACCESS.OWNER],t.reverse=!1):n===T.WHO_CAN_ACCESS.ADMIN&&(t.roles=[T.WHO_CAN_ACCESS.OWNER,T.WHO_CAN_ACCESS.ADMIN],t.reverse=!1),t},no=o=>o instanceof Object?{origin:o.origin?{override:o.origin?.override??!0,value:o.origin?.value?.join(`
2
- `),smart:o.origin?.smart??!0}:void 0,methods:o.methods,allowedHeaders:o.allowedHeaders?{override:o.allowedHeaders?.override??!0,value:o.allowedHeaders?.value?.join(`
3
- `)}:void 0,exposedHeaders:o.exposedHeaders?{override:o.exposedHeaders?.override??!0,value:o.exposedHeaders?.value?.join(`
4
- `)}:void 0,maxAge:o.maxAge,optionsSuccessStatus:o.optionsSuccessStatus,preflightContinue:o.preflightContinue,credentials:o.credentials}:void 0,lo=o=>o instanceof Object?{origin:{override:o.origin?.override,value:o.origin?.value?.split(`
5
- `).filter(c=>c),smart:o.origin?.smart},methods:o.methods,allowedHeaders:{override:o.allowedHeaders?.override,value:o.allowedHeaders?.value?.split(`
6
- `).filter(c=>c)},exposedHeaders:{override:o.exposedHeaders?.override,value:o.exposedHeaders?.value?.split(`
7
- `).filter(c=>c)},maxAge:o.maxAge,optionsSuccessStatus:o.optionsSuccessStatus,preflightContinue:o.preflightContinue,credentials:o.credentials}:void 0,io=o=>o instanceof Object?{contentSecurityPolicy:o.contentSecurityPolicy,referrerPolicy:o.referrerPolicy,xFrameOptions:o.xFrameOptions,xPoweredBy:o.xPoweredBy,xXssProtection:o.xXssProtection}:void 0,co=o=>o instanceof Object?{contentSecurityPolicy:o.contentSecurityPolicy,referrerPolicy:o.referrerPolicy,xFrameOptions:o.xFrameOptions,xPoweredBy:o.xPoweredBy,xXssProtection:o.xXssProtection}:void 0,ao=o=>{const t=je(o);if(o.securityHeader)try{t.securityHeader=JSON.parse(o.securityHeader)}catch{t.securityHeader=null}if(o.cors)try{t.cors=JSON.parse(o.cors)}catch{t.cors=null}return t};function qe({ref:o=null}){const{t}=k.useContext(ee),{roles:c}=Se(),s=te()?.transitions?.duration?.leavingScreen||300,i=oe({mode:"add",show:!1,callback:U,get dialogTitle(){return this.mode==="edit"?t("accessPolicy.edit"):this.mode==="view"?t("accessPolicy.view"):t("accessPolicy.add")}}),{handleSubmit:d,control:u,watch:l,setValue:r,reset:f,formState:{errors:h}}=pe({mode:"onChange",defaultValues:{name:"",description:"",roles:null,whoCanAccess:"all"}}),H=w(()=>{f(),i.mode="add"}),x=w(()=>{i.show=!1,setTimeout(()=>{H()},s)}),I=w((a=U,b=null)=>{if(i.callback=a,i.show=!0,b){b.id?i.mode="edit":i.mode="view";const E=Ae(b);r("name",E.name),r("description",E.description),r("roles",E.roles),r("whoCanAccess",E.whoCanAccess)}});k.useImperativeHandle(o,()=>({open:I,close:x}),[I,x]);const B=w(a=>{i.callback(ro(a),x)}),A=w(a=>a?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.name")})),_=l("whoCanAccess"),S=i.mode==="view",j=w(a=>["roles","roles_reverse"].includes(_)&&(!a||a?.length===0)?t("common.requiredErrorText",{name:t("accessPolicy.form.roles")}):!0),m=w(a=>a?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.accessType")}));return e.jsx(ae,{open:i.show,title:i.dialogTitle,onClose:x,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(de,{color:"primary",autoFocus:!0,variant:"contained",onClick:d(B),children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[e.jsx(F,{name:"name",control:u,rules:{validate:A},render:({field:a})=>e.jsx(D,{fullWidth:!0,required:!0,margin:"dense",size:"small",disabled:S,placeholder:t("accessPolicy.form.namePlaceholder"),label:t("accessPolicy.form.name"),error:!!h?.name?.message,helperText:h?.name?.message||" ",...a})}),e.jsx(F,{name:"whoCanAccess",control:u,rules:{validate:m},render:({field:a})=>e.jsx(ke,{required:!0,size:"small",margin:"dense",disabled:S,error:!!h?.whoCanAccess?.message,helperText:h?.whoCanAccess?.message||" ",...a})}),["roles","roles_reverse"].includes(_)?e.jsx(F,{name:"roles",rules:{validate:j},control:u,render:({field:a})=>e.jsxs(L,{variant:"standard",error:!!h?.roles?.message,children:[e.jsx(J,{sx:{display:"flex",flexDirection:"row",mt:-3},children:c.map(b=>e.jsx(V,{control:e.jsx(G,{disabled:S,size:"small",checked:a.value?.includes(b.name),sx:{p:.75},onChange:(E,p)=>{const g=a.value||[];p?a.onChange([...g,b.name]):a.onChange(g.filter(R=>R!==b.name))}}),label:b.title},b.name))}),e.jsx(Me,{sx:{transform:"translateY(-8px)"},children:h?.roles?.message||" "})]})}):null,e.jsx(F,{name:"description",control:u,render:({field:a})=>e.jsx(D,{fullWidth:!0,multiline:!0,disabled:S,minRows:3,maxRows:7,margin:"dense",size:"small",placeholder:t("accessPolicy.form.descriptionPlaceholder"),label:t("accessPolicy.form.description"),helperText:h?.message,...a})})]})})}qe.propTypes={ref:v.any};function uo(){const{t:o,locale:t}=Z(),{blocklet:c}=se(),{api:n}=re(),{roles:s}=Se(),i=c?.meta?.did,d=k.useRef(null),u=k.useRef(null),{confirmApi:l,confirmHolder:r}=fe(),f=()=>{},h=Y(async()=>{const{accessPolicies:m}=await n.getBlockletAccessPolicies({input:{did:i}});return Q(m,a=>a.isProtected?1:0)}),H=h.data||[],x=w(()=>{u.current.open((m,a)=>{W(async()=>{await n.addBlockletAccessPolicy({input:{did:i,data:m}}),z.success(o("common.succeeded")),h.run(),a()})})}),I=w(m=>{u.current.open((a,b)=>{W(async()=>{await n.updateBlockletAccessPolicy({input:{did:i,data:{...a,id:m.id}}}),z.success(o("common.succeeded")),h.run(),b()})},m)}),B=w(m=>{u.current.open((a,b)=>{b()},$(m,["id"]))}),A=w(m=>{l.open({title:o("accessPolicy.delete.title"),content:o("accessPolicy.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(a){W(async()=>{await n.deleteBlockletAccessPolicy({input:{did:i,id:m.id}}),z.success(o("common.succeeded")),h.run(),a()})}})}),_={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(m,{dataIndex:a},b){if(d.current?.contains(b.target)){const E=H[a];B(E)}}},S=[e.jsx(X,{size:"small",variant:"outlined",onClick:()=>{h.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(X,{size:"small",variant:"contained",onClick:x,children:o("common.add")})],j=[{label:o("accessPolicy.form.name"),name:"name",options:{customBodyRenderLite(m){const a=H[m],b=a.isProtected?e.jsx(q,{title:"Built-in policy, can't edit",children:e.jsx(P,{component:O,icon:Pe,sx:{fontSize:16}})}):null;return e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b," ",a.name]})}}},{label:o("accessPolicy.form.roles"),name:"roles",options:{customBodyRenderLite(m){const a=H[m],b=Ae(a);if([T.WHO_CAN_ACCESS.ALL,T.WHO_CAN_ACCESS.INVITED].includes(b.whoCanAccess)){const p=we.find(g=>g.value===b.whoCanAccess);return p.title?.[t]||p.title?.en}const E=s.filter(p=>a.reverse?!b.roles?.includes(p.name):b.roles?.includes(p.name));return e.jsx(P,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:E.map(p=>e.jsx(q,{title:p.description,children:e.jsx(Ue,{size:"small",label:p.title},p.name)}))})}}},{label:o("accessPolicy.form.description"),name:"description"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(m){const a=H[m];return e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:0},onClick:b=>b.stopPropagation(),children:[a.isProtected?e.jsx(q,{title:o("common.view"),children:e.jsx(N,{size:"small",onClick:()=>{B(a,m)},children:e.jsx(O,{icon:Te,fontSize:18})})}):null,a.isProtected?null:e.jsx(q,{title:o("common.edit"),children:e.jsx(N,{size:"small",onClick:()=>{I(a,m)},color:"success",children:e.jsx(O,{icon:xe,fontSize:18})})}),a.isProtected?null:e.jsx(q,{title:o("common.delete"),children:e.jsx(N,{size:"small",onClick:()=>{A(a,m)},color:"error",children:e.jsx(O,{icon:he,fontSize:18})})})]})}}}].filter(Boolean);return e.jsxs(P,{sx:{display:"flex",flexDirection:"column",gap:2},ref:d,children:[e.jsx(ue,{verticalKeyWidth:100,locale:t,title:o("accessPolicy.title"),data:H,columns:j,customButtons:S,options:_,loading:h.loading,onChange:f}),e.jsx(qe,{ref:u}),r]})}const mo={width:24,height:24,body:'<path fill="currentColor" d="m12 15.375l-6-6l1.4-1.4l4.6 4.6l4.6-4.6l1.4 1.4l-6 6Z"/>'};function ie({title:o,actions:t,children:c=null,defaultValue:n=!0,value:s,onChange:i,showExpand:d=!0}){const u=!M(s),l=oe({open:n}),r=me(()=>u?s:l.open,[s,u,l.open]),f=w(()=>{u?i(!r):l.open=!l.open});return e.jsxs(Ze,{variant:"outlined",children:[e.jsxs(P,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",px:2,py:1,backgroundColor:"grey.50"},onClick:f,children:[e.jsx(P,{sx:{fontWeight:"bold"},children:o}),e.jsxs(P,{sx:{display:"flex",alignItems:"center"},children:[t,d?e.jsx(P,{component:O,icon:mo,sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease",fontSize:"2rem"}}):null]})]}),e.jsx($e,{in:r,children:e.jsx(Xe,{children:c})})]})}ie.propTypes={title:v.string.isRequired,defaultValue:v.bool,value:v.bool,actions:v.node,children:v.node,onChange:v.func,showExpand:v.bool};const ce={width:24,height:24,body:'<path fill="currentColor" d="M11.95 18q.525 0 .888-.363t.362-.887q0-.525-.362-.888t-.888-.362q-.525 0-.887.363t-.363.887q0 .525.363.888t.887.362Zm.05 4q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22Zm0-2q3.35 0 5.675-2.325T20 12q0-3.35-2.325-5.675T12 4Q8.65 4 6.325 6.325T4 12q0 3.35 2.325 5.675T12 20Zm0-8Zm.1-4.3q.625 0 1.088.4t.462 1q0 .55-.337.975t-.763.8q-.575.5-1.012 1.1t-.438 1.35q0 .35.263.588t.612.237q.375 0 .638-.25t.337-.625q.1-.525.45-.938t.75-.787q.575-.55.988-1.2t.412-1.45q0-1.275-1.038-2.087T12.1 6q-.95 0-1.812.4T8.975 7.625q-.175.3-.113.638t.338.512q.35.2.725.125t.625-.425q.275-.375.688-.575t.862-.2Z"/>'};function Ie({config:o={},onChange:t=()=>{},disabled:c=!1}){const n=["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],s={origin:{override:!1,value:"*",smart:!0},methods:{override:!1,value:[...n]},allowedHeaders:{override:!1,value:"*"},exposedHeaders:{override:!1,value:"*"},maxAge:{override:!1,value:void 0},optionsSuccessStatus:{override:!1,value:204},preflightContinue:{override:!1,value:!1},credentials:{override:!1,value:!1},...be(o,M)},{t:i}=Z(),d=(r,{override:f,value:h,smart:H})=>{const x={...s?.[r]};!M(H)&&r==="origin"&&(x.smart=H),M(f)||(x.override=f),M(h)||(x.value=h),t({...s,[r]:x})},u=[{title:i("responseHeaderPolicy.form.cors.origin"),override:s.origin.override,smart:s.origin.smart,name:"origin",required:!0,value:s.origin.value,content:e.jsx(L,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:4,maxRows:10,disabled:c,variant:"outlined",size:"small",placeholder:i("responseHeaderPolicy.form.cors.originPlaceholder"),helperText:i("responseHeaderPolicy.form.cors.originHelperText"),value:s.origin.value,onChange:r=>{d("origin",{value:r.target.value})}})})},{title:i("responseHeaderPolicy.form.cors.methods"),name:"methods",override:s.methods.override,required:!0,value:s.methods.value,content:e.jsx(J,{sx:{flexDirection:"row"},children:n.map(r=>e.jsx(V,{control:e.jsx(G,{size:"small",disabled:c,checked:s.methods.value.includes(r),onChange:(f,h)=>{d("methods",{value:h?[...s.methods.value,r]:s.methods.value.filter(H=>H!==r)})}}),label:r},r))})},{title:i("responseHeaderPolicy.form.cors.allowedHeaders"),override:s.allowedHeaders.override,name:"allowedHeaders",value:s.allowedHeaders.value,content:e.jsx(L,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:3,maxRows:7,disabled:c,variant:"outlined",size:"small",placeholder:i("responseHeaderPolicy.form.cors.allowedHeadersPlaceholder"),helperText:i("responseHeaderPolicy.form.cors.allowedHeadersHelperText"),value:s.allowedHeaders.value,onChange:r=>{d("allowedHeaders",{value:r.target.value})}})})},{title:i("responseHeaderPolicy.form.cors.exposedHeaders"),override:s.exposedHeaders.override,name:"exposedHeaders",value:s.exposedHeaders.value,content:e.jsx(L,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{multiline:!0,minRows:3,maxRows:7,disabled:c,variant:"outlined",size:"small",placeholder:i("responseHeaderPolicy.form.cors.exposedHeadersPlaceholder"),helperText:i("responseHeaderPolicy.form.cors.exposedHeadersHelperText"),value:s.exposedHeaders.value,onChange:r=>{d("exposedHeaders",{value:r.target.value})}})})},{title:i("responseHeaderPolicy.form.cors.maxAge"),override:s.maxAge.override,name:"maxAge",value:s.maxAge.value,content:e.jsx(L,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{type:"number",variant:"outlined",size:"small",disabled:c,value:s.maxAge.value,onChange:r=>{d("maxAge",{value:r.target.value})},helperText:i("responseHeaderPolicy.form.cors.maxAgeHelperText")})})},{title:i("responseHeaderPolicy.form.cors.optionsSuccessStatus"),override:s.optionsSuccessStatus.override,name:"optionsSuccessStatus",value:s.optionsSuccessStatus.value,content:e.jsx(L,{fullWidth:!0,sx:{mt:.75,"& .MuiFormHelperText-root":{mx:0}},children:e.jsx(D,{type:"number",variant:"outlined",size:"small",disabled:c,value:s.optionsSuccessStatus.value,onChange:r=>{d("optionsSuccessStatus",{value:r.target.value})}})})},{title:i("responseHeaderPolicy.form.cors.preflightContinue"),override:s.preflightContinue.override,name:"preflightContinue",value:s.preflightContinue.value,control:e.jsx(K,{size:"small",disabled:c,checked:s.preflightContinue.value,onChange:(r,f)=>{d("preflightContinue",{value:f})}})},{title:i("responseHeaderPolicy.form.cors.credentials"),override:s.credentials.override,name:"credentials",value:s.credentials.value,control:e.jsx(K,{size:"small",disabled:c,checked:s.credentials.value,onChange:(r,f)=>{d("credentials",{value:f})}})}];ve(()=>{t(s)});const l={".PrivateSwitchBase-input+svg":{fontSize:"1rem"},".MuiCheckbox-sizeSmall":{p:.75},".MuiFormControlLabel-label":{fontSize:"0.8rem"}};return e.jsx(J,{children:u.map((r,f)=>e.jsxs(k.Fragment,{children:[e.jsxs(P,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(V,{sx:{mt:f===0?0:1},control:r.control||e.jsx(P,{sx:{pl:1.35}}),label:r.title,required:r.required},`${r.name}_form`),e.jsxs(P,{children:[r.name==="origin"?e.jsx(V,{control:e.jsx(G,{size:"small",checked:r.smart,color:"primary",disabled:c,onChange:()=>{d(r.name,{smart:!r.smart})}}),label:e.jsxs(e.Fragment,{children:[i("responseHeaderPolicy.form.cors.smartMode"),e.jsx(q,{title:i("responseHeaderPolicy.form.cors.smartModeHelperText"),children:e.jsx(P,{component:O,icon:ce,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:l},`${r.name}_smart`):null,e.jsx(V,{control:e.jsx(G,{size:"small",checked:r.override,color:"warning",disabled:c,onChange:()=>{d(r.name,{override:!r.override})}}),label:e.jsxs(e.Fragment,{children:[i("responseHeaderPolicy.form.originOverride"),e.jsx(q,{title:i("responseHeaderPolicy.form.originOverrideHelperText"),children:e.jsx(P,{component:O,icon:ce,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:{...l,mr:0}},`${r.name}_override`)]})]}),r.content?e.jsx(P,{sx:{ml:3.5},children:r.content},`${r.name}_content`):null]},r.name))})}Ie.propTypes={config:v.object,onChange:v.func,disabled:v.bool};function Oe({value:o,onChange:t=()=>{},disabled:c=!1}){const n="sameorigin",s=[{label:"DENY",value:"deny"},{label:"SAMEORIGIN (default)",value:"sameorigin"}],i=d=>{t({action:d.target.value})};return k.useEffect(()=>{o===!0&&t({action:n})},[o]),e.jsx(P,{children:e.jsx(L,{children:e.jsx(ge,{row:!0,children:s.map(d=>e.jsx(V,{value:d.value,control:e.jsx(Ce,{size:"small",disabled:c,checked:d.value===o?.action,onChange:i,sx:{p:.75}}),label:d.label},d.value))})})})}Oe.propTypes={value:v.oneOfType([v.string,v.bool]).isRequired,onChange:v.func,disabled:v.bool};function Be({value:o,onChange:t=()=>{},disabled:c=!1}){const n="strict-origin-when-cross-origin",s=[{label:"no-referrer",value:"no-referrer"},{label:"no-referrer-when-downgrade",value:"no-referrer-when-downgrade"},{label:"origin",value:"origin"},{label:"origin-when-cross-origin",value:"origin-when-cross-origin"},{label:"same-origin",value:"same-origin"},{label:"strict-origin",value:"strict-origin"},{label:"strict-origin-when-cross-origin (default)",value:"strict-origin-when-cross-origin"},{label:"unsafe-url",value:"unsafe-url"}],i=d=>{t({policy:d.target.value})};return k.useEffect(()=>{o===!0&&t({policy:n})},[o]),e.jsx(P,{children:e.jsx(L,{children:e.jsx(ge,{children:s.map(d=>e.jsx(V,{value:d.value,control:e.jsx(Ce,{size:"small",disabled:c,checked:d.value===o?.policy,onChange:i,sx:{p:.75}}),label:d.label},d.value))})})})}Be.propTypes={value:v.oneOfType([v.string,v.bool]).isRequired,onChange:v.func,disabled:v.func};function ze({value:o,onChange:t=()=>{},disabled:c=!1}){const n={"default-src":["'self'"],"base-uri":["'self'"],"font-src":["'self'","https:","data:"],"form-action":["'self'"],"frame-ancestors":["'self'"],"img-src":["'self'","data:"],"object-src":["'none'"],"script-src":["'self'"],"script-src-attr":["'none'"],"style-src":["'self'","https:","'unsafe-inline'"],"upgrade-insecure-requests":[]};function s(r){return Object.keys(r).map(f=>[f,r[f].filter(Boolean).join(" ")].filter(Boolean).join(" ")).filter(Boolean).join(`
8
- `)}const i=s(o?.directives||n),[d,u]=k.useState(i),l=r=>{u(r.target.value);const f=r.target.value.split(`
9
- `).reduce((h,H)=>{const[x,...I]=H.split(" ");return h[x]=I.filter(B=>B!==""),h},{});t({useDefaults:!1,directives:f})};return k.useEffect(()=>{o===!0&&(t({useDefaults:!1,directives:n}),u(s(n)))},[o]),e.jsx(P,{sx:{mt:1},children:e.jsx(L,{fullWidth:!0,children:e.jsx(D,{fullWidth:!0,multiline:!0,disabled:c,rows:12,size:"small",value:d,onChange:l})})})}ze.propTypes={value:v.oneOfType([v.object,v.bool]).isRequired,onChange:v.func,disabled:v.bool};function Ee({config:o={},onChange:t=()=>{},disabled:c=!1}){const n={contentSecurityPolicy:{override:!1,value:!1},referrerPolicy:{override:!1,value:!1},xFrameOptions:{override:!1,value:!1},xPoweredBy:{override:!1,value:!0},xXssProtection:{override:!1,value:!1},...be(o,M)},{t:s}=Z(),i=(l,{override:r,value:f})=>{const h={...n?.[l]};M(r)||(h.override=r),M(f)||(h.value=f),t({...n,[l]:h})},d=[{title:"Content-Security-Policy",name:"contentSecurityPolicy",override:n.contentSecurityPolicy.override,value:!!n.contentSecurityPolicy.value,content:e.jsx(ze,{disabled:c,value:n.contentSecurityPolicy.value,onChange:l=>{i("contentSecurityPolicy",{value:l})}}),onChange(l){i("contentSecurityPolicy",{value:l})}},{title:"Referrer-Policy",name:"referrerPolicy",override:n.referrerPolicy.override,value:!!n.referrerPolicy.value,content:e.jsx(Be,{disabled:c,value:n.referrerPolicy.value,onChange:l=>{i("referrerPolicy",{value:l})}}),onChange(l){i("referrerPolicy",{value:l})}},{title:"X-Frame-Options",name:"xFrameOptions",override:n.xFrameOptions.override,value:!!n.xFrameOptions.value,content:e.jsx(Oe,{disabled:c,value:n.xFrameOptions.value,onChange:l=>{i("xFrameOptions",{value:l})}}),onChange(l){i("xFrameOptions",{value:l})}},{title:"Disable X-Powered-By",name:"xPoweredBy",override:n.xPoweredBy.override,value:n.xPoweredBy.value,content:null,onChange(l){i("xPoweredBy",{value:l})}},{title:"X-XSS-Protection",name:"xXssProtection",override:n.xXssProtection.override,value:n.xXssProtection.value,content:null,onChange(l){i("xXssProtection",{value:l})}}];ve(()=>{t(n)});const u={".PrivateSwitchBase-input+svg":{fontSize:"1rem"},".MuiCheckbox-sizeSmall":{p:.75},".MuiFormControlLabel-label":{fontSize:"0.8rem"}};return e.jsx(J,{children:d.map((l,r)=>e.jsxs(k.Fragment,{children:[e.jsxs(P,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(V,{sx:{mt:r===0?0:1},control:e.jsx(K,{size:"small",disabled:c,checked:l.value,onChange:()=>{l.onChange(!l.value)}},`${l.name}_switch`),label:l.title},`${l.name}_form`),l.value?e.jsx(V,{control:e.jsx(G,{size:"small",checked:l.override,color:"warning",disabled:c,onChange:()=>{i(l.name,{override:!l.override})}}),label:e.jsxs(e.Fragment,{children:[s("responseHeaderPolicy.form.originOverride"),e.jsx(q,{title:s("responseHeaderPolicy.form.originOverrideHelperText"),children:e.jsx(P,{component:O,icon:ce,sx:{cursor:"pointer",color:"grey",ml:.5,fontSize:"1.1em"}})})]}),sx:{...u,mr:0}}):null]}),l.value&&l.content?e.jsx(P,{sx:{ml:3.7},children:l.content},`${l.name}_content`):null]},l.name))})}Ee.propTypes={config:v.object,onChange:v.func,disabled:v.bool};function De({ref:o=null}){const{t}=k.useContext(ee),n=te()?.transitions?.duration?.leavingScreen||300,s=oe({mode:"add",show:!1,callback:U,get dialogTitle(){return this.mode==="edit"?t("responseHeaderPolicy.edit"):this.mode==="view"?t("responseHeaderPolicy.view"):t("responseHeaderPolicy.add")},cors:null,securityHeader:null,enableCORS:!1}),{handleSubmit:i,control:d,setValue:u,reset:l,formState:{errors:r}}=pe({mode:"onChange",defaultValues:{name:"",description:""}}),f=w(()=>{l(),s.mode="add",s.enableCORS=!1,s.cors=null,s.securityHeader=null}),h=w(()=>{s.show=!1,setTimeout(()=>{f()},n)}),H=w((S=U,j=null)=>{s.callback=S,s.show=!0,j&&(j.id?s.mode="edit":s.mode="view",u("name",j.name),u("description",j.description),s.cors=no(j.cors),s.securityHeader=io(j.securityHeader),s.enableCORS=!!j.cors)});k.useImperativeHandle(o,()=>({open:H,close:h}),[H,h]);const x=s.mode==="view",I=w(S=>{const j=lo(s.cors),m=co(s.securityHeader),a=je({...S,cors:s.enableCORS?JSON.stringify(j):null,securityHeader:JSON.stringify(m)});s.callback(a,h)}),B=w(S=>S?.trim()?!0:t("common.requiredErrorText",{name:t("accessPolicy.form.name")})),A=S=>{s.securityHeader=S},_=S=>{s.cors=S};return e.jsx(ae,{open:s.show,title:s.dialogTitle,onClose:h,PaperProps:{style:{minHeight:"unset",width:900,maxWidth:"100%"}},actions:e.jsx(de,{color:"primary",autoFocus:!0,variant:"contained",onClick:i(I),children:t("common.confirm")}),children:e.jsxs("form",{noValidate:!0,autoComplete:"off",children:[e.jsx(F,{name:"name",control:d,rules:{validate:B},render:({field:S})=>e.jsx(D,{fullWidth:!0,required:!0,size:"small",margin:"dense",disabled:x,placeholder:t("accessPolicy.form.namePlaceholder"),label:t("accessPolicy.form.name"),error:!!r?.name?.message,helperText:r?.name?.message||" ",...S})}),e.jsx(F,{name:"description",control:d,render:({field:S})=>e.jsx(D,{fullWidth:!0,multiline:!0,size:"small",margin:"dense",disabled:x,minRows:3,maxRows:7,placeholder:"Description",label:"Description",helperText:r?.description?.message||" ",...S})}),e.jsx(ie,{title:"Cross-origin resource sharing (CORS)",value:s.enableCORS,onChange:S=>{x||(s.enableCORS=S)},showExpand:!1,actions:e.jsx(K,{size:"small",disabled:x,checked:s.enableCORS}),children:e.jsx(Ie,{config:s.cors,onChange:_,disabled:x})}),e.jsx("br",{}),e.jsx(ie,{title:"Security Headers",children:e.jsx(Ee,{config:s.securityHeader,onChange:A,disabled:x})})]})})}De.propTypes={ref:v.any};function fo(){const{t:o,locale:t}=Z(),{blocklet:c}=se(),{api:n}=re(),s=c?.meta?.did,i=k.useRef(null),d=k.useRef(null),{confirmApi:u,confirmHolder:l}=fe(),r=()=>{},f=Y(async()=>{const{responseHeaderPolicies:j}=await n.getBlockletResponseHeaderPolicies({input:{did:s}});return Q(j.map(m=>ao(m)),m=>m.isProtected?1:0)}),h=f.data||[],H=w(()=>{i.current.open((j,m)=>{W(async()=>{await n.addBlockletResponseHeaderPolicy({input:{did:s,data:j}}),z.success(o("common.succeeded")),f.run(),m()})})}),x=w(j=>{i.current.open((m,a)=>{a()},$(j,["id"]))}),I=w(j=>{i.current.open((m,a)=>{W(async()=>{await n.updateBlockletResponseHeaderPolicy({input:{did:s,data:{...m,id:j.id}}}),z.success(o("common.succeeded")),f.run(),a()})},j)}),B=w(j=>{u.open({title:o("responseHeaderPolicy.delete.title"),content:o("responseHeaderPolicy.delete.description"),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),onConfirm(m){W(async()=>{await n.deleteBlockletResponseHeaderPolicy({input:{did:s,id:j.id}}),z.success(o("common.succeeded")),f.run(),m()})}})}),A={sort:!1,download:!1,filter:!1,print:!1,search:!1,viewColumns:!1,expandableRowsOnClick:!0,searchDebounceTime:600,onRowClick(j,{dataIndex:m},a){if(d.current?.contains(a.target)){const b=h[m];x(b)}}},_=[e.jsx(X,{size:"small",variant:"outlined",onClick:()=>{f.run()},sx:{mr:1},children:o("common.refresh")},"refresh"),e.jsx(X,{size:"small",variant:"contained",onClick:H,children:o("common.add")},"add")],S=[{label:o("common.name"),name:"name",options:{customBodyRenderLite(j){const m=h[j],a=m.isProtected?e.jsx(q,{title:"Built-in policy, can't edit",children:e.jsx(P,{component:O,icon:Pe,sx:{fontSize:16}})}):null;return e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:.5},children:[a," ",m.name]})}}},{label:o("common.description"),name:"description"},{label:o("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite(j){const m=h[j];return e.jsxs(P,{sx:{display:"flex",alignItems:"center",gap:0},onClick:a=>a.stopPropagation(),children:[m.isProtected?e.jsx(q,{title:o("common.view"),children:e.jsx(N,{size:"small",onClick:()=>{x(m,j)},children:e.jsx(O,{icon:Te,fontSize:18})})}):null,m.isProtected?null:e.jsx(q,{title:o("common.edit"),children:e.jsx(N,{size:"small",onClick:()=>{I(m,j)},color:"success",children:e.jsx(O,{icon:xe,fontSize:18})})}),m.isProtected?null:e.jsx(q,{title:o("common.delete"),children:e.jsx(N,{size:"small",onClick:()=>{B(m,j)},color:"error",children:e.jsx(O,{icon:he,fontSize:18})})})]})}}}].filter(Boolean);return e.jsxs(P,{sx:{display:"flex",flexDirection:"column",gap:2},ref:d,children:[e.jsx(ue,{verticalKeyWidth:100,locale:t,title:o("responseHeaderPolicy.title"),data:h,columns:S,customButtons:_,options:A,loading:f.loading,onChange:r}),e.jsx(De,{ref:i}),l]})}function Io(){const{t:o}=k.useContext(ee),t=eo({key:"lg"}),c=[{label:e.jsx(P,{sx:{textAlign:"center",width:"100%"},children:o("securityRule.title")}),value:"security"},{label:e.jsx(P,{sx:{textAlign:"center",width:"100%"},children:o("accessPolicy.title")}),value:"accessPolicy"},{label:e.jsx(P,{sx:{textAlign:"center",width:"100%"},children:o("responseHeaderPolicy.title")}),value:"responseHeaderPolicy"}],[n,s]=k.useState(c[0].value),i=me(()=>({security:e.jsx(so,{}),accessPolicy:e.jsx(uo,{}),responseHeaderPolicy:e.jsx(fo,{})}),[o]);return e.jsx(po,{children:e.jsxs(Ge,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(P,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(_e,{tabs:c,current:n,orientation:t?"horizontal":"vertical",onChange:s,sx:{borderRight:t?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(P,{sx:{flexGrow:1,minWidth:0},children:e.jsx(P,{children:i[n]})})]})})}const po=Ye.div`
10
- .MuiTab-root {
11
- text-align: left;
12
- align-items: flex-start;
13
- font-weight: normal;
14
-
15
- div {
16
- text-align: left;
17
- }
18
- }
19
- .Mui-selected {
20
- font-weight: bold;
21
- }
22
- `;export{Io as default};
@@ -1 +0,0 @@
1
- import{j as e,y,x as S,bZ as I,M as c,ak as n,U as O,T as f,ca as T,F as W,W as r}from"./vendor-mui-core-DnR6WYuU.js";import{l as z}from"./arrow-down.svg-C4FUKwt4.js";function M({fullWidth:m=!1,multiple:a=!1,required:o=!1,label:d="",placeholer:j="",options:t=[],helperText:v="",error:b=!1,margin:p="",size:u,...h}){const g=t.find(l=>l.value===h.value)?.title;return e.jsxs(y,{margin:p,fullWidth:m,error:b,children:[e.jsx(S,{size:u,children:`${d}${o?"*":""}`}),e.jsxs(I,{multiple:a,sx:{"& .MuiInputBase-input":{width:"calc(100% - 46px)","& > .MuiBox-root:first-of-type":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},input:e.jsx(T,{defaultValue:g,sx:{flex:1},required:o,label:d,inputProps:{margin:p},size:u}),renderValue:l=>{if(a)return e.jsx(n,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:l.map(i=>{const x=t.find(w=>w.value===i);return x&&x.title&&e.jsx(O,{size:"small",label:x.title},i)})});const s=t.find(i=>i.value===l);return s&&s.title&&e.jsxs(n,{children:[e.jsx(f,{component:"span",children:s.title}),e.jsx(f,{component:"span",variant:"body2",sx:{marginLeft:1,color:"text.secondary"},children:s.description})]})},IconComponent:l=>e.jsx(z,{...l,width:20,height:20}),...h,children:[e.jsx(c,{disabled:!0,children:e.jsx("em",{children:j})}),!o&&!a&&e.jsx(c,{value:"",children:"None"}),t.map(l=>l&&l.value&&e.jsx(c,{value:l.value,children:e.jsxs(n,{children:[e.jsx("span",{children:l.title}),l.description&&e.jsx(n,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))]}),e.jsx(W,{children:v})]})}M.propTypes={error:r.bool,required:r.bool,multiple:r.bool,fullWidth:r.bool,label:r.string,placeholer:r.string,options:r.array,helperText:r.string,margin:r.string,size:r.string,textDirection:r.oneOf("row","column")};export{M as S};