@abtnode/blocklet-services 1.17.8-beta-20260119-102944-6ba93a16 → 1.17.8-beta-20260125-093329-64b43854

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 (309) hide show
  1. package/api/index.js +5 -0
  2. package/api/libs/connect/session.js +33 -39
  3. package/api/middlewares/launcher-login.js +1 -2
  4. package/api/routes/federated.js +1 -2
  5. package/api/routes/oauth/server.js +1 -2
  6. package/api/routes/user-session.js +0 -2
  7. package/api/routes/user.js +61 -41
  8. package/api/services/auth/connect/destroy-self.js +0 -2
  9. package/api/services/auth/connect/invite.js +0 -2
  10. package/api/services/auth/connect/issue-passport.js +0 -2
  11. package/api/services/auth/connect/receive-transfer-app-owner.js +0 -2
  12. package/api/services/auth/connect/verify-destroy.js +0 -2
  13. package/api/services/auth/connect/verify-elevated.js +0 -2
  14. package/api/services/auth/session.js +1 -36
  15. package/api/util/user-util.js +1 -2
  16. package/dist/assets/{AdapterDayjs-CYW0YvmK.js → AdapterDayjs-B5owpIH3.js} +1 -1
  17. package/dist/assets/{Google-DKRt92nm.js → Google-efeywUOs.js} +1 -1
  18. package/dist/assets/{LottiePlayer.modern-CeQuigIa.js → LottiePlayer.modern-CE8erevJ.js} +1 -1
  19. package/dist/assets/access-control-BzsCJj-F.js +14 -0
  20. package/dist/assets/{actions-DydkTgA0.js → actions-DbuL4r3Z.js} +1 -1
  21. package/dist/assets/actions-Dm98-Dap.js +64 -0
  22. package/dist/assets/{add-component-core-nc1ps0ni.js → add-component-core-BKVGCdxY.js} +21 -21
  23. package/dist/assets/add-resource-Cxa0mbrd.js +1 -0
  24. package/dist/assets/{addon-DfWedLEC.js → addon-B1KwZDQ5.js} +1 -1
  25. package/dist/assets/advanced-B62UUhxe.js +14 -0
  26. package/dist/assets/{aigne-6nMSoyeQ.js → aigne-jjaGOQQ7.js} +1 -1
  27. package/dist/assets/api-BMcHDEnt.js +1 -0
  28. package/dist/assets/appearance-_ZB7EroL.js +1 -0
  29. package/dist/assets/{ar-DOhYGTlW.js → ar-BJmSv7rn.js} +1 -1
  30. package/dist/assets/audit-logs-DF2wcdWX.js +35 -0
  31. package/dist/assets/authorize-C6nOsMWm.js +1 -0
  32. package/dist/assets/{base-chart-DcZV4ZCI.js → base-chart-D_u2nVGm.js} +1 -1
  33. package/dist/assets/{base32-7iZvvdX8.js → base32-D79Y2AcQ.js} +1 -1
  34. package/dist/assets/bind-account-BIj9FA7d.js +1 -0
  35. package/dist/assets/branding-BEGHWROe.js +40 -0
  36. package/dist/assets/{branding-CwSyd5WC.js → branding-C86_64it.js} +3 -3
  37. package/dist/assets/branding-Dqv4_zpD.js +1 -0
  38. package/dist/assets/bundle-avatar-Cy8tSSSQ.js +1 -0
  39. package/dist/assets/button-DMYwcDVh.js +1 -0
  40. package/dist/assets/{click-to-copy-BgIYUMoo.js → click-to-copy-BCjXD9Nd.js} +1 -1
  41. package/dist/assets/{cloneDeep-YxES7wNt.js → cloneDeep-q2Jbqwkh.js} +1 -1
  42. package/dist/assets/{collapse-RMuUWnK3.js → collapse-CBrasNzu.js} +1 -1
  43. package/dist/assets/complete-CCe1VfI6.js +39 -0
  44. package/dist/assets/{component-CuKviNC8.js → component-DLlaIYmq.js} +37 -37
  45. package/dist/assets/config-BccEmD3I.js +53 -0
  46. package/dist/assets/config-C0CmuuRP.js +1 -0
  47. package/dist/assets/config-CsQBU86s.js +32 -0
  48. package/dist/assets/{config-navigation-hDihVsjx.js → config-navigation-D46rq0IX.js} +11 -11
  49. package/dist/assets/config-space-DLjHQVCq.js +1 -0
  50. package/dist/assets/{confirm-CdVn5WdC.js → confirm-ClxC2cDv.js} +1 -1
  51. package/dist/assets/connect-9CgvkPOq.js +1 -0
  52. package/dist/assets/{connect-Dy0Y8HRB.js → connect-C1q4hvQ3.js} +1 -1
  53. package/dist/assets/connect-DXjJ46DL.js +5 -0
  54. package/dist/assets/connect-to-CbgQNAwh.js +1 -0
  55. package/dist/assets/{content-layout-Dlmn5DW6.js → content-layout-BH_g_OCf.js} +1 -1
  56. package/dist/assets/{create-passport-svg-hldNORaB.js → create-passport-svg-Ct68e5tm.js} +1 -1
  57. package/dist/assets/{createClass-CgfWUrk8.js → createClass-CeMEAEuP.js} +1 -1
  58. package/dist/assets/dashboard-y1fk-IQM.js +93 -0
  59. package/dist/assets/{de-CtKPdGk6.js → de-B2IoQCYX.js} +1 -1
  60. package/dist/assets/{delete-confirm-CkiUXocp.js → delete-confirm-CxRbnJU_.js} +1 -1
  61. package/dist/assets/{did-address-CG36eCOx.js → did-address-BhAIkFPZ.js} +1 -1
  62. package/dist/assets/{domain-CDTeLbkZ.js → domain-CMJp7emz.js} +1 -1
  63. package/dist/assets/domain-action-card-CKlATj2V.js +28 -0
  64. package/dist/assets/domains-CQs-XM9-.js +1 -0
  65. package/dist/assets/email-CYR31d5d.js +17 -0
  66. package/dist/assets/{empty-spinner-DB1GKIOS.js → empty-spinner-DzVQ0tC1.js} +1 -1
  67. package/dist/assets/engine-ByRLynLu.js +1 -0
  68. package/dist/assets/{es-BSYtSZPg.js → es-nlHqTKrO.js} +1 -1
  69. package/dist/assets/exchange-passport-BAD6oRbd.js +1 -0
  70. package/dist/assets/{fallback-D-IHOW-7.js → fallback-CJFJeDKq.js} +1 -1
  71. package/dist/assets/{form-text-input-CPLafaTk.js → form-text-input-Dq_8KU_Y.js} +2 -2
  72. package/dist/assets/{form-wrapper-kWYD3nZz.js → form-wrapper-YOmD-sDI.js} +1 -1
  73. package/dist/assets/{form-Co-tgocU.js → form-zHvITlPG.js} +3 -3
  74. package/dist/assets/{fr-C35fi7h9.js → fr-LrrW00cI.js} +1 -1
  75. package/dist/assets/{fuel-BFx1ShM2.js → fuel-CU-CpANh.js} +1 -1
  76. package/dist/assets/gen-access-key-Fb9M1v-f.js +1 -0
  77. package/dist/assets/gen-simple-access-key-BgYT9wM-.js +1 -0
  78. package/dist/assets/get-safe-url-CCXmZ6Ty.js +1 -0
  79. package/dist/assets/hi-DxZE2HUh.js +5 -0
  80. package/dist/assets/home-Cy8jLKNF.js +1 -0
  81. package/dist/assets/{id-DoVb0JYr.js → id-C3U8Kyb0.js} +1 -1
  82. package/dist/assets/{iframe-DUzp97tk.js → iframe-CZ9tjsFz.js} +1 -1
  83. package/dist/assets/{index-8RHrVCC6.js → index-B-yh2KQb.js} +1 -1
  84. package/dist/assets/index-B2LgdSh1.js +242 -0
  85. package/dist/assets/index-BJ69cdwn.js +88 -0
  86. package/dist/assets/index-BJCzMYyG.js +832 -0
  87. package/dist/assets/{index-BUhEyicQ.js → index-BZxTtTlP.js} +1 -1
  88. package/dist/assets/index-Bg0Lw3eZ.js +150 -0
  89. package/dist/assets/{index-C1fKsLzf.js → index-Bij9abGY.js} +2 -2
  90. package/dist/assets/index-BkgA3JrZ.js +124 -0
  91. package/dist/assets/{index-VKjWmvRV.js → index-BqISx1lI.js} +1 -1
  92. package/dist/assets/index-BsIQdVmB.js +29 -0
  93. package/dist/assets/{index-CfvGuvbD.js → index-BtHiIOEI.js} +1 -1
  94. package/dist/assets/index-BtxDkXoY.js +7 -0
  95. package/dist/assets/{index-DqcciDRh.js → index-CKgbiYHC.js} +2 -2
  96. package/dist/assets/index-CQz-yW1Q.js +120 -0
  97. package/dist/assets/{index-Cax1AxL9.js → index-CSdd2W7t.js} +1 -1
  98. package/dist/assets/{index-D3BuekEe.js → index-CYam9iu7.js} +5 -5
  99. package/dist/assets/index-CZc0agHR.js +1 -0
  100. package/dist/assets/index-Cb9H09Dz.js +1 -0
  101. package/dist/assets/{index-D1Fa760B.js → index-CtCzpHpi.js} +1 -1
  102. package/dist/assets/index-D0VFBmtN.js +280 -0
  103. package/dist/assets/{index-3H6a5edM.js → index-D1HHdOwz.js} +2 -2
  104. package/dist/assets/{index-B9FojAjj.js → index-DDpk_EEp.js} +1 -1
  105. package/dist/assets/{index-Di2nSesc.js → index-DPbBn0Vu.js} +1 -1
  106. package/dist/assets/{index-D6pCyJv8.js → index-DbbtJMIS.js} +1 -1
  107. package/dist/assets/index-DgwyiIiW.js +1 -0
  108. package/dist/assets/{index-Bo9KtpTY.js → index-Dh38UJiv.js} +1 -1
  109. package/dist/assets/{index-CqCXPf7W.js → index-DvtkahBB.js} +1 -1
  110. package/dist/assets/index-Dw9kO-TK.js +7 -0
  111. package/dist/assets/{index-DFUM0Pvk.js → index-E0k6Os1B.js} +1 -1
  112. package/dist/assets/index-L6md5GCk.js +6 -0
  113. package/dist/assets/index-VTJ4vv2F.js +200 -0
  114. package/dist/assets/{index-CEJb82tA.js → index-WY8_4PO1.js} +1 -1
  115. package/dist/assets/{index-ZzcJ7eKO.js → index-lGLHoHAP.js} +1 -1
  116. package/dist/assets/{index-Cx0E03Bs.js → index-rh1DYsh2.js} +3 -3
  117. package/dist/assets/{index-C_kNXHsF.js → index-u8Hqob_G.js} +1 -1
  118. package/dist/assets/index-vQWAt26Z.js +81 -0
  119. package/dist/assets/info-outline-rounded-CTki6xsp.js +1 -0
  120. package/dist/assets/{invitation-BP8hOEFv.js → invitation-CrLJgh5y.js} +6 -6
  121. package/dist/assets/{invitations-C8aZLxdl.js → invitations-Cs7LYbh9.js} +2 -2
  122. package/dist/assets/invite-B0wKu-K4.js +1 -0
  123. package/dist/assets/issue-passport-B1azomgq.js +1 -0
  124. package/dist/assets/item-CcfCB60B.js +1 -0
  125. package/dist/assets/{ja-DZPUwZ9l.js → ja-Cv-fddix.js} +1 -1
  126. package/dist/assets/{ko-q4i4r9g6.js → ko-Cy3G6t2o.js} +1 -1
  127. package/dist/assets/{landing-page-JLA-ZD1t.js → landing-page-3yvA3dHp.js} +1 -1
  128. package/dist/assets/{launch-result-message-DJqF-slD.js → launch-result-message-CYcW9uFA.js} +1 -1
  129. package/dist/assets/layout-DPEeowZp.js +29 -0
  130. package/dist/assets/{list-3MUy-8Ol.js → list-BtmehYr0.js} +3 -3
  131. package/dist/assets/{list-header-BEZSwSji.js → list-header-DqG9VFur.js} +1 -1
  132. package/dist/assets/list-qef9ITY3.js +2 -0
  133. package/dist/assets/localization-VGnaiTRr.js +1 -0
  134. package/dist/assets/{log-Bq445Z1e.js → log-BDLuou50.js} +1 -1
  135. package/dist/assets/logger-Cn2_Ur4V.js +1 -0
  136. package/dist/assets/login-BTzBeYdR.js +1 -0
  137. package/dist/assets/login-method-item-T1v3TnPG.js +1 -0
  138. package/dist/assets/login-oauth-callback-f1uXdv_Y.js +1 -0
  139. package/dist/assets/{logo-uploader-CyZuvhwV.js → logo-uploader-YNwnzUQw.js} +1 -1
  140. package/dist/assets/{lost-passport-BiYg3QQI.js → lost-passport-Cv4fSebj.js} +2 -2
  141. package/dist/assets/metadata-BeJTujvj.js +55 -0
  142. package/dist/assets/{nav-menu-DSdXRbfg.js → nav-menu-CefEor9d.js} +1 -1
  143. package/dist/assets/{omit-Dq0FLBY8.js → omit-vVhnMpHQ.js} +1 -1
  144. package/dist/assets/{open-window-Dyu79ome.js → open-window-Cq_Eb4d0.js} +1 -1
  145. package/dist/assets/over-due-invoice-payment-Cx9nVkCY.js +1 -0
  146. package/dist/assets/overview-UWHPi3tV.js +116 -0
  147. package/dist/assets/{page-header-qdK3sAJh.js → page-header-DayahqMa.js} +1 -1
  148. package/dist/assets/passport-D7GEY4wO.js +1 -0
  149. package/dist/assets/passport-item-CpICtT-w.js +1 -0
  150. package/dist/assets/{permission-CvrrGfG6.js → permission-ozcooui7.js} +1 -1
  151. package/dist/assets/preferences-RHaCYv9t.js +1 -0
  152. package/dist/assets/profile-embed-BLPUgZl6.js +1 -0
  153. package/dist/assets/provider-icon-Blmpf_9p.js +1 -0
  154. package/dist/assets/pt-CLIZ5rGV.js +5 -0
  155. package/dist/assets/publish-resource-Cn5CEQma.js +1 -0
  156. package/dist/assets/{react-beautiful-dnd.esm-CWJ5I9Zv.js → react-beautiful-dnd.esm-L71UpeRK.js} +1 -1
  157. package/dist/assets/{react-stripe.esm-B-FTN8ep.js → react-stripe.esm-B1zA7yon.js} +1 -1
  158. package/dist/assets/{required-DnQpCGsD.js → required-jUJP5eu8.js} +1 -1
  159. package/dist/assets/ru-DoXNa8xl.js +5 -0
  160. package/dist/assets/{runtime-B_ZLP4FF.js → runtime-CGShJ0Po.js} +1 -1
  161. package/dist/assets/{sanitize-Bzl4lTuH.js → sanitize-BHeUjEo7.js} +1 -1
  162. package/dist/assets/sdk-C05lZFmW.js +1 -0
  163. package/dist/assets/{section-CZylgxjz.js → section-BHNJgwmP.js} +1 -1
  164. package/dist/assets/security-_Iru3mSY.js +22 -0
  165. package/dist/assets/session-DpYXqKUu.js +1 -0
  166. package/dist/assets/setup-DCnaHhf3.js +24 -0
  167. package/dist/assets/{shorten-label-CuBHsWUR.js → shorten-label-NmLkBKIj.js} +1 -1
  168. package/dist/assets/simple-select--uh08-vW.js +1 -0
  169. package/dist/assets/{spaces-ix8u0ZiI.js → spaces-gCrHfJB8.js} +1 -1
  170. package/dist/assets/start-S0ZFYLEE.js +187 -0
  171. package/dist/assets/{starting-progress-CWp5fTY0.js → starting-progress-BSgBADJS.js} +1 -1
  172. package/dist/assets/{status-Dn_LKaNp.js → status-DqZ0B8Xa.js} +1 -1
  173. package/dist/assets/{step-actions-DIZRcnXf.js → step-actions-DxJMBPwi.js} +1 -1
  174. package/dist/assets/{studio-CVIa8-XY.js → studio-B2SgpXxn.js} +1 -1
  175. package/dist/assets/{switch-BbyTGEOo.js → switch-D9wb-oPu.js} +1 -1
  176. package/dist/assets/{switch-control-BRjXGc1d.js → switch-control-Dl1BCyFd.js} +1 -1
  177. package/dist/assets/{table-tips-Dvmdodc5.js → table-tips-C5NrUDu8.js} +1 -1
  178. package/dist/assets/team-DXPe7dCA.js +146 -0
  179. package/dist/assets/th-DmzEcJam.js +5 -0
  180. package/dist/assets/{theme-mode-toggle-D3bcd10D.js → theme-mode-toggle-BYQvzsDR.js} +1 -1
  181. package/dist/assets/traffic-BandB_6R.js +1 -0
  182. package/dist/assets/transfer-Dky9H1bl.js +16 -0
  183. package/dist/assets/unsubscribe-D0la_6Ib.js +1 -0
  184. package/dist/assets/{use-app-logo-IRizt64R.js → use-app-logo-0G6x82Xn.js} +1 -1
  185. package/dist/assets/{use-blocklet-logo-Cf1j7pQz.js → use-blocklet-logo-IV_8xnB2.js} +1 -1
  186. package/dist/assets/{use-mobile-DFkQ5N0b.js → use-mobile-CEr7zhO3.js} +1 -1
  187. package/dist/assets/{use-mobile-DwGMuJlg.js → use-mobile-DAngW3li.js} +1 -1
  188. package/dist/assets/{use-mobile-CyUZDIaX.js → use-mobile-kXWiSSQD.js} +1 -1
  189. package/dist/assets/{use-server-logo-KZn9RrZd.js → use-server-logo-BVKQ1t0s.js} +1 -1
  190. package/dist/assets/{use-window-close-Dpj5UcYT.js → use-window-close-C-WcChaL.js} +1 -1
  191. package/dist/assets/{useAsync-DfiOQMQ_.js → useAsync-DRrTtbU_.js} +1 -1
  192. package/dist/assets/{useAsync-CkKfnulP.js → useAsync-D_y3bEgl.js} +1 -1
  193. package/dist/assets/{useAsyncRetry-C4R9ufi-.js → useAsyncRetry-BZ4R17gr.js} +2 -2
  194. package/dist/assets/{useLocalStorage-BQfIniHX.js → useLocalStorage-C5E7FrUa.js} +1 -1
  195. package/dist/assets/{user-center-6K47tx8j.js → user-center-D-UOqGpV.js} +5 -5
  196. package/dist/assets/{user-follower-BwzTutxU.js → user-follower-_9B1O2CU.js} +1 -1
  197. package/dist/assets/util-Bf1lWzn8.js +1 -0
  198. package/dist/assets/util-Dn9RqFJI.js +1 -0
  199. package/dist/assets/utils-eOkzHJzR.js +1 -0
  200. package/dist/assets/{vendor-arcblock-Dll6qxMT.js → vendor-arcblock-B6JCofz3.js} +1 -1
  201. package/dist/assets/vendor-hooks-Bt9Vv36g.js +1 -0
  202. package/dist/assets/{vendor-mui-core-CV-FnYH_.js → vendor-mui-core-D6nniiQs.js} +2 -2
  203. package/dist/assets/{vendor-mui-x-DwN6dcQH.js → vendor-mui-x-Ds-5Y7YM.js} +1 -1
  204. package/dist/assets/vendor-utils-BbcnEeJI.js +23 -0
  205. package/dist/assets/{vendor-ux-CLT2i3Pv.js → vendor-ux-hzekFYg2.js} +123 -123
  206. package/dist/assets/vi-6MG7Pp6O.js +5 -0
  207. package/dist/assets/wait-connect-DmtX5SsS.js +1 -0
  208. package/dist/assets/wallet-hidden-topbar-OBN14KiV.js +68 -0
  209. package/dist/assets/wizard-Q2Vm8Y9G.js +8 -0
  210. package/dist/assets/wizard-components-CON7Dump.js +52 -0
  211. package/dist/assets/wrap-locale-BGMozDAq.js +1 -0
  212. package/dist/assets/{zh-G2I44gfs.js → zh-B9y8LJ3-.js} +1 -1
  213. package/dist/assets/{zh-CJ9vCpmv.js → zh-Dfkd9CXx.js} +1 -1
  214. package/dist/assets/{zh-tw-C4Juvs-i.js → zh-tw-CbtwifV_.js} +1 -1
  215. package/dist/index.html +1 -1
  216. package/package.json +44 -44
  217. package/dist/assets/access-control-RI6LQbSm.js +0 -14
  218. package/dist/assets/actions-BlWED76c.js +0 -64
  219. package/dist/assets/add-resource-BVOdOQSW.js +0 -1
  220. package/dist/assets/advanced-CuKHqbLO.js +0 -14
  221. package/dist/assets/api-B8JXuhVp.js +0 -1
  222. package/dist/assets/appearance-C9TkbSjV.js +0 -1
  223. package/dist/assets/audit-logs-DKGke9hI.js +0 -35
  224. package/dist/assets/authorize-DkSqywe8.js +0 -1
  225. package/dist/assets/bind-account-DOwM9Nhe.js +0 -1
  226. package/dist/assets/branding-Cak2s8bn.js +0 -1
  227. package/dist/assets/branding-lcfxmmPp.js +0 -40
  228. package/dist/assets/bundle-avatar-DwiOyeMO.js +0 -1
  229. package/dist/assets/button-uUU4Wycr.js +0 -1
  230. package/dist/assets/complete-Udiv_yFp.js +0 -39
  231. package/dist/assets/config-6IwEgT3b.js +0 -32
  232. package/dist/assets/config-CJwxv2uK.js +0 -1
  233. package/dist/assets/config-D1OcHGlN.js +0 -53
  234. package/dist/assets/config-space-DfstlHnF.js +0 -1
  235. package/dist/assets/connect-CT2vMz6l.js +0 -5
  236. package/dist/assets/connect-DA7RO2yv.js +0 -1
  237. package/dist/assets/connect-to-CQMUbQkH.js +0 -1
  238. package/dist/assets/dashboard-BvI3ii8Z.js +0 -93
  239. package/dist/assets/domain-action-card-kMPYS2Nj.js +0 -28
  240. package/dist/assets/domains-TI6o1CvX.js +0 -1
  241. package/dist/assets/email-DHRHueET.js +0 -17
  242. package/dist/assets/engine-D_fEFx9_.js +0 -1
  243. package/dist/assets/exchange-passport-Cc872mjQ.js +0 -1
  244. package/dist/assets/gen-access-key-DrgLVRbm.js +0 -1
  245. package/dist/assets/gen-simple-access-key-B24d6k7g.js +0 -1
  246. package/dist/assets/get-safe-url-beob4f2C.js +0 -1
  247. package/dist/assets/hi-5fpYJkiW.js +0 -5
  248. package/dist/assets/home-Dw18IODa.js +0 -1
  249. package/dist/assets/index--WQuhwJL.js +0 -6
  250. package/dist/assets/index-2M4w6J9r.js +0 -29
  251. package/dist/assets/index-B-8044Gs.js +0 -280
  252. package/dist/assets/index-B6l4xGy5.js +0 -7
  253. package/dist/assets/index-BOPR4Iyc.js +0 -88
  254. package/dist/assets/index-BeunkI-Z.js +0 -242
  255. package/dist/assets/index-Bpic07NM.js +0 -200
  256. package/dist/assets/index-C4ZzROeE.js +0 -120
  257. package/dist/assets/index-CXp5SI_f.js +0 -832
  258. package/dist/assets/index-DH4rC-7M.js +0 -1
  259. package/dist/assets/index-DKzBOJCu.js +0 -81
  260. package/dist/assets/index-DL0wTcgx.js +0 -1
  261. package/dist/assets/index-DWHFecw2.js +0 -150
  262. package/dist/assets/index-DcW3jqfL.js +0 -6
  263. package/dist/assets/index-Vf51dp11.js +0 -124
  264. package/dist/assets/index-bEFOmVth.js +0 -1
  265. package/dist/assets/info-outline-rounded-DlgANjBB.js +0 -1
  266. package/dist/assets/invite-Cd5zEHFb.js +0 -1
  267. package/dist/assets/issue-passport-D7zqv3Al.js +0 -1
  268. package/dist/assets/item-DNj7ORqk.js +0 -1
  269. package/dist/assets/joi-browser.min-CUdv8seQ.js +0 -1
  270. package/dist/assets/joi-browser.min-eEVeW7LC.js +0 -1
  271. package/dist/assets/layout-Cwvm7lmD.js +0 -29
  272. package/dist/assets/list-BSXHuqLM.js +0 -2
  273. package/dist/assets/localization-Dond4H78.js +0 -1
  274. package/dist/assets/logger-CCAAJ2Xo.js +0 -1
  275. package/dist/assets/login-dc2t9Qyo.js +0 -1
  276. package/dist/assets/login-method-item-CyTsqz88.js +0 -1
  277. package/dist/assets/login-oauth-callback-Bext19kc.js +0 -1
  278. package/dist/assets/metadata-B2-Ltdko.js +0 -55
  279. package/dist/assets/over-due-invoice-payment-DzUsy6q0.js +0 -1
  280. package/dist/assets/overview-0TBmi-_i.js +0 -116
  281. package/dist/assets/passport-BhEaZ-sr.js +0 -1
  282. package/dist/assets/passport-item-DHwif94N.js +0 -1
  283. package/dist/assets/preferences-BBSWzZiT.js +0 -1
  284. package/dist/assets/profile-embed-shcOdRUI.js +0 -1
  285. package/dist/assets/provider-icon-DO2PqSth.js +0 -1
  286. package/dist/assets/pt-BFCHl6F1.js +0 -5
  287. package/dist/assets/publish-resource-CMuHIOUf.js +0 -1
  288. package/dist/assets/ru-CSTl62kK.js +0 -5
  289. package/dist/assets/sdk-CktKu_IW.js +0 -1
  290. package/dist/assets/security-DHRU8k0u.js +0 -22
  291. package/dist/assets/session-Bp3LV7zJ.js +0 -1
  292. package/dist/assets/setup-B6-Ei_3X.js +0 -24
  293. package/dist/assets/simple-select-nI-W90c_.js +0 -1
  294. package/dist/assets/start-oRp78RMQ.js +0 -187
  295. package/dist/assets/team-BTz28XqK.js +0 -146
  296. package/dist/assets/th-D75Dlluo.js +0 -5
  297. package/dist/assets/traffic-Cea69sMW.js +0 -1
  298. package/dist/assets/transfer-BydXCVCg.js +0 -16
  299. package/dist/assets/unsubscribe-BjAjx-Fl.js +0 -1
  300. package/dist/assets/util-DkTwHdRu.js +0 -1
  301. package/dist/assets/util-DySzCymV.js +0 -1
  302. package/dist/assets/vendor-hooks-DAZ1H6Va.js +0 -1
  303. package/dist/assets/vendor-utils-BzQg432x.js +0 -23
  304. package/dist/assets/vi-D1mKYrmb.js +0 -5
  305. package/dist/assets/wait-connect-q0_7mz_u.js +0 -1
  306. package/dist/assets/wallet-hidden-topbar-joIVZ1nl.js +0 -68
  307. package/dist/assets/wizard-C5Kl-g70.js +0 -8
  308. package/dist/assets/wizard-components-DQrlaeeW.js +0 -52
  309. package/dist/assets/wrap-locale-5DJTJTXP.js +0 -1
@@ -1 +0,0 @@
1
- var U={exports:{}},B;function G(){return B||(B=1,(function(V,W){(function(F,T){V.exports=T()})(self,(()=>{return F={7629:(j,$,b)=>{const l=b(375),y=b(8571),g=b(9474),f=b(1687),t=b(8652),a=b(8160),n=b(3292),r=b(6354),e=b(8901),o=b(9708),s=b(6914),i=b(2294),u=b(6133),m=b(1152),d=b(8863),_=b(2036),v={Base:class{constructor(c){this.type=c,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new i.Ids,this._preferences=null,this._refs=new u.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return l(typeof o.describe=="function","Manifest functionality disabled"),o.describe(this)}allow(...c){return a.verifyFlat(c,"allow"),this._values(c,"_valids")}alter(c){l(c&&typeof c=="object"&&!Array.isArray(c),"Invalid targets argument"),l(!this._inRuleset(),"Cannot set alterations inside a ruleset");const h=this.clone();h.$_terms.alterations=h.$_terms.alterations||[];for(const p in c){const w=c[p];l(typeof w=="function","Alteration adjuster for",p,"must be a function"),h.$_terms.alterations.push({target:p,adjuster:w})}return h.$_temp.ruleset=!1,h}artifact(c){return l(c!==void 0,"Artifact cannot be undefined"),l(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",c)}cast(c){return l(c===!1||typeof c=="string","Invalid to value"),l(c===!1||this._definition.cast[c],"Type",this.type,"does not support casting to",c),this.$_setFlag("cast",c===!1?void 0:c)}default(c,h){return this._default("default",c,h)}description(c){return l(c&&typeof c=="string","Description must be a non-empty string"),this.$_setFlag("description",c)}empty(c){const h=this.clone();return c!==void 0&&(c=h.$_compile(c,{override:!1})),h.$_setFlag("empty",c,{clone:!1})}error(c){return l(c,"Missing error"),l(c instanceof Error||typeof c=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",c)}example(c,h={}){return l(c!==void 0,"Missing example"),a.assertOptions(h,["override"]),this._inner("examples",c,{single:!0,override:h.override})}external(c,h){return typeof c=="object"&&(l(!h,"Cannot combine options with description"),h=c.description,c=c.method),l(typeof c=="function","Method must be a function"),l(h===void 0||h&&typeof h=="string","Description must be a non-empty string"),this._inner("externals",{method:c,description:h},{single:!0})}failover(c,h){return this._default("failover",c,h)}forbidden(){return this.presence("forbidden")}id(c){return c?(l(typeof c=="string","id must be a non-empty string"),l(/^[^\.]+$/.test(c),"id cannot contain period character"),this.$_setFlag("id",c)):this.$_setFlag("id",void 0)}invalid(...c){return this._values(c,"_invalids")}label(c){return l(c&&typeof c=="string","Label name must be a non-empty string"),this.$_setFlag("label",c)}meta(c){return l(c!==void 0,"Meta cannot be undefined"),this._inner("metas",c,{single:!0})}note(...c){l(c.length,"Missing notes");for(const h of c)l(h&&typeof h=="string","Notes must be non-empty strings");return this._inner("notes",c)}only(c=!0){return l(typeof c=="boolean","Invalid mode:",c),this.$_setFlag("only",c)}optional(){return this.presence("optional")}prefs(c){l(c,"Missing preferences"),l(c.context===void 0,"Cannot override context"),l(c.externals===void 0,"Cannot override externals"),l(c.warnings===void 0,"Cannot override warnings"),l(c.debug===void 0,"Cannot override debug"),a.checkPreferences(c);const h=this.clone();return h._preferences=a.preferences(h._preferences,c),h}presence(c){return l(["optional","required","forbidden"].includes(c),"Unknown presence mode",c),this.$_setFlag("presence",c)}raw(c=!0){return this.$_setFlag("result",c?"raw":void 0)}result(c){return l(["raw","strip"].includes(c),"Unknown result mode",c),this.$_setFlag("result",c)}required(){return this.presence("required")}strict(c){const h=this.clone(),p=c!==void 0&&!c;return h._preferences=a.preferences(h._preferences,{convert:p}),h}strip(c=!0){return this.$_setFlag("result",c?"strip":void 0)}tag(...c){l(c.length,"Missing tags");for(const h of c)l(h&&typeof h=="string","Tags must be non-empty strings");return this._inner("tags",c)}unit(c){return l(c&&typeof c=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",c)}valid(...c){a.verifyFlat(c,"valid");const h=this.allow(...c);return h.$_setFlag("only",!!h._valids,{clone:!1}),h}when(c,h){const p=this.clone();p.$_terms.whens||(p.$_terms.whens=[]);const w=n.when(p,c,h);if(!["any","link"].includes(p.type)){const x=w.is?[w]:w.switch;for(const k of x)l(!k.then||k.then.type==="any"||k.then.type===p.type,"Cannot combine",p.type,"with",k.then&&k.then.type),l(!k.otherwise||k.otherwise.type==="any"||k.otherwise.type===p.type,"Cannot combine",p.type,"with",k.otherwise&&k.otherwise.type)}return p.$_terms.whens.push(w),p.$_mutateRebuild()}cache(c){l(!this._inRuleset(),"Cannot set caching inside a ruleset"),l(!this._cache,"Cannot override schema cache"),l(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const h=this.clone();return h._cache=c||t.provider.provision(),h.$_temp.ruleset=!1,h}clone(){const c=Object.create(Object.getPrototypeOf(this));return this._assign(c)}concat(c){l(a.isSchema(c),"Invalid schema object"),l(this.type==="any"||c.type==="any"||c.type===this.type,"Cannot merge type",this.type,"with another type:",c.type),l(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),l(!c._inRuleset(),"Cannot concatenate a schema with open ruleset");let h=this.clone();if(this.type==="any"&&c.type!=="any"){const p=c.clone();for(const w of Object.keys(h))w!=="type"&&(p[w]=h[w]);h=p}h._ids.concat(c._ids),h._refs.register(c,u.toSibling),h._preferences=h._preferences?a.preferences(h._preferences,c._preferences):c._preferences,h._valids=_.merge(h._valids,c._valids,c._invalids),h._invalids=_.merge(h._invalids,c._invalids,c._valids);for(const p of c._singleRules.keys())h._singleRules.has(p)&&(h._rules=h._rules.filter((w=>w.keep||w.name!==p)),h._singleRules.delete(p));for(const p of c._rules)c._definition.rules[p.method].multi||h._singleRules.set(p.name,p),h._rules.push(p);if(h._flags.empty&&c._flags.empty){h._flags.empty=h._flags.empty.concat(c._flags.empty);const p=Object.assign({},c._flags);delete p.empty,f(h._flags,p)}else if(c._flags.empty){h._flags.empty=c._flags.empty;const p=Object.assign({},c._flags);delete p.empty,f(h._flags,p)}else f(h._flags,c._flags);for(const p in c.$_terms){const w=c.$_terms[p];w?h.$_terms[p]?h.$_terms[p]=h.$_terms[p].concat(w):h.$_terms[p]=w.slice():h.$_terms[p]||(h.$_terms[p]=w)}return this.$_root._tracer&&this.$_root._tracer._combine(h,[this,c]),h.$_mutateRebuild()}extend(c){return l(!c.base,"Cannot extend type with another base"),e.type(this,c)}extract(c){return c=Array.isArray(c)?c:c.split("."),this._ids.reach(c)}fork(c,h){l(!this._inRuleset(),"Cannot fork inside a ruleset");let p=this;for(let w of[].concat(c))w=Array.isArray(w)?w:w.split("."),p=p._ids.fork(w,h,p);return p.$_temp.ruleset=!1,p}rule(c){const h=this._definition;a.assertOptions(c,Object.keys(h.modifiers)),l(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const p=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;l(p>=0&&p<this._rules.length,"Cannot apply rules to empty ruleset");const w=this.clone();for(let x=p;x<w._rules.length;++x){const k=w._rules[x],R=y(k);for(const S in c)h.modifiers[S](R,c[S]),l(R.name===k.name,"Cannot change rule name");w._rules[x]=R,w._singleRules.get(R.name)===k&&w._singleRules.set(R.name,R)}return w.$_temp.ruleset=!1,w.$_mutateRebuild()}get ruleset(){l(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const c=this.clone();return c.$_temp.ruleset=c._rules.length,c}get $(){return this.ruleset}tailor(c){c=[].concat(c),l(!this._inRuleset(),"Cannot tailor inside a ruleset");let h=this;if(this.$_terms.alterations)for(const{target:p,adjuster:w}of this.$_terms.alterations)c.includes(p)&&(h=w(h),l(a.isSchema(h),"Alteration adjuster for",p,"failed to return a schema object"));return h=h.$_modify({each:p=>p.tailor(c),ref:!1}),h.$_temp.ruleset=!1,h.$_mutateRebuild()}tracer(){return m.location?m.location(this):this}validate(c,h){return d.entry(c,this,h)}validateAsync(c,h){return d.entryAsync(c,this,h)}$_addRule(c){typeof c=="string"&&(c={name:c}),l(c&&typeof c=="object","Invalid options"),l(c.name&&typeof c.name=="string","Invalid rule name");for(const k in c)l(k[0]!=="_","Cannot set private rule properties");const h=Object.assign({},c);h._resolve=[],h.method=h.method||h.name;const p=this._definition.rules[h.method],w=h.args;l(p,"Unknown rule",h.method);const x=this.clone();if(w){l(Object.keys(w).length===1||Object.keys(w).length===this._definition.rules[h.name].args.length,"Invalid rule definition for",this.type,h.name);for(const k in w){let R=w[k];if(p.argsByName){const S=p.argsByName.get(k);if(S.ref&&a.isResolvable(R))h._resolve.push(k),x.$_mutateRegister(R);else if(S.normalize&&(R=S.normalize(R),w[k]=R),S.assert){const A=a.validateArg(R,k,S);l(!A,A,"or reference")}}R!==void 0?w[k]=R:delete w[k]}}return p.multi||(x._ruleRemove(h.name,{clone:!1}),x._singleRules.set(h.name,h)),x.$_temp.ruleset===!1&&(x.$_temp.ruleset=null),p.priority?x._rules.unshift(h):x._rules.push(h),x}$_compile(c,h){return n.schema(this.$_root,c,h)}$_createError(c,h,p,w,x,k={}){const R=k.flags!==!1?this._flags:{},S=k.messages?s.merge(this._definition.messages,k.messages):this._definition.messages;return new r.Report(c,h,p,R,S,w,x)}$_getFlag(c){return this._flags[c]}$_getRule(c){return this._singleRules.get(c)}$_mapLabels(c){return c=Array.isArray(c)?c:c.split("."),this._ids.labels(c)}$_match(c,h,p,w){(p=Object.assign({},p)).abortEarly=!0,p._externals=!1,h.snapshot();const x=!d.validate(c,this,h,p,w).errors;return h.restore(),x}$_modify(c){return a.assertOptions(c,["each","once","ref","schema"]),i.schema(this,c)||this}$_mutateRebuild(){return l(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(c,{source:h,name:p,path:w,key:x})=>{const k=this._definition[h][p]&&this._definition[h][p].register;k!==!1&&this.$_mutateRegister(c,{family:k,key:x})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(c,{family:h,key:p}={}){this._refs.register(c,h),this._ids.register(c,{key:p})}$_property(c){return this._definition.properties[c]}$_reach(c){return this._ids.reach(c)}$_rootReferences(){return this._refs.roots()}$_setFlag(c,h,p={}){l(c[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const w=this._definition.flags[c]||{};if(g(h,w.default)&&(h=void 0),g(h,this._flags[c]))return this;const x=p.clone!==!1?this.clone():this;return h!==void 0?(x._flags[c]=h,x.$_mutateRegister(h)):delete x._flags[c],c[0]!=="_"&&(x.$_temp.ruleset=!1),x}$_parent(c,...h){return this[c][a.symbols.parent].call(this,...h)}$_validate(c,h,p){return d.validate(c,this,h,p)}_assign(c){c.type=this.type,c.$_root=this.$_root,c.$_temp=Object.assign({},this.$_temp),c.$_temp.whens={},c._ids=this._ids.clone(),c._preferences=this._preferences,c._valids=this._valids&&this._valids.clone(),c._invalids=this._invalids&&this._invalids.clone(),c._rules=this._rules.slice(),c._singleRules=y(this._singleRules,{shallow:!0}),c._refs=this._refs.clone(),c._flags=Object.assign({},this._flags),c._cache=null,c.$_terms={};for(const h in this.$_terms)c.$_terms[h]=this.$_terms[h]?this.$_terms[h].slice():null;c.$_super={};for(const h in this.$_super)c.$_super[h]=this._super[h].bind(c);return c}_bare(){const c=this.clone();c._reset();const h=c._definition.terms;for(const p in h){const w=h[p];c.$_terms[p]=w.init}return c.$_mutateRebuild()}_default(c,h,p={}){return a.assertOptions(p,"literal"),l(h!==void 0,"Missing",c,"value"),l(typeof h=="function"||!p.literal,"Only function value supports literal option"),typeof h=="function"&&p.literal&&(h={[a.symbols.literal]:!0,literal:h}),this.$_setFlag(c,h)}_generate(c,h,p){if(!this.$_terms.whens)return{schema:this};const w=[],x=[];for(let S=0;S<this.$_terms.whens.length;++S){const A=this.$_terms.whens[S];if(A.concat){w.push(A.concat),x.push(`${S}.concat`);continue}const O=A.ref?A.ref.resolve(c,h,p):c,C=A.is?[A]:A.switch,M=x.length;for(let D=0;D<C.length;++D){const{is:E,then:I,otherwise:L}=C[D],N=`${S}${A.switch?"."+D:""}`;if(E.$_match(O,h.nest(E,`${N}.is`),p)){if(I){const P=h.localize([...h.path,`${N}.then`],h.ancestors,h.schemas),{schema:z,id:q}=I._generate(c,P,p);w.push(z),x.push(`${N}.then${q?`(${q})`:""}`);break}}else if(L){const P=h.localize([...h.path,`${N}.otherwise`],h.ancestors,h.schemas),{schema:z,id:q}=L._generate(c,P,p);w.push(z),x.push(`${N}.otherwise${q?`(${q})`:""}`);break}}if(A.break&&x.length>M)break}const k=x.join(", ");if(h.mainstay.tracer.debug(h,"rule","when",k),!k)return{schema:this};if(!h.mainstay.tracer.active&&this.$_temp.whens[k])return{schema:this.$_temp.whens[k],id:k};let R=this;this._definition.generate&&(R=this._definition.generate(this,c,h,p));for(const S of w)R=R.concat(S);return this.$_root._tracer&&this.$_root._tracer._combine(R,[this,...w]),this.$_temp.whens[k]=R,{schema:R,id:k}}_inner(c,h,p={}){l(!this._inRuleset(),`Cannot set ${c} inside a ruleset`);const w=this.clone();return w.$_terms[c]&&!p.override||(w.$_terms[c]=[]),p.single?w.$_terms[c].push(h):w.$_terms[c].push(...h),w.$_temp.ruleset=!1,w}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(c,h={}){if(!this._singleRules.has(c))return this;const p=h.clone!==!1?this.clone():this;p._singleRules.delete(c);const w=[];for(let x=0;x<p._rules.length;++x){const k=p._rules[x];k.name!==c||k.keep?w.push(k):p._inRuleset()&&x<p.$_temp.ruleset&&--p.$_temp.ruleset}return p._rules=w,p}_values(c,h){a.verifyFlat(c,h.slice(1,-1));const p=this.clone(),w=c[0]===a.symbols.override;if(w&&(c=c.slice(1)),!p[h]&&c.length?p[h]=new _:w&&(p[h]=c.length?new _:null,p.$_mutateRebuild()),!p[h])return p;w&&p[h].override();for(const x of c){l(x!==void 0,"Cannot call allow/valid/invalid with undefined"),l(x!==a.symbols.override,"Override must be the first value");const k=h==="_invalids"?"_valids":"_invalids";p[k]&&(p[k].remove(x),p[k].length||(l(h==="_valids"||!p._flags.only,"Setting invalid value",x,"leaves schema rejecting all values due to previous valid rule"),p[k]=null)),p[h].add(x,p._refs)}return p}}};v.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,j.exports=new v.Base},8652:(j,$,b)=>{const l=b(375),y=b(8571),g=b(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};$.provider={provision:t=>new f.Cache(t)},f.Cache=class{constructor(t={}){g.assertOptions(t,["max"]),l(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(t,a){if(t!==null&&!f.supported.has(typeof t))return;let n=this._map.get(t);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:t,value:a}),this._map.set(t,n),this._compact()}get(t){const a=this._map.get(t);if(a)return this._list.first(a),y(a.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:a,prev:n}=t;return a.prev=n,n&&(n.next=a),t===this.tail&&(this.tail=a),t.prev=null,t.next=null,t}}},8160:(j,$,b)=>{const l=b(375),y=b(7916),g=b(5934);let f,t;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};$.version=g.version,$.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},$.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},$.assertOptions=function(n,r,e="Options"){l(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const o=Object.keys(n).filter((s=>!r.includes(s)));l(o.length===0,`${e} contain unknown keys: ${o}`)},$.checkPreferences=function(n){t=t||b(3378);const r=t.preferences.validate(n);if(r.error)throw new y([r.error.details[0].message])},$.compare=function(n,r,e){switch(e){case"=":return n===r;case">":return n>r;case"<":return n<r;case">=":return n>=r;case"<=":return n<=r}},$.default=function(n,r){return n===void 0?r:n},$.isIsoDate=function(n){return a.isoDate.test(n)},$.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},$.isResolvable=function(n){return!!n&&(n[$.symbols.ref]||n[$.symbols.template])},$.isSchema=function(n,r={}){const e=n&&n[$.symbols.any];return!!e&&(l(r.legacy||e.version===$.version,"Cannot mix different versions of joi schemas"),!0)},$.isValues=function(n){return n[$.symbols.values]},$.limit=function(n){return Number.isSafeInteger(n)&&n>=0},$.preferences=function(n,r){f=f||b(6914),n=n||{},r=r||{};const e=Object.assign({},n,r);return r.errors&&n.errors&&(e.errors=Object.assign({},n.errors,r.errors),e.errors.wrap=Object.assign({},n.errors.wrap,r.errors.wrap)),r.messages&&(e.messages=f.compile(r.messages,n.messages)),delete e[$.symbols.prefs],e},$.tryWithPath=function(n,r,e={}){try{return n()}catch(o){throw o.path!==void 0?o.path=r+"."+o.path:o.path=r,e.append&&(o.message=`${o.message} (${o.path})`),o}},$.validateArg=function(n,r,{assert:e,message:o}){if($.isSchema(e)){const s=e.validate(n);return s.error?s.error.message:void 0}if(!e(n))return r?`${r} ${o}`:o},$.verifyFlat=function(n,r){for(const e of n)l(!Array.isArray(e),"Method no longer accepts array arguments:",r)}},3292:(j,$,b)=>{const l=b(375),y=b(8160),g=b(6133),f={};$.schema=function(t,a,n={}){y.assertOptions(n,["appendPath","override"]);try{return f.schema(t,a,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},f.schema=function(t,a,n){l(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(l(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(e,...o)=>n.override!==!1?e.valid(t.override,...o):e.valid(...o);if(f.simple(a))return r(t,a);if(typeof a=="function")return t.custom(a);if(l(typeof a=="object","Invalid schema content:",typeof a),y.isResolvable(a))return r(t,a);if(y.isSchema(a))return a;if(Array.isArray(a)){for(const e of a)if(!f.simple(e))return t.alternatives().try(...a);return r(t,...a)}return a instanceof RegExp?t.string().regex(a):a instanceof Date?r(t.date(),a):(l(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(a))},$.ref=function(t,a){return g.isRef(t)?t:g.create(t,a)},$.compile=function(t,a,n={}){y.assertOptions(n,["legacy"]);const r=a&&a[y.symbols.any];if(r)return l(n.legacy||r.version===y.version,"Cannot mix different versions of joi schemas:",r.version,y.version),a;if(typeof a!="object"||!n.legacy)return $.schema(t,a,{appendPath:!0});const e=f.walk(a);return e?e.compile(e.root,a):$.schema(t,a,{appendPath:!0})},f.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const n of t){const r=f.walk(n);if(r)return r}return null}const a=t[y.symbols.any];if(a)return{root:t[a.root],compile:a.compile};l(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in t){const r=f.walk(t[n]);if(r)return r}return null},f.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},$.when=function(t,a,n){if(n===void 0&&(l(a&&typeof a=="object","Missing options"),n=a,a=g.create(".")),Array.isArray(n)&&(n={switch:n}),y.assertOptions(n,["is","not","then","otherwise","switch","break"]),y.isSchema(a))return l(n.is===void 0,'"is" can not be used with a schema condition'),l(n.not===void 0,'"not" can not be used with a schema condition'),l(n.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(t,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(l(g.isRef(a)||typeof a=="string","Invalid condition:",a),l(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let e=n;n.not!==void 0&&(e={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let o=e.is!==void 0?t.$_compile(e.is):t.$_root.invalid(null,!1,0,"").required();return l(e.then!==void 0||e.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),l(e.break===void 0||e.then===void 0||e.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||g.isRef(n.is)||y.isSchema(n.is)||(o=o.required()),f.condition(t,{ref:$.ref(a),is:o,then:e.then,otherwise:e.otherwise,break:e.break})}l(Array.isArray(n.switch),'"switch" must be an array'),l(n.is===void 0,'Cannot combine "switch" with "is"'),l(n.not===void 0,'Cannot combine "switch" with "not"'),l(n.then===void 0,'Cannot combine "switch" with "then"');const r={ref:$.ref(a),switch:[],break:n.break};for(let e=0;e<n.switch.length;++e){const o=n.switch[e],s=e===n.switch.length-1;y.assertOptions(o,s?["is","then","otherwise"]:["is","then"]),l(o.is!==void 0,'Switch statement missing "is"'),l(o.then!==void 0,'Switch statement missing "then"');const i={is:t.$_compile(o.is),then:t.$_compile(o.then)};if(g.isRef(o.is)||y.isSchema(o.is)||(i.is=i.is.required()),s){l(n.otherwise===void 0||o.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=n.otherwise!==void 0?n.otherwise:o.otherwise;u!==void 0&&(l(r.break===void 0,"Cannot specify both otherwise and break"),i.otherwise=t.$_compile(u))}r.switch.push(i)}return r},f.condition=function(t,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=t.$_compile(a[n]);return a}},6354:(j,$,b)=>{const l=b(5688),y=b(8160),g=b(3328);$.Report=class{constructor(f,t,a,n,r,e,o){if(this.code=f,this.flags=n,this.messages=r,this.path=e.path,this.prefs=o,this.state=e,this.value=t,this.message=null,this.template=null,this.local=a||{},this.local.label=$.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,t){return $.template(this.value,f,t||this.code,this.state,this.prefs)}},$.path=function(f){let t="";for(const a of f)typeof a!="object"&&(typeof a=="string"?(t&&(t+="."),t+=a):t+=`[${a}]`);return t},$.template=function(f,t,a,n,r){if(!t)return;if(g.isTemplate(t))return a!=="root"?t:null;let e=r.errors.language;if(y.isResolvable(e)&&(e=e.resolve(f,n,r)),e&&t[e]){if(t[e][a]!==void 0)return t[e][a];if(t[e]["*"]!==void 0)return t[e]["*"]}return t[a]?t[a]:t["*"]},$.label=function(f,t,a,n){if(f.label)return f.label;if(!a.errors.label)return"";let r=t.path;return a.errors.label==="key"&&t.path.length>1&&(r=t.path.slice(-1)),$.path(r)||$.template(null,a.messages,"root",t,a)||n&&$.template(null,n,"root",t,a)||"value"},$.process=function(f,t,a){if(!f)return null;const{override:n,message:r,details:e}=$.details(f);if(n)return n;if(a.errors.stack)return new $.ValidationError(r,e,t);const o=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new $.ValidationError(r,e,t);return Error.stackTraceLimit=o,s},$.details=function(f,t={}){let a=[];const n=[];for(const r of f){if(r instanceof Error){if(t.override!==!1)return{override:r};const o=r.toString();a.push(o),n.push({message:o,type:"override",context:{error:r}});continue}const e=r.toString();a.push(e),n.push({message:e,path:r.path.filter((o=>typeof o!="object")),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},$.ValidationError=class extends Error{constructor(f,t,a){super(f),this._original=a,this.details=t}static isError(f){return f instanceof $.ValidationError}},$.ValidationError.prototype.isJoi=!0,$.ValidationError.prototype.name="ValidationError",$.ValidationError.prototype.annotate=l.error},8901:(j,$,b)=>{const l=b(375),y=b(8571),g=b(8160),f=b(6914),t={};$.type=function(a,n){const r=Object.getPrototypeOf(a),e=y(r),o=a._assign(Object.create(e)),s=Object.assign({},n);delete s.base,e._definition=s;const i=r._definition||{};s.messages=f.merge(i.messages,s.messages),s.properties=Object.assign({},i.properties,s.properties),o.type=s.type,s.flags=Object.assign({},i.flags,s.flags);const u=Object.assign({},i.terms);if(s.terms)for(const v in s.terms){const c=s.terms[v];l(o.$_terms[v]===void 0,"Invalid term override for",s.type,v),o.$_terms[v]=c.init,u[v]=c}s.terms=u,s.args||(s.args=i.args),s.prepare=t.prepare(s.prepare,i.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=t.coerce(s.coerce,i.coerce),s.validate=t.validate(s.validate,i.validate);const m=Object.assign({},i.rules);if(s.rules)for(const v in s.rules){const c=s.rules[v];l(typeof c=="object","Invalid rule definition for",s.type,v);let h=c.method;if(h===void 0&&(h=function(){return this.$_addRule(v)}),h&&(l(!e[v],"Rule conflict in",s.type,v),e[v]=h),l(!m[v],"Rule conflict in",s.type,v),m[v]=c,c.alias){const p=[].concat(c.alias);for(const w of p)e[w]=c.method}c.args&&(c.argsByName=new Map,c.args=c.args.map((p=>(typeof p=="string"&&(p={name:p}),l(!c.argsByName.has(p.name),"Duplicated argument name",p.name),g.isSchema(p.assert)&&(p.assert=p.assert.strict().label(p.name)),c.argsByName.set(p.name,p),p))))}s.rules=m;const d=Object.assign({},i.modifiers);if(s.modifiers)for(const v in s.modifiers){l(!e[v],"Rule conflict in",s.type,v);const c=s.modifiers[v];l(typeof c=="function","Invalid modifier definition for",s.type,v);const h=function(p){return this.rule({[v]:p})};e[v]=h,d[v]=c}if(s.modifiers=d,s.overrides){e._super=r,o.$_super={};for(const v in s.overrides)l(r[v],"Cannot override missing",v),s.overrides[v][g.symbols.parent]=r[v],o.$_super[v]=r[v].bind(o);Object.assign(e,s.overrides)}s.cast=Object.assign({},i.cast,s.cast);const _=Object.assign({},i.manifest,s.manifest);return _.build=t.build(s.manifest&&s.manifest.build,i.manifest&&i.manifest.build),s.manifest=_,s.rebuild=t.rebuild(s.rebuild,i.rebuild),o},t.build=function(a,n){return a&&n?function(r,e){return n(a(r,e),e)}:a||n},t.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(r,e){let o;if((!n.from||n.from.includes(typeof r))&&(o=n.method(r,e),o)){if(o.errors||o.value===void 0)return o;r=o.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,e);if(s)return s}return o}}:a||n},t.prepare=function(a,n){return a&&n?function(r,e){const o=a(r,e);if(o){if(o.errors||o.value===void 0)return o;r=o.value}return n(r,e)||o}:a||n},t.rebuild=function(a,n){return a&&n?function(r){n(r),a(r)}:a||n},t.validate=function(a,n){return a&&n?function(r,e){const o=n(r,e);if(o){if(o.errors&&(!Array.isArray(o.errors)||o.errors.length))return o;r=o.value}return a(r,e)||o}:a||n}},5107:(j,$,b)=>{const l=b(375),y=b(8571),g=b(8652),f=b(8160),t=b(3292),a=b(6354),n=b(8901),r=b(9708),e=b(6133),o=b(3328),s=b(1152);let i;const u={types:{alternatives:b(4946),any:b(8068),array:b(546),boolean:b(4937),date:b(7500),function:b(390),link:b(8785),number:b(3832),object:b(8966),string:b(7417),symbol:b(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const m={_types:new Set(Object.keys(u.types))};for(const d of m._types)m[d]=function(..._){return l(!_.length||["alternatives","link","object"].includes(d),"The",d,"type does not allow arguments"),u.generate(this,u.types[d],_)};for(const d of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])m[d]=function(..._){return this.any()[d](..._)};Object.assign(m,u.methods);for(const d in u.aliases){const _=u.aliases[d];m[d]=m[_]}return m.x=m.expression,s.setup&&s.setup(m),m}};u.methods={ValidationError:a.ValidationError,version:f.version,cache:g.provider,assert(m,d,..._){u.assert(m,d,!0,_)},attempt:(m,d,..._)=>u.assert(m,d,!1,_),build(m){return l(typeof r.build=="function","Manifest functionality disabled"),r.build(this,m)},checkPreferences(m){f.checkPreferences(m)},compile(m,d){return t.compile(this,m,d)},defaults(m){l(typeof m=="function","modifier must be a function");const d=Object.assign({},this);for(const _ of d._types){const v=m(d[_]());l(f.isSchema(v),"modifier must return a valid schema object"),d[_]=function(...c){return u.generate(this,v,c)}}return d},expression:(...m)=>new o(...m),extend(...m){f.verifyFlat(m,"extend"),i=i||b(3378),l(m.length,"You need to provide at least one extension"),this.assert(m,i.extensions);const d=Object.assign({},this);d._types=new Set(d._types);for(let _ of m){typeof _=="function"&&(_=_(d)),this.assert(_,i.extension);const v=u.expandExtension(_,d);for(const c of v){l(d[c.type]===void 0||d._types.has(c.type),"Cannot override name",c.type);const h=c.base||this.any(),p=n.type(h,c);d._types.add(c.type),d[c.type]=function(...w){return u.generate(this,p,w)}}}return d},isError:a.ValidationError.isError,isExpression:o.isTemplate,isRef:e.isRef,isSchema:f.isSchema,in:(...m)=>e.in(...m),override:f.symbols.override,ref:(...m)=>e.create(...m),types(){const m={};for(const d of this._types)m[d]=this[d]();for(const d in u.aliases)m[d]=this[d]();return m}},u.assert=function(m,d,_,v){const c=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,h=c!==null?v[1]:v[0],p=d.validate(m,f.preferences({errors:{stack:!0}},h||{}));let w=p.error;if(!w)return p.value;if(c instanceof Error)throw c;const x=_&&typeof w.annotate=="function"?w.annotate():w.message;throw w instanceof a.ValidationError==0&&(w=y(w)),w.message=c?`${c} ${x}`:x,w},u.generate=function(m,d,_){return l(m,"Must be invoked on a Joi instance."),d.$_root=m,d._definition.args&&_.length?d._definition.args(d,..._):d},u.expandExtension=function(m,d){if(typeof m.type=="string")return[m];const _=[];for(const v of d._types)if(m.type.test(v)){const c=Object.assign({},m);c.type=v,c.base=d[v](),_.push(c)}return _},j.exports=u.root()},6914:(j,$,b)=>{const l=b(375),y=b(8571),g=b(3328);$.compile=function(f,t){if(typeof f=="string")return l(!t,"Cannot set single message string"),new g(f);if(g.isTemplate(f))return l(!t,"Cannot set single message template"),f;l(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),t=t?y(t):{};for(let a in f){const n=f[a];if(a==="root"||g.isTemplate(n)){t[a]=n;continue}if(typeof n=="string"){t[a]=new g(n);continue}l(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const r=a;for(a in t[r]=t[r]||{},n){const e=n[a];a==="root"||g.isTemplate(e)?t[r][a]=e:(l(typeof e=="string","Invalid message for",a,"in",r),t[r][a]=new g(e))}}return t},$.decompile=function(f){const t={};for(let a in f){const n=f[a];if(a==="root"){t.root=n;continue}if(g.isTemplate(n)){t[a]=n.describe({compact:!0});continue}const r=a;for(a in t[r]={},n){const e=n[a];a!=="root"?t[r][a]=e.describe({compact:!0}):t[r].root=e}}return t},$.merge=function(f,t){if(!f)return $.compile(t);if(!t)return f;if(typeof t=="string")return new g(t);if(g.isTemplate(t))return t;const a=y(f);for(let n in t){const r=t[n];if(n==="root"||g.isTemplate(r)){a[n]=r;continue}if(typeof r=="string"){a[n]=new g(r);continue}l(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);const e=n;for(n in a[e]=a[e]||{},r){const o=r[n];n==="root"||g.isTemplate(o)?a[e][n]=o:(l(typeof o=="string","Invalid message for",n,"in",e),a[e][n]=new g(o))}}return a}},2294:(j,$,b)=>{const l=b(375),y=b(8160),g=b(6133),f={};$.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new f.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[a,n]of t._byId.entries())l(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of t._byKey.entries())l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(t,a,n){const r=this._collect(t);r.push({schema:n});const e=r.shift();let o={id:e.id,schema:a(e.schema)};l(y.isSchema(o.schema),"adjuster function failed to return a joi schema type");for(const s of r)o={id:s.id,schema:f.fork(s.schema,o.id,o.schema)};return o.schema}labels(t,a=[]){const n=t[0],r=this._get(n);if(!r)return[...a,...t].join(".");const e=t.slice(1);return a=[...a,r.schema._flags.label||n],e.length?r.schema._ids.labels(e,a):a.join(".")}reach(t,a=[]){const n=t[0],r=this._get(n);l(r,"Schema does not contain path",[...a,...t].join("."));const e=t.slice(1);return e.length?r.schema._ids.reach(e,[...a,n]):r.schema}register(t,{key:a}={}){if(!t||!y.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const n=t._flags.id;if(n){const r=this._byId.get(n);l(!r||r.schema===t,"Cannot add different schemas with the same id:",n),l(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}a&&(l(!this._byKey.has(a),"Schema already contains key:",a),l(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:t,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,a=[],n=[]){const r=t[0],e=this._get(r);l(e,"Schema does not contain path",[...a,...t].join(".")),n=[e,...n];const o=t.slice(1);return o.length?e.schema._ids._collect(o,[...a,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}},f.fork=function(t,a,n){const r=$.schema(t,{each:(e,{key:o})=>{if(a===(e._flags.id||o))return n},ref:!1});return r?r.$_mutateRebuild():t},$.schema=function(t,a){let n;for(const r in t._flags){if(r[0]==="_")continue;const e=f.scan(t._flags[r],{source:"flags",name:r},a);e!==void 0&&(n=n||t.clone(),n._flags[r]=e)}for(let r=0;r<t._rules.length;++r){const e=t._rules[r],o=f.scan(e.args,{source:"rules",name:e.name},a);if(o!==void 0){n=n||t.clone();const s=Object.assign({},e);s.args=o,n._rules[r]=s,n._singleRules.get(e.name)===e&&n._singleRules.set(e.name,s)}}for(const r in t.$_terms){if(r[0]==="_")continue;const e=f.scan(t.$_terms[r],{source:"terms",name:r},a);e!==void 0&&(n=n||t.clone(),n.$_terms[r]=e)}return n},f.scan=function(t,a,n,r,e){const o=r||[];if(t===null||typeof t!="object")return;let s;if(Array.isArray(t)){for(let i=0;i<t.length;++i){const u=a.source==="terms"&&a.name==="keys"&&t[i].key,m=f.scan(t[i],a,n,[i,...o],u);m!==void 0&&(s=s||t.slice(),s[i]=m)}return s}if(n.schema!==!1&&y.isSchema(t)||n.ref!==!1&&g.isRef(t)){const i=n.each(t,{...a,path:o,key:e});return i===t?void 0:i}for(const i in t){if(i[0]==="_")continue;const u=f.scan(t[i],a,n,[i,...o],e);u!==void 0&&(s=s||Object.assign({},t),s[i]=u)}return s}},6133:(j,$,b)=>{const l=b(375),y=b(8571),g=b(9621),f=b(8160);let t;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};$.create=function(n,r={}){l(typeof n=="string","Invalid reference key:",n),f.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),l(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const e=Object.assign({},a.defaults,r);delete e.prefix;const o=e.separator,s=a.context(n,o,r.prefix);if(e.type=s.type,n=s.key,e.type==="value")if(s.root&&(l(!o||n[0]!==o,"Cannot specify relative path with root prefix"),e.ancestor="root",n||(n=null)),o&&o===n)n=null,e.ancestor=0;else if(e.ancestor!==void 0)l(!o||!n||n[0]!==o,"Cannot combine prefix with ancestor option");else{const[i,u]=a.ancestor(n,o);u&&(n=n.slice(u))===""&&(n=null),e.ancestor=i}return e.path=o?n===null?[]:n.split(o):[n],new a.Ref(e)},$.in=function(n,r={}){return $.create(n,{...r,in:!0})},$.isRef=function(n){return!!n&&!!n[f.symbols.ref]},a.Ref=class{constructor(n){l(typeof n=="object","Invalid reference construction"),f.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),l([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),l(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),l(!n.map||Array.isArray(n.map),"options.map must be an array"),l(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),l(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(n,r,e,o,s={}){return l(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(e.context,r,s):this.type==="local"?this._resolve(o,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(l(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(n,r,s)}_resolve(n,r,e){let o;if(this.type==="value"&&r.mainstay.shadow&&e.shadow!==!1&&(o=r.mainstay.shadow.get(this.absolute(r))),o===void 0&&(o=g(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(o=this.adjust(o)),this.map){const s=this.map.get(o);s!==void 0&&(o=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,o),o}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(n[r]=this[r]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${n||""}`}},a.Ref.prototype[f.symbols.ref]=!0,$.build=function(n){return(n=Object.assign({},a.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new a.Ref(n)},a.context=function(n,r,e={}){if(n=n.trim(),e){const o=e.global===void 0?"$":e.global;if(o!==r&&n.startsWith(o))return{key:n.slice(o.length),type:"global"};const s=e.local===void 0?"#":e.local;if(s!==r&&n.startsWith(s))return{key:n.slice(s.length),type:"local"};const i=e.root===void 0?"/":e.root;if(i!==r&&n.startsWith(i))return{key:n.slice(i.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,r){if(!r)return[1,0];if(n[0]!==r)return[1,0];if(n[1]!==r)return[0,1];let e=2;for(;n[e]===r;)++e;return[e-1,e]},$.toSibling=0,$.toParent=1,$.Manager=class{constructor(){this.refs=[]}register(n,r){if(n)if(r=r===void 0?$.toParent:r,Array.isArray(n))for(const e of n)this.register(e,r);else if(f.isSchema(n))for(const e of n._refs.refs)e.ancestor-r>=0&&this.refs.push({ancestor:e.ancestor-r,root:e.root});else $.isRef(n)&&n.type==="value"&&n.ancestor-r>=0&&this.refs.push({ancestor:n.ancestor-r,root:n.root}),t=t||b(3328),t.isTemplate(n)&&this.register(n.refs(),r)}get length(){return this.refs.length}clone(){const n=new $.Manager;return n.refs=y(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter((n=>!n.ancestor)).map((n=>n.root))}}},3378:(j,$,b)=>{const l=b(5107),y={};y.wrap=l.string().min(1).max(2).allow(!1),$.preferences=l.object({allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),context:l.object(),convert:l.boolean(),dateFormat:l.valid("date","iso","string","time","utc"),debug:l.boolean(),errors:{escapeHtml:l.boolean(),label:l.valid("path","key",!1),language:[l.string(),l.object().ref()],render:l.boolean(),stack:l.boolean(),wrap:{label:y.wrap,array:y.wrap,string:y.wrap}},externals:l.boolean(),messages:l.object(),noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:l.valid("required","optional","forbidden"),skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()}).strict(),y.nameRx=/^[a-zA-Z0-9]\w*$/,y.rule=l.object({alias:l.array().items(l.string().pattern(y.nameRx)).single(),args:l.array().items(l.string(),l.object({name:l.string().pattern(y.nameRx).required(),ref:l.boolean(),assert:l.alternatives([l.function(),l.object().schema()]).conditional("ref",{is:!0,then:l.required()}),normalize:l.function(),message:l.string().when("assert",{is:l.function(),then:l.required()})})),convert:l.boolean(),manifest:l.boolean(),method:l.function().allow(!1),multi:l.boolean(),validate:l.function()}),$.extension=l.object({type:l.alternatives([l.string(),l.object().regex()]).required(),args:l.function(),cast:l.object().pattern(y.nameRx,l.object({from:l.function().maxArity(1).required(),to:l.function().minArity(1).maxArity(2).required()})),base:l.object().schema().when("type",{is:l.object().regex(),then:l.forbidden()}),coerce:[l.function().maxArity(3),l.object({method:l.function().maxArity(3).required(),from:l.array().items(l.string()).single()})],flags:l.object().pattern(y.nameRx,l.object({setter:l.string(),default:l.any()})),manifest:{build:l.function().arity(2)},messages:[l.object(),l.string()],modifiers:l.object().pattern(y.nameRx,l.function().minArity(1).maxArity(2)),overrides:l.object().pattern(y.nameRx,l.function()),prepare:l.function().maxArity(3),rebuild:l.function().arity(1),rules:l.object().pattern(y.nameRx,y.rule),terms:l.object().pattern(y.nameRx,l.object({init:l.array().allow(null).required(),manifest:l.object().pattern(/.+/,[l.valid("schema","single"),l.object({mapped:l.object({from:l.string().required(),to:l.string().required()}).required()})])})),validate:l.function().maxArity(3)}).strict(),$.extensions=l.array().items(l.object(),l.function().arity(1)).strict(),y.desc={buffer:l.object({buffer:l.string()}),func:l.object({function:l.function().required(),options:{literal:!0}}),override:l.object({override:!0}),ref:l.object({ref:l.object({type:l.valid("value","global","local"),path:l.array().required(),separator:l.string().length(1).allow(!1),ancestor:l.number().min(0).integer().allow("root"),map:l.array().items(l.array().length(2)).min(1),adjust:l.function(),iterables:l.boolean(),in:l.boolean(),render:l.boolean()}).required()}),regex:l.object({regex:l.string().min(3)}),special:l.object({special:l.valid("deep").required()}),template:l.object({template:l.string().required(),options:l.object()}),value:l.object({value:l.alternatives([l.object(),l.array()]).required()})},y.desc.entity=l.alternatives([l.array().items(l.link("...")),l.boolean(),l.function(),l.number(),l.string(),y.desc.buffer,y.desc.func,y.desc.ref,y.desc.regex,y.desc.special,y.desc.template,y.desc.value,l.link("/")]),y.desc.values=l.array().items(null,l.boolean(),l.function(),l.number().allow(1/0,-1/0),l.string().allow(""),l.symbol(),y.desc.buffer,y.desc.func,y.desc.override,y.desc.ref,y.desc.regex,y.desc.template,y.desc.value),y.desc.messages=l.object().pattern(/.+/,[l.string(),y.desc.template,l.object().pattern(/.+/,[l.string(),y.desc.template])]),$.description=l.object({type:l.string().required(),flags:l.object({cast:l.string(),default:l.any(),description:l.string(),empty:l.link("/"),failover:y.desc.entity,id:l.string(),label:l.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:l.boolean(),unit:l.string()}).unknown(),preferences:{allowUnknown:l.boolean(),abortEarly:l.boolean(),artifacts:l.boolean(),cache:l.boolean(),convert:l.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:l.boolean(),label:["path","key"],language:[l.string(),y.desc.ref],wrap:{label:y.wrap,array:y.wrap}},externals:l.boolean(),messages:y.desc.messages,noDefaults:l.boolean(),nonEnumerables:l.boolean(),presence:["required","optional","forbidden"],skipFunctions:l.boolean(),stripUnknown:l.object({arrays:l.boolean(),objects:l.boolean()}).or("arrays","objects").allow(!0,!1),warnings:l.boolean()},allow:y.desc.values,invalid:y.desc.values,rules:l.array().min(1).items({name:l.string().required(),args:l.object().min(1),keep:l.boolean(),message:[l.string(),y.desc.messages],warn:l.boolean()}),keys:l.object().pattern(/.*/,l.link("/")),link:y.desc.ref}).pattern(/^[a-z]\w*$/,l.any())},493:(j,$,b)=>{const l=b(8571),y=b(9621),g=b(8160),f={value:Symbol("value")};j.exports=f.State=class{constructor(t,a,n){this.path=t,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,a=null,n=null){const r=new f.State(t,a,this);return n&&r.schemas&&(r.schemas=[f.schemas(n),...r.schemas]),r}nest(t,a){const n=new f.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[f.schemas(t),...n.schemas],n.debug=a,n}shadow(t,a){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,t,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=l(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(t){return g.isSchema(t)?{schema:t}:t},f.Shadow=class{constructor(){this._values=null}set(t,a,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let e=0;e<t.length;++e){const o=t[e];let s=r.get(o);s||(s=new Map,r.set(o,s)),r=s}r[f.value]=a}get(t){const a=this.node(t);if(a)return a[f.value]}node(t){if(this._values)return y(this._values,t,{iterables:!0})}override(t,a){if(!this._values)return;const n=t.slice(0,-1),r=t[t.length-1],e=y(this._values,n,{iterables:!0});a?e.set(r,a):e&&e.delete(r)}}},3328:(j,$,b)=>{const l=b(375),y=b(8571),g=b(5277),f=b(1447),t=b(8160),a=b(6354),n=b(6133),r={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};j.exports=r.Template=class{constructor(e,o){if(l(typeof e=="string","Template source must be a string"),l(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,o){const{functions:s,...i}=o;this._settings=Object.keys(i).length?y(i):void 0,this._functions=s,this._functions&&(l(Object.keys(this._functions).every((u=>typeof u=="string")),"Functions keys must be strings"),l(Object.values(this._functions).every((u=>typeof u=="function")),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=r.encode(this.source),o=r.split(e);let s=!1;const i=[],u=o.shift();u&&i.push(u);for(const m of o){const d=m[0]!=="{",_=d?"}":"}}",v=m.indexOf(_);if(v===-1||m[1]==="{"){i.push(`{${r.decode(m)}`);continue}let c=m.slice(d?0:1,v);const h=c[0]===":";h&&(c=c.slice(1));const p=this._ref(r.decode(c),{raw:d,wrapped:h});i.push(p),typeof p!="string"&&(s=!0);const w=m.slice(v+_.length);w&&i.push(r.decode(w))}s?this._template=i:this.rendered=i.join("")}static date(e,o){return r.dateFormat[o.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const o={template:this.source};return this._settings&&(o.options=this._settings),this._functions&&(o.functions=this._functions),o}static build(e){return new r.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[t.symbols.template]}refs(){if(!this._template)return;const e=[];for(const o of this._template)typeof o!="string"&&e.push(...o.refs);return e}resolve(e,o,s,i){return this._template&&this._template.length===1?this._part(this._template[0],e,o,s,i,{}):this.render(e,o,s,i)}_part(e,...o){return e.ref?e.ref.resolve(...o):e.formula.evaluate(o)}render(e,o,s,i,u={}){if(!this.isDynamic())return this.rendered;const m=[];for(const d of this._template)if(typeof d=="string")m.push(d);else{const _=this._part(d,e,o,s,i,u),v=r.stringify(_,e,o,s,i,u);if(v!==void 0){const c=d.raw||(u.errors&&u.errors.escapeHtml)===!1?v:g(v);m.push(r.wrap(c,d.wrapped&&s.errors.wrap.label))}}return m.join("")}_ref(e,{raw:o,wrapped:s}){const i=[],u=d=>{const _=n.create(d,this._settings);return i.push(_),v=>{const c=_.resolve(...v);return c!==void 0?c:null}};try{const d=this._functions?{...r.functions,...this._functions}:r.functions;var m=new f.Parser(e,{reference:u,functions:d,constants:r.constants})}catch(d){throw d.message=`Invalid template variable "${e}" fails due to: ${d.message}`,d}if(m.single){if(m.single.type==="reference"){const d=i[0];return{ref:d,raw:o,refs:i,wrapped:s||d.type==="local"&&d.key==="label"}}return r.stringify(m.single.value)}return{formula:m,raw:o,refs:i}}toString(){return this.source}},r.Template.prototype[t.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(e){return e.replace(/\\(\{+)/g,((o,s)=>r.opens.slice(0,s.length))).replace(/\\(\}+)/g,((o,s)=>r.closes.slice(0,s.length)))},r.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(e){const o=[];let s="";for(let i=0;i<e.length;++i){const u=e[i];if(u==="{"){let m="";for(;i+1<e.length&&e[i+1]==="{";)m+="{",++i;o.push(s),s=m}else s+=u}return o.push(s),o},r.wrap=function(e,o){return o?o.length===1?`${o}${e}${o}`:`${o[0]}${e}${o[1]}`:e},r.stringify=function(e,o,s,i,u,m={}){const d=typeof e,_=i&&i.errors&&i.errors.wrap||{};let v=!1;if(n.isRef(e)&&e.render&&(v=e.in,e=e.resolve(o,s,i,u,{in:e.in,...m})),e===null)return"null";if(d==="string")return r.wrap(e,m.arrayItems&&_.string);if(d==="number"||d==="function"||d==="symbol")return e.toString();if(d!=="object")return JSON.stringify(e);if(e instanceof Date)return r.Template.date(e,i);if(e instanceof Map){const h=[];for(const[p,w]of e.entries())h.push(`${p.toString()} -> ${w.toString()}`);e=h}if(!Array.isArray(e))return e.toString();const c=[];for(const h of e)c.push(r.stringify(h,o,s,i,u,{arrayItems:!0,...m}));return r.wrap(c.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(e,o,s)=>e?o:s,length:e=>typeof e=="string"?e.length:e&&typeof e=="object"?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[o,s,i,u,m]=this,d=m.messages;if(!d)return"";const _=a.template(o,d[0],e,s,i)||a.template(o,d[1],e,s,i);return _?_.render(o,s,i,u,m):""},number:e=>typeof e=="number"?e:typeof e=="string"?parseFloat(e):typeof e=="boolean"?e?1:0:e instanceof Date?e.getTime():null}},4946:(j,$,b)=>{const l=b(375),y=b(1687),g=b(8068),f=b(8160),t=b(3292),a=b(6354),n=b(6133),r={};j.exports=g.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(e,...o)=>o.length===1&&Array.isArray(o[0])?e.try(...o[0]):e.try(...o),validate(e,o){const{schema:s,error:i,state:u,prefs:m}=o;if(s._flags.match){const _=[],v=[];for(let h=0;h<s.$_terms.matches.length;++h){const p=s.$_terms.matches[h],w=u.nest(p.schema,`match.${h}`);w.snapshot();const x=p.schema.$_validate(e,w,m);x.errors?(v.push(x.errors),w.restore()):(_.push(x.value),w.commit())}if(_.length===0)return{errors:i("alternatives.any",{details:v.map((h=>a.details(h,{override:!1})))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:i("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:i("alternatives.all",{details:v.map((h=>a.details(h,{override:!1})))})};const c=h=>h.$_terms.matches.some((p=>p.schema.type==="object"||p.schema.type==="alternatives"&&c(p.schema)));return c(s)?{value:_.reduce(((h,p)=>y(h,p,{mergeArrays:!1})))}:{value:_[_.length-1]}}const d=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const p=u.nest(v.schema,`match.${_}`);p.snapshot();const w=v.schema.$_validate(e,p,m);if(!w.errors)return p.commit(),w;p.restore(),d.push({schema:v.schema,reports:w.errors});continue}const c=v.ref?v.ref.resolve(e,u,m):e,h=v.is?[v]:v.switch;for(let p=0;p<h.length;++p){const w=h[p],{is:x,then:k,otherwise:R}=w,S=`match.${_}${v.switch?"."+p:""}`;if(x.$_match(c,u.nest(x,`${S}.is`),m)){if(k)return k.$_validate(e,u.nest(k,`${S}.then`),m)}else if(R)return R.$_validate(e,u.nest(R,`${S}.otherwise`),m)}}return r.errors(d,o)},rules:{conditional:{method(e,o){l(!this._flags._endedSwitch,"Unreachable condition"),l(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),l(o.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),i=t.when(s,e,o),u=i.is?[i]:i.switch;for(const m of u)if(m.then&&m.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(i),s.$_mutateRebuild()}},match:{method(e){if(l(["any","one","all"].includes(e),"Invalid alternatives match mode",e),e!=="any")for(const o of this.$_terms.matches)l(o.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){l(e.length,"Missing alternative schemas"),f.verifyFlat(e,"try"),l(!this._flags._endedSwitch,"Unreachable condition");const o=this.clone();for(const s of e)o.$_terms.matches.push({schema:o.$_compile(s)});return o.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(o,s)=>s.path[0]!=="is"&&typeof o._flags.label!="string"?o.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:o=>{f.isSchema(o)&&o.type==="array"&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,o){if(o.matches)for(const s of o.matches){const{schema:i,ref:u,is:m,not:d,then:_,otherwise:v}=s;e=i?e.try(i):u?e.conditional(u,{is:m,then:_,not:d,otherwise:v,switch:s.switch}):e.conditional(m,{then:_,otherwise:v})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),r.errors=function(e,{error:o,state:s}){if(!e.length)return{errors:o("alternatives.any")};if(e.length===1)return{errors:e[0].reports};const i=new Set,u=[];for(const{reports:m,schema:d}of e){if(m.length>1)return r.unmatched(e,o);const _=m[0];if(_ instanceof a.Report==0)return r.unmatched(e,o);if(_.state.path.length!==s.path.length){u.push({type:d.type,report:_});continue}if(_.code==="any.only"){for(const h of _.local.valids)i.add(h);continue}const[v,c]=_.code.split(".");c==="base"?i.add(v):u.push({type:d.type,report:_})}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(e,o):{errors:o("alternatives.types",{types:[...i]})}},r.unmatched=function(e,o){const s=[];for(const i of e)s.push(...i.reports);return{errors:o("alternatives.match",a.details(s,{override:!1}))}}},8068:(j,$,b)=>{const l=b(375),y=b(7629),g=b(8160),f=b(6914);j.exports=y.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,a){return l(typeof t=="function","Method must be a function"),l(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:a}})},validate(t,a,{method:n}){try{return n(t,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){l(g.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(t),a.$_mutateRegister(t),a}},warning:{method(t,a){return l(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:a},warn:!0})},validate:(t,a,{code:n,local:r})=>a.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(t,a=!0){t.keep=a},message(t,a){t.message=f.compile(a)},warn(t,a=!0){t.warn=a}},manifest:{build(t,a){for(const n in a){const r=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const e of r)t=t[n.slice(0,-1)](e);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const e of r)t=t.shared(e)}else for(const e of r){const{ref:o,is:s,not:i,then:u,otherwise:m,concat:d}=e;t=d?t.concat(d):o?t.when(o,{is:s,not:i,then:u,otherwise:m,switch:e.switch,break:e.break}):t.when(s,{then:u,otherwise:m,break:e.break})}else{const e={};for(const{target:o,adjuster:s}of r)e[o]=s;t=t.alter(e)}}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(j,$,b)=>{const l=b(375),y=b(9474),g=b(9621),f=b(8068),t=b(8160),a=b(3292),n={};j.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(r,{schema:e,state:o,prefs:s}){if(!Array.isArray(r))return;const i=e.$_getRule("sort");return i?n.sort(e,r,i.args.options,o,s):void 0}},validate(r,{schema:e,error:o}){if(!Array.isArray(r)){if(e._flags.single){const s=[r];return s[t.symbols.arraySingle]=!0,{value:s}}return{errors:o("array.base")}}if(e.$_getRule("items")||e.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const e=this.$_addRule({name:"has",args:{schema:r}});return e.$_mutateRegister(r),e},validate(r,{state:e,prefs:o,error:s},{schema:i}){const u=[r,...e.ancestors];for(let d=0;d<r.length;++d){const _=e.localize([...e.path,d],u,i);if(i.$_match(r[d],_,o))return r}const m=i._flags.label;return m?s("array.hasKnown",{patternLabel:m}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){t.verifyFlat(r,"items");const e=this.$_addRule("items");for(let o=0;o<r.length;++o){const s=t.tryWithPath((()=>this.$_compile(r[o])),o,{append:!0});e.$_terms.items.push(s)}return e.$_mutateRebuild()},validate(r,{schema:e,error:o,state:s,prefs:i,errorsArray:u}){const m=e.$_terms._requireds.slice(),d=e.$_terms.ordered.slice(),_=[...e.$_terms._inclusions,...m],v=!r[t.symbols.arraySingle];delete r[t.symbols.arraySingle];const c=u();let h=r.length;for(let p=0;p<h;++p){const w=r[p];let x=!1,k=!1;const R=v?p:new Number(p),S=[...s.path,R];if(!e._flags.sparse&&w===void 0){if(c.push(o("array.sparse",{key:R,path:S,pos:p,value:void 0},s.localize(S))),i.abortEarly)return c;d.shift();continue}const A=[r,...s.ancestors];for(const D of e.$_terms._exclusions)if(D.$_match(w,s.localize(S,A,D),i,{presence:"ignore"})){if(c.push(o("array.excludes",{pos:p,value:w},s.localize(S))),i.abortEarly)return c;x=!0,d.shift();break}if(x)continue;if(e.$_terms.ordered.length){if(d.length){const D=d.shift(),E=D.$_validate(w,s.localize(S,A,D),i);if(E.errors){if(c.push(...E.errors),i.abortEarly)return c}else if(D._flags.result==="strip")n.fastSplice(r,p),--p,--h;else{if(!e._flags.sparse&&E.value===void 0){if(c.push(o("array.sparse",{key:R,path:S,pos:p,value:void 0},s.localize(S))),i.abortEarly)return c;continue}r[p]=E.value}continue}if(!e.$_terms.items.length){if(c.push(o("array.orderedLength",{pos:p,limit:e.$_terms.ordered.length})),i.abortEarly)return c;break}}const O=[];let C=m.length;for(let D=0;D<C;++D){const E=s.localize(S,A,m[D]);E.snapshot();const I=m[D].$_validate(w,E,i);if(O[D]=I,!I.errors){if(E.commit(),r[p]=I.value,k=!0,n.fastSplice(m,D),--D,--C,!e._flags.sparse&&I.value===void 0&&(c.push(o("array.sparse",{key:R,path:S,pos:p,value:void 0},s.localize(S))),i.abortEarly))return c;break}E.restore()}if(k)continue;const M=i.stripUnknown&&!!i.stripUnknown.arrays||!1;C=_.length;for(const D of _){let E;const I=m.indexOf(D);if(I!==-1)E=O[I];else{const L=s.localize(S,A,D);if(L.snapshot(),E=D.$_validate(w,L,i),!E.errors){L.commit(),D._flags.result==="strip"?(n.fastSplice(r,p),--p,--h):e._flags.sparse||E.value!==void 0?r[p]=E.value:(c.push(o("array.sparse",{key:R,path:S,pos:p,value:void 0},s.localize(S))),x=!0),k=!0;break}L.restore()}if(C===1){if(M){n.fastSplice(r,p),--p,--h,k=!0;break}if(c.push(...E.errors),i.abortEarly)return c;x=!0;break}}if(!x&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!k){if(M){n.fastSplice(r,p),--p,--h;continue}if(c.push(o("array.includes",{pos:p,value:w},s.localize(S))),i.abortEarly)return c}}return m.length&&n.fillMissedErrors(e,c,m,r,s,i),d.length&&(n.fillOrderedErrors(e,c,d,r,s,i),c.length||n.fillDefault(d,r,s,i)),c.length?c:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,e,{limit:o},{name:s,operator:i,args:u})=>t.compare(r.length,o,i)?r:e.error("array."+s,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){t.verifyFlat(r,"ordered");const e=this.$_addRule("items");for(let o=0;o<r.length;++o){const s=t.tryWithPath((()=>this.$_compile(r[o])),o,{append:!0});n.validateSingle(s,e),e.$_mutateRegister(s),e.$_terms.ordered.push(s)}return e.$_mutateRebuild()}},single:{method(r){const e=r===void 0||!!r;return l(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(r={}){t.assertOptions(r,["by","order"]);const e={order:r.order||"ascending"};return r.by&&(e.by=a.ref(r.by,{ancestor:0}),l(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(r,{error:e,state:o,prefs:s,schema:i},{options:u}){const{value:m,errors:d}=n.sort(i,r,u,o,s);if(d)return d;for(let _=0;_<r.length;++_)if(r[_]!==m[_])return e("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const e=r===void 0||!!r;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(r,e={}){l(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),t.assertOptions(e,["ignoreUndefined","separator"]);const o={name:"unique",args:{options:e,comparator:r}};if(r)if(typeof r=="string"){const s=t.default(e.separator,".");o.path=s?r.split(s):[r]}else o.comparator=r;return this.$_addRule(o)},validate(r,{state:e,error:o,schema:s},{comparator:i,options:u},{comparator:m,path:d}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},v=m||y,c=u.ignoreUndefined;for(let h=0;h<r.length;++h){const p=d?g(r[h],d):r[h],w=m?_.custom:_[typeof p];if(l(w,"Failed to find unique map container for type",typeof p),w instanceof Map){const x=w.entries();let k;for(;!(k=x.next()).done;)if(v(k.value[0],p)){const R=e.localize([...e.path,h],[r,...e.ancestors]),S={pos:h,value:r[h],dupePos:k.value[1],dupeValue:r[k.value[1]]};return d&&(S.path=i),o("array.unique",S,R)}w.set(p,h)}else{if((!c||p!==void 0)&&w[p]!==void 0){const x={pos:h,value:r[h],dupePos:w[p],dupeValue:r[w[p]]};return d&&(x.path=i),o("array.unique",x,e.localize([...e.path,h],[r,...e.ancestors]))}w[p]=h}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,e)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const e of r.$_terms.items)n.validateSingle(e,r),e._flags.presence==="required"?r.$_terms._requireds.push(e):e._flags.presence==="forbidden"?r.$_terms._exclusions.push(e):r.$_terms._inclusions.push(e);for(const e of r.$_terms.ordered)n.validateSingle(e,r)},manifest:{build:(r,e)=>(e.items&&(r=r.items(...e.items)),e.ordered&&(r=r.ordered(...e.ordered)),r)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),n.fillMissedErrors=function(r,e,o,s,i,u){const m=[];let d=0;for(const _ of o){const v=_._flags.label;v?m.push(v):++d}m.length?d?e.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:m,unknownMisses:d},i,u)):e.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:m},i,u)):e.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:d},i,u))},n.fillOrderedErrors=function(r,e,o,s,i,u){const m=[];for(const d of o)d._flags.presence==="required"&&m.push(d);m.length&&n.fillMissedErrors(r,e,m,s,i,u)},n.fillDefault=function(r,e,o,s){const i=[];let u=!0;for(let m=r.length-1;m>=0;--m){const d=r[m],_=[e,...o.ancestors],v=d.$_validate(void 0,o.localize(o.path,_,d),s).value;if(u){if(v===void 0)continue;u=!1}i.unshift(v)}i.length&&e.push(...i)},n.fastSplice=function(r,e){let o=e;for(;o<r.length;)r[o++]=r[o];--r.length},n.validateSingle=function(r,e){(r.type==="array"||r._flags._arrayItems)&&(l(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(r,e,o,s,i){const u=o.order==="ascending"?1:-1,m=-1*u,d=u,_=(v,c)=>{let h=n.compare(v,c,m,d);if(h!==null||(o.by&&(v=o.by.resolve(v,s,i),c=o.by.resolve(c,s,i)),h=n.compare(v,c,m,d),h!==null))return h;const p=typeof v;if(p!==typeof c)throw r.$_createError("array.sort.mismatching",e,null,s,i);if(p!=="number"&&p!=="string")throw r.$_createError("array.sort.unsupported",e,{type:p},s,i);return p==="number"?(v-c)*u:v<c?m:d};try{return{value:e.slice().sort(_)}}catch(v){return{errors:v}}},n.compare=function(r,e,o,s){return r===e?0:r===void 0?1:e===void 0?-1:r===null?s:e===null?o:null}},4937:(j,$,b)=>{const l=b(375),y=b(8068),g=b(8160),f=b(2036),t={isBool:function(a){return typeof a=="boolean"}};j.exports=y.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:n}){if(typeof a!="boolean"){if(typeof a=="string"){const r=n._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="false"&&a}return typeof a!="boolean"&&(a=n.$_terms.truthy&&n.$_terms.truthy.has(a,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(a,null,null,!n._flags.sensitive))&&a),{value:a}}},validate(a,{error:n}){if(typeof a!="boolean")return{value:a,errors:n("boolean.base")}},rules:{truthy:{method(...a){g.verifyFlat(a,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new f;for(let r=0;r<a.length;++r){const e=a[r];l(e!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(e)}return n}},falsy:{method(...a){g.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new f;for(let r=0;r<a.length;++r){const e=a[r];l(e!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(e)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:t.isBool,to:(a,n)=>a?1:0},string:{from:t.isBool,to:(a,n)=>a?"true":"false"}},manifest:{build:(a,n)=>(n.truthy&&(a=a.truthy(...n.truthy)),n.falsy&&(a=a.falsy(...n.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(j,$,b)=>{const l=b(375),y=b(8068),g=b(8160),f=b(3328),t={isDate:function(a){return a instanceof Date}};j.exports=y.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:t.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:r,prefs:e}){if(a instanceof Date&&!isNaN(a.getTime()))return;const o=n._flags.format;return e.convert&&o&&typeof a=="string"?{value:a,errors:r("date.format",{format:o})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:r},{name:e,operator:o,args:s}){const i=r==="now"?Date.now():r.getTime();return g.compare(a.getTime(),i,o)?a:n.error("date."+e,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:t.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return l(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return l(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:t.isDate,to:(a,n)=>a.getTime()},string:{from:t.isDate,to:(a,{prefs:n})=>f.date(a,n)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),t.parse=function(a,n){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(n==="iso")return g.isIsoDate(a)?t.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return t.date(1*a);if(n==="unix")return t.date(1e3*a);if(typeof r=="string")return null}return t.date(a)},t.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(j,$,b)=>{const l=b(375),y=b(7824);j.exports=y.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(g){return l(Number.isSafeInteger(g)&&g>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:g}})},validate:(g,f,{n:t})=>g.length===t?g:f.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(g,f)=>/^\s*class\s/.test(g.toString())?g:f.error("function.class",{value:g})},minArity:{method(g){return l(Number.isSafeInteger(g)&&g>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:g}})},validate:(g,f,{n:t})=>g.length>=t?g:f.error("function.minArity",{n:t})},maxArity:{method(g){return l(Number.isSafeInteger(g)&&g>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:g}})},validate:(g,f,{n:t})=>g.length<=t?g:f.error("function.maxArity",{n:t})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(j,$,b)=>{const l=b(978),y=b(375),g=b(8571),f=b(3652),t=b(8068),a=b(8160),n=b(3292),r=b(6354),e=b(6133),o=b(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};j.exports=t.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(i,u)=>i.keys(u),validate(i,{schema:u,error:m,state:d,prefs:_}){if(!i||typeof i!==u.$_property("typeof")||Array.isArray(i))return{value:i,errors:m("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;i=s.clone(i,_);const v=[];if(u.$_terms.renames&&!s.rename(u,i,d,_,v))return{value:i,errors:v};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:i,errors:v};const c=new Set(Object.keys(i));if(u.$_terms.keys){const h=[i,...d.ancestors];for(const p of u.$_terms.keys){const w=p.key,x=i[w];c.delete(w);const k=d.localize([...d.path,w],h,p),R=p.schema.$_validate(x,k,_);if(R.errors){if(_.abortEarly)return{value:i,errors:R.errors};R.value!==void 0&&(i[w]=R.value),v.push(...R.errors)}else p.schema._flags.result==="strip"||R.value===void 0&&x!==void 0?delete i[w]:R.value!==void 0&&(i[w]=R.value)}}if(c.size||u._flags._hasPatternMatch){const h=s.unknown(u,i,c,v,d,_);if(h)return h}if(u.$_terms.dependencies)for(const h of u.$_terms.dependencies){if(h.key!==null&&s.isPresent(h.options)(h.key.resolve(i,d,_,null,{shadow:!1}))===!1)continue;const p=s.dependencies[h.rel](u,h,i,d,_);if(p){const w=u.$_createError(p.code,i,p.context,d,_);if(_.abortEarly)return{value:i,errors:w};v.push(w)}}return{value:i,errors:v}},rules:{and:{method(...i){return a.verifyFlat(i,"and"),s.dependency(this,"and",null,i)}},append:{method(i){return i==null||Object.keys(i).length===0?this:this.keys(i)}},assert:{method(i,u,m){o.isTemplate(i)||(i=n.ref(i)),y(m===void 0||typeof m=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const d=this.$_addRule({name:"assert",args:{subject:i,schema:u,message:m}});return d.$_mutateRegister(i),d.$_mutateRegister(u),d},validate(i,{error:u,prefs:m,state:d},{subject:_,schema:v,message:c}){const h=_.resolve(i,d,m),p=e.isRef(_)?_.absolute(d):[];return v.$_match(h,d.localize(p,[i,...d.ancestors],v),m)?i:u("object.assert",{subject:_,message:c})},args:["subject","schema","message"],multi:!0},instance:{method(i,u){return y(typeof i=="function","constructor must be a function"),u=u||i.name,this.$_addRule({name:"instance",args:{constructor:i,name:u}})},validate:(i,u,{constructor:m,name:d})=>i instanceof m?i:u.error("object.instance",{type:d,value:i}),args:["constructor","name"]},keys:{method(i){y(i===void 0||typeof i=="object","Object schema must be a valid object"),y(!a.isSchema(i),"Object schema cannot be a joi schema");const u=this.clone();if(i)if(Object.keys(i).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter((m=>!i.hasOwnProperty(m.key))):new s.Keys;for(const m in i)a.tryWithPath((()=>u.$_terms.keys.push({key:m,schema:this.$_compile(i[m])})),m)}else u.$_terms.keys=new s.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(i){return this.$_addRule({name:"length",args:{limit:i},operator:"="})},validate:(i,u,{limit:m},{name:d,operator:_,args:v})=>a.compare(Object.keys(i).length,m,_)?i:u.error("object."+d,{limit:v.limit,value:i}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(i){return this.$_addRule({name:"max",method:"length",args:{limit:i},operator:"<="})}},min:{method(i){return this.$_addRule({name:"min",method:"length",args:{limit:i},operator:">="})}},nand:{method(...i){return a.verifyFlat(i,"nand"),s.dependency(this,"nand",null,i)}},or:{method(...i){return a.verifyFlat(i,"or"),s.dependency(this,"or",null,i)}},oxor:{method(...i){return s.dependency(this,"oxor",null,i)}},pattern:{method(i,u,m={}){const d=i instanceof RegExp;d||(i=this.$_compile(i,{appendPath:!0})),y(u!==void 0,"Invalid rule"),a.assertOptions(m,["fallthrough","matches"]),d&&y(!i.flags.includes("g")&&!i.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[d?"regex":"schema"]:i,rule:u};return m.matches&&(v.matches=this.$_compile(m.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),m.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(u),_}},ref:{method(){return this.$_addRule("ref")},validate:(i,u)=>e.isRef(i)?i:u.error("object.refType",{value:i})},regex:{method(){return this.$_addRule("regex")},validate:(i,u)=>i instanceof RegExp?i:u.error("object.regex",{value:i})},rename:{method(i,u,m={}){y(typeof i=="string"||i instanceof RegExp,"Rename missing the from argument"),y(typeof u=="string"||u instanceof o,"Invalid rename to argument"),y(u!==i,"Cannot rename key to same name:",i),a.assertOptions(m,["alias","ignoreUndefined","override","multiple"]);const d=this.clone();d.$_terms.renames=d.$_terms.renames||[];for(const _ of d.$_terms.renames)y(_.from!==i,"Cannot rename the same key multiple times");return u instanceof o&&d.$_mutateRegister(u),d.$_terms.renames.push({from:i,to:u,options:l(s.renameDefaults,m)}),d}},schema:{method(i="any"){return this.$_addRule({name:"schema",args:{type:i}})},validate:(i,u,{type:m})=>!a.isSchema(i)||m!=="any"&&i.type!==m?u.error("object.schema",{type:m}):i},unknown:{method(i){return this.$_setFlag("unknown",i!==!1)}},with:{method(i,u,m={}){return s.dependency(this,"with",i,u,m)}},without:{method(i,u,m={}){return s.dependency(this,"without",i,u,m)}},xor:{method(...i){return a.verifyFlat(i,"xor"),s.dependency(this,"xor",null,i)}}},overrides:{default(i,u){return i===void 0&&(i=a.symbols.deepDefault),this.$_parent("default",i,u)}},rebuild(i){if(i.$_terms.keys){const u=new f.Sorter;for(const m of i.$_terms.keys)a.tryWithPath((()=>u.add(m,{after:m.schema.$_rootReferences(),group:m.key})),m.key);i.$_terms.keys=new s.Keys(...u.nodes)}},manifest:{build(i,u){if(u.keys&&(i=i.keys(u.keys)),u.dependencies)for(const{rel:m,key:d=null,peers:_,options:v}of u.dependencies)i=s.dependency(i,m,d,_,v);if(u.patterns)for(const{regex:m,schema:d,rule:_,fallthrough:v,matches:c}of u.patterns)i=i.pattern(m||d,_,{fallthrough:v,matches:c});if(u.renames)for(const{from:m,to:d,options:_}of u.renames)i=i.rename(m,d,_);return i}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),s.clone=function(i,u){if(typeof i=="object"){if(u.nonEnumerables)return g(i,{shallow:!0});const d=Object.create(Object.getPrototypeOf(i));return Object.assign(d,i),d}const m=function(...d){return i.apply(this,d)};return m.prototype=g(i.prototype),Object.defineProperty(m,"name",{value:i.name,writable:!1}),Object.defineProperty(m,"length",{value:i.length,writable:!1}),Object.assign(m,i),m},s.dependency=function(i,u,m,d,_){y(m===null||typeof m=="string",u,"key must be a strings"),_||(_=d.length>1&&typeof d[d.length-1]=="object"?d.pop():{}),a.assertOptions(_,["separator","isPresent"]),d=[].concat(d);const v=a.default(_.separator,"."),c=[];for(const p of d)y(typeof p=="string",u,"peers must be strings"),c.push(n.ref(p,{separator:v,ancestor:0,prefix:!1}));m!==null&&(m=n.ref(m,{separator:v,ancestor:0,prefix:!1}));const h=i.clone();return h.$_terms.dependencies=h.$_terms.dependencies||[],h.$_terms.dependencies.push(new s.Dependency(u,m,c,d,_)),h},s.dependencies={and(i,u,m,d,_){const v=[],c=[],h=u.peers.length,p=s.isPresent(u.options);for(const w of u.peers)p(w.resolve(m,d,_,null,{shadow:!1}))===!1?v.push(w.key):c.push(w.key);if(v.length!==h&&c.length!==h)return{code:"object.and",context:{present:c,presentWithLabels:s.keysToLabels(i,c),missing:v,missingWithLabels:s.keysToLabels(i,v)}}},nand(i,u,m,d,_){const v=[],c=s.isPresent(u.options);for(const w of u.peers)c(w.resolve(m,d,_,null,{shadow:!1}))&&v.push(w.key);if(v.length!==u.peers.length)return;const h=u.paths[0],p=u.paths.slice(1);return{code:"object.nand",context:{main:h,mainWithLabel:s.keysToLabels(i,h),peers:p,peersWithLabels:s.keysToLabels(i,p)}}},or(i,u,m,d,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(m,d,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)}}},oxor(i,u,m,d,_){const v=[],c=s.isPresent(u.options);for(const p of u.peers)c(p.resolve(m,d,_,null,{shadow:!1}))&&v.push(p.key);if(!v.length||v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.oxor",context:h}},with(i,u,m,d,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(m,d,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},without(i,u,m,d,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(m,d,_,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},xor(i,u,m,d,_){const v=[],c=s.isPresent(u.options);for(const p of u.peers)c(p.resolve(m,d,_,null,{shadow:!1}))&&v.push(p.key);if(v.length===1)return;const h={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return v.length===0?{code:"object.missing",context:h}:(h.present=v,h.presentWithLabels=s.keysToLabels(i,v),{code:"object.xor",context:h})}},s.keysToLabels=function(i,u){return Array.isArray(u)?u.map((m=>i.$_mapLabels(m))):i.$_mapLabels(u)},s.isPresent=function(i){return typeof i.isPresent=="function"?i.isPresent:u=>u!==void 0},s.rename=function(i,u,m,d,_){const v={};for(const c of i.$_terms.renames){const h=[],p=typeof c.from!="string";if(p)for(const w in u){if(u[w]===void 0&&c.options.ignoreUndefined||w===c.to)continue;const x=c.from.exec(w);x&&h.push({from:w,to:c.to,match:x})}else!Object.prototype.hasOwnProperty.call(u,c.from)||u[c.from]===void 0&&c.options.ignoreUndefined||h.push(c);for(const w of h){const x=w.from;let k=w.to;if(k instanceof o&&(k=k.render(u,m,d,w.match)),x!==k){if(!c.options.multiple&&v[k]&&(_.push(i.$_createError("object.rename.multiple",u,{from:x,to:k,pattern:p},m,d)),d.abortEarly)||Object.prototype.hasOwnProperty.call(u,k)&&!c.options.override&&!v[k]&&(_.push(i.$_createError("object.rename.override",u,{from:x,to:k,pattern:p},m,d)),d.abortEarly))return!1;u[x]===void 0?delete u[k]:u[k]=u[x],v[k]=!0,c.options.alias||delete u[x]}}}return!0},s.unknown=function(i,u,m,d,_,v){if(i.$_terms.patterns){let c=!1;const h=i.$_terms.patterns.map((w=>{if(w.matches)return c=!0,[]})),p=[u,..._.ancestors];for(const w of m){const x=u[w],k=[..._.path,w];for(let R=0;R<i.$_terms.patterns.length;++R){const S=i.$_terms.patterns[R];if(S.regex){const C=S.regex.test(w);if(_.mainstay.tracer.debug(_,"rule",`pattern.${R}`,C?"pass":"error"),!C)continue}else if(!S.schema.$_match(w,_.nest(S.schema,`pattern.${R}`),v))continue;m.delete(w);const A=_.localize(k,p,{schema:S.rule,key:w}),O=S.rule.$_validate(x,A,v);if(O.errors){if(v.abortEarly)return{value:u,errors:O.errors};d.push(...O.errors)}if(S.matches&&h[R].push(w),u[w]=O.value,!S.fallthrough)break}}if(c)for(let w=0;w<h.length;++w){const x=h[w];if(!x)continue;const k=i.$_terms.patterns[w].matches,R=_.localize(_.path,p,k),S=k.$_validate(x,R,v);if(S.errors){const A=r.details(S.errors,{override:!1});A.matches=x;const O=i.$_createError("object.pattern.match",u,A,_,v);if(v.abortEarly)return{value:u,errors:O};d.push(O)}}}if(m.size&&(i.$_terms.keys||i.$_terms.patterns)){if(v.stripUnknown&&!i._flags.unknown||v.skipFunctions){const c=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const h of m)c?(delete u[h],m.delete(h)):typeof u[h]=="function"&&m.delete(h)}if(!a.default(i._flags.unknown,v.allowUnknown))for(const c of m){const h=_.localize([..._.path,c],[]),p=i.$_createError("object.unknown",u[c],{child:c},h,v,{flags:!1});if(v.abortEarly)return{value:u,errors:p};d.push(p)}}},s.Dependency=class{constructor(i,u,m,d,_){this.rel=i,this.key=u,this.peers=m,this.paths=d,this.options=_}describe(){const i={rel:this.rel,peers:this.paths};return this.key!==null&&(i.key=this.key.key),this.peers[0].separator!=="."&&(i.options={...i.options,separator:this.peers[0].separator}),this.options.isPresent&&(i.options={...i.options,isPresent:this.options.isPresent}),i}},s.Keys=class extends Array{concat(i){const u=this.slice(),m=new Map;for(let d=0;d<u.length;++d)m.set(u[d].key,d);for(const d of i){const _=d.key,v=m.get(_);v!==void 0?u[v]={key:_,schema:u[v].schema.concat(d.schema)}:u.push(d)}return u}}},8785:(j,$,b)=>{const l=b(375),y=b(8068),g=b(8160),f=b(3292),t=b(6354),a={};j.exports=y.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,r)=>n.ref(r),validate(n,{schema:r,state:e,prefs:o}){l(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,n,e,o),i=r.$_terms.link[0].ref;return s.$_validate(n,e.nest(s,`link:${i.display}:${s.type}`),o)},generate:(n,r,e,o)=>a.generate(n,r,e,o),rules:{ref:{method(n){l(!this.$_terms.link,"Cannot reinitialize schema"),n=f.ref(n),l(n.type==="value"||n.type==="local","Invalid reference type:",n.type),l(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:n}],r}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){l(this.$_terms.link,"Uninitialized link schema"),l(g.isSchema(n),"Invalid schema object"),l(n.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:n}),r.$_mutateRebuild()}},manifest:{build:(n,r)=>(l(r.link,"Invalid link description missing link"),n.ref(r.link))}}),a.generate=function(n,r,e,o){let s=e.mainstay.links.get(n);if(s)return s._generate(r,e,o).schema;const i=n.$_terms.link[0].ref,{perspective:u,path:m}=a.perspective(i,e);a.assert(u,"which is outside of schema boundaries",i,n,e,o);try{s=m.length?u.$_reach(m):u}catch{a.assert(!1,"to non-existing schema",i,n,e,o)}return a.assert(s.type!=="link","which is another link",i,n,e,o),n._flags.relative||e.mainstay.links.set(n,s),s._generate(r,e,o).schema},a.perspective=function(n,r){if(n.type==="local"){for(const{schema:e,key:o}of r.schemas){if((e._flags.id||o)===n.path[0])return{perspective:e,path:n.path.slice(1)};if(e.$_terms.shared){for(const s of e.$_terms.shared)if(s._flags.id===n.path[0])return{perspective:s,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:n.path}:{perspective:r.schemas[n.ancestor]&&r.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,r,e,o,s,i){n||l(!1,`"${t.label(o._flags,s,i)}" contains link reference "${e.display}" ${r}`)}},3832:(j,$,b)=>{const l=b(375),y=b(8068),g=b(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const a=t.toString(),n=a.indexOf("."),r=a.indexOf("e");return(n<0?0:(r<0?a.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};j.exports=y.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:a,error:n}){if(!t.match(f.numberRx))return;t=t.trim();const r={value:parseFloat(t)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(t.match(/e/i)){if(f.extractSignificantDigits(t)!==f.extractSignificantDigits(String(r.value)))return r.errors=n("number.unsafe"),r}else{const e=r.value.toString();if(e.match(/e/i))return r;if(e!==f.normalizeDecimal(t))return r.errors=n("number.unsafe"),r}return r}},validate(t,{schema:a,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!g.isNumber(t))return{value:t,errors:n("number.base")};const e={value:t};if(r.convert){const o=a.$_getRule("precision");if(o){const s=Math.pow(10,o.args.limit);e.value=Math.round(e.value*s)/s}}return e.value===0&&(e.value=0),!a._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(e.errors=n("number.unsafe")),e},rules:{compare:{method:!1,validate:(t,a,{limit:n},{name:r,operator:e,args:o})=>g.compare(t,n,e)?t:a.error("number."+r,{limit:o.limit,value:t}),args:[{name:"limit",ref:!0,assert:g.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,a)=>Math.trunc(t)-t==0?t:a.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const a=typeof t=="number"?f.decimalPlaces(t):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:a,pfactor:n}})},validate:(t,a,{base:n,baseDecimalPlace:r,pfactor:e},o)=>f.decimalPlaces(t)>r?a.error("number.multiple",{multiple:o.args.base,value:t}):Math.round(e*t)%Math.round(e*n)==0?t:a.error("number.multiple",{multiple:o.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,a)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return l(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,a,{limit:n}){const r=t.toString().match(f.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:a.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return l(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,a,{sign:n})=>n==="negative"&&t<0||n==="positive"&&t>0?t:a.error(`number.${n}`)},unsafe:{method(t=!0){return l(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,a)=>t.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(t){return t.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(j,$,b)=>{const l=b(7824);j.exports=l.extend({type:"object",cast:{map:{from:y=>y&&typeof y=="object",to:(y,g)=>new Map(Object.entries(y))}}})},7417:(j,$,b)=>{const l=b(375),y=b(5380),g=b(1745),f=b(9959),t=b(6064),a=b(9926),n=b(5752),r=b(8068),e=b(8160),o={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};j.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:i,state:u,prefs:m}){const d=i.$_getRule("normalize");d&&(s=s.normalize(d.args.form));const _=i.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=i.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),i.$_terms.replacements)for(const h of i.$_terms.replacements)s=s.replace(h.pattern,h.replacement);const c=i.$_getRule("hex");if(c&&c.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),i.$_getRule("isoDate")){const h=o.isoDate(s);h&&(s=h)}if(i._flags.truncate){const h=i.$_getRule("max");if(h){let p=h.args.limit;if(e.isResolvable(p)&&(p=p.resolve(s,u,m),!e.limit(p)))return{value:s,errors:i.$_createError("any.ref",p,{ref:h.args.limit,arg:"limit",reason:"must be a positive integer"},u,m)};s=s.slice(0,p)}}return{value:s}}},validate(s,{schema:i,error:u}){if(typeof s!="string")return{value:s,errors:u("string.base")};if(s===""){const m=i.$_getRule("min");return m&&m.args.limit===0?void 0:{value:s,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,i)=>/^[a-zA-Z0-9]+$/.test(s)?s:i.error("string.alphanum")},base64:{method(s={}){return e.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),l(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,i,{options:u})=>o.base64Regex[u.paddingRequired][u.urlSafe].test(s)?s:i.error("string.base64")},case:{method(s){return l(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,i,{direction:u})=>u==="lower"&&s===s.toLocaleLowerCase()||u==="upper"&&s===s.toLocaleUpperCase()?s:i.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,i){let u=s.length,m=0,d=1;for(;u--;){const _=s.charAt(u)*d;m+=_-9*(_>9),d^=3}return m>0&&m%10==0?s:i.error("string.creditCard")}},dataUri:{method(s={}){return e.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},l(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,i,{options:u}){const m=s.match(o.dataUriRegex);return m&&(!m[2]||m[2]!=="base64"||o.base64Regex[u.paddingRequired].false.test(m[3]))?s:i.error("string.dataUri")}},domain:{method(s){s&&e.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const i=o.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:i})},validate:(s,i,u,{address:m})=>y.isValid(s,m)?s:i.error("string.domain")},email:{method(s={}){e.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),l(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const i=o.addressOptions(s),u=new RegExp(`\\s*[${s.separator?t(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:u,address:i})},validate(s,i,{options:u},{regex:m,address:d}){const _=u.multiple?s.split(m):[s],v=[];for(const c of _)g.isValid(c,d)||v.push(c);return v.length?i.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){e.assertOptions(s,["version","separator"]);let i="";if(s.version){const d=[].concat(s.version);l(d.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<d.length;++v){const c=d[v];l(typeof c=="string","version at position "+v+" must be a string");const h=o.guidVersions[c.toLowerCase()];l(h,"version at position "+v+" must be one of "+Object.keys(o.guidVersions).join(", ")),l(!_.has(h),"version at position "+v+" must not be a duplicate"),i+=h,_.add(h)}}l(o.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const u=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,m=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${i||"0-9A-F"}][0-9A-F]{3}\\2?[${i?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:m})},validate(s,i,u,{regex:m}){const d=m.exec(s);return d?o.guidBrackets[d[1]]!==d[d.length-1]?i.error("string.guid"):s:i.error("string.guid")}},hex:{method(s={}){return e.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},l(typeof s.byteAligned=="boolean","byteAligned must be boolean"),l(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,i,{options:u})=>(u.prefix==="optional"?o.hexRegex.withOptionalPrefix:u.prefix===!0?o.hexRegex.withPrefix:o.hexRegex.withoutPrefix).test(s)?u.byteAligned&&s.length%2!=0?i.error("string.hexAlign"):s:i.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,i)=>y.isValid(s,{minDomainSegments:1})||o.ipRegex.test(s)?s:i.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){e.assertOptions(s,["cidr","version"]);const{cidr:i,versions:u,regex:m}=f.regex(s),d=s.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:i,version:d}},regex:m})},validate:(s,i,{options:u},{regex:m})=>m.test(s)?s:u.version?i.error("string.ipVersion",{value:s,cidr:u.cidr,version:u.version}):i.error("string.ip",{value:s,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:i})=>o.isoDate(s)?s:i("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,i)=>o.isoDurationRegex.test(s)?s:i.error("string.isoDuration")},length:{method(s,i){return o.length(this,"length",s,"=",i)},validate(s,i,{limit:u,encoding:m},{name:d,operator:_,args:v}){const c=!m&&s.length;return e.compare(c,u,_)?s:i.error("string."+d,{limit:v.limit,value:s,encoding:m})},args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,i){return o.length(this,"max",s,"<=",i)},args:["limit","encoding"]},min:{method(s,i){return o.length(this,"min",s,">=",i)},args:["limit","encoding"]},normalize:{method(s="NFC"){return l(o.normalizationForms.includes(s),"normalization form must be one of "+o.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:i},{form:u})=>s===s.normalize(u)?s:i("string.normalize",{value:s,form:u}),convert:!0},pattern:{alias:"regex",method(s,i={}){l(s instanceof RegExp,"regex must be a RegExp"),l(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof i=="string"&&(i={name:i}),e.assertOptions(i,["invert","name"]);const u=["string.pattern",i.invert?".invert":"",i.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:i},errorCode:u})},validate:(s,i,{regex:u,options:m},{errorCode:d})=>u.test(s)^m.invert?s:i.error(d,{name:m.name,regex:u,value:s}),args:["regex","options"],multi:!0},replace:{method(s,i){typeof s=="string"&&(s=new RegExp(t(s),"g")),l(s instanceof RegExp,"pattern must be a RegExp"),l(typeof i=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:s,replacement:i}),u}},token:{method(){return this.$_addRule("token")},validate:(s,i)=>/^\w+$/.test(s)?s:i.error("string.token")},trim:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,i,{enabled:u})=>u&&s!==s.trim()?i.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return l(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){e.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),s.domain&&e.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:i,scheme:u}=n.regex(s),m=s.domain?o.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:i,domain:m,scheme:u})},validate(s,i,{options:u},{regex:m,domain:d,scheme:_}){if(["http:/","https:/"].includes(s))return i.error("string.uri");const v=m.exec(s);if(v){const c=v[1]||v[2];return!d||u.allowRelative&&!c||y.isValid(c,d)?s:i.error("string.domain",{value:c})}return u.relativeOnly?i.error("string.uriRelativeOnly"):u.scheme?i.error("string.uriCustomScheme",{scheme:_,value:s}):i.error("string.uri")}}},manifest:{build(s,i){if(i.replacements)for(const{pattern:u,replacement:m}of i.replacements)s=s.replace(u,m);return s}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),o.addressOptions=function(s){if(!s)return o.tlds||s;if(l(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),l(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return l(o.tlds,"Built-in TLD list disabled"),Object.assign({},s,o.tlds);l(typeof s.tlds=="object","tlds must be true, false, or an object");const i=s.tlds.deny;if(i)return Array.isArray(i)&&(s=Object.assign({},s,{tlds:{deny:new Set(i)}})),l(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),l(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),o.validateTlds(s.tlds.deny,"tlds.deny"),s;const u=s.tlds.allow;return u?u===!0?(l(o.tlds,"Built-in TLD list disabled"),Object.assign({},s,o.tlds)):(Array.isArray(u)&&(s=Object.assign({},s,{tlds:{allow:new Set(u)}})),l(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),o.validateTlds(s.tlds.allow,"tlds.allow"),s):s},o.validateTlds=function(s,i){for(const u of s)l(y.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${i} must contain valid top level domain names`)},o.isoDate=function(s){if(!e.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const i=new Date(s);return isNaN(i.getTime())?null:i.toISOString()},o.length=function(s,i,u,m,d){return l(!d||!1,"Invalid encoding:",d),s.$_addRule({name:i,method:"length",args:{limit:u,encoding:d},operator:m})}},8826:(j,$,b)=>{const l=b(375),y=b(8068),g={};g.Map=class extends Map{slice(){return new g.Map(this)}},j.exports=y.extend({type:"symbol",terms:{map:{init:new g.Map}},coerce:{method(f,{schema:t,error:a}){const n=t.$_terms.map.get(f);return n&&(f=n),t._flags.only&&typeof f!="symbol"?{value:f,errors:a("symbol.map",{map:t.$_terms.map})}:{value:f}}},validate(f,{error:t}){if(typeof f!="symbol")return{value:f,errors:t("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),l(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),a=[];for(const n of f){l(n&&n[Symbol.iterator],"Entry must be an iterable");const[r,e]=n;l(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),l(typeof e=="symbol","Value must be a Symbol"),t.$_terms.map.set(r,e),a.push(e)}return t.valid(...a)}}},manifest:{build:(f,t)=>(t.map&&(f=f.map(t.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(j,$,b)=>{const l=b(375),y=b(8571),g=b(738),f=b(9621),t=b(8160),a=b(6354),n=b(493),r={result:Symbol("result")};$.entry=function(e,o,s){let i=t.defaults;s&&(l(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),l(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),i=t.preferences(t.defaults,s));const u=r.entry(e,o,i);l(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const m={value:u.value};return u.error&&(m.error=u.error),u.mainstay.warnings.length&&(m.warning=a.details(u.mainstay.warnings)),u.mainstay.debug&&(m.debug=u.mainstay.debug),u.mainstay.artifacts&&(m.artifacts=u.mainstay.artifacts),m},$.entryAsync=async function(e,o,s){let i=t.defaults;s&&(i=t.preferences(t.defaults,s));const u=r.entry(e,o,i),m=u.mainstay;if(u.error)throw m.debug&&(u.error.debug=m.debug),u.error;if(m.externals.length){let _=u.value;const v=[];for(const c of m.externals){const h=c.state.path,p=c.schema.type==="link"?m.links.get(c.schema):null;let w,x,k=_;const R=h.length?[_]:[],S=h.length?f(e,h):e;if(h.length){w=h[h.length-1];let A=_;for(const O of h.slice(0,-1))A=A[O],R.unshift(A);x=R[0],k=x[w]}try{const A=(C,M)=>(p||c.schema).$_createError(C,k,M,c.state,i),O=await c.method(k,{schema:c.schema,linked:p,state:c.state,prefs:s,original:S,error:A,errorsArray:r.errorsArray,warn:(C,M)=>m.warnings.push((p||c.schema).$_createError(C,k,M,c.state,i)),message:(C,M)=>(p||c.schema).$_createError("external",k,M,c.state,i,{messages:C})});if(O===void 0||O===k)continue;if(O instanceof a.Report){if(m.tracer.log(c.schema,c.state,"rule","external","error"),v.push(O),i.abortEarly)break;continue}if(Array.isArray(O)&&O[t.symbols.errors]){if(m.tracer.log(c.schema,c.state,"rule","external","error"),v.push(...O),i.abortEarly)break;continue}x?(m.tracer.value(c.state,"rule",k,O,"external"),x[w]=O):(m.tracer.value(c.state,"rule",_,O,"external"),_=O)}catch(A){throw i.errors.label&&(A.message+=` (${c.label})`),A}}if(u.value=_,v.length)throw u.error=a.process(v,e,i),m.debug&&(u.error.debug=m.debug),u.error}if(!i.warnings&&!i.debug&&!i.artifacts)return u.value;const d={value:u.value};return m.warnings.length&&(d.warning=a.details(m.warnings)),m.debug&&(d.debug=m.debug),m.artifacts&&(d.artifacts=m.artifacts),d},r.Mainstay=class{constructor(e,o,s){this.externals=[],this.warnings=[],this.tracer=e,this.debug=o,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},r.entry=function(e,o,s){const{tracer:i,cleanup:u}=r.tracer(o,s),m=s.debug?[]:null,d=o._ids._schemaChain?new Map:null,_=new r.Mainstay(i,m,d),v=o._ids._schemaChain?[{schema:o}]:null,c=new n([],[],{mainstay:_,schemas:v}),h=$.validate(e,o,c,s);u&&o.$_root.untrace();const p=a.process(h.errors,e,s);return{value:h.value,error:p,mainstay:_}},r.tracer=function(e,o){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:o.debug?(l(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:r.ignore}},$.validate=function(e,o,s,i,u={}){if(o.$_terms.whens&&(o=o._generate(e,s,i).schema),o._preferences&&(i=r.prefs(o,i)),o._cache&&i.cache){const p=o._cache.get(e);if(s.mainstay.tracer.debug(s,"validate","cached",!!p),p)return p}const m=(p,w,x)=>o.$_createError(p,e,w,x||s,i),d={original:e,prefs:i,schema:o,state:s,error:m,errorsArray:r.errorsArray,warn:(p,w,x)=>s.mainstay.warnings.push(m(p,w,x)),message:(p,w)=>o.$_createError("custom",e,w,s,i,{messages:p})};s.mainstay.tracer.entry(o,s);const _=o._definition;if(_.prepare&&e!==void 0&&i.convert){const p=_.prepare(e,d);if(p){if(s.mainstay.tracer.value(s,"prepare",e,p.value),p.errors)return r.finalize(p.value,[].concat(p.errors),d);e=p.value}}if(_.coerce&&e!==void 0&&i.convert&&(!_.coerce.from||_.coerce.from.includes(typeof e))){const p=_.coerce.method(e,d);if(p){if(s.mainstay.tracer.value(s,"coerced",e,p.value),p.errors)return r.finalize(p.value,[].concat(p.errors),d);e=p.value}}const v=o._flags.empty;v&&v.$_match(r.trim(e,o),s.nest(v),t.defaults)&&(s.mainstay.tracer.value(s,"empty",e,void 0),e=void 0);const c=u.presence||o._flags.presence||(o._flags._endedSwitch?null:i.presence);if(e===void 0){if(c==="forbidden")return r.finalize(e,null,d);if(c==="required")return r.finalize(e,[o.$_createError("any.required",e,null,s,i)],d);if(c==="optional"){if(o._flags.default!==t.symbols.deepDefault)return r.finalize(e,null,d);s.mainstay.tracer.value(s,"default",e,{}),e={}}}else if(c==="forbidden")return r.finalize(e,[o.$_createError("any.unknown",e,null,s,i)],d);const h=[];if(o._valids){const p=o._valids.get(e,s,i,o._flags.insensitive);if(p)return i.convert&&(s.mainstay.tracer.value(s,"valids",e,p.value),e=p.value),s.mainstay.tracer.filter(o,s,"valid",p),r.finalize(e,null,d);if(o._flags.only){const w=o.$_createError("any.only",e,{valids:o._valids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(e,[w],d);h.push(w)}}if(o._invalids){const p=o._invalids.get(e,s,i,o._flags.insensitive);if(p){s.mainstay.tracer.filter(o,s,"invalid",p);const w=o.$_createError("any.invalid",e,{invalids:o._invalids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(e,[w],d);h.push(w)}}if(_.validate){const p=_.validate(e,d);if(p&&(s.mainstay.tracer.value(s,"base",e,p.value),e=p.value,p.errors)){if(!Array.isArray(p.errors))return h.push(p.errors),r.finalize(e,h,d);if(p.errors.length)return h.push(...p.errors),r.finalize(e,h,d)}}return o._rules.length?r.rules(e,h,d):r.finalize(e,h,d)},r.rules=function(e,o,s){const{schema:i,state:u,prefs:m}=s;for(const d of i._rules){const _=i._definition.rules[d.method];if(_.convert&&m.convert){u.mainstay.tracer.log(i,u,"rule",d.name,"full");continue}let v,c=d.args;if(d._resolve.length){c=Object.assign({},c);for(const p of d._resolve){const w=_.argsByName.get(p),x=c[p].resolve(e,u,m),k=w.normalize?w.normalize(x):x,R=t.validateArg(k,null,w);if(R){v=i.$_createError("any.ref",x,{arg:p,ref:c[p],reason:R},u,m);break}c[p]=k}}v=v||_.validate(e,s,c,d);const h=r.rule(v,d);if(h.errors){if(u.mainstay.tracer.log(i,u,"rule",d.name,"error"),d.warn){u.mainstay.warnings.push(...h.errors);continue}if(m.abortEarly)return r.finalize(e,h.errors,s);o.push(...h.errors)}else u.mainstay.tracer.log(i,u,"rule",d.name,"pass"),u.mainstay.tracer.value(u,"rule",e,h.value,d.name),e=h.value}return r.finalize(e,o,s)},r.rule=function(e,o){return e instanceof a.Report?(r.error(e,o),{errors:[e],value:null}):Array.isArray(e)&&e[t.symbols.errors]?(e.forEach((s=>r.error(s,o))),{errors:e,value:null}):{errors:null,value:e}},r.error=function(e,o){return o.message&&e._setTemplate(o.message),e},r.finalize=function(e,o,s){o=o||[];const{schema:i,state:u,prefs:m}=s;if(o.length){const _=r.default("failover",void 0,o,s);_!==void 0&&(u.mainstay.tracer.value(u,"failover",e,_),e=_,o=[])}if(o.length&&i._flags.error)if(typeof i._flags.error=="function"){o=i._flags.error(o),Array.isArray(o)||(o=[o]);for(const _ of o)l(_ instanceof Error||_ instanceof a.Report,"error() must return an Error object")}else o=[i._flags.error];if(e===void 0){const _=r.default("default",e,o,s);u.mainstay.tracer.value(u,"default",e,_),e=_}if(i._flags.cast&&e!==void 0){const _=i._definition.cast[i._flags.cast];if(_.from(e)){const v=_.to(e,s);u.mainstay.tracer.value(u,"cast",e,v,i._flags.cast),e=v}}if(i.$_terms.externals&&m.externals&&m._externals!==!1)for(const{method:_}of i.$_terms.externals)u.mainstay.externals.push({method:_,schema:i,state:u,label:a.label(i._flags,u,m)});const d={value:e,errors:o.length?o:null};return i._flags.result&&(d.value=i._flags.result==="strip"?void 0:s.original,u.mainstay.tracer.value(u,i._flags.result,e,d.value),u.shadow(e,i._flags.result)),i._cache&&m.cache!==!1&&!i._refs.length&&i._cache.set(s.original,d),e===void 0||d.errors||i._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(i._flags.artifact)||u.mainstay.artifacts.set(i._flags.artifact,[]),u.mainstay.artifacts.get(i._flags.artifact).push(u.path)),d},r.prefs=function(e,o){const s=o===t.defaults;return s&&e._preferences[t.symbols.prefs]?e._preferences[t.symbols.prefs]:(o=t.preferences(o,e._preferences),s&&(e._preferences[t.symbols.prefs]=o),o)},r.default=function(e,o,s,i){const{schema:u,state:m,prefs:d}=i,_=u._flags[e];if(d.noDefaults||_===void 0)return o;if(m.mainstay.tracer.log(u,m,"rule",e,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[y(m.ancestors[0]),i]:[];try{return _(...v)}catch(c){return void s.push(u.$_createError(`any.${e}`,null,{error:c},m,d))}}return typeof _!="object"?_:_[t.symbols.literal]?_.literal:t.isResolvable(_)?_.resolve(o,m,d):y(_)},r.trim=function(e,o){if(typeof e!="string")return e;const s=o.$_getRule("trim");return s&&s.args.enabled?e.trim():e},r.ignore={active:!1,debug:g,entry:g,filter:g,log:g,resolve:g,value:g},r.errorsArray=function(){const e=[];return e[t.symbols.errors]=!0,e}},2036:(j,$,b)=>{const l=b(375),y=b(9474),g=b(8160),f={};j.exports=f.Values=class{constructor(t,a){this._values=new Set(t),this._refs=new Set(a),this._lowercase=f.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,a){g.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),a&&a.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,a,n){if(t=t||new f.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])t.add(r)}if(n)for(const r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){g.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,a,n,r){return!!this.get(t,a,n,r)}get(t,a,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){const e=this._lowercase.get(t.toLowerCase());if(e)return{value:e}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const e of this._values)if(y(e,t))return{value:e}}if(a)for(const e of this._refs){const o=e.resolve(t,a,n,null,{in:!0});if(o===void 0)continue;const s=e.in&&typeof o=="object"?Array.isArray(o)?o:Object.keys(o):[o];for(const i of s)if(typeof i==typeof t){if(r&&t&&typeof t=="string"){if(i.toLowerCase()===t.toLowerCase())return{value:i,ref:e}}else if(y(i,t))return{value:i,ref:e}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const a=[];for(const n of[...this._values,...this._refs])n!==void 0&&a.push(n);return a}return Array.from([...this._values,...this._refs])}clone(){const t=new f.Values(this._values,this._refs);return t._override=this._override,t}concat(t){l(!t._override,"Cannot concat override set of values");const a=new f.Values([...this._values,...t._values],[...this._refs,...t._refs]);return a._override=this._override,a}describe(){const t=[];this._override&&t.push({override:!0});for(const a of this._values.values())t.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())t.push(a.describe());return t}},f.Values.prototype[g.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(t){const a=new Map;if(t)for(const n of t)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(j,$,b)=>{const l=b(375),y=b(8571),g=b(1687),f=b(9621),t={};j.exports=function(a,n,r={}){if(l(a&&typeof a=="object","Invalid defaults value: must be an object"),l(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),l(typeof r=="object","Invalid options: must be an object"),!n)return null;if(r.shallow)return t.applyToDefaultsWithShallow(a,n,r);const e=y(a);if(n===!0)return e;const o=r.nullOverride!==void 0&&r.nullOverride;return g(e,n,{nullOverride:o,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(a,n,r){const e=r.shallow;l(Array.isArray(e),"Invalid keys");const o=new Map,s=n===!0?null:new Set;for(let m of e){m=Array.isArray(m)?m:m.split(".");const d=f(a,m);d&&typeof d=="object"?o.set(d,s&&f(n,m)||d):s&&s.add(m)}const i=y(a,{},o);if(!s)return i;for(const m of s)t.reachCopy(i,n,m);const u=r.nullOverride!==void 0&&r.nullOverride;return g(i,n,{nullOverride:u,mergeArrays:!1})},t.reachCopy=function(a,n,r){for(const s of r){if(!(s in n))return;const i=n[s];if(typeof i!="object"||i===null)return;n=i}const e=n;let o=a;for(let s=0;s<r.length-1;++s){const i=r[s];typeof o[i]!="object"&&(o[i]={}),o=o[i]}o[r[r.length-1]]=e}},375:(j,$,b)=>{const l=b(7916);j.exports=function(y,...g){if(!y)throw g.length===1&&g[0]instanceof Error?g[0]:new l(g)}},8571:(j,$,b)=>{const l=b(9621),y=b(4277),g=b(7043),f={needsProtoHack:new Set([y.set,y.map,y.weakSet,y.weakMap])};j.exports=f.clone=function(t,a={},n=null){if(typeof t!="object"||t===null)return t;let r=f.clone,e=n;if(a.shallow){if(a.shallow!==!0)return f.cloneWithShallow(t,a);r=u=>u}else if(e){const u=e.get(t);if(u)return u}else e=new Map;const o=y.getInternalProto(t);if(o===y.buffer)return!1;if(o===y.date)return new Date(t.getTime());if(o===y.regex)return new RegExp(t);const s=f.base(t,o,a);if(s===t)return t;if(e&&e.set(t,s),o===y.set)for(const u of t)s.add(r(u,a,e));else if(o===y.map)for(const[u,m]of t)s.set(u,r(m,a,e));const i=g.keys(t,a);for(const u of i){if(u==="__proto__")continue;if(o===y.array&&u==="length"){s.length=t.length;continue}const m=Object.getOwnPropertyDescriptor(t,u);m?m.get||m.set?Object.defineProperty(s,u,m):m.enumerable?s[u]=r(t[u],a,e):Object.defineProperty(s,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],a,e)}):Object.defineProperty(s,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],a,e)})}return s},f.cloneWithShallow=function(t,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const e of n){const o=l(t,e);typeof o!="object"&&typeof o!="function"||r.set(o,o)}return f.clone(t,a,r)},f.base=function(t,a,n){if(n.prototype===!1)return f.needsProtoHack.has(a)?new a.constructor:a===y.array?[]:{};const r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(a===y.array){const e=[];return r!==a&&Object.setPrototypeOf(e,r),e}if(f.needsProtoHack.has(a)){const e=new r.constructor;return r!==a&&Object.setPrototypeOf(e,r),e}return Object.create(r)}},9474:(j,$,b)=>{const l=b(4277),y={mismatched:null};j.exports=function(g,f,t){return t=Object.assign({prototype:!0},t),!!y.isDeepEqual(g,f,t,[])},y.isDeepEqual=function(g,f,t,a){if(g===f)return g!==0||1/g==1/f;const n=typeof g;if(n!==typeof f||g===null||f===null)return!1;if(n==="function"){if(!t.deepFunction||g.toString()!==f.toString())return!1}else if(n!=="object")return g!=g&&f!=f;const r=y.getSharedType(g,f,!!t.prototype);switch(r){case l.buffer:return!1;case l.promise:return g===f;case l.regex:return g.toString()===f.toString();case y.mismatched:return!1}for(let e=a.length-1;e>=0;--e)if(a[e].isSame(g,f))return!0;a.push(new y.SeenEntry(g,f));try{return!!y.isDeepEqualObj(r,g,f,t,a)}finally{a.pop()}},y.getSharedType=function(g,f,t){if(t)return Object.getPrototypeOf(g)!==Object.getPrototypeOf(f)?y.mismatched:l.getInternalProto(g);const a=l.getInternalProto(g);return a!==l.getInternalProto(f)?y.mismatched:a},y.valueOf=function(g){const f=g.valueOf;if(f===void 0)return g;try{return f.call(g)}catch(t){return t}},y.hasOwnEnumerableProperty=function(g,f){return Object.prototype.propertyIsEnumerable.call(g,f)},y.isSetSimpleEqual=function(g,f){for(const t of Set.prototype.values.call(g))if(!Set.prototype.has.call(f,t))return!1;return!0},y.isDeepEqualObj=function(g,f,t,a,n){const{isDeepEqual:r,valueOf:e,hasOwnEnumerableProperty:o}=y,{keys:s,getOwnPropertySymbols:i}=Object;if(g===l.array){if(!a.part){if(f.length!==t.length)return!1;for(let v=0;v<f.length;++v)if(!r(f[v],t[v],a,n))return!1;return!0}for(const v of f)for(const c of t)if(r(v,c,a,n))return!0}else if(g===l.set){if(f.size!==t.size)return!1;if(!y.isSetSimpleEqual(f,t)){const v=new Set(Set.prototype.values.call(t));for(const c of Set.prototype.values.call(f)){if(v.delete(c))continue;let h=!1;for(const p of v)if(r(c,p,a,n)){v.delete(p),h=!0;break}if(!h)return!1}}}else if(g===l.map){if(f.size!==t.size)return!1;for(const[v,c]of Map.prototype.entries.call(f))if(c===void 0&&!Map.prototype.has.call(t,v)||!r(c,Map.prototype.get.call(t,v),a,n))return!1}else if(g===l.error&&(f.name!==t.name||f.message!==t.message))return!1;const u=e(f),m=e(t);if((f!==u||t!==m)&&!r(u,m,a,n))return!1;const d=s(f);if(!a.part&&d.length!==s(t).length&&!a.skip)return!1;let _=0;for(const v of d)if(a.skip&&a.skip.includes(v))t[v]===void 0&&++_;else if(!o(t,v)||!r(f[v],t[v],a,n))return!1;if(!a.part&&d.length-_!==s(t).length)return!1;if(a.symbols!==!1){const v=i(f),c=new Set(i(t));for(const h of v){if(!a.skip||!a.skip.includes(h)){if(o(f,h)){if(!o(t,h)||!r(f[h],t[h],a,n))return!1}else if(o(t,h))return!1}c.delete(h)}for(const h of c)if(o(t,h))return!1}return!0},y.SeenEntry=class{constructor(g,f){this.obj=g,this.ref=f}isSame(g,f){return this.obj===g&&this.ref===f}}},7916:(j,$,b)=>{const l=b(8761);j.exports=class extends Error{constructor(y){super(y.filter((g=>g!=="")).map((g=>typeof g=="string"?g:g instanceof Error?g.message:l(g))).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$.assert)}}},5277:j=>{const $={};j.exports=function(b){if(!b)return"";let l="";for(let y=0;y<b.length;++y){const g=b.charCodeAt(y);$.isSafe(g)?l+=b[y]:l+=$.escapeHtmlChar(g)}return l},$.escapeHtmlChar=function(b){return $.namedHtml.get(b)||(b>=256?"&#"+b+";":`&#x${b.toString(16).padStart(2,"0")};`)},$.isSafe=function(b){return $.safeCharCodes.has(b)},$.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),$.safeCharCodes=(function(){const b=new Set;for(let l=32;l<123;++l)(l>=97||l>=65&&l<=90||l>=48&&l<=57||l===32||l===46||l===44||l===45||l===58||l===95)&&b.add(l);return b})()},6064:j=>{j.exports=function($){return $.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:j=>{j.exports=function(){}},1687:(j,$,b)=>{const l=b(375),y=b(8571),g=b(7043),f={};j.exports=f.merge=function(t,a,n){if(l(t&&typeof t=="object","Invalid target value: must be an object"),l(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){l(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let e=0;e<a.length;++e)t.push(y(a[e],{symbols:n.symbols}));return t}const r=g.keys(a,n);for(let e=0;e<r.length;++e){const o=r[e];if(o==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,o))continue;const s=a[o];if(s&&typeof s=="object"){if(t[o]===s)continue;!t[o]||typeof t[o]!="object"||Array.isArray(t[o])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?t[o]=y(s,{symbols:n.symbols}):f.merge(t[o],s,n)}else(s!=null||n.nullOverride)&&(t[o]=s)}return t}},9621:(j,$,b)=>{const l=b(375),y={};j.exports=function(g,f,t){if(f===!1||f==null)return g;typeof(t=t||{})=="string"&&(t={separator:t});const a=Array.isArray(f);l(!a||!t.separator,"Separator option is not valid for array-based chain");const n=a?f:f.split(t.separator||".");let r=g;for(let e=0;e<n.length;++e){let o=n[e];const s=t.iterables&&y.iterables(r);if(Array.isArray(r)||s==="set"){const i=Number(o);Number.isInteger(i)&&(o=i<0?r.length+i:i)}if(!r||typeof r=="function"&&t.functions===!1||!s&&r[o]===void 0){l(!t.strict||e+1===n.length,"Missing segment",o,"in reach path ",f),l(typeof r=="object"||t.functions===!0||typeof r!="function","Invalid segment",o,"in reach path ",f),r=t.default;break}r=s?s==="set"?[...r][o]:r.get(o):r[o]}return r},y.iterables=function(g){return g instanceof Set?"set":g instanceof Map?"map":void 0}},8761:j=>{j.exports=function(...$){try{return JSON.stringify(...$)}catch(b){return"[Cannot display object: "+b.message+"]"}}},4277:(j,$)=>{const b={};$=j.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},b.typeMap=new Map([["[object Error]",$.error],["[object Map]",$.map],["[object Promise]",$.promise],["[object Set]",$.set],["[object WeakMap]",$.weakMap],["[object WeakSet]",$.weakSet]]),$.getInternalProto=function(l){if(Array.isArray(l))return $.array;if(l instanceof Date)return $.date;if(l instanceof RegExp)return $.regex;if(l instanceof Error)return $.error;const y=Object.prototype.toString.call(l);return b.typeMap.get(y)||$.generic}},7043:(j,$)=>{$.keys=function(b,l={}){return l.symbols!==!1?Reflect.ownKeys(b):Object.getOwnPropertyNames(b)}},3652:(j,$,b)=>{const l=b(375),y={};$.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(g,f){const t=[].concat((f=f||{}).before||[]),a=[].concat(f.after||[]),n=f.group||"?",r=f.sort||0;l(!t.includes(n),`Item cannot come before itself: ${n}`),l(!t.includes("?"),"Item cannot come before unassociated items"),l(!a.includes(n),`Item cannot come after itself: ${n}`),l(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(g)||(g=[g]);for(const e of g){const o={seq:this._items.length,sort:r,before:t,after:a,group:n,node:e};this._items.push(o)}if(!f.manual){const e=this._sort();l(e,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(g){Array.isArray(g)||(g=[g]);for(const t of g)if(t)for(const a of t._items)this._items.push(Object.assign({},a));this._items.sort(y.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const f=this._sort();return l(f,"merge created a dependencies error"),this.nodes}sort(){const g=this._sort();return l(g,"sort created a dependencies error"),this.nodes}_sort(){const g={},f=Object.create(null),t=Object.create(null);for(const o of this._items){const s=o.seq,i=o.group;t[i]=t[i]||[],t[i].push(s),g[s]=o.before;for(const u of o.after)f[u]=f[u]||[],f[u].push(s)}for(const o in g){const s=[];for(const i in g[o]){const u=g[o][i];t[u]=t[u]||[],s.push(...t[u])}g[o]=s}for(const o in f)if(t[o])for(const s of t[o])g[s].push(...f[o]);const a={};for(const o in g){const s=g[o];for(const i of s)a[i]=a[i]||[],a[i].push(o)}const n={},r=[];for(let o=0;o<this._items.length;++o){let s=o;if(a[o]){s=null;for(let i=0;i<this._items.length;++i){if(n[i]===!0)continue;a[i]||(a[i]=[]);const u=a[i].length;let m=0;for(let d=0;d<u;++d)n[a[i][d]]&&++m;if(m===u){s=i;break}}}s!==null&&(n[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const e={};for(const o of this._items)e[o.seq]=o;this._items=[],this.nodes=[];for(const o of r){const s=e[o];this.nodes.push(s.node),this._items.push(s)}return!0}},y.mergeSort=(g,f)=>g.sort===f.sort?0:g.sort<f.sort?-1:1},5380:(j,$,b)=>{const l=b(443),y=b(2178),g={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:l.URL||URL};$.analyze=function(f,t={}){if(!f)return y.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return y.code("DOMAIN_TOO_LONG");if(g.nonAsciiRx.test(f)){if(t.allowUnicode===!1)return y.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(g.domainControlRx.test(f))return y.code("DOMAIN_INVALID_CHARS");f=g.punycode(f),t.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const a=t.minDomainSegments||g.minDomainSegments,n=f.split(".");if(n.length<a)return y.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return y.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=t.tlds;if(r){const e=n[n.length-1].toLowerCase();if(r.deny&&r.deny.has(e)||r.allow&&!r.allow.has(e))return y.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const o=n[e];if(!o.length)return y.code("DOMAIN_EMPTY_SEGMENT");if(o.length>63)return y.code("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(!g.domainSegmentRx.test(o))return y.code("DOMAIN_INVALID_CHARS")}else if(!g.tldSegmentRx.test(o))return y.code("DOMAIN_INVALID_TLDS_CHARS")}return null},$.isValid=function(f,t){return!$.analyze(f,t)},g.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new g.URL(`http://${f}`).host}catch{return f}}},1745:(j,$,b)=>{const l=b(9848),y=b(5380),g=b(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(l.TextEncoder||TextEncoder)};$.analyze=function(t,a){return f.email(t,a)},$.isValid=function(t,a){return!f.email(t,a)},f.email=function(t,a={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return g.code("EMPTY_STRING");const n=!f.nonAsciiRx.test(t);if(!n){if(a.allowUnicode===!1)return g.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const r=t.split("@");if(r.length!==2)return r.length>2?g.code("MULTIPLE_AT_CHAR"):g.code("MISSING_AT_CHAR");const[e,o]=r;if(!e)return g.code("EMPTY_LOCAL");if(!a.ignoreLength){if(t.length>254)return g.code("ADDRESS_TOO_LONG");if(f.encoder.encode(e).length>64)return g.code("LOCAL_TOO_LONG")}return f.local(e,n)||y.analyze(o,a)},f.local=function(t,a){const n=t.split(".");for(const r of n){if(!r.length)return g.code("EMPTY_LOCAL_SEGMENT");if(a){if(!f.atextRx.test(r))return g.code("INVALID_LOCAL_CHARS")}else for(const e of r){if(f.atextRx.test(e))continue;const o=f.binary(e);if(!f.atomRx.test(o))return g.code("INVALID_LOCAL_CHARS")}}},f.binary=function(t){return Array.from(f.encoder.encode(t)).map((a=>String.fromCharCode(a))).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(j,$)=>{$.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},$.code=function(b){return{code:b,error:$.codes[b]}}},9959:(j,$,b)=>{const l=b(375),y=b(5752);$.regex=function(g={}){l(g.cidr===void 0||typeof g.cidr=="string","options.cidr must be a string");const f=g.cidr?g.cidr.toLowerCase():"optional";l(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),l(g.version===void 0||typeof g.version=="string"||Array.isArray(g.version),"options.version must be a string or an array of string");let t=g.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),l(t.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<t.length;++r)l(typeof t[r]=="string","options.version must only contain strings"),t[r]=t[r].toLowerCase(),l(["ipv4","ipv6","ipvfuture"].includes(t[r]),"options.version contains unknown version "+t[r]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const a=`(?:${t.map((r=>{if(f==="forbidden")return y.ip[r];const e=`\\/${r==="ipv4"?y.ip.v4Cidr:y.ip.v6Cidr}`;return f==="required"?`${y.ip[r]}${e}`:`${y.ip[r]}(?:${e})?`})).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:f,versions:t,regex:n,raw:a}}},5752:(j,$,b)=>{const l=b(375),y=b(6064),g={generate:function(){const f={},t="\\dA-Fa-f",a="["+t+"]",n="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",e="%"+t,o=n+e+r+":@",s="["+o+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+i+"\\.){3}"+i;const u=a+"{1,4}",m="(?:"+u+":"+u+"|"+f.ipv4address+")",d="(?:"+u+":){6}"+m,_="::(?:"+u+":){5}"+m,v="(?:"+u+")?::(?:"+u+":){4}"+m,c="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+m,h="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+m,p="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+m,w="(?:(?:"+u+":){0,4}"+u+")?::"+m,x="(?:(?:"+u+":){0,5}"+u+")?::"+u,k="(?:(?:"+u+":){0,6}"+u+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+d+"|"+_+"|"+v+"|"+c+"|"+h+"|"+p+"|"+w+"|"+x+"|"+k+")",f.ipvFuture="v"+a+"+\\.["+n+r+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const R="["+n+e+r+":]*",S="["+n+e+r+"]{1,255}",A="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+S+")",O="(?:"+R+"@)?"+A+"(?::\\d*)?",C="(?:"+R+"@)?("+A+")(?::\\d*)?",M=s+"*",D=s+"+",E="(?:\\/"+M+")*",I="\\/(?:"+D+E+")?",L=D+E,N="["+n+e+r+"@]+"+E,P="(?:\\/\\/\\/"+M+E+")";return f.hierPart="(?:(?:\\/\\/"+O+E+")|"+I+"|"+L+"|"+P+")",f.hierPartCapture="(?:(?:\\/\\/"+C+E+")|"+I+"|"+L+")",f.relativeRef="(?:(?:\\/\\/"+O+E+")|"+I+"|"+N+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+C+E+")|"+I+"|"+N+"|)",f.query="["+o+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+o+"\\/\\?]*",f}};g.rfc3986=g.generate(),$.ip={v4Cidr:g.rfc3986.ipv4Cidr,v6Cidr:g.rfc3986.ipv6Cidr,ipv4:g.rfc3986.ipv4address,ipv6:g.rfc3986.ipv6address,ipvfuture:g.rfc3986.ipvFuture},g.createRegex=function(f){const t=g.rfc3986,a="(?:\\?"+(f.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",n=f.domain?t.relativeRefCapture:t.relativeRef;if(f.relativeOnly)return g.wrap(n+a);let r="";if(f.scheme){l(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(f.scheme);l(s.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let u=0;u<s.length;++u){const m=s[u];l(m instanceof RegExp||typeof m=="string","scheme at position "+u+" must be a RegExp or String"),m instanceof RegExp?i.push(m.source.toString()):(l(t.schemeRegex.test(m),"scheme at position "+u+" must be a valid scheme"),i.push(y(m)))}r=i.join("|")}const e="(?:"+(r?"(?:"+r+")":t.scheme)+":"+(f.domain?t.hierPartCapture:t.hierPart)+")",o=f.allowRelative?"(?:"+e+"|"+n+")":e;return g.wrap(o+a,r)},g.wrap=function(f,t){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:t}},g.uriRegex=g.createRegex({}),$.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?g.createRegex(f):g.uriRegex}},1447:(j,$)=>{const b={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};$.Parser=class{constructor(l,y={}){if(!y[b.settings]&&y.constants)for(const g in y.constants){const f=y.constants[g];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${g} contains invalid ${typeof f} value type`)}this.settings=y[b.settings]?y:Object.assign({[b.settings]:!0,constants:{},functions:{}},y),this.single=null,this._parts=null,this._parse(l)}_parse(l){let y=[],g="",f=0,t=!1;const a=r=>{if(f)throw new Error("Formula missing closing parenthesis");const e=y.length?y[y.length-1]:null;if(t||g||r){if(e&&e.type==="reference"&&r===")")return e.type="function",e.value=this._subFormula(g,e.value),void(g="");if(r===")"){const o=new $.Parser(g,this.settings);y.push({type:"segment",value:o})}else if(t){if(t==="]")return y.push({type:"reference",value:g}),void(g="");y.push({type:"literal",value:g})}else if(b.operatorCharacters.includes(g))e&&e.type==="operator"&&b.operators.includes(e.value+g)?e.value+=g:y.push({type:"operator",value:g});else if(g.match(b.numberRx))y.push({type:"constant",value:parseFloat(g)});else if(this.settings.constants[g]!==void 0)y.push({type:"constant",value:this.settings.constants[g]});else{if(!g.match(b.tokenRx))throw new Error(`Formula contains invalid token: ${g}`);y.push({type:"reference",value:g})}g=""}};for(const r of l)t?r===t?(a(),t=!1):g+=r:f?r==="("?(g+=r,++f):r===")"?(--f,f?g+=r:a(r)):g+=r:r in b.literals?t=b.literals[r]:r==="("?(a(),++f):b.operatorCharacters.includes(r)?(a(),g=r,a()):r!==" "?g+=r:a();a(),y=y.map(((r,e)=>r.type!=="operator"||r.value!=="-"||e&&y[e-1].type!=="operator"?r:{type:"operator",value:"n"}));let n=!1;for(const r of y){if(r.type==="operator"){if(b.operatorsPrefix.includes(r.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!b.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");y.length===1&&["reference","literal","constant"].includes(y[0].type)&&(this.single={type:y[0].type==="reference"?"reference":"value",value:y[0].value}),this._parts=y.map((r=>{if(r.type==="operator")return b.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):b.reference(r.value)}))}_subFormula(l,y){const g=this.settings.functions[y];if(typeof g!="function")throw new Error(`Formula contains unknown function ${y}`);let f=[];if(l){let t="",a=0,n=!1;const r=()=>{if(!t)throw new Error(`Formula contains function ${y} with invalid arguments ${l}`);f.push(t),t=""};for(let e=0;e<l.length;++e){const o=l[e];n?(t+=o,o===n&&(n=!1)):o in b.literals&&!a?(t+=o,n=b.literals[o]):o!==","||a?(t+=o,o==="("?++a:o===")"&&--a):r()}r()}return f=f.map((t=>new $.Parser(t,this.settings))),function(t){const a=[];for(const n of f)a.push(n.evaluate(t));return g.call(t,...a)}}evaluate(l){const y=this._parts.slice();for(let g=y.length-2;g>=0;--g){const f=y[g];if(f&&f.type==="operator"){const t=y[g+1];y.splice(g+1,1);const a=b.evaluate(t,l);y[g]=b.single(f.value,a)}}return b.operatorsOrder.forEach((g=>{for(let f=1;f<y.length-1;)if(g.includes(y[f])){const t=y[f],a=b.evaluate(y[f-1],l),n=b.evaluate(y[f+1],l);y.splice(f,2);const r=b.calculate(t,a,n);y[f-1]=r===0?0:r}else f+=2})),b.evaluate(y[0],l)}},$.Parser.prototype[b.symbol]=!0,b.reference=function(l){return function(y){return y&&y[l]!==void 0?y[l]:null}},b.evaluate=function(l,y){return l===null?null:typeof l=="function"?l(y):l[b.symbol]?l.evaluate(y):l},b.single=function(l,y){if(l==="!")return!y;const g=-y;return g===0?0:g},b.calculate=function(l,y,g){if(l==="??")return b.exists(y)?y:g;if(typeof y=="string"||typeof g=="string"){if(l==="+")return(y=b.exists(y)?y:"")+(b.exists(g)?g:"")}else switch(l){case"^":return Math.pow(y,g);case"*":return y*g;case"/":return y/g;case"%":return y%g;case"+":return y+g;case"-":return y-g}switch(l){case"<":return y<g;case"<=":return y<=g;case">":return y>g;case">=":return y>=g;case"==":return y===g;case"!=":return y!==g;case"&&":return y&&g;case"||":return y||g}return null},b.exists=function(l){return l!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:j=>{j.exports=JSON.parse('{"version":"17.12.2"}')}},T={},(function j($){var b=T[$];if(b!==void 0)return b.exports;var l=T[$]={exports:{}};return F[$](l,l.exports,j),l.exports})(5107);var F,T}))})(U)),U.exports}export{G as r};
@@ -1 +0,0 @@
1
- import{g as r}from"./vendor-react-DX7tU9aY.js";import{r as o}from"./joi-browser.min-CUdv8seQ.js";var s=o();const t=r(s);export{t as B};
@@ -1,29 +0,0 @@
1
- import{j as r,aT as m}from"./vendor-mui-core-CV-FnYH_.js";import{C as p}from"./content-layout-Dlmn5DW6.js";import{W as c,Q as n}from"./vendor-ux-CLT2i3Pv.js";import{a0 as d,G as i}from"./index-CXp5SI_f.js";const u=m(p)`
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
5
- height: 100%;
6
-
7
- .header {
8
- width: 100%;
9
- margin-bottom: 34px;
10
- ${e=>e.theme.breakpoints.up("md")} {
11
- margin-bottom: 64px;
12
- }
13
- }
14
- .container-main {
15
- position: relative;
16
- flex: 1;
17
- width: 100%;
18
- }
19
- .container-inner {
20
- position: absolute;
21
- left: 0;
22
- top: 0;
23
- width: 100%;
24
- height: 100%;
25
- display: flex;
26
- justify-content: center;
27
- overflow-y: auto;
28
- }
29
- `;function g({children:e,...a}){const{t:o}=c(),{ws:{useSubscription:s}}=d();return s(i.BlockletEvents.certIssued,t=>{n.success(o("setup.domain.genCertSuccess",{domain:t.domain}))}),s(i.BlockletEvents.certError,t=>{n.error(o("setup.domain.genCertFailed",{domain:t.domain,message:t.message}))}),r.jsx(u,{...a,children:e})}export{g as S};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrCTi6nm.css"),window.__toCdnUrl("assets/index-_3Fxot8G.css")])))=>i.map(i=>d[i]);
2
- import{r as b,a as be}from"./vendor-react-DX7tU9aY.js";import{W as D,Q as H,_ as ye,U as re,bm as V,aR as ve,aQ as Ce}from"./vendor-ux-CLT2i3Pv.js";import{j as e,Z as K,b1 as M,I as X,ak as G,a0 as Q,b3 as q,T as I,al as c,A as w,F as C,bX as Te,bP as le,bK as ne,a6 as se,a4 as J,b4 as oe,S as ae,R as z,a7 as Z,X as n,an as we,ct as ce,cu as Se,cr as Ie}from"./vendor-mui-core-CV-FnYH_.js";import{W as B,c as k,V as Re,aI as Ee,aJ as Ae,aK as ke}from"./index-CXp5SI_f.js";import{u as We}from"./useAsyncRetry-C4R9ufi-.js";import{r as Pe}from"./index-BUhEyicQ.js";import{b as $}from"./team-BTz28XqK.js";import{u as ue,C as S}from"./index.esm-C4tuRtuv.js";import{o as Ne,b as qe,z as te}from"./vendor-utils-BzQg432x.js";import{T as Oe}from"./index-CfvGuvbD.js";import{E as Le}from"./empty-spinner-DB1GKIOS.js";import{C as v}from"./click-to-copy-BgIYUMoo.js";import{D as _e}from"./delete-confirm-CkiUXocp.js";import{a as ze}from"./passport-item-DHwif94N.js";import{A as Fe}from"./actions-DydkTgA0.js";import{T as ie}from"./table-tips-Dvmdodc5.js";import{u as De}from"./use-mobile-DwGMuJlg.js";import"./vendor-hooks-DAZ1H6Va.js";import"./vendor-arcblock-Dll6qxMT.js";import"./useAsync-DfiOQMQ_.js";import"./index-CqCXPf7W.js";import"./index-CEJb82tA.js";import"./session-Bp3LV7zJ.js";import"./purify.es-HRjpPm7y.js";import"./wallet-hidden-topbar-joIVZ1nl.js";import"./theme-mode-toggle-D3bcd10D.js";import"./use-mobile-CyUZDIaX.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./use-blocklet-logo-Cf1j7pQz.js";import"./use-app-logo-IRizt64R.js";import"./arrow-down.svg-Dz9H9vM-.js";import"./vendor-mui-x-DwN6dcQH.js";import"./AdapterDayjs-CYW0YvmK.js";import"./confirm-CdVn5WdC.js";import"./index-DBs9Ljax.js";import"./ua-parser-D6QF1h5N.js";import"./did-address-CG36eCOx.js";import"./util-DkTwHdRu.js";import"./base32-7iZvvdX8.js";var de=Pe();const Be={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:a}){const[i,h]=b.useState(!1),{t:l,locale:s}=D(),{api:f}=B(),{teamDid:d}=$(),{control:y,handleSubmit:g,formState:{errors:u},watch:W,setValue:m}=ue({defaultValues:Be,mode:"onChange"}),T=W("scope"),R=o=>{o!=="profile:read"&&m("scope",T.includes(o)?T.filter(x=>x!==o):[...T,o])},P=async o=>{h(!0);try{const x={...o,redirectUris:o.redirectUris,contacts:o.contacts?o.contacts.split(",").map(A=>A.trim()):[],scope:o.scope.join(" ")};await f.createOAuthClient({input:{teamDid:d,input:Ne(x,qe)}}),r(x)}catch(x){H.error(x.message||"Failed to create OAuth App")}finally{h(!1)}};return e.jsxs(K,{open:!0,onClose:a,maxWidth:"md",fullWidth:!0,children:[e.jsxs(M,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:4,sx:{mt:2},children:[e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:y,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!u.clientName,helperText:u.clientName?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:y,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!u.clientUri,helperText:u.clientUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:y,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!u.redirectUris,helperText:u.redirectUris?.message}),e.jsxs(c,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})})}),e.jsxs(Te,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(I,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([o,x])=>e.jsx(ne,{control:e.jsx(se,{checked:T.includes(o),onChange:()=>R(o),disabled:o==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:x})})},o))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(q,{children:e.jsx(S,{name:"contacts",control:y,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:o})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!u.contacts,helperText:u.contacts?.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!u.tosUri,helperText:u.tosUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:y,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:o})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...o,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!u.policyUri,helperText:u.policyUri?.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})})]}),u.error&&e.jsx(oe,{severity:"error",children:u.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:a,children:l("common.cancel")}),e.jsxs(z,{onClick:g(P),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Z,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function Y({scope:r="",...a}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(q,{direction:"row",...a,sx:[{flexWrap:"wrap",gap:1},...Array.isArray(a.sx)?a.sx:[a.sx]],children:i.map(h=>e.jsx(be.Fragment,{children:e.jsx(we,{title:k.OAUTH_SCOPES[h],children:e.jsx(v,{children:h})})},h))})}Y.propTypes={scope:n.string};const ee=r=>{const{prefix:a}=B(),{blocklet:i}=Re(),h=te(a,"/api/media/upload",i.appPid),l=b.useCallback(f=>f?f.startsWith("http")?f:`${te(a,"/api/media/upload",i.appPid)}/${f}`:"",[a,i.appPid]);return{clientLogoUrl:b.useMemo(()=>l(r),[r,l]),apiPath:h,getClientLogoUrl:l}},$e=b.lazy(()=>ye(()=>import("./index-DqcciDRh.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:a,onClose:i}){const[h,l]=b.useState(!1),{t:s,locale:f}=D(),d=b.useRef(null),{api:y}=B(),{teamDid:g}=$(),{control:u,handleSubmit:W,formState:{errors:m},watch:T,setValue:R,getValues:P}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),o=T("scope"),x=T("logoUri"),{clientLogoUrl:A,apiPath:N}=ee(x),E=t=>{t!=="profile:read"&&R("scope",o.includes(t)?o.filter(p=>p!==t):[...o,t])},O=async t=>{const p={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(j=>j.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(j=>j.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri,clientSecretExpiresAt:t.clientSecretExpiresAt?parseInt(t.clientSecretExpiresAt/1e3,10):null};await y.updateOAuthClient({input:{teamDid:g,input:p}})},_=async t=>{l(!0);try{await O(t),a(),i()}catch(p){H.error(p.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(K,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(M,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsxs(q,{spacing:3,sx:{mt:2},children:[e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(c,{children:[e.jsx(c,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:A?e.jsx(c,{children:e.jsx("img",{src:A,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(c,{onClick:()=>{d.current?.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{d.current?.open()},children:s(A?"common.change":"common.upload")})]}),e.jsx(c,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Le,{}),children:e.jsx($e,{ref:d,locale:f,popup:!0,onUploadFinish:t=>{R("logoUri",t.data.filename),O(P()).then(()=>{a()}).catch(p=>{H.error(p.message||s("oauth.client.updateFailed"))}).finally(()=>{d.current?.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:N,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(c,{children:e.jsx(S,{name:"clientName",control:u,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:m.clientName?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"clientUri",control:u,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:m.clientUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})})}),e.jsx(c,{children:e.jsx(S,{name:"redirectUris",control:u,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:m.redirectUris?.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})})}),e.jsx(S,{name:"clientSecretExpiresAt",control:u,render:({field:t})=>e.jsx(Oe,{placeholder:s("oauth.client.input.expireTime"),value:t.value*1e3,onChange:p=>{t.onChange(p)}})}),e.jsxs(c,{sx:{display:"none"},children:[e.jsx(I,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(c,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(k.OAUTH_SCOPES).map(([t,p])=>e.jsx(ne,{control:e.jsx(se,{checked:o.includes(t),onChange:()=>E(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(c,{children:e.jsx(I,{variant:"body2",sx:{fontWeight:500},children:p})})},t))})})]}),e.jsx(J,{}),e.jsx(I,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(c,{children:e.jsx(S,{name:"contacts",control:u,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>e.jsxs(e.Fragment,{children:[e.jsx(w,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:m.contacts?.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})})}),e.jsxs(q,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:m.tosUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}),e.jsx(S,{name:"policyUri",control:u,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>e.jsxs(c,{sx:{width:"50%"},children:[e.jsx(w,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:m.policyUri?.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:W(_),disabled:h,variant:"contained",color:"primary",children:h?e.jsx(Z,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:a,onClose:i}){return e.jsx(he,{client:r,onUpdate:h=>a(h),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string,clientSecretExpiresAt:n.number}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function xe({clientId:r,clientName:a,onDelete:i=()=>{},onClose:h=()=>{}}){const{t:l}=D(),{api:s}=B(),{teamDid:f}=$(),d=()=>{h()},y=async()=>{try{await s.deleteOAuthClient({input:{teamDid:f,clientId:r}}),i()}catch(u){H.error(u?.message)}finally{d()}},g={keyName:a,title:l("oauth.client.delete.title"),description:l("oauth.client.delete.description",{name:`<b>${a}</b>`}),confirmPlaceholder:l("oauth.client.delete.description",{name:a}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:y,onCancel:d};return e.jsx(_e,{keyName:g.keyName,title:g.title,description:g.description,confirmPlaceholder:g.confirmPlaceholder,confirm:g.confirm,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})}xe.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};function je({title:r,items:a}){return e.jsxs(c,{sx:{mb:3},children:[e.jsx(I,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(q,{spacing:1.5,children:a.map(({label:i,value:h})=>e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(I,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(I,{sx:{wordBreak:"break-all"},children:h||"-"})]},i))})]})}je.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function ge({client:r,onClose:a}){const{t:i,locale:h}=D(),{teamDid:l}=$(),{clientName:s,clientId:f,clientSecret:d,redirectUris:y,scope:g,clientUri:u,logoUri:W,contacts:m,tosUri:T,policyUri:R,jwksUri:P,jwks:o,softwareId:x,softwareVersion:A,clientIdIssuedAt:N,clientSecretExpiresAt:E,updatedAt:O,createUser:_}=r,{clientLogoUrl:t}=ee(W),p=L=>{try{const F=new URL(window.blocklet.appUrl);return F.pathname=L,F.toString()}catch{return"-"}},j=de.fromAppDid(f,l),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:t,did:j.address,size:64})},{label:i("oauth.client.clientUri"),value:u?e.jsx(v,{children:u}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:f})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:d})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(y||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(Y,{scope:g})},{label:i("oauth.client.createUser"),value:_?ze(_,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:p("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:p(`${k.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:m.length?e.jsx(v,{children:(m||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(v,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:R?e.jsx(v,{children:R}):"-"},{label:i("oauth.client.jwksUri"),value:P},{label:i("oauth.client.jwks"),value:o},{label:i("oauth.client.softwareId"),value:x},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:N?e.jsx(V,{value:N*1e3,type:"all",locale:h}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:E?e.jsx(V,{value:E*1e3,type:"all",locale:h}):"-"},{label:i("common.updatedAt"),value:O?e.jsx(V,{value:O,type:"all",locale:h}):"-"}]}].filter(Boolean);return e.jsxs(K,{open:!0,onClose:a,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(M,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:a,sx:{position:"absolute",right:8,top:8},children:e.jsx(G,{})})]}),e.jsx(Q,{children:e.jsx(c,{sx:{mt:1},children:U.map((L,F)=>e.jsxs(c,{children:[e.jsx(je,{title:L.title,items:L.items}),F!==U.length-1&&e.jsx(J,{sx:{my:2}})]},L.title))})})]})}ge.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function Ve(r){return e.jsx(V,{value:r*1e3})}function fe({selected:r=null,onClose:a}){return r?e.jsx(ge,{client:r,onClose:a}):null}fe.propTypes={selected:n.object,onClose:n.func.isRequired};function Ue({open:r,onCreated:a,onClose:i}){return r?e.jsx(pe,{onCreated:a,onClose:i}):null}Ue.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function kt(){const[r,a]=b.useState({searchText:"",pageSize:10,page:1}),[i,h]=b.useState(null),[l,s]=b.useState(!1),f=b.useRef(null),{t:d,locale:y}=D(),{api:g}=B(),{teamDid:u}=$(),[W,m]=b.useState(null),[T,R]=b.useState(null),P=De(),{getClientLogoUrl:o}=ee(),x=We(async()=>await g.getOAuthClients({input:{teamDid:u,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:A}=x,N=b.useMemo(()=>x.value?.list||[],[x.value?.list]),E=b.useMemo(()=>r.searchText?N.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):N,[r.searchText,N]),O=b.useMemo(()=>[{label:d("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p],U=o(j.logoUri),L=de.fromAppDid(j.clientId,u);return e.jsx(c,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(c,{sx:{display:"flex",alignItems:"center",gap:2,cursor:"pointer"},children:[e.jsx(re,{variant:"rounded",shape:"square",did:L.address,src:U,size:48}),e.jsxs(q,{sx:{gap:.5},children:[e.jsx(c,{sx:{color:"text.primary"},children:j.clientName}),e.jsx(c,{sx:{color:"text.secondary"},children:j.clientUri})]})]})})}}},{label:d("oauth.client.clientId"),name:"clientId"},{label:d("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(Y,{scope:t})}},{label:d("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Ve}},{label:d("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(Ee,{showDid:!0,did:t,cardType:ke.Detailed,infoType:Ae.Minimal,sx:{border:0,padding:0}}):d("oauth.client.openRegistration")}},{label:d("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:p})=>{const j=E[p];return e.jsx(Fe,{actions:[{icon:e.jsx(Se,{}),text:d("common.edit"),onClick:U=>{U.stopPropagation(),m(j)}},{icon:e.jsx(Ie,{}),text:d("common.delete"),onClick:U=>{U.stopPropagation(),R(j)}}]})}}}],[E,d,o,u,m,R]),_=({page:t,rowsPerPage:p,searchText:j})=>{r.pageSize!==p?a(U=>({...U,searchText:"",pageSize:p,page:1})):r.page!==t+1?a(U=>({...U,searchText:"",page:t+1})):r.searchText!==j&&a(U=>({...U,searchText:j,page:1}))};return e.jsxs(c,{ref:f,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[P?e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}):null,e.jsx(ve,{data:E,columns:O,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:E.length,searchDebounceTime:400,onRowClick(t,{dataIndex:p},j){if(f.current?.contains(j.target)){const U=E[p];h(U)}}},onChange:_,title:P?null:e.jsx(ie,{title:d("oauth.client.listTitle"),tooltipTitle:d("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${y}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[A?e.jsx(Z,{size:16}):e.jsx(ce,{style:{fontSize:16}}),d("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ce,{children:d("oauth.client.empty")})}),e.jsx(fe,{selected:i,onClose:()=>h(null)}),e.jsx(Ue,{open:l,onCreated:()=>{s(!1),x.retry()},onClose:()=>s(!1)}),W&&e.jsx(me,{client:W,onUpdate:x.retry,onClose:()=>m(null)}),T&&e.jsx(xe,{...T,onDelete:x.retry,onClose:()=>R(null)})]})}export{kt as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-CV-FnYH_.js";import"./vendor-react-DX7tU9aY.js";import{S as t}from"./studio-CVIa8-XY.js";import"./vendor-ux-CLT2i3Pv.js";import"./vendor-utils-BzQg432x.js";import"./vendor-hooks-DAZ1H6Va.js";import"./index-3H6a5edM.js";import"./index-CXp5SI_f.js";import"./vendor-arcblock-Dll6qxMT.js";import"./nav-menu-DSdXRbfg.js";import"./fallback-D-IHOW-7.js";function x(){return o.jsx(t,{children:"Coming soon..."})}export{x as default};
@@ -1 +0,0 @@
1
- import{J as e,K as s}from"./vendor-ux-CLT2i3Pv.js";const c=e("blocklet-services");s("blocklet-services");export{c as d};
@@ -1 +0,0 @@
1
- import{j as e,al as p,T as I,X as r,an as Q,R as O,bf as pe,a7 as fe}from"./vendor-mui-core-CV-FnYH_.js";import{h as ge,a as ue,b as me,j as he}from"./vendor-hooks-DAZ1H6Va.js";import{r as J,u as we}from"./vendor-react-DX7tU9aY.js";import{u as xe,z as ye,s as ke,c as R,a as Pe,H as $,b as je,d as be,e as ve,f as z,R as Te,g as Ie}from"./index-CXp5SI_f.js";import{z as N,b as _,F as Ce,c as Le}from"./vendor-utils-BzQg432x.js";import{o as Re}from"./vendor-arcblock-Dll6qxMT.js";import{U as _e,Z as We,W as G,N as M,af as Ne,a5 as Ae,a4 as Ee,Q as V,ab as Se,an as B}from"./vendor-ux-CLT2i3Pv.js";import{u as Ue}from"./use-passport-id-B-b-_oYF.js";import{g as X}from"./get-safe-url-beob4f2C.js";import{d as W}from"./logger-CCAAJ2Xo.js";function Z({blocklet:c=window.blocklet}){return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(_e,{variant:"rounded",shape:"square",did:c.appPid,src:c.appLogo,size:80}),e.jsx(I,{component:"h2",variant:"h6",children:c.appName}),e.jsx(We,{did:c.appPid})]})}const De=J.memo(Z);Z.propTypes={blocklet:r.shape({appName:r.string,appLogo:r.string,appPid:r.string})};const qe=()=>window.blocklet?.componentMountPoints?.find(s=>s.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint;function Y({children:c=null,cta:s=null,...i}){return e.jsxs(p,{...i,children:[c?e.jsx(p,{sx:{maxHeight:"50vh",overflow:"hidden",position:"relative",":after":{content:'""',position:"absolute",left:0,right:0,bottom:0,height:"80%",background:"linear-gradient(transparent, #fff 85%)"}},children:c}):null,s?e.jsx(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:4,borderRadius:2},children:s}):null]})}Y.propTypes={children:r.node,cta:r.node};function ee({passports:c=[],onConnect:s=()=>{},redirect:i,...y}){const{t:f}=G(),k=qe(),P=a=>{const m=a?.payable;return k&&m?N(k,`/api/redirect/checkout/${m}?redirect=${i}`):null};return e.jsxs(p,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",maxWidth:"400px",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsx(De,{}),e.jsx(Y,{...y,cta:e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"h4",sx:{mx:2,textAlign:"center",fontWeight:"bold",color:"warning.main"},children:f("login.accessLimit.title")}),e.jsx(I,{variant:"body1",sx:{maxWidth:620,mt:2,mx:2,textAlign:"center",color:"gray"},children:f("login.accessLimit.description")}),e.jsx(p,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1,mt:5},children:c?.map(a=>{const m=P(a);return m?e.jsx(Q,{title:f("login.accessLimit.buyPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"primary",variant:"contained",endIcon:e.jsx(pe,{}),href:m,target:"_blank",children:a.title||a.name})},a.name):e.jsx(Q,{title:f("login.connectWithPassport"),arrow:!0,placement:"top",children:e.jsx(O,{color:"inherit",variant:"contained",onClick:s,children:a.title||a.name})},a.name)})}),e.jsxs(I,{variant:"body1",sx:{mt:2,color:"grey.400"},children:[e.jsx(p,{component:"span",sx:{display:"inline-block",mr:1},children:f("login.accessLimit.alreadyHavePassport")}),e.jsx(p,{component:"span",sx:{textDecoration:"underline",cursor:"pointer",color:"primary.main"},onClick:s,children:f("common.connect")})]})]})})]})}ee.propTypes={passports:r.arrayOf(r.shape({name:r.string.isRequired,title:r.string,payable:r.string})),onConnect:r.func,onClose:r.func,redirect:r.string.isRequired};function Xe(){const c=J.useRef(null),{session:s}=xe(),{t:i,locale:y}=G(),{getPassportId:f}=Ue(),k=we(),P=M(),a=Ne(),{encryptKey:m,decrypt:ne}=ye(),j=ge(s),{searchParams:o}=new URL(window.location.href),h={passportId:f()},A=o.get("componentId"),E=o.get("authenticated"),te=o.get("sessionToken"),oe=o.get("csrfToken"),ie=o.get("refreshToken"),se=o.get("requiredRoles"),g=o.get("redirect"),d=o.get("forceConnected"),b=o.get("sourceAppPid"),C=o.get("origin"),S=o.get("autoConnectWebview"),U=o.get("popup"),D=o.get("showQuickConnect");let w=o.get("inviter");if(!w&&g)try{w=(g.startsWith("http")?new URL(g):new URL(g,window.location.origin)).searchParams.get("inviter")}catch{}w=w||localStorage.getItem("inviter"),A&&(h.componentId=A),P&&(h.visitorId=P),w&&(h.inviter=w),Le(b)||(b==="null"?h.sourceAppPid=null:b!==null&&(h.sourceAppPid=b));let q=[];try{q=JSON.parse(se)}catch{}const re=async n=>{const t=o.get("fromWallet");W("login page notifyWallet",{data:n,fromWallet:t,"browser.wallet":a.wallet}),n&&String(t)==="1"&&a.wallet&&await Promise.any([B.asyncCall("arcSetToken",n),z(3e3)])},v=n=>n&&(o.get("encrypted")?ne(n):n),H=async n=>{n&&await re(n),setTimeout(()=>{if(g){const t=decodeURIComponent(g);t.startsWith(R.WELLKNOWN_SERVICE_PATH_PREFIX)?k(t,{replace:!0}):window.location.replace(X(t))}else window.location.replace(window.env.pathPrefix||"/")},50)},ce=n=>{const t={did:n.user.did,host:window.location.host,appPid:window.blocklet.appPid,visitorId:M(),sourceAppPid:n.user.sourceAppPid,fullName:n.user.fullName};W("bridge callArc: onLogin",t),B.callArc("onLogin",t)},F=async(n,t)=>{const L=t(n.csrfToken),T=t(n.sessionToken),x=t(n.refreshToken),u=t(n.visitorId);W("login page onLogin",{result:n,decodeSessionToken:T,decodeRefreshToken:x,decodeVisitorId:u}),je(T),be(L),ve(x),n.visitorId&&Se(u),await s.refresh(),await z(100),ce(j.current);const l={};o.get("saveConnect")?(l.connected_did=j.current.user.did,l.connected_pk=j.current.user.pk,l.connected_wallet_os=j.current.walletOS,l.connected_app=Te()):(l.connected_did=o.get("connected_did"),l.connected_pk=o.get("connected_pk"),l.connected_app=o.get("connected_app"),l.connected_wallet_os=o.get("connected_wallet_os")),Ie(l,!0),H({sessionToken:T,refreshToken:x,visitorId:u})},ae=ue(()=>C==="switch-did"?d&&typeof d=="string"?{title:i("login.switchSpecifiedDid.title"),scan:i("login.switchSpecifiedDid.scan",{did:d}),confirm:i("login.switchSpecifiedDid.confirm"),success:i("login.switchSpecifiedDid.success")}:{title:i("login.switchDid.title"),scan:i("login.switchDid.scan"),confirm:i("login.switchDid.confirm"),success:i("login.switchDid.success")}:{title:i("login.connect.title"),scan:i("login.connect.scan"),confirm:i("login.connect.confirm"),success:i("login.connect.success")},[d,C,i]),K=me(()=>{const n=window?.blocklet,t={className:"connect",popup:!1,action:"login",passkeyBehavior:"both",onSuccess:F,onError:le,locale:y,messages:ae,extraParams:h,baseUrl:window.location.origin,prefix:N(window.location.origin,R.WELLKNOWN_SERVICE_PATH_PREFIX,ke)};d&&(t.forceConnected=d,t.extraParams.enableSwitchApp=!1,t.extraParams.forceConnected=d),t.options||(t.options={}),C==="switch-did"?t.options.showQuickConnect=!0:_(D)||([!1,"false"].includes(D)?t.options.showQuickConnect=!1:t.options.showQuickConnect=!0);const L=Ae();Ee()&&(t.extraParams.sourceAppPid=L.appPid);const x=N(window.location.origin,R.WELLKNOWN_SERVICE_PATH_PREFIX,"connect"),u={params:Pe(encodeURIComponent(JSON.stringify(t))),appPid:n?.appPid,appName:n?.appName,locale:y,redirect:window.location.href,_ek_:m};_(S)||(u.autoConnectWebview=S),_(U)||(u.popup=U),u.disableClose=!0;const l=X(Ce(x,u),{allowDomains:null});window.location.href=l});he(()=>{if(o.get("sessionToken")){const n=o.get("visitorId");if(!n){V.error("Unexpected login response from server: visitorId is required");return}F({sessionToken:v(te),csrfToken:v(oe),refreshToken:v(ie),visitorId:v(n)},t=>t)}else!s.user||d&&s.user.did!==d?K():!E&&!o.get("sessionToken")&&H()});const le=n=>{V.error(n.message)},de=o.has("popup");if(s.loading||s.user){if(!E||o.get("sessionToken"))return e.jsxs(e.Fragment,{children:[e.jsx($,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(Re,{children:de?null:e.jsx(fe,{})})]});const n=g?new URL(g,window.location.origin).href:window.location.href;return e.jsx(ee,{onConnect:K,passports:q,redirect:n})}return e.jsxs(e.Fragment,{children:[e.jsx($,{children:e.jsx("title",{children:i("pageTitle.login")})}),e.jsx(p,{sx:{"box-sizing":"border-box",width:"100%",height:"100vh",position:"relative",display:"flex","flex-direction":"column",".connect":{background:"#fafafa"}},ref:c})]})}export{Xe as default};
@@ -1 +0,0 @@
1
- import{G as g,j as e,al as s,an as u,T as r,X as o}from"./vendor-mui-core-CV-FnYH_.js";import{a1 as m,bK as p,Y as d,bL as b}from"./vendor-ux-CLT2i3Pv.js";import{r as j}from"./vendor-react-DX7tU9aY.js";import{n as _}from"./vendor-utils-BzQg432x.js";function S({isLatest:t=!1,title:n,description:a=null,icon:i,iconScale:x=.95,slotProps:f={},mode:y="normal",t:h=_,...l}){const c=g();return e.jsxs(s,{...l,className:"arc-login-item",sx:m({position:"relative",display:"flex",alignItems:"center",gap:1,cursor:"pointer",p:1.2,borderRadius:1,backgroundColor:t?"grey.100":"grey.50",border:t?"1px solid":"none",borderColor:t?"grey.100":"transparent",textDecoration:"none",transition:"background-color 0.5s","&:hover, &:active, &.did-connect__choose-item__active":{backgroundColor:"grey.100"},"& .other-item-icon":{opacity:"0",transform:"translateX(-100%)",transition:"transform 0.2s ease, opacity 0.1s ease"},"&:hover":{"& .other-item-icon":{display:"inline-block",transform:"translateX(0)",opacity:"1"}}},l?.sx),children:[e.jsx(u,{title:n,children:e.jsx(s,{className:"arc-login-item__icon",sx:m({display:"flex",justifyContent:"center",alignItems:"center",color:"text.primary"},f?.icon?.sx),children:j.isValidElement(i)?i:e.jsx(s,{component:d,icon:i,sx:{transform:`scale(${x})`,width:p,height:p}})})}),y==="normal"?e.jsxs(e.Fragment,{children:[e.jsxs(s,{className:"arc-login-item__body",sx:{display:"flex",flexDirection:"column",flex:1},children:[e.jsx(r,{sx:{fontSize:14,fontWeight:"500",color:"text.primary",whiteSpace:"nowrap"},children:n}),a?e.jsx(r,{sx:{color:"text.secondary",fontSize:12,lineHeight:1},children:a}):null]}),t?e.jsx(r,{component:"span",className:"latest-badge",style:{color:c.palette.text.secondary,fontSize:11},children:h("lastUsed")}):e.jsx(d,{className:"other-item-icon",icon:b,fontSize:"1.3rem",color:c.palette.primary.main})]}):null]})}S.propTypes={title:o.string.isRequired,description:o.string,icon:o.any.isRequired,iconScale:o.number,slotProps:o.object,mode:o.oneOf(["mini","simple","normal"]),isLatest:o.bool,t:o.func};export{S as R};
@@ -1 +0,0 @@
1
- import{j as e,aS as d,al as r,T as m,b4 as p,R as u}from"./vendor-mui-core-CV-FnYH_.js";import{i as x,p as f,j as h}from"./vendor-hooks-DAZ1H6Va.js";import{j as c}from"./vendor-react-DX7tU9aY.js";import{c as j,h as y,i as w}from"./index-CXp5SI_f.js";import{k as C}from"./fallback-D-IHOW-7.js";import{W as v}from"./vendor-ux-CLT2i3Pv.js";import{z as M}from"./vendor-utils-BzQg432x.js";import"./vendor-arcblock-Dll6qxMT.js";const k="authorization_response",A=w();function L(){const{t}=v(),[o]=c(),a=()=>{window.close()};return h(()=>{const i=o.get("state"),l=o.get("code"),s={type:k,response:{code:l}};if(window.opener)try{const n=new URL(i);window.opener.postMessage(s,n.origin),setTimeout(()=>{window.close()},2e3)}catch(n){console.error("Invalid login caller",n)}}),e.jsx(p,{severity:"success",children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",gap:1},children:[t("login.needManualClose"),e.jsx(r,{sx:{textAlign:"center"},children:e.jsx(u,{variant:"outlined",size:"small",onClick:a,children:t("login.closeWindow")})})]})})}function _(){const{blocklet:t}=window,[o]=c(),a=o.get("error"),i=o.get("error_description"),l=o.get("state"),s=x({errorMessage:"",loading:!0});f(async()=>{if(a)s.errorMessage=i,s.loading=!1;else try{const g=new URL(l);(await A.federated.getTrustedDomains()).includes(g.hostname)||(s.errorMessage="Invalid login caller",s.loading=!1)}catch{s.errorMessage="Invalid login caller",s.loading=!1}},[a,i,l]);const n=M(j.WELLKNOWN_SERVICE_PATH_PREFIX,`/blocklet/logo?&version=${t?.meta?.version||""}`);return e.jsx(d,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh",justifyContent:"center",alignContent:"center"},children:e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minHeight:"100vh",margin:"auto",paddingBottom:{sx:0,md:15}},children:[e.jsxs(r,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:.5},children:[e.jsx(r,{component:"img",src:n,alt:`${t?.appName||"site"} logo`,sx:{width:80}}),e.jsx(m,{variant:"h6",component:"p",children:t?.appName})]}),s.loading?s.errorMessage?e.jsx(C,{error:{message:s.errorMessage}}):e.jsx(L,{}):null,e.jsx(y,{sx:{mt:4}})]})})}export{_ as default};