tanstack_start_ts 1.0.0

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 (336) hide show
  1. package/.wrangler/deploy/config.json +1 -0
  2. package/bunfig.toml +6 -0
  3. package/components.json +22 -0
  4. package/config.json +0 -0
  5. package/dist/client/.assetsignore +2 -0
  6. package/dist/client/assets/ProductCard-DbIkJAE-.js +1 -0
  7. package/dist/client/assets/about-AskxOruL.js +1 -0
  8. package/dist/client/assets/admin-BZVcAQM3.js +1 -0
  9. package/dist/client/assets/admin.functions--RdVcuBx.js +1 -0
  10. package/dist/client/assets/admin.login-QgrF_9Fp.js +1 -0
  11. package/dist/client/assets/affiliate-disclosure-BIAsA-HO.js +1 -0
  12. package/dist/client/assets/categories-D0N418mK.js +1 -0
  13. package/dist/client/assets/category._slug-aCaQm14E.js +1 -0
  14. package/dist/client/assets/contact-PhvO-V15.js +1 -0
  15. package/dist/client/assets/faq-BsiHWPM8.js +1 -0
  16. package/dist/client/assets/hero-bg-BP2eVUIX.jpg +0 -0
  17. package/dist/client/assets/index-BU9rnkF3.js +1 -0
  18. package/dist/client/assets/index-BpJWZkva.js +1 -0
  19. package/dist/client/assets/index-vRX-zAyq.js +1 -0
  20. package/dist/client/assets/login-DteE0ZGp.js +1 -0
  21. package/dist/client/assets/logo-pSNfLJQk.png +0 -0
  22. package/dist/client/assets/privacy-B_Pu7040.js +1 -0
  23. package/dist/client/assets/product-links-BkZ41Gv3.js +1 -0
  24. package/dist/client/assets/product._id-BVUysCW-.js +1 -0
  25. package/dist/client/assets/products.functions-cGzRziKO.js +1 -0
  26. package/dist/client/assets/profile-CveRcKq2.js +1 -0
  27. package/dist/client/assets/reset-password-ySEjItX_.js +1 -0
  28. package/dist/client/assets/saved-CHtdQDJF.js +1 -0
  29. package/dist/client/assets/search-CXWfET1y.js +1 -0
  30. package/dist/client/assets/signup-CEx90iuV.js +1 -0
  31. package/dist/client/assets/styles-DrNJG0BO.css +1 -0
  32. package/dist/client/assets/terms-VqJ9kX9b.js +1 -0
  33. package/dist/client/assets/update-password-C-d0ix5e.js +1 -0
  34. package/dist/client/assets/vendor-aria-hidden-DvXkyWUv.js +1 -0
  35. package/dist/client/assets/vendor-class-variance-authority-5VPnzWs2.js +1 -0
  36. package/dist/client/assets/vendor-clsx-B-dksMZM.js +1 -0
  37. package/dist/client/assets/vendor-cookie-es-CS0aJGDi.js +1 -0
  38. package/dist/client/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
  39. package/dist/client/assets/vendor-floating-ui-core-BlUy28sp.js +1 -0
  40. package/dist/client/assets/vendor-floating-ui-dom-BxK0hn2R.js +1 -0
  41. package/dist/client/assets/vendor-floating-ui-react-dom-Bas3975S.js +1 -0
  42. package/dist/client/assets/vendor-floating-ui-utils-BfYUAVcw.js +1 -0
  43. package/dist/client/assets/vendor-framer-motion-BMdL-cuX.js +9 -0
  44. package/dist/client/assets/vendor-get-nonce-C-Z93AgS.js +1 -0
  45. package/dist/client/assets/vendor-iceberg-js-tWD4K6Lg.js +1 -0
  46. package/dist/client/assets/vendor-lovable.dev-cloud-auth-js-VuzqtJVg.js +1 -0
  47. package/dist/client/assets/vendor-lucide-react-b5K2fehp.js +1 -0
  48. package/dist/client/assets/vendor-motion-dom-BETJamZt.js +1 -0
  49. package/dist/client/assets/vendor-motion-utils-BuWewJbj.js +1 -0
  50. package/dist/client/assets/vendor-radix-ui-primitive-Dc_FVRD7.js +1 -0
  51. package/dist/client/assets/vendor-radix-ui-react-accordion-C22Rgxe9.js +1 -0
  52. package/dist/client/assets/vendor-radix-ui-react-arrow-DMHj2mKI.js +1 -0
  53. package/dist/client/assets/vendor-radix-ui-react-avatar-CVPBkFXg.js +1 -0
  54. package/dist/client/assets/vendor-radix-ui-react-collapsible-BvM-4sKX.js +1 -0
  55. package/dist/client/assets/vendor-radix-ui-react-collection-D9KtqmHm.js +1 -0
  56. package/dist/client/assets/vendor-radix-ui-react-compose-refs-Cvq0AS8Z.js +1 -0
  57. package/dist/client/assets/vendor-radix-ui-react-context-CAqqn5Nx.js +1 -0
  58. package/dist/client/assets/vendor-radix-ui-react-dialog-DZ01vOLq.js +5 -0
  59. package/dist/client/assets/vendor-radix-ui-react-direction-DxZwNuei.js +1 -0
  60. package/dist/client/assets/vendor-radix-ui-react-dismissable-layer-Dqgrs55Y.js +1 -0
  61. package/dist/client/assets/vendor-radix-ui-react-dropdown-menu-0uzvrqkn.js +1 -0
  62. package/dist/client/assets/vendor-radix-ui-react-focus-guards-DgWoZ-fP.js +1 -0
  63. package/dist/client/assets/vendor-radix-ui-react-focus-scope-BLIu5QaL.js +1 -0
  64. package/dist/client/assets/vendor-radix-ui-react-id-bpga_rLa.js +1 -0
  65. package/dist/client/assets/vendor-radix-ui-react-menu-D0qf2r6_.js +1 -0
  66. package/dist/client/assets/vendor-radix-ui-react-popper-BafIylxU.js +1 -0
  67. package/dist/client/assets/vendor-radix-ui-react-portal-BnAsfNCS.js +1 -0
  68. package/dist/client/assets/vendor-radix-ui-react-presence-C-f3UKQ2.js +1 -0
  69. package/dist/client/assets/vendor-radix-ui-react-primitive-zTHwXNoz.js +1 -0
  70. package/dist/client/assets/vendor-radix-ui-react-roving-focus-jyJB8K2E.js +1 -0
  71. package/dist/client/assets/vendor-radix-ui-react-slot-6LXHJrHl.js +1 -0
  72. package/dist/client/assets/vendor-radix-ui-react-use-callback-ref-E91aPc6s.js +1 -0
  73. package/dist/client/assets/vendor-radix-ui-react-use-controllable-state-Ca3eMtxa.js +1 -0
  74. package/dist/client/assets/vendor-radix-ui-react-use-effect-event-CPeX4A3c.js +1 -0
  75. package/dist/client/assets/vendor-radix-ui-react-use-escape-keydown-7n3YsXFo.js +1 -0
  76. package/dist/client/assets/vendor-radix-ui-react-use-is-hydrated-C1PY1qNv.js +1 -0
  77. package/dist/client/assets/vendor-radix-ui-react-use-layout-effect-B3AcGWPy.js +1 -0
  78. package/dist/client/assets/vendor-radix-ui-react-use-size-CXS04sct.js +1 -0
  79. package/dist/client/assets/vendor-react-dom-BnNs-kzm.js +9 -0
  80. package/dist/client/assets/vendor-react-gJPiVnX5.js +1 -0
  81. package/dist/client/assets/vendor-react-remove-scroll-DHKl-IMP.js +4 -0
  82. package/dist/client/assets/vendor-react-remove-scroll-bar-CSjdInc2.js +38 -0
  83. package/dist/client/assets/vendor-react-style-singleton-BqHpkgXn.js +1 -0
  84. package/dist/client/assets/vendor-scheduler-7OC5HNn7.js +1 -0
  85. package/dist/client/assets/vendor-seroval-B_Fur-nl.js +3 -0
  86. package/dist/client/assets/vendor-seroval-plugins-CBHnPkZJ.js +1 -0
  87. package/dist/client/assets/vendor-sonner-71-LdGG1.js +1 -0
  88. package/dist/client/assets/vendor-supabase-auth-js-DWrN-bIx.js +18 -0
  89. package/dist/client/assets/vendor-supabase-functions-js-uY_V-TxC.js +1 -0
  90. package/dist/client/assets/vendor-supabase-phoenix-BzEf37Ve.js +2 -0
  91. package/dist/client/assets/vendor-supabase-postgrest-js-C4rBWbCx.js +4 -0
  92. package/dist/client/assets/vendor-supabase-realtime-js-D6BlOYKE.js +23 -0
  93. package/dist/client/assets/vendor-supabase-storage-js-BG98L3Zz.js +1 -0
  94. package/dist/client/assets/vendor-supabase-supabase-js-DCCzdwBJ.js +1 -0
  95. package/dist/client/assets/vendor-tailwind-merge-Ct12j0u0.js +1 -0
  96. package/dist/client/assets/vendor-tanstack-history-C617CaxG.js +1 -0
  97. package/dist/client/assets/vendor-tanstack-query-core-7wuJJ5ZL.js +1 -0
  98. package/dist/client/assets/vendor-tanstack-react-query-HImzo8sX.js +1 -0
  99. package/dist/client/assets/vendor-tanstack-react-router-sIZLK-LU.js +1 -0
  100. package/dist/client/assets/vendor-tanstack-react-start-client-GiYCfWmf.js +1 -0
  101. package/dist/client/assets/vendor-tanstack-react-store-EvTi3ahh.js +1 -0
  102. package/dist/client/assets/vendor-tanstack-router-core-Cr7bYUZv.js +1 -0
  103. package/dist/client/assets/vendor-tanstack-start-client-core-C-00BBOu.js +2 -0
  104. package/dist/client/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
  105. package/dist/client/assets/vendor-tanstack-store-BC7mA7pq.js +1 -0
  106. package/dist/client/assets/vendor-tslib-Du-meQkk.js +1 -0
  107. package/dist/client/assets/vendor-use-callback-ref-C_fIAtot.js +1 -0
  108. package/dist/client/assets/vendor-use-sidecar-Bh0DDN6h.js +1 -0
  109. package/dist/client/assets/vendor-use-sync-external-store-ZvKHXaIn.js +1 -0
  110. package/dist/client/assets/vendor-vercel-analytics-DwPM5BWs.js +1 -0
  111. package/dist/client/assets/vendor-zod-By9teAtI.js +1 -0
  112. package/dist/client/robots.txt +2 -0
  113. package/dist/server/.dev.vars +5 -0
  114. package/dist/server/.vite/manifest.json +2528 -0
  115. package/dist/server/assets/ProductCard-CUPXy5Eo.js +149 -0
  116. package/dist/server/assets/_tanstack-start-manifest_v-do7vTWFD.js +4 -0
  117. package/dist/server/assets/about-TfKQw0Ga.js +28 -0
  118. package/dist/server/assets/admin-DspfJOJk.js +578 -0
  119. package/dist/server/assets/admin.functions-B78ppWLR.js +645 -0
  120. package/dist/server/assets/admin.functions-BWlKBoTL.js +93 -0
  121. package/dist/server/assets/admin.login-CV7QfeA6.js +139 -0
  122. package/dist/server/assets/affiliate-disclosure-B1wI1cDb.js +86 -0
  123. package/dist/server/assets/auth-middleware-Cn49MidW.js +62 -0
  124. package/dist/server/assets/categories-Z7jnAYZP.js +108 -0
  125. package/dist/server/assets/category._slug-D0XY3FGK.js +112 -0
  126. package/dist/server/assets/contact-IzyONsXs.js +104 -0
  127. package/dist/server/assets/faq-aRhB_CR3.js +133 -0
  128. package/dist/server/assets/hero-bg-BP2eVUIX.jpg +0 -0
  129. package/dist/server/assets/index-BTPHbXw9.js +221 -0
  130. package/dist/server/assets/index-ByJkHkrU.js +30 -0
  131. package/dist/server/assets/login-Dvy5Dm0f.js +175 -0
  132. package/dist/server/assets/logo-pSNfLJQk.png +0 -0
  133. package/dist/server/assets/privacy-B6Wiez1P.js +93 -0
  134. package/dist/server/assets/product-links-CGYEPP56.js +16 -0
  135. package/dist/server/assets/product._id-BpRa-1z0.js +231 -0
  136. package/dist/server/assets/products.functions-DSlmibYN.js +209 -0
  137. package/dist/server/assets/products.functions-DlHkRiqi.js +24 -0
  138. package/dist/server/assets/profile-B0NWzVAZ.js +314 -0
  139. package/dist/server/assets/reset-password-CY-rmqMr.js +115 -0
  140. package/dist/server/assets/saved-7FA6Dbom.js +126 -0
  141. package/dist/server/assets/search-Yw5c_fZa.js +329 -0
  142. package/dist/server/assets/signup-UPzgZo4i.js +143 -0
  143. package/dist/server/assets/styles-DrNJG0BO.css +1 -0
  144. package/dist/server/assets/terms-CMnX95bP.js +89 -0
  145. package/dist/server/assets/update-password-Cr94ea8n.js +131 -0
  146. package/dist/server/assets/vendor-aria-hidden-DPa16MWu.js +122 -0
  147. package/dist/server/assets/vendor-class-variance-authority-0YxJPB9Y.js +44 -0
  148. package/dist/server/assets/vendor-cloudflare-unenv-preset-ya0VEFBz.js +250 -0
  149. package/dist/server/assets/vendor-clsx-DgYk2OaC.js +16 -0
  150. package/dist/server/assets/vendor-cookie-es-DAoofYiI.js +44 -0
  151. package/dist/server/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
  152. package/dist/server/assets/vendor-floating-ui-core-3tkK0THV.js +726 -0
  153. package/dist/server/assets/vendor-floating-ui-dom-C-cPtgJv.js +626 -0
  154. package/dist/server/assets/vendor-floating-ui-react-dom-CRG6gBpH.js +319 -0
  155. package/dist/server/assets/vendor-floating-ui-utils-DmXANH-E.js +320 -0
  156. package/dist/server/assets/vendor-framer-motion-X4zAkX3J.js +1979 -0
  157. package/dist/server/assets/vendor-get-nonce-DiSj3EHl.js +9 -0
  158. package/dist/server/assets/vendor-h3-v2-CCobnLY5.js +287 -0
  159. package/dist/server/assets/vendor-iceberg-js-bHCkXyJn.js +534 -0
  160. package/dist/server/assets/vendor-isbot-CZ7WjwVs.js +21 -0
  161. package/dist/server/assets/vendor-lovable.dev-cloud-auth-js-BE03njZw.js +180 -0
  162. package/dist/server/assets/vendor-lucide-react-Ddew6HYb.js +458 -0
  163. package/dist/server/assets/vendor-motion-dom-D2MTwGIG.js +5983 -0
  164. package/dist/server/assets/vendor-motion-utils-LJlIFN6m.js +161 -0
  165. package/dist/server/assets/vendor-radix-ui-primitive-B-mNdDrH.js +11 -0
  166. package/dist/server/assets/vendor-radix-ui-react-accordion-1Izf6x00.js +308 -0
  167. package/dist/server/assets/vendor-radix-ui-react-arrow-B882lnFK.js +23 -0
  168. package/dist/server/assets/vendor-radix-ui-react-avatar-BVgZt2Ab.js +209 -0
  169. package/dist/server/assets/vendor-radix-ui-react-collapsible-DCBbMZiS.js +147 -0
  170. package/dist/server/assets/vendor-radix-ui-react-collection-BZ2srfgU.js +150 -0
  171. package/dist/server/assets/vendor-radix-ui-react-compose-refs-D3qsKVk1.js +39 -0
  172. package/dist/server/assets/vendor-radix-ui-react-context-BVoNDLue.js +78 -0
  173. package/dist/server/assets/vendor-radix-ui-react-dialog-DlxMaNYK.js +406 -0
  174. package/dist/server/assets/vendor-radix-ui-react-direction-Dt_WDL1t.js +9 -0
  175. package/dist/server/assets/vendor-radix-ui-react-dismissable-layer-CjsuPohV.js +210 -0
  176. package/dist/server/assets/vendor-radix-ui-react-dropdown-menu-DVxKumY8.js +263 -0
  177. package/dist/server/assets/vendor-radix-ui-react-focus-guards-D_6NoePE.js +29 -0
  178. package/dist/server/assets/vendor-radix-ui-react-focus-scope-DEIhTJJH.js +206 -0
  179. package/dist/server/assets/vendor-radix-ui-react-id-DFFpgh6m.js +14 -0
  180. package/dist/server/assets/vendor-radix-ui-react-menu-CiTMLwjT.js +893 -0
  181. package/dist/server/assets/vendor-radix-ui-react-popper-23Ye2Vyc.js +286 -0
  182. package/dist/server/assets/vendor-radix-ui-react-portal-CZCH5uPk.js +16 -0
  183. package/dist/server/assets/vendor-radix-ui-react-presence-CaAULlDU.js +128 -0
  184. package/dist/server/assets/vendor-radix-ui-react-primitive-BeOk3UYa.js +124 -0
  185. package/dist/server/assets/vendor-radix-ui-react-roving-focus-DES9GR8l.js +224 -0
  186. package/dist/server/assets/vendor-radix-ui-react-slot-DUhZbzoH.js +103 -0
  187. package/dist/server/assets/vendor-radix-ui-react-use-callback-ref-BynBgohw.js +11 -0
  188. package/dist/server/assets/vendor-radix-ui-react-use-controllable-state-C9KpT6DG.js +69 -0
  189. package/dist/server/assets/vendor-radix-ui-react-use-effect-event-gpNY2xjS.js +1 -0
  190. package/dist/server/assets/vendor-radix-ui-react-use-escape-keydown-CcYRQ2pp.js +17 -0
  191. package/dist/server/assets/vendor-radix-ui-react-use-is-hydrated-D_LcBPXY.js +15 -0
  192. package/dist/server/assets/vendor-radix-ui-react-use-layout-effect-1LNLXAjr.js +6 -0
  193. package/dist/server/assets/vendor-radix-ui-react-use-size-D6fiKJQo.js +39 -0
  194. package/dist/server/assets/vendor-react-DvBrY0qp.js +511 -0
  195. package/dist/server/assets/vendor-react-dom-yvMLPM0j.js +10484 -0
  196. package/dist/server/assets/vendor-react-remove-scroll-BNtiEvVN.js +328 -0
  197. package/dist/server/assets/vendor-react-remove-scroll-bar-hLqRASRk.js +82 -0
  198. package/dist/server/assets/vendor-react-style-singleton-BXjcXskB.js +69 -0
  199. package/dist/server/assets/vendor-rou3-3NaGPdI8.js +8 -0
  200. package/dist/server/assets/vendor-seroval-dJyC-Zhz.js +1775 -0
  201. package/dist/server/assets/vendor-seroval-plugins-Pq_U2meB.js +58 -0
  202. package/dist/server/assets/vendor-sonner-CqbjhsRh.js +1086 -0
  203. package/dist/server/assets/vendor-srvx-BA-baEX9.js +6 -0
  204. package/dist/server/assets/vendor-supabase-auth-js-D4xjVprw.js +7602 -0
  205. package/dist/server/assets/vendor-supabase-functions-js-sWy4UYn1.js +322 -0
  206. package/dist/server/assets/vendor-supabase-phoenix-Bw3Uh2Nn.js +1777 -0
  207. package/dist/server/assets/vendor-supabase-postgrest-js-AO-BXa7I.js +4938 -0
  208. package/dist/server/assets/vendor-supabase-realtime-js-BtdNgJbm.js +2111 -0
  209. package/dist/server/assets/vendor-supabase-storage-js-Dk_MrPYO.js +2679 -0
  210. package/dist/server/assets/vendor-supabase-supabase-js-D1EEtG3j.js +697 -0
  211. package/dist/server/assets/vendor-tailwind-merge-BHb_obmC.js +3255 -0
  212. package/dist/server/assets/vendor-tanstack-history-C4pKJmkt.js +204 -0
  213. package/dist/server/assets/vendor-tanstack-query-core-PwwTR5ld.js +2552 -0
  214. package/dist/server/assets/vendor-tanstack-react-query-hhHzXAK1.js +190 -0
  215. package/dist/server/assets/vendor-tanstack-react-router-XzqpA65A.js +1120 -0
  216. package/dist/server/assets/vendor-tanstack-react-start-RvWUpvat.js +37 -0
  217. package/dist/server/assets/vendor-tanstack-react-start-client-gpNY2xjS.js +1 -0
  218. package/dist/server/assets/vendor-tanstack-react-start-server-uj_Y9pEN.js +15 -0
  219. package/dist/server/assets/vendor-tanstack-react-store-gpNY2xjS.js +1 -0
  220. package/dist/server/assets/vendor-tanstack-router-core-6wywV3KN.js +4252 -0
  221. package/dist/server/assets/vendor-tanstack-start-client-core-DoOKV2pA.js +1741 -0
  222. package/dist/server/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
  223. package/dist/server/assets/vendor-tanstack-start-server-core-CsAstXv7.js +1421 -0
  224. package/dist/server/assets/vendor-tanstack-start-storage-context-DgH9hIJT.js +17 -0
  225. package/dist/server/assets/vendor-tanstack-store-l0sNRNKZ.js +1 -0
  226. package/dist/server/assets/vendor-tslib-_8ICaZ64.js +67 -0
  227. package/dist/server/assets/vendor-unenv-DUvF4YIF.js +544 -0
  228. package/dist/server/assets/vendor-use-callback-ref-DMFDRvmi.js +66 -0
  229. package/dist/server/assets/vendor-use-sidecar-DG1tHua4.js +106 -0
  230. package/dist/server/assets/vendor-use-sync-external-store-rZ8vi0It.js +64 -0
  231. package/dist/server/assets/vendor-vercel-analytics-oP8BDp0L.js +168 -0
  232. package/dist/server/assets/vendor-zod-BRyQdbC-.js +3580 -0
  233. package/dist/server/index.js +158 -0
  234. package/dist/server/wrangler.json +1 -0
  235. package/enable-powershell.ps1 +7 -0
  236. package/eslint.config.js +41 -0
  237. package/lint.bat +4 -0
  238. package/package.json +95 -0
  239. package/public/robots.txt +2 -0
  240. package/run-npm-build.cjs +20 -0
  241. package/run-npm-build.js +20 -0
  242. package/src/assets/hero-bg.jpg +0 -0
  243. package/src/assets/logo.png +0 -0
  244. package/src/components/scrollsy/Footer.tsx +68 -0
  245. package/src/components/scrollsy/LiveTicker.tsx +31 -0
  246. package/src/components/scrollsy/Logo.tsx +28 -0
  247. package/src/components/scrollsy/Nav.tsx +255 -0
  248. package/src/components/scrollsy/ProductCard.tsx +190 -0
  249. package/src/components/scrollsy/ProductFilters.tsx +226 -0
  250. package/src/components/scrollsy/SupportWidget.tsx +197 -0
  251. package/src/components/ui/accordion.tsx +51 -0
  252. package/src/components/ui/alert-dialog.tsx +115 -0
  253. package/src/components/ui/alert.tsx +49 -0
  254. package/src/components/ui/aspect-ratio.tsx +5 -0
  255. package/src/components/ui/avatar.tsx +47 -0
  256. package/src/components/ui/badge.tsx +32 -0
  257. package/src/components/ui/breadcrumb.tsx +101 -0
  258. package/src/components/ui/button.tsx +49 -0
  259. package/src/components/ui/calendar.tsx +177 -0
  260. package/src/components/ui/card.tsx +55 -0
  261. package/src/components/ui/carousel.tsx +240 -0
  262. package/src/components/ui/chart.tsx +331 -0
  263. package/src/components/ui/checkbox.tsx +26 -0
  264. package/src/components/ui/collapsible.tsx +11 -0
  265. package/src/components/ui/command.tsx +143 -0
  266. package/src/components/ui/context-menu.tsx +187 -0
  267. package/src/components/ui/dialog.tsx +104 -0
  268. package/src/components/ui/drawer.tsx +98 -0
  269. package/src/components/ui/dropdown-menu.tsx +188 -0
  270. package/src/components/ui/form.tsx +171 -0
  271. package/src/components/ui/hover-card.tsx +27 -0
  272. package/src/components/ui/input-otp.tsx +69 -0
  273. package/src/components/ui/input.tsx +22 -0
  274. package/src/components/ui/label.tsx +21 -0
  275. package/src/components/ui/menubar.tsx +229 -0
  276. package/src/components/ui/navigation-menu.tsx +120 -0
  277. package/src/components/ui/pagination.tsx +98 -0
  278. package/src/components/ui/popover.tsx +31 -0
  279. package/src/components/ui/progress.tsx +25 -0
  280. package/src/components/ui/radio-group.tsx +36 -0
  281. package/src/components/ui/resizable.tsx +37 -0
  282. package/src/components/ui/scroll-area.tsx +44 -0
  283. package/src/components/ui/select.tsx +152 -0
  284. package/src/components/ui/separator.tsx +24 -0
  285. package/src/components/ui/sheet.tsx +122 -0
  286. package/src/components/ui/sidebar.tsx +744 -0
  287. package/src/components/ui/skeleton.tsx +7 -0
  288. package/src/components/ui/slider.tsx +23 -0
  289. package/src/components/ui/sonner.tsx +23 -0
  290. package/src/components/ui/switch.tsx +27 -0
  291. package/src/components/ui/table.tsx +94 -0
  292. package/src/components/ui/tabs.tsx +53 -0
  293. package/src/components/ui/textarea.tsx +21 -0
  294. package/src/components/ui/toggle-group.tsx +57 -0
  295. package/src/components/ui/toggle.tsx +42 -0
  296. package/src/components/ui/tooltip.tsx +32 -0
  297. package/src/hooks/use-auth.ts +26 -0
  298. package/src/hooks/use-mobile.tsx +19 -0
  299. package/src/integrations/lovable/index.ts +41 -0
  300. package/src/lib/admin.functions.ts +564 -0
  301. package/src/lib/error-capture.ts +27 -0
  302. package/src/lib/error-page.ts +30 -0
  303. package/src/lib/product-links.ts +39 -0
  304. package/src/lib/products.functions.ts +101 -0
  305. package/src/lib/utils.ts +6 -0
  306. package/src/routeTree.gen.ts +480 -0
  307. package/src/router.tsx +16 -0
  308. package/src/routes/__root.tsx +177 -0
  309. package/src/routes/about.tsx +66 -0
  310. package/src/routes/admin.login.tsx +95 -0
  311. package/src/routes/admin.tsx +811 -0
  312. package/src/routes/affiliate-disclosure.tsx +35 -0
  313. package/src/routes/categories.tsx +57 -0
  314. package/src/routes/category.$slug.tsx +51 -0
  315. package/src/routes/contact.tsx +69 -0
  316. package/src/routes/faq.tsx +63 -0
  317. package/src/routes/index.tsx +269 -0
  318. package/src/routes/login.tsx +160 -0
  319. package/src/routes/privacy.tsx +39 -0
  320. package/src/routes/product.$id.tsx +212 -0
  321. package/src/routes/profile.tsx +393 -0
  322. package/src/routes/reset-password.tsx +71 -0
  323. package/src/routes/saved.tsx +83 -0
  324. package/src/routes/search.tsx +136 -0
  325. package/src/routes/signup.tsx +108 -0
  326. package/src/routes/sitemap[.]xml.ts +34 -0
  327. package/src/routes/terms.tsx +40 -0
  328. package/src/routes/update-password.tsx +91 -0
  329. package/src/server.ts +80 -0
  330. package/src/start.ts +24 -0
  331. package/src/styles.css +333 -0
  332. package/terminal-test-output.txt +1 -0
  333. package/tsconfig.json +27 -0
  334. package/vercel.json +26 -0
  335. package/vite.config.ts +38 -0
  336. package/wrangler.jsonc +7 -0
@@ -0,0 +1,23 @@
1
+ import{P as H,S as M}from"./vendor-supabase-phoenix-BzEf37Ve.js";class I{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const t=globalThis;if(typeof globalThis<"u"&&typeof t.WebSocket<"u")return{type:"native",wsConstructor:t.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof t.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&t.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const i=s.versions;if(i&&i.node){const o=i.node,a=parseInt(o.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
2
+ import ws from "ws"
3
+ new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
4
+
5
+ Suggested solution: ${e.workaround}`),new Error(t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const J="2.106.1",$=`realtime-js/${J}`,x="1.0.0",B="2.0.0",V=B,z=1e4,F=100,b={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},D={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},T={connecting:"connecting",closing:"closing",closed:"closed"};class K{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return t(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer((t=e.payload)===null||t===void 0?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;const s=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var t,r;const s=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,t,r){var s,i;const o=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",c=(i=e.join_ref)!==null&&i!==void 0?i:"",d=e.payload.event,g=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(g).length===0?"":JSON.stringify(g);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+a.length+o.length+d.length+f.length,h=new ArrayBuffer(this.HEADER_LENGTH+p);let l=new DataView(h),v=0;l.setUint8(v++,this.KINDS.userBroadcastPush),l.setUint8(v++,c.length),l.setUint8(v++,a.length),l.setUint8(v++,o.length),l.setUint8(v++,d.length),l.setUint8(v++,f.length),l.setUint8(v++,t),Array.from(c,m=>l.setUint8(v++,m.charCodeAt(0))),Array.from(a,m=>l.setUint8(v++,m.charCodeAt(0))),Array.from(o,m=>l.setUint8(v++,m.charCodeAt(0))),Array.from(d,m=>l.setUint8(v++,m.charCodeAt(0))),Array.from(f,m=>l.setUint8(v++,m.charCodeAt(0)));var _=new Uint8Array(h.byteLength+r.byteLength);return _.set(new Uint8Array(h),0),_.set(new Uint8Array(r),h.byteLength),_.buffer}decode(e,t){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return t(r)}if(typeof e=="string"){const r=JSON.parse(e),[s,i,o,a,c]=r;return t({join_ref:s,ref:i,topic:o,event:a,payload:c})}return t({})}_binaryDecode(e){const t=new DataView(e),r=t.getUint8(0),s=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,s)}_decodeUserBroadcast(e,t,r){const s=t.getUint8(1),i=t.getUint8(2),o=t.getUint8(3),a=t.getUint8(4);let c=this.HEADER_LENGTH+4;const d=r.decode(e.slice(c,c+s));c=c+s;const g=r.decode(e.slice(c,c+i));c=c+i;const f=r.decode(e.slice(c,c+o));c=c+o;const p=e.slice(c,e.byteLength),h=a===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,l={type:this.BROADCAST_EVENT,event:g,payload:h};return o>0&&(l.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:l}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||((t=e?.constructor)===null||t===void 0?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>t.includes(r)))}}var u;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(u||(u={}));const R=(n,e,t={})=>{var r;const s=(r=t.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=G(o,n,e,s),i),{}):{}},G=(n,e,t,r)=>{const s=e.find(a=>a.name===n),i=s?.type,o=t[n];return i&&!r.includes(i)?L(i,o):O(o)},L=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return Z(e,t)}switch(n){case u.bool:return q(e);case u.float4:case u.float8:case u.int2:case u.int4:case u.int8:case u.numeric:case u.oid:return Y(e);case u.json:case u.jsonb:return X(e);case u.timestamp:return Q(e);case u.abstime:case u.date:case u.daterange:case u.int4range:case u.int8range:case u.money:case u.reltime:case u.text:case u.time:case u.timestamptz:case u.timetz:case u.tsrange:case u.tstzrange:return O(e);default:return O(e)}},O=n=>n,q=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},Y=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},X=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n},Z=(n,e)=>{if(typeof n!="string")return n;const t=n.length-1,r=n[t];if(n[0]==="{"&&r==="}"){let i;const o=n.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>L(e,a))}return n},Q=n=>typeof n=="string"?n.replace(" ","T"):n,W=n=>{const e=new URL(n);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class A{constructor(e,t){const r=te(t);this.presence=new H(e.getChannel(),r),this.presence.onJoin((s,i,o)=>{const a=A.onJoinPayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=A.onLeavePayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return A.transformState(this.presence.state)}static transformState(e){return e=ee(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const s=e[r];return t[r]=C(s),t},{})}static onJoinPayload(e,t,r){const s=N(t),i=C(r);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,t,r){const s=N(t),i=C(r);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function C(n){return n.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function ee(n){return JSON.parse(JSON.stringify(n))}function te(n){return n?.events&&{events:n.events}}function N(n){return n?.metas?C(n):[]}var j;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(j||(j={}));class ne{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new A(this.channel.channelAdapter,t)}}function re(n){if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n&&typeof n=="object"){const e=n;if(typeof e.code=="number"){const t=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${t}`,{cause:n})}return new Error("channel error: transport failure",{cause:n})}return new Error("channel error: connection lost")}class se{constructor(e,t,r){const s=ie(r);this.channel=e.getSocket().channel(t,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let s;try{s=this.channel.push(e,t,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>F){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===b.joined}isJoined(){return this.state===b.joined}isJoining(){return this.state===b.joining}isClosed(){return this.state===b.closed}isLeaving(){return this.state===b.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function ie(n){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config)}}var P;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(P||(P={}));var w;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(w||(w={}));var k;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(k||(k={}));class E{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var s,i;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new se(this.socket.socketAdapter,e,this.params),this.presence=new ne(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=W(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:c}}=this.params,d=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&s!==void 0?s:[],g=!!this.bindings[w.PRESENCE]&&this.bindings[w.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},p={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:g}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>{e?.(k.CHANNEL_ERROR,re(h))}),this._onClose(()=>e?.(k.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:h})=>{if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){e?.(k.SUBSCRIBED);return}this._updatePostgresBindings(h,e)}).receive("error",h=>{this.state=b.errored;const l=Object.values(h).join(", ")||"error";e?.(k.CHANNEL_ERROR,new Error(l,{cause:h}))}).receive("timeout",()=>{e?.(k.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;const s=this.bindings.postgres_changes,i=(r=s?.length)!==null&&r!==void 0?r:0,o=[];for(let a=0;a<i;a++){const c=s[a],{filter:{event:d,schema:g,table:f,filter:p}}=c,h=e&&e[a];if(h&&h.event===d&&E.isFilterValueEqual(h.schema,g)&&E.isFilterValueEqual(h.table,f)&&E.isFilterValueEqual(h.filter,p))o.push(Object.assign(Object.assign({},c),{id:h.id}));else{this.unsubscribe(),this.state=b.errored,t?.(k.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=b.errored&&t&&t(k.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===w.PRESENCE||e===w.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var s;if(t==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let c=a.statusText;try{const d=await a.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(e,t={}){var r,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const d=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:s.signal}));return clearTimeout(i),o}_on(e,t,r){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,r),o={type:s,filter:t,callback:r,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var s,i,o,a,c,d,g;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,r))return!1;const p=(s=this.bindings[f])===null||s===void 0?void 0:s.find(h=>h.ref===e.ref);if(!p)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in p){const h=p.id,l=(i=p.filter)===null||i===void 0?void 0:i.event;return h&&((o=t.ids)===null||o===void 0?void 0:o.includes(h))&&(l==="*"||l?.toLocaleLowerCase()===((a=t.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const h=(d=(c=p?.filter)===null||c===void 0?void 0:c.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return h==="*"||h===((g=t?.event)===null||g===void 0?void 0:g.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,t){const{close:r,error:s,leave:i,join:o}=D;return t&&[r,s,i,o].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if(typeof t=="object"&&"ids"in t){const s=t.data,{schema:i,table:o,commit_timestamp:a,type:c,errors:d}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:c,new:{},old:{},errors:d}),this._getPayloadRecords(s))}return t})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const t in e.bindings)for(const r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=R(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=R(e.columns,e.old_record)),t}}class oe{constructor(e,t){this.socket=new M(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==T.connecting}isDisconnecting(){return this.socket.connectionState()==T.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const U={HEARTBEAT_INTERVAL:25e3},ae=[1e3,2e3,5e3,1e4],ce=1e4;function le(){const n=new Map;return{get length(){return n.size},clear(){n.clear()},getItem(e){return n.has(e)?n.get(e):null},key(e){var t;return(t=Array.from(n.keys())[e])!==null&&t!==void 0?t:null},removeItem(e){n.delete(e)},setItem(e,t){n.set(e,String(t))}}}function de(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return le()}const he=`
6
+ addEventListener("message", (e) => {
7
+ if (e.data.event === "start") {
8
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
9
+ }
10
+ });`;class fe{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new K,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((r=t?.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const s=this._initializeOptions(t);this.socketAdapter=new oe(e,s),this.httpEndpoint=W(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const t=e.message;throw t.includes("Node.js")?new Error(`${t}
11
+
12
+ To use Realtime in Node.js, you need to provide a WebSocket implementation:
13
+
14
+ Option 1: Use Node.js 22+ which has native WebSocket support
15
+ Option 2: Install and provide the "ws" package:
16
+
17
+ npm install ws
18
+
19
+ import ws from "ws"
20
+ const client = new RealtimeClient(url, {
21
+ ...options,
22
+ transport: ws
23
+ })`):new Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return t==="ok"&&e.teardown(),t}async removeAllChannels(){const e=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||T.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new E(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(s=>{const i={access_token:t,version:$};t&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(D.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(t=>{this.log("error","error waiting for auth on connect",t)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{t=="sent"&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([he],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}_initializeOptions(e){var t,r,s,i,o,a,c,d,g,f,p,h;this.worker=(t=e?.worker)!==null&&t!==void 0?t:!1,this.accessToken=(r=e?.accessToken)!==null&&r!==void 0?r:null;const l={};l.timeout=(s=e?.timeout)!==null&&s!==void 0?s:z,l.heartbeatIntervalMs=(i=e?.heartbeatIntervalMs)!==null&&i!==void 0?i:U.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=e?.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((a=e?.heartbeatIntervalMs)!==null&&a!==void 0?a:U.HEARTBEAT_INTERVAL),l.transport=(c=e?.transport)!==null&&c!==void 0?c:I.getWebSocketConstructor(),l.params=e?.params,l.logger=e?.logger,l.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),l.sessionStorage=(d=e?.sessionStorage)!==null&&d!==void 0?d:de(),l.reconnectAfterMs=(g=e?.reconnectAfterMs)!==null&&g!==void 0?g:(y=>ae[y-1]||ce);let v,_;const m=(f=e?.vsn)!==null&&f!==void 0?f:V;switch(m){case x:v=(y,S)=>S(JSON.stringify(y)),_=(y,S)=>S(JSON.parse(y));break;case B:v=this.serializer.encode.bind(this.serializer),_=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${l.vsn}`)}if(l.vsn=m,l.encode=(p=e?.encode)!==null&&p!==void 0?p:v,l.decode=(h=e?.decode)!==null&&h!==void 0?h:_,l.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,l.params=Object.assign(Object.assign({},l.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e?.workerUrl,l.autoSendHeartbeat=!this.worker}return l}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}export{fe as R};
@@ -0,0 +1 @@
1
+ import{I as V}from"./vendor-iceberg-js-tWD4K6Lg.js";function v(t){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(t)}function F(t,e){if(v(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(v(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function L(t){var e=F(t,"string");return v(e)=="symbol"?e:e+""}function D(t,e,r){return(e=L(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?j(Object(r),!0).forEach(function(a){D(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}var _=class extends Error{constructor(t,e="storage",r,a){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=a}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function S(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var x=class extends _{constructor(t,e,r,a="storage"){super(t,a,e,r),this.name=a==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return c({},super.toJSON())}},C=class extends _{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function b(t,e,r){const a=c({},t),n=e.toLowerCase();for(const s of Object.keys(a))s.toLowerCase()===n&&delete a[s];return a[n]=r,a}function R(t){const e={};for(const[r,a]of Object.entries(t))e[r.toLowerCase()]=a;return e}const A=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),H=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},$=t=>{if(Array.isArray(t))return t.map(r=>$(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,a])=>{const n=r.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[n]=$(a)}),e},q=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),T=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},z=async(t,e,r,a)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const n=t;let s=parseInt(String(n.status),10);Number.isFinite(s)||(s=500),n.json().then(o=>{const u=o?.statusCode||o?.code||s+"";e(new x(T(o),s,u,a))}).catch(()=>{const o=s+"";e(new x(n.statusText||`HTTP ${s} error`,s,o,a))})}else e(new C(T(t),t,a))},K=(t,e,r,a)=>{const n={method:t,headers:e?.headers||{}};if(t==="GET"||t==="HEAD"||!a)return c(c({},n),r);if(H(a)){var s;const o=e?.headers||{};let u;for(const[i,l]of Object.entries(o))i.toLowerCase()==="content-type"&&(u=l);n.headers=b(o,"Content-Type",(s=u)!==null&&s!==void 0?s:"application/json"),n.body=JSON.stringify(a)}else n.body=a;return e?.duplex&&(n.duplex=e.duplex),c(c({},n),r)};async function g(t,e,r,a,n,s,o){return new Promise((u,i)=>{t(r,K(e,a,n,s)).then(l=>{if(!l.ok)throw l;if(a?.noResolveJson)return l;if(o==="vectors"){const d=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!d||!d.includes("application/json"))return{}}return l.json()}).then(l=>u(l)).catch(l=>z(l,i,a,o))})}function I(t="storage"){return{get:async(e,r,a,n)=>g(e,"GET",r,a,n,void 0,t),post:async(e,r,a,n,s)=>g(e,"POST",r,n,s,a,t),put:async(e,r,a,n,s)=>g(e,"PUT",r,n,s,a,t),head:async(e,r,a,n)=>g(e,"HEAD",r,c(c({},a),{},{noResolveJson:!0}),n,void 0,t),remove:async(e,r,a,n,s)=>g(e,"DELETE",r,n,s,a,t)}}const M=I("storage"),{get:m,post:f,put:B,head:J,remove:P}=M,h=I("vectors");var p=class{constructor(t,e={},r,a="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=R(e),this.fetch=A(r),this.namespace=a}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=b(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(S(r))return{data:null,error:r};throw r}}};let N;N=Symbol.toStringTag;var G=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[N]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(S(e))return{data:null,error:e};throw e}}};let U;U=Symbol.toStringTag;var Q=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[U]="BlobDownloadBuilder",this.promise=null}asStream(){return new G(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(S(e))return{data:null,error:e};throw e}}};const W={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},E={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var X=class extends p{constructor(t,e={},r,a){super(t,e,a,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,a){var n=this;return n.handleOperation(async()=>{let s;const o=c(c({},E),a);let u=c(c({},n.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const i=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",o.cacheControl),i&&s.append("metadata",n.encodeMetadata(i)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.has("cacheControl")||s.append("cacheControl",o.cacheControl),i&&!s.has("metadata")&&s.append("metadata",n.encodeMetadata(i))):(s=r,u["cache-control"]=`max-age=${o.cacheControl}`,u["content-type"]=o.contentType,i&&(u["x-metadata"]=n.toBase64(n.encodeMetadata(i))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!o.duplex&&(o.duplex="half")),a?.headers)for(const[O,k]of Object.entries(a.headers))u=b(u,O,k);const l=n._removeEmptyFolders(e),d=n._getFinalPath(l),y=await(t=="PUT"?B:f)(n.fetch,`${n.url}/object/${d}`,s,c({headers:u},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:y.Id,fullPath:y.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,a){var n=this;const s=n._removeEmptyFolders(t),o=n._getFinalPath(s),u=new URL(n.url+`/object/upload/sign/${o}`);return u.searchParams.set("token",e),n.handleOperation(async()=>{let i;const l=c(c({},E),a);let d=c(c({},n.headers),{"x-upsert":String(l.upsert)});const y=l.metadata;if(typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",l.cacheControl),y&&i.append("metadata",n.encodeMetadata(y)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",l.cacheControl),y&&!i.has("metadata")&&i.append("metadata",n.encodeMetadata(y))):(i=r,d["cache-control"]=`max-age=${l.cacheControl}`,d["content-type"]=l.contentType,y&&(d["x-metadata"]=n.toBase64(n.encodeMetadata(y))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!l.duplex&&(l.duplex="half")),a?.headers)for(const[O,k]of Object.entries(a.headers))d=b(d,O,k);return{path:s,fullPath:(await B(n.fetch,u.toString(),i,c({headers:d},l?.duplex?{duplex:l.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let a=r._getFinalPath(t);const n=c({},r.headers);e?.upsert&&(n["x-upsert"]="true");const s=await f(r.fetch,`${r.url}/object/upload/sign/${a}`,{},{headers:n}),o=new URL(r.url+s.url),u=o.searchParams.get("token");if(!u)throw new _("No token returned by API");return{signedUrl:o.toString(),path:t,token:u}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var a=this;return a.handleOperation(async()=>await f(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:a.headers}))}async copy(t,e,r){var a=this;return a.handleOperation(async()=>({path:(await f(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r?.destinationBucket},{headers:a.headers})).Key}))}async createSignedUrl(t,e,r){var a=this;return a.handleOperation(async()=>{let n=a._getFinalPath(t);const s=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await f(a.fetch,`${a.url}/object/sign/${n}`,c({expiresIn:e},s?{transform:r.transform}:{}),{headers:a.headers});const u=new URLSearchParams;r?.download&&u.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&u.set("cacheNonce",String(r.cacheNonce));const i=u.toString();return{signedUrl:encodeURI(`${a.url}${o.signedURL}${i?`&${i}`:""}`)}})}async createSignedUrls(t,e,r){var a=this;return a.handleOperation(async()=>{const n=await f(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:e,paths:t},{headers:a.headers}),s=new URLSearchParams;r?.download&&s.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&s.set("cacheNonce",String(r.cacheNonce));const o=s.toString();return n.map(u=>c(c({},u),{},{signedUrl:u.signedURL?encodeURI(`${a.url}${u.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const a=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",n=new URLSearchParams;e?.transform&&this.applyTransformOptsToQuery(n,e.transform),e?.cacheNonce!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),o=this._getFinalPath(t),u=()=>m(this.fetch,`${this.url}/${a}/${o}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new Q(u,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>$(await m(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await J(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(S(n)){var a;const s=n instanceof x?n.status:n instanceof C?(a=n.originalError)===null||a===void 0?void 0:a.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:n}}throw n}}getPublicUrl(t,e){const r=this._getFinalPath(t),a=new URLSearchParams;e?.download&&a.set("download",e.download===!0?"":e.download),e?.transform&&this.applyTransformOptsToQuery(a,e.transform),e?.cacheNonce!=null&&a.set("cacheNonce",String(e.cacheNonce));const n=a.toString(),s=typeof e?.transform=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${r}`)+(n?`?${n}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await P(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var a=this;return a.handleOperation(async()=>{const n=c(c(c({},W),e),{},{prefix:t||""});return await f(a.fetch,`${a.url}/object/list/${a.bucketId}`,n,{headers:a.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const a=c({},t);return await f(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,a,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const Y="2.106.1",w={"X-Client-Info":`storage-js/${Y}`};var Z=class extends p{constructor(t,e={},r,a){const n=new URL(t);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase."));const s=n.href.replace(/\/$/,""),o=c(c({},w),e);super(s,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await m(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await m(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await f(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await B(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await f(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await P(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},ee=class extends p{constructor(t,e={},r){const a=t.replace(/\/$/,""),n=c(c({},w),e);super(a,n,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await f(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;t?.limit!==void 0&&r.set("limit",t.limit.toString()),t?.offset!==void 0&&r.set("offset",t.offset.toString()),t?.sortColumn&&r.set("sortColumn",t.sortColumn),t?.sortOrder&&r.set("sortOrder",t.sortOrder),t?.search&&r.set("search",t.search);const a=r.toString(),n=a?`${e.url}/bucket?${a}`:`${e.url}/bucket`;return await m(e.fetch,n,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await P(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!q(t))throw new _("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new V({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(r,{get(n,s){const o=n[s];return typeof o!="function"?o:async(...u)=>{try{return{data:await o.apply(n,u),error:null}}catch(i){if(a)throw i;return{data:null,error:i}}}}})}},te=class extends p{constructor(t,e={},r){const a=t.replace(/\/$/,""),n=c(c({},w),{},{"Content-Type":"application/json"},e);super(a,n,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await h.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await h.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},re=class extends p{constructor(t,e={},r){const a=t.replace(/\/$/,""),n=c(c({},w),{},{"Content-Type":"application/json"},e);super(a,n,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},ae=class extends p{constructor(t,e={},r){const a=t.replace(/\/$/,""),n=c(c({},w),{},{"Content-Type":"application/json"},e);super(a,n,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await h.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},ne=class extends ae{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new se(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},se=class extends te{constructor(t,e,r,a){super(t,e,a),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new ce(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},ce=class extends re{constructor(t,e,r,a,n){super(t,e,n),this.vectorBucketName=r,this.indexName=a}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,c(c({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},ie=class extends Z{constructor(t,e={},r,a){super(t,e,r,a)}from(t){return new X(this.url,this.headers,t,this.fetch)}get vectors(){return new ne(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new ee(this.url+"/iceberg",this.headers,this.fetch)}};export{ie as S};
@@ -0,0 +1 @@
1
+ import{P as A}from"./vendor-supabase-postgrest-js-C4rBWbCx.js";import{R as P}from"./vendor-supabase-realtime-js-D6BlOYKE.js";import{S as E}from"./vendor-supabase-storage-js-BG98L3Zz.js";import{A as L}from"./vendor-supabase-auth-js-DWrN-bIx.js";import{F as U}from"./vendor-supabase-functions-js-uY_V-TxC.js";const k="2.106.1";let T="";typeof Deno<"u"?T="deno":typeof document<"u"?T="web":typeof navigator<"u"&&navigator.product==="ReactNative"?T="react-native":T="node";const C={"X-Client-Info":`supabase-js-${T}/${k}`},D={headers:C},R={schema:"public"},I={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},j={},F={enabled:!1,respectSamplingDecision:!0};function N(e,t,r,n){function s(a){return a instanceof r?a:new r(function(c){c(a)})}return new(r||(r=Promise))(function(a,c){function p(l){try{f(n.next(l))}catch(u){c(u)}}function i(l){try{f(n.throw(l))}catch(u){c(u)}}function f(l){l.done?a(l.value):s(l.value).then(p,i)}f((n=n.apply(e,[])).next())})}let w=null;const $="@opentelemetry/api";function x(){return w===null&&(w=import($).catch(()=>null)),w}function H(){return N(this,void 0,void 0,function*(){try{const e=yield x();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const r=t.traceparent;return r?{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function K(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[r,n,s,a]=t;if(r.length!==2||n.length!==32||s.length!==16||a.length!==2)return null;const c=/^[0-9a-f]+$/i;return!c.test(r)||!c.test(n)||!c.test(s)||!c.test(a)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:a,isSampled:(parseInt(a,16)&1)===1}}function G(e,t){if(!e||!t||t.length===0)return!1;let r;if(e instanceof URL)r=e;else try{r=new URL(e)}catch{return!1}for(const n of t)try{if(typeof n=="string"){if(B(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function B(e,t){if(t===e)return!0;if(t.startsWith("*.")){const r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}function z(e){const t=[];try{const r=new URL(e);t.push(r.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function y(e){"@babel/helpers - typeof";return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(e)}function W(e,t){if(y(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M(e){var t=W(e,"string");return y(t)=="symbol"?t:t+""}function q(e,t,r){return(t=M(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(n){q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const V=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),J=()=>Headers,X=(e,t,r,n,s)=>{const a=V(n),c=J(),p=s?.enabled===!0,i=s?.respectSamplingDecision!==!1,f=p?z(t):null;return async(l,u)=>{var m;const v=(m=await r())!==null&&m!==void 0?m:e;let h=new c(u?.headers);if(h.has("apikey")||h.set("apikey",e),h.has("Authorization")||h.set("Authorization",`Bearer ${v}`),f){const d=await Q(l,f,i);d&&(d.traceparent&&!h.has("traceparent")&&h.set("traceparent",d.traceparent),d.tracestate&&!h.has("tracestate")&&h.set("tracestate",d.tracestate),d.baggage&&!h.has("baggage")&&h.set("baggage",d.baggage))}return a(l,o(o({},u),{},{headers:h}))}};async function Q(e,t,r){if(!G(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const n=await H();if(!n||!n.traceparent)return null;if(r){const s=K(n.traceparent);if(s&&!s.isSampled)return null}return n}function S(e){return typeof e=="boolean"?{enabled:e}:e}function Y(e){return e.endsWith("/")?e:e+"/"}function Z(e,t){var r,n,s,a,c,p;const{db:i,auth:f,realtime:l,global:u}=e,{db:m,auth:v,realtime:h,global:d}=t,g=S(e.tracePropagation),b=S(t.tracePropagation),_={db:o(o({},m),i),auth:o(o({},v),f),realtime:o(o({},h),l),storage:{},global:o(o(o({},d),u),{},{headers:o(o({},(r=d?.headers)!==null&&r!==void 0?r:{}),(n=u?.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(a=g?.enabled)!==null&&a!==void 0?a:b?.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(c=(p=g?.respectSamplingDecision)!==null&&p!==void 0?p:b?.respectSamplingDecision)!==null&&c!==void 0?c:!0},accessToken:async()=>""};return e.accessToken?_.accessToken=e.accessToken:delete _.accessToken,_}function ee(e){const t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Y(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var te=class extends L{constructor(e){super(e)}},re=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const a=ee(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const c=`sb-${a.hostname.split(".")[0]}-auth-token`,p={db:R,realtime:j,auth:o(o({},I),{},{storageKey:c}),global:D,tracePropagation:F},i=Z(r??{},p);if(this.settings=i,this.storageKey=(n=i.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=i.global.headers)!==null&&s!==void 0?s:{},i.accessToken)this.accessToken=i.accessToken,this.auth=new Proxy({},{get:(l,u)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(u)} is not possible`)}});else{var f;this.auth=this._initSupabaseAuthClient((f=i.auth)!==null&&f!==void 0?f:{},this.headers,i.global.fetch)}this.fetch=X(t,e,this._getAccessToken.bind(this),i.global.fetch,i.tracePropagation),this.realtime=this._initRealtimeClient(o({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},i.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(l=>this.realtime.setAuth(l)).catch(l=>console.warn("Failed to set initial Realtime auth token:",l)),this.rest=new A(new URL("rest/v1",a).href,{headers:this.headers,schema:i.db.schema,fetch:this.fetch,timeout:i.db.timeout,urlLengthLimit:i.db.urlLengthLimit}),this.storage=new E(this.storageUrl.href,this.headers,this.fetch,r?.storage),i.accessToken||this._listenForAuthEvents()}get functions(){return new U(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:a,flowType:c,lock:p,debug:i,throwOnError:f,experimental:l,lockAcquireTimeout:u,skipAutoInitialize:m},v,h){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new te({url:this.authUrl.href,headers:o(o({},d),v),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:c,lock:p,debug:i,throwOnError:f,experimental:l,fetch:h,lockAcquireTimeout:u,skipAutoInitialize:m,hasCustomAuthorizationHeader:Object.keys(this.headers).some(g=>g.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new P(this.realtimeUrl.href,o(o({},e),{},{params:o(o({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const le=(e,t,r)=>new re(e,t,r);function ne(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}ne()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");export{le as c};
@@ -0,0 +1 @@
1
+ const Oe=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Ge=(e,t)=>({classGroupId:e,validator:t}),ke=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r});const be=[],Ee="arbitrary..",Le=e=>{const t=Ne(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return _e(i);const b=i.split("-"),u=b[0]===""&&b.length>1?1:0;return xe(b,u,t)},getConflictingClassGroupIds:(i,b)=>{if(b){const u=o[i],m=r[i];return u?m?Oe(m,u):u:m||be}return r[i]||be}}},xe=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const c=e[t],d=r.nextPart.get(c);if(d){const m=xe(e,t+1,d);if(m)return m}const i=r.validators;if(i===null)return;const b=t===0?e.join("-"):e.slice(t).join("-"),u=i.length;for(let m=0;m<u;m++){const h=i[m];if(h.validator(b))return h.classGroupId}},_e=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Ee+o:void 0})(),Ne=e=>{const{theme:t,classGroups:r}=e;return je(r,t)},je=(e,t)=>{const r=ke();for(const o in e){const c=e[o];te(c,r,o,t)}return r},te=(e,t,r,o)=>{const c=e.length;for(let d=0;d<c;d++){const i=e[d];Fe(i,t,r,o)}},Fe=(e,t,r,o)=>{if(typeof e=="string"){We(e,t,r);return}if(typeof e=="function"){Ve(e,t,r,o);return}Be(e,t,r,o)},We=(e,t,r)=>{const o=e===""?t:we(t,e);o.classGroupId=r},Ve=(e,t,r,o)=>{if(De(e)){te(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Ge(r,e))},Be=(e,t,r,o)=>{const c=Object.entries(e),d=c.length;for(let i=0;i<d;i++){const[b,u]=c[i];te(u,we(t,b),r,o)}},we=(e,t)=>{let r=e;const o=t.split("-"),c=o.length;for(let d=0;d<c;d++){const i=o[d];let b=r.nextPart.get(i);b||(b=ke(),r.nextPart.set(i,b)),r=b}return r},De=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$e=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const c=(d,i)=>{r[d]=i,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(d){let i=r[d];if(i!==void 0)return i;if((i=o[d])!==void 0)return c(d,i),i},set(d,i){d in r?r[d]=i:c(d,i)}}};const Ue=[],ue=(e,t,r,o,c)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:c}),Ye=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=c=>{const d=[];let i=0,b=0,u=0,m;const h=c.length;for(let y=0;y<h;y++){const A=c[y];if(i===0&&b===0){if(A===":"){d.push(c.slice(u,y)),u=y+1;continue}if(A==="/"){m=y;continue}}A==="["?i++:A==="]"?i--:A==="("?b++:A===")"&&b--}const k=d.length===0?c:c.slice(u);let O=k,R=!1;k.endsWith("!")?(O=k.slice(0,-1),R=!0):k.startsWith("!")&&(O=k.slice(1),R=!0);const V=m&&m>u?m-u:void 0;return ue(d,R,O,V)};if(t){const c=t+":",d=o;o=i=>i.startsWith(c)?d(i.slice(c.length)):ue(Ue,!1,i,void 0,!0)}if(r){const c=o;o=d=>r({className:d,parseClassName:c})}return o},qe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let c=[];for(let d=0;d<r.length;d++){const i=r[d],b=i[0]==="[",u=t.has(i);b||u?(c.length>0&&(c.sort(),o.push(...c),c=[]),o.push(i)):c.push(i)}return c.length>0&&(c.sort(),o.push(...c)),o}},Xe=e=>({cache:$e(e.cacheSize),parseClassName:Ye(e),sortModifiers:qe(e),postfixLookupClassGroupIds:Je(e),...Le(e)}),Je=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)t[r[o]]=!0;return t},Qe=/\s+/,He=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d,postfixLookupClassGroupIds:i}=t,b=[],u=e.trim().split(Qe);let m="";for(let h=u.length-1;h>=0;h-=1){const k=u[h],{isExternal:O,modifiers:R,hasImportantModifier:V,baseClassName:y,maybePostfixModifierPosition:A}=r(k);if(O){m=k+(m.length>0?" "+m:m);continue}let G=!!A,v;if(G){const I=y.substring(0,A);v=o(I);const a=v&&i[v]?o(y):void 0;a&&a!==v&&(v=a,G=!1)}else v=o(y);if(!v){if(!G){m=k+(m.length>0?" "+m:m);continue}if(v=o(y),!v){m=k+(m.length>0?" "+m:m);continue}G=!1}const B=R.length===0?"":R.length===1?R[0]:d(R).join(":"),N=V?B+"!":B,j=N+v;if(b.indexOf(j)>-1)continue;b.push(j);const F=c(v,G);for(let I=0;I<F.length;++I){const a=F[I];b.push(N+a)}m=k+(m.length>0?" "+m:m)}return m},Ke=(...e)=>{let t=0,r,o,c="";for(;t<e.length;)(r=e[t++])&&(o=ye(r))&&(c&&(c+=" "),c+=o);return c},ye=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ye(e[o]))&&(r&&(r+=" "),r+=t);return r},Ze=(e,...t)=>{let r,o,c,d;const i=u=>{const m=t.reduce((h,k)=>k(h),e());return r=Xe(m),o=r.cache.get,c=r.cache.set,d=b,b(u)},b=u=>{const m=o(u);if(m)return m;const h=He(u,r);return c(u,h),h};return d=i,(...u)=>d(Ke(...u))},eo=[],f=e=>{const t=r=>r[e]||eo;return t.isThemeGetter=!0,t},ve=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ze=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,to=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,so=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,no=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ao=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,T=e=>oo.test(e),p=e=>!!e&&!Number.isNaN(Number(e)),S=e=>!!e&&Number.isInteger(Number(e)),re=e=>e.endsWith("%")&&p(e.slice(0,-1)),P=e=>ro.test(e),Ae=()=>!0,io=e=>to.test(e)&&!so.test(e),se=()=>!1,lo=e=>no.test(e),co=e=>ao.test(e),mo=e=>!s(e)&&!n(e),po=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),bo=e=>M(e,Se,se),s=e=>ve.test(e),L=e=>M(e,Ie,io),fe=e=>M(e,yo,p),uo=e=>M(e,Te,Ae),fo=e=>M(e,Pe,se),ge=e=>M(e,Ce,se),go=e=>M(e,Re,co),J=e=>M(e,Me,lo),n=e=>ze.test(e),D=e=>_(e,Ie),ho=e=>_(e,Pe),he=e=>_(e,Ce),ko=e=>_(e,Se),xo=e=>_(e,Re),Q=e=>_(e,Me,!0),wo=e=>_(e,Te,!0),M=(e,t,r)=>{const o=ve.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},_=(e,t,r=!1)=>{const o=ze.exec(e);return o?o[1]?t(o[1]):r:!1},Ce=e=>e==="position"||e==="percentage",Re=e=>e==="image"||e==="url",Se=e=>e==="length"||e==="size"||e==="bg-size",Ie=e=>e==="length",yo=e=>e==="number",Pe=e=>e==="family-name",Te=e=>e==="number"||e==="weight",Me=e=>e==="shadow",vo=()=>{const e=f("color"),t=f("font"),r=f("text"),o=f("font-weight"),c=f("tracking"),d=f("leading"),i=f("breakpoint"),b=f("container"),u=f("spacing"),m=f("radius"),h=f("shadow"),k=f("inset-shadow"),O=f("text-shadow"),R=f("drop-shadow"),V=f("blur"),y=f("perspective"),A=f("aspect"),G=f("ease"),v=f("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...N(),n,s],F=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],a=()=>[n,s,u],z=()=>[T,"full","auto",...a()],ne=()=>[S,"none","subgrid",n,s],ae=()=>["auto",{span:["full",S,n,s]},S,n,s],$=()=>[S,"auto",n,s],ie=()=>["auto","min","max","fr",n,s],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...a()],E=()=>[T,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],K=()=>[T,"screen","full","dvw","lvw","svw","min","max","fit",...a()],Z=()=>[T,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],l=()=>[e,n,s],le=()=>[...N(),he,ge,{position:[n,s]}],ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",ko,bo,{size:[n,s]}],ee=()=>[re,D,L],x=()=>["","none","full",m,n,s],w=()=>["",p,D,L],U=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],g=()=>[p,re,he,ge],pe=()=>["","none",V,n,s],Y=()=>["none",p,n,s],q=()=>["none",p,n,s],oe=()=>[p,n,s],X=()=>[T,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[P],breakpoint:[P],color:[Ae],container:[P],"drop-shadow":[P],ease:["in","out","in-out"],font:[mo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[P],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[P],shadow:[P],spacing:["px",p],text:[P],"text-shadow":[P],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",T,s,n,A]}],container:["container"],"container-type":[{"@container":["","normal","size",n,s]}],"container-named":[po],columns:[{columns:[p,s,n,b]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[S,"auto",n,s]}],basis:[{basis:[T,"full","auto",b,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[p,T,"auto","initial","none",s]}],grow:[{grow:["",p,n,s]}],shrink:[{shrink:["",p,n,s]}],order:[{order:[S,"first","last","none",n,s]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[b,"screen",...E()]}],"min-w":[{"min-w":[b,"screen","none",...E()]}],"max-w":[{"max-w":[b,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",r,D,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,wo,uo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",re,s]}],"font-family":[{font:[ho,fo,t]}],"font-features":[{"font-features":[s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,n,s]}],"line-clamp":[{"line-clamp":[p,"none",n,fe]}],leading:[{leading:[d,...a()]}],"list-image":[{"list-image":["none",n,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",n,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:l()}],"text-color":[{text:l()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:[p,"from-font","auto",n,L]}],"text-decoration-color":[{decoration:l()}],"underline-offset":[{"underline-offset":[p,"auto",n,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"tab-size":[{tab:[S,n,s]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",n,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",n,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},S,n,s],radial:["",n,s],conic:[S,n,s]},xo,go]}],"bg-color":[{bg:l()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:l()}],"gradient-via":[{via:l()}],"gradient-to":[{to:l()}],rounded:[{rounded:x()}],"rounded-s":[{"rounded-s":x()}],"rounded-e":[{"rounded-e":x()}],"rounded-t":[{"rounded-t":x()}],"rounded-r":[{"rounded-r":x()}],"rounded-b":[{"rounded-b":x()}],"rounded-l":[{"rounded-l":x()}],"rounded-ss":[{"rounded-ss":x()}],"rounded-se":[{"rounded-se":x()}],"rounded-ee":[{"rounded-ee":x()}],"rounded-es":[{"rounded-es":x()}],"rounded-tl":[{"rounded-tl":x()}],"rounded-tr":[{"rounded-tr":x()}],"rounded-br":[{"rounded-br":x()}],"rounded-bl":[{"rounded-bl":x()}],"border-w":[{border:w()}],"border-w-x":[{"border-x":w()}],"border-w-y":[{"border-y":w()}],"border-w-s":[{"border-s":w()}],"border-w-e":[{"border-e":w()}],"border-w-bs":[{"border-bs":w()}],"border-w-be":[{"border-be":w()}],"border-w-t":[{"border-t":w()}],"border-w-r":[{"border-r":w()}],"border-w-b":[{"border-b":w()}],"border-w-l":[{"border-l":w()}],"divide-x":[{"divide-x":w()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":w()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...U(),"hidden","none"]}],"divide-style":[{divide:[...U(),"hidden","none"]}],"border-color":[{border:l()}],"border-color-x":[{"border-x":l()}],"border-color-y":[{"border-y":l()}],"border-color-s":[{"border-s":l()}],"border-color-e":[{"border-e":l()}],"border-color-bs":[{"border-bs":l()}],"border-color-be":[{"border-be":l()}],"border-color-t":[{"border-t":l()}],"border-color-r":[{"border-r":l()}],"border-color-b":[{"border-b":l()}],"border-color-l":[{"border-l":l()}],"divide-color":[{divide:l()}],"outline-style":[{outline:[...U(),"none","hidden"]}],"outline-offset":[{"outline-offset":[p,n,s]}],"outline-w":[{outline:["",p,D,L]}],"outline-color":[{outline:l()}],shadow:[{shadow:["","none",h,Q,J]}],"shadow-color":[{shadow:l()}],"inset-shadow":[{"inset-shadow":["none",k,Q,J]}],"inset-shadow-color":[{"inset-shadow":l()}],"ring-w":[{ring:w()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:l()}],"ring-offset-w":[{"ring-offset":[p,L]}],"ring-offset-color":[{"ring-offset":l()}],"inset-ring-w":[{"inset-ring":w()}],"inset-ring-color":[{"inset-ring":l()}],"text-shadow":[{"text-shadow":["none",O,Q,J]}],"text-shadow-color":[{"text-shadow":l()}],opacity:[{opacity:[p,n,s]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[p]}],"mask-image-linear-from-pos":[{"mask-linear-from":g()}],"mask-image-linear-to-pos":[{"mask-linear-to":g()}],"mask-image-linear-from-color":[{"mask-linear-from":l()}],"mask-image-linear-to-color":[{"mask-linear-to":l()}],"mask-image-t-from-pos":[{"mask-t-from":g()}],"mask-image-t-to-pos":[{"mask-t-to":g()}],"mask-image-t-from-color":[{"mask-t-from":l()}],"mask-image-t-to-color":[{"mask-t-to":l()}],"mask-image-r-from-pos":[{"mask-r-from":g()}],"mask-image-r-to-pos":[{"mask-r-to":g()}],"mask-image-r-from-color":[{"mask-r-from":l()}],"mask-image-r-to-color":[{"mask-r-to":l()}],"mask-image-b-from-pos":[{"mask-b-from":g()}],"mask-image-b-to-pos":[{"mask-b-to":g()}],"mask-image-b-from-color":[{"mask-b-from":l()}],"mask-image-b-to-color":[{"mask-b-to":l()}],"mask-image-l-from-pos":[{"mask-l-from":g()}],"mask-image-l-to-pos":[{"mask-l-to":g()}],"mask-image-l-from-color":[{"mask-l-from":l()}],"mask-image-l-to-color":[{"mask-l-to":l()}],"mask-image-x-from-pos":[{"mask-x-from":g()}],"mask-image-x-to-pos":[{"mask-x-to":g()}],"mask-image-x-from-color":[{"mask-x-from":l()}],"mask-image-x-to-color":[{"mask-x-to":l()}],"mask-image-y-from-pos":[{"mask-y-from":g()}],"mask-image-y-to-pos":[{"mask-y-to":g()}],"mask-image-y-from-color":[{"mask-y-from":l()}],"mask-image-y-to-color":[{"mask-y-to":l()}],"mask-image-radial":[{"mask-radial":[n,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":g()}],"mask-image-radial-to-pos":[{"mask-radial-to":g()}],"mask-image-radial-from-color":[{"mask-radial-from":l()}],"mask-image-radial-to-color":[{"mask-radial-to":l()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[p]}],"mask-image-conic-from-pos":[{"mask-conic-from":g()}],"mask-image-conic-to-pos":[{"mask-conic-to":g()}],"mask-image-conic-from-color":[{"mask-conic-from":l()}],"mask-image-conic-to-color":[{"mask-conic-to":l()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",n,s]}],filter:[{filter:["","none",n,s]}],blur:[{blur:pe()}],brightness:[{brightness:[p,n,s]}],contrast:[{contrast:[p,n,s]}],"drop-shadow":[{"drop-shadow":["","none",R,Q,J]}],"drop-shadow-color":[{"drop-shadow":l()}],grayscale:[{grayscale:["",p,n,s]}],"hue-rotate":[{"hue-rotate":[p,n,s]}],invert:[{invert:["",p,n,s]}],saturate:[{saturate:[p,n,s]}],sepia:[{sepia:["",p,n,s]}],"backdrop-filter":[{"backdrop-filter":["","none",n,s]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[p,n,s]}],"backdrop-contrast":[{"backdrop-contrast":[p,n,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",p,n,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p,n,s]}],"backdrop-invert":[{"backdrop-invert":["",p,n,s]}],"backdrop-opacity":[{"backdrop-opacity":[p,n,s]}],"backdrop-saturate":[{"backdrop-saturate":[p,n,s]}],"backdrop-sepia":[{"backdrop-sepia":["",p,n,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",n,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[p,"initial",n,s]}],ease:[{ease:["linear","initial",G,n,s]}],delay:[{delay:[p,n,s]}],animate:[{animate:["none",v,n,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,n,s]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[n,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],zoom:[{zoom:[S,n,s]}],accent:[{accent:l()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:l()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",n,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":l()}],"scrollbar-track-color":[{"scrollbar-track":l()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",n,s]}],fill:[{fill:["none",...l()]}],"stroke-w":[{stroke:[p,D,L,fe]}],stroke:[{stroke:["none",...l()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zo=Ze(vo);export{zo as t};
@@ -0,0 +1 @@
1
+ var y="__TSR_index",O="popstate",K="beforeunload";function D(n){let e=n.getLocation();const s=new Set,l=r=>{e=n.getLocation(),s.forEach(o=>o({location:e,action:r}))},u=r=>{n.notifyOnIndexChange??!0?l(r):e=n.getLocation()},f=async({task:r,navigateOpts:o,...i})=>{if(o?.ignoreBlocker??!1){r();return}const c=n.getBlockers?.()??[],d=i.type==="PUSH"||i.type==="REPLACE";if(typeof document<"u"&&c.length&&d)for(const S of c){const B=L(i.path,i.state);if(await S.blockerFn({currentLocation:e,nextLocation:B,action:i.type})){n.onBlocked?.();return}}r()};return{get location(){return e},get length(){return n.getLength()},subscribers:s,subscribe:r=>(s.add(r),()=>{s.delete(r)}),push:(r,o,i)=>{const c=e.state[y];o=U(c+1,o),f({task:()=>{n.pushState(r,o),l({type:"PUSH"})},navigateOpts:i,type:"PUSH",path:r,state:o})},replace:(r,o,i)=>{const c=e.state[y];o=U(c,o),f({task:()=>{n.replaceState(r,o),l({type:"REPLACE"})},navigateOpts:i,type:"REPLACE",path:r,state:o})},go:(r,o)=>{f({task:()=>{n.go(r),u({type:"GO",index:r})},navigateOpts:o,type:"GO"})},back:r=>{f({task:()=>{n.back(r?.ignoreBlocker??!1),u({type:"BACK"})},navigateOpts:r,type:"BACK"})},forward:r=>{f({task:()=>{n.forward(r?.ignoreBlocker??!1),u({type:"FORWARD"})},navigateOpts:r,type:"FORWARD"})},canGoBack:()=>e.state[y]!==0,createHref:r=>n.createHref(r),block:r=>{if(!n.setBlockers)return()=>{};const o=n.getBlockers?.()??[];return n.setBlockers([...o,r]),()=>{const i=n.getBlockers?.()??[];n.setBlockers?.(i.filter(c=>c!==r))}},flush:()=>n.flush?.(),destroy:()=>n.destroy?.(),notify:l}}function U(n,e){e||(e={});const s=R();return{...e,key:s,__TSR_key:s,[y]:n}}function W(n){const e=typeof document<"u"?window:void 0,s=e.history.pushState,l=e.history.replaceState;let u=[];const f=()=>u,r=t=>u=t,o=(t=>t),i=(()=>L(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const t=R();e.history.replaceState({[y]:0,key:t,__TSR_key:t},"")}let c=i(),d,S=!1,B=!1,x=!1,P=!1;const F=()=>c;let k,_;const v=()=>{k&&(h._ignoreSubscribers=!0,(k.isPush?e.history.pushState:e.history.replaceState)(k.state,"",k.href),h._ignoreSubscribers=!1,k=void 0,_=void 0,d=void 0)},E=(t,a,g)=>{const p=o(a);_||(d=c),c=L(a,g),k={href:p,state:g,isPush:k?.isPush||t==="push"},_||(_=Promise.resolve().then(()=>v()))},A=t=>{c=i(),h.notify({type:t})},H=async()=>{if(B){B=!1;return}const t=i(),a=t.state[y]-c.state[y],g=a===1,p=a===-1,b=!g&&!p||S;S=!1;const G=b?"GO":p?"BACK":"FORWARD",w=b?{type:"GO",index:a}:{type:p?"BACK":"FORWARD"};if(x)x=!1;else{const C=f();if(typeof document<"u"&&C.length){for(const I of C)if(await I.blockerFn({currentLocation:c,nextLocation:t,action:G})){B=!0,e.history.go(1),h.notify(w);return}}}c=i(),h.notify(w)},m=t=>{if(P){P=!1;return}let a=!1;const g=f();if(typeof document<"u"&&g.length)for(const p of g){const b=p.enableBeforeUnload??!0;if(b===!0){a=!0;break}if(typeof b=="function"&&b()===!0){a=!0;break}}if(a)return t.preventDefault(),t.returnValue=""},h=D({getLocation:F,getLength:()=>e.history.length,pushState:(t,a)=>E("push",t,a),replaceState:(t,a)=>E("replace",t,a),back:t=>(t&&(x=!0),P=!0,e.history.back()),forward:t=>{t&&(x=!0),P=!0,e.history.forward()},go:t=>{S=!0,e.history.go(t)},createHref:t=>o(t),flush:v,destroy:()=>{e.history.pushState=s,e.history.replaceState=l,e.removeEventListener(K,m,{capture:!0}),e.removeEventListener(O,H)},onBlocked:()=>{d&&c!==d&&(c=d)},getBlockers:f,setBlockers:r,notifyOnIndexChange:!1});return e.addEventListener(K,m,{capture:!0}),e.addEventListener(O,H),e.history.pushState=function(...t){const a=s.apply(e.history,t);return h._ignoreSubscribers||A("PUSH"),a},e.history.replaceState=function(...t){const a=l.apply(e.history,t);return h._ignoreSubscribers||A("REPLACE"),a},h}function T(n){let e=n.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function L(n,e){const s=T(n),l=s.indexOf("#"),u=s.indexOf("?"),f=R();return{href:s,pathname:s.substring(0,l>0?u>0?Math.min(l,u):l:u>0?u:s.length),hash:l>-1?s.substring(l):"",search:u>-1?s.slice(u,l===-1?void 0:l):"",state:e||{[y]:0,key:f,__TSR_key:f}}}function R(){return(Math.random()+1).toString(36).substring(7)}export{W as c,L as p};
@@ -0,0 +1 @@
1
+ var D=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yt=class extends D{#t;#e;#s;constructor(){super(),this.#s=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},W=new yt,vt={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},mt=class{#t=vt;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}},Q=new mt;function bt(t){setTimeout(t,0)}var gt=typeof window>"u"||"Deno"in globalThis;function S(){}function Ot(t,e){return typeof t=="function"?t(e):t}function H(t){return typeof t=="number"&&t>=0&&t!==1/0}function ot(t,e){return Math.max(t+(e||0)-Date.now(),0)}function C(t,e){return typeof t=="function"?t(e):t}function g(t,e){return typeof t=="function"?t(e):t}function X(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:o,stale:u}=t;if(o){if(i){if(e.queryHash!==V(o,e.options))return!1}else if(!E(e.queryKey,o))return!1}if(s!=="all"){const a=e.isActive();if(s==="active"&&!a||s==="inactive"&&a)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||r&&r!==e.state.fetchStatus||n&&!n(e))}function Y(t,e){const{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(T(e.options.mutationKey)!==T(n))return!1}else if(!E(e.options.mutationKey,n))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function V(t,e){return(e?.queryKeyHashFn||T)(t)}function T(t){return JSON.stringify(t,(e,s)=>G(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function E(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>E(t[s],e[s])):!1}var St=Object.prototype.hasOwnProperty;function ut(t,e,s=0){if(t===e)return t;if(s>500)return e;const i=tt(t)&&tt(e);if(!i&&!(G(t)&&G(e)))return e;const n=(i?t:Object.keys(t)).length,o=i?e:Object.keys(e),u=o.length,a=i?new Array(u):{};let f=0;for(let h=0;h<u;h++){const y=i?h:o[h],l=t[y],m=e[y];if(l===m){a[y]=l,(i?h<n:St.call(t,y))&&f++;continue}if(l===null||m===null||typeof l!="object"||typeof m!="object"){a[y]=m;continue}const d=ut(l,m,s+1);a[y]=d,d===l&&f++}return n===u&&f===n?t:a}function q(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function tt(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function G(t){if(!et(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!et(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function et(t){return Object.prototype.toString.call(t)==="[object Object]"}function wt(t){return new Promise(e=>{Q.setTimeout(e,t)})}function _(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?ut(t,e):e}function Pt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Ft(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var $=Symbol();function ht(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===$?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Kt(t,e){return typeof t=="function"?t(...e):!!t}function Ct(t,e,s){let i=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),t}var K=(()=>{let t=()=>gt;return{isServer(){return t()},setIsServer(e){t=e}}})();function N(){let t,e;const s=new Promise((r,n)=>{t=r,e=n});s.status="pending",s.catch(()=>{});function i(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},s.reject=r=>{i({status:"rejected",reason:r}),e(r)},s}var Rt=bt;function Mt(){let t=[],e=0,s=u=>{u()},i=u=>{u()},r=Rt;const n=u=>{e?t.push(u):r(()=>{s(u)})},o=()=>{const u=t;t=[],u.length&&r(()=>{i(()=>{u.forEach(a=>{s(a)})})})};return{batch:u=>{let a;e++;try{a=u()}finally{e--,e||o()}return a},batchCalls:u=>(...a)=>{n(()=>{u(...a)})},schedule:n,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}var p=Mt(),Qt=class extends D{#t=!0;#e;#s;constructor(){super(),this.#s=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#t!==t&&(this.#t=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#t}},k=new Qt;function Tt(t){return Math.min(1e3*2**t,3e4)}function ct(t){return(t??"online")==="online"?k.isOnline():!0}var B=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function lt(t){let e=!1,s=0,i;const r=N(),n=()=>r.status!=="pending",o=c=>{if(!n()){const v=new B(c);l(v),t.onCancel?.(v)}},u=()=>{e=!0},a=()=>{e=!1},f=()=>W.isFocused()&&(t.networkMode==="always"||k.isOnline())&&t.canRun(),h=()=>ct(t.networkMode)&&t.canRun(),y=c=>{n()||(i?.(),r.resolve(c))},l=c=>{n()||(i?.(),r.reject(c))},m=()=>new Promise(c=>{i=v=>{(n()||f())&&c(v)},t.onPause?.()}).then(()=>{i=void 0,n()||t.onContinue?.()}),d=()=>{if(n())return;let c;const v=s===0?t.initialPromise:void 0;try{c=v??t.fn()}catch(b){c=Promise.reject(b)}Promise.resolve(c).then(y).catch(b=>{if(n())return;const w=t.retry??(K.isServer()?0:3),P=t.retryDelay??Tt,R=typeof P=="function"?P(s,b):P,M=w===!0||typeof w=="number"&&s<w||typeof w=="function"&&w(s,b);if(e||!M){l(b);return}s++,t.onFail?.(s,b),wt(R).then(()=>f()?void 0:m()).then(()=>{e?l(b):d()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(i?.(),r),cancelRetry:u,continueRetry:a,canStart:h,start:()=>(h()?d():m().then(d),r)}}var dt=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#t=Q.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(K.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Q.clearTimeout(this.#t),this.#t=void 0)}};function Dt(t){return{onFetch:(e,s)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},a=0;const f=async()=>{let h=!1;const y=d=>{Ct(d,()=>e.signal,()=>h=!0)},l=ht(e.options,e.fetchOptions),m=async(d,c,v)=>{if(h)return Promise.reject(e.signal.reason);if(c==null&&d.pages.length)return Promise.resolve(d);const w=(()=>{const L={client:e.client,queryKey:e.queryKey,pageParam:c,direction:v?"backward":"forward",meta:e.options.meta};return y(L),L})(),P=await l(w),{maxPages:R}=e.options,M=v?Ft:Pt;return{pages:M(d.pages,P,R),pageParams:M(d.pageParams,c,R)}};if(r&&n.length){const d=r==="backward",c=d?It:st,v={pages:n,pageParams:o},b=c(i,v);u=await m(v,b,d)}else{const d=t??n.length;do{const c=a===0?o[0]??i.initialPageParam:st(i,u);if(a>0&&c==null)break;u=await m(u,c),a++}while(a<d)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=f}}}function st(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function It(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var Et=class extends dt{#t;#e;#s;#i;#n;#r;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#n=t.client,this.#i=this.#n.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=rt(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#o,...t},t?._type&&(this.#t=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=rt(this.options);e.data!==void 0&&(this.setState(it(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const s=_(this.state.data,t,this.options);return this.#u({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t){this.#u({type:"setState",state:t})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(S).catch(S):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>g(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>C(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ot(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#r&&(this.#a||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#u({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const a=this.observers.find(f=>f.options.queryFn);a&&this.setOptions(a.options)}const s=new AbortController,i=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},r=()=>{const a=ht(this.options,e),h=(()=>{const y={client:this.#n,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#a=!1,this.options.persister?this.options.persister(a,h,this):a(h)},o=(()=>{const a={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:r};return i(a),a})();(this.#t==="infinite"?Dt(this.options.pages):this.options.behavior)?.onFetch(o,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#u({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=lt({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:a=>{a instanceof B&&a.revert&&this.setState({...this.#s,fetchStatus:"idle"}),s.abort()},onFail:(a,f)=>{this.#u({type:"failed",failureCount:a,error:f})},onPause:()=>{this.#u({type:"pause"})},onContinue:()=>{this.#u({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#i.config.onSuccess?.(a,this),this.#i.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof B){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#u({type:"error",error:a}),this.#i.config.onError?.(a,this),this.#i.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#u(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...ft(s.data,this.options),fetchMeta:t.meta??null};case"success":const i={...s,...it(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=t.manual?i:void 0,i;case"error":const r=t.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),p.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function ft(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ct(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function it(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var kt=class extends D{constructor(t,e){super(),this.options=e,this.#t=t,this.#a=null,this.#o=N(),this.bindMethods(),this.setOptions(e)}#t;#e=void 0;#s=void 0;#i=void 0;#n;#r;#o;#a;#c;#u;#p;#l;#d;#h;#y=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),nt(this.#e,this.options)?this.#f():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#S(),this.#e.removeObserver(this)}setOptions(t){const e=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof g(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),e._defaulted&&!q(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const i=this.hasListeners();i&&at(this.#e,s,this.options,e)&&this.#f(),this.updateResult(),i&&(this.#e!==s||g(this.options.enabled,this.#e)!==g(e.enabled,this.#e)||C(this.options.staleTime,this.#e)!==C(e.staleTime,this.#e))&&this.#v();const r=this.#m();i&&(this.#e!==s||g(this.options.enabled,this.#e)!==g(e.enabled,this.#e)||r!==this.#h)&&this.#b(r)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return jt(this,s)&&(this.#i=s,this.#r=this.options,this.#n=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(t){this.#y.add(t)}getCurrentQuery(){return this.#e}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#f(t){this.#w();let e=this.#e.fetch(this.options,t);return t?.throwOnError||(e=e.catch(S)),e}#v(){this.#O();const t=C(this.options.staleTime,this.#e);if(K.isServer()||this.#i.isStale||!H(t))return;const s=ot(this.#i.dataUpdatedAt,t)+1;this.#l=Q.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(t){this.#S(),this.#h=t,!(K.isServer()||g(this.options.enabled,this.#e)===!1||!H(this.#h)||this.#h===0)&&(this.#d=Q.setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.#f()},this.#h))}#g(){this.#v(),this.#b(this.#m())}#O(){this.#l!==void 0&&(Q.clearTimeout(this.#l),this.#l=void 0)}#S(){this.#d!==void 0&&(Q.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){const s=this.#e,i=this.options,r=this.#i,n=this.#n,o=this.#r,a=t!==s?t.state:this.#s,{state:f}=t;let h={...f},y=!1,l;if(e._optimisticResults){const O=this.hasListeners(),I=!O&&nt(t,e),A=O&&at(t,s,e,i);(I||A)&&(h={...h,...ft(f.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:d,status:c}=h;l=h.data;let v=!1;if(e.placeholderData!==void 0&&l===void 0&&c==="pending"){let O;r?.isPlaceholderData&&e.placeholderData===o?.placeholderData?(O=r.data,v=!0):O=typeof e.placeholderData=="function"?e.placeholderData(this.#p?.state.data,this.#p):e.placeholderData,O!==void 0&&(c="success",l=_(r?.data,O,e),y=!0)}if(e.select&&l!==void 0&&!v)if(r&&l===n?.data&&e.select===this.#c)l=this.#u;else try{this.#c=e.select,l=e.select(l),l=_(r?.data,l,e),this.#u=l,this.#a=null}catch(O){this.#a=O}this.#a&&(m=this.#a,l=this.#u,d=Date.now(),c="error");const b=h.fetchStatus==="fetching",w=c==="pending",P=c==="error",R=w&&b,M=l!==void 0,F={status:c,fetchStatus:h.fetchStatus,isPending:w,isSuccess:c==="success",isError:P,isInitialLoading:R,isLoading:R,data:l,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:d,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>a.dataUpdateCount||h.errorUpdateCount>a.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:P&&!M,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:P&&M,isStale:J(t,e),refetch:this.refetch,promise:this.#o,isEnabled:g(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=F.data!==void 0,I=F.status==="error"&&!O,A=U=>{I?U.reject(F.error):O&&U.resolve(F.data)},Z=()=>{const U=this.#o=F.promise=N();A(U)},j=this.#o;switch(j.status){case"pending":t.queryHash===s.queryHash&&A(j);break;case"fulfilled":(I||F.data!==j.value)&&Z();break;case"rejected":(!I||F.error!==j.reason)&&Z();break}}return F}updateResult(){const t=this.#i,e=this.createResult(this.#e,this.options);if(this.#n=this.#e.state,this.#r=this.options,this.#n.data!==void 0&&(this.#p=this.#e),q(e,t))return;this.#i=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,r=typeof i=="function"?i():i;if(r==="all"||!r&&!this.#y.size)return!0;const n=new Set(r??this.#y);return this.options.throwOnError&&n.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==t[u]&&n.has(u)})};this.#P({listeners:s()})}#w(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#e)return;const e=this.#e;this.#e=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#P(t){p.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function At(t,e){return g(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&g(e.retryOnMount,t)===!1)}function nt(t,e){return At(t,e)||t.state.data!==void 0&&z(t,e,e.refetchOnMount)}function z(t,e,s){if(g(e.enabled,t)!==!1&&C(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&J(t,e)}return!1}function at(t,e,s,i){return(t!==e||g(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&J(t,s)}function J(t,e){return g(e.enabled,t)!==!1&&t.isStaleByTime(C(e.staleTime,t))}function jt(t,e){return!q(t.getCurrentResult(),e)}var Ut=class extends dt{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||pt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#n({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=lt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(n,o)=>{this.#n({type:"failed",failureCount:n,error:o})},onPause:()=>{this.#n({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i=this.state.status==="pending",r=!this.#i.canStart();try{if(i)e();else{this.#n({type:"pending",variables:t,isPaused:r}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const o=await this.options.onMutate?.(t,s);o!==this.state.context&&this.#n({type:"pending",context:o,variables:t,isPaused:r})}const n=await this.#i.start();return await this.#s.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#s.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#n({type:"success",data:n}),n}catch(n){try{await this.#s.config.onError?.(n,t,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onError?.(n,t,this.state.context,s)}catch(o){Promise.reject(o)}try{await this.#s.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,s)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,n,t,this.state.context,s)}catch(o){Promise.reject(o)}throw this.#n({type:"error",error:n}),n}finally{this.#s.runNext(this)}}#n(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),p.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function pt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xt=class extends D{constructor(t={}){super(),this.config=t,this.#t=new Set,this.#e=new Map,this.#s=0}#t;#e;#s;build(t,e,s){const i=new Ut({client:t,mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#t.add(t);const e=x(t);if(typeof e=="string"){const s=this.#e.get(e);s?s.push(t):this.#e.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#t.delete(t)){const e=x(t);if(typeof e=="string"){const s=this.#e.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#e.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=x(t);if(typeof e=="string"){const i=this.#e.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=x(t);return typeof e=="string"?this.#e.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){p.batch(()=>{this.#t.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>Y(e,s))}findAll(t={}){return this.getAll().filter(e=>Y(t,e))}notify(t){p.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return p.batch(()=>Promise.all(t.map(e=>e.continue().catch(S))))}};function x(t){return t.options.scope?.id}var Lt=class extends D{#t;#e=void 0;#s;#i;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#t.defaultMutationOptions(t),q(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&T(e.mutationKey)!==T(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#r(t)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#r()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#t.getMutationCache().build(this.#t,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){const t=this.#s?.state??pt();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){p.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#e.variables,s=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,e,s,i)}catch(r){Promise.reject(r)}try{this.#i.onSettled?.(t.data,null,e,s,i)}catch(r){Promise.reject(r)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,e,s,i)}catch(r){Promise.reject(r)}try{this.#i.onSettled?.(void 0,t.error,e,s,i)}catch(r){Promise.reject(r)}}}this.listeners.forEach(e=>{e(this.#e)})})}},qt=class extends D{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){const i=e.queryKey,r=e.queryHash??V(i,e);let n=this.get(r);return n||(n=new Et({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(n)),n}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){p.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>X(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>X(t,s)):e}notify(t){p.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){p.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){p.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ht=class{#t;#e;#s;#i;#n;#r;#o;#a;constructor(t={}){this.#t=t.queryCache||new qt,this.#e=t.mutationCache||new xt,this.#s=t.defaultOptions||{},this.#i=new Map,this.#n=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=W.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=k.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(t){return this.#t.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#t.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(C(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#t.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),n=this.#t.get(i.queryHash)?.state.data,o=Ot(e,n);if(o!==void 0)return this.#t.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return p.batch(()=>this.#t.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#t.get(e.queryHash)?.state}removeQueries(t){const e=this.#t;p.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#t;return p.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=p.batch(()=>this.#t.findAll(t).map(r=>r.cancel(s)));return Promise.all(i).then(S).catch(S)}invalidateQueries(t,e={}){return p.batch(()=>(this.#t.findAll(t).forEach(s=>{s.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=p.batch(()=>this.#t.findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let n=r.fetch(void 0,s);return s.throwOnError||(n=n.catch(S)),r.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(i).then(S)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#t.build(this,e);return s.isStaleByTime(C(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(S).catch(S)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(S).catch(S)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return k.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#i.set(T(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{E(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#n.set(T(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#n.values()],s={};return e.forEach(i=>{E(t,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=V(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===$&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}};export{Lt as M,Ht as Q,kt as a,p as b,K as e,S as n,Kt as s};
@@ -0,0 +1 @@
1
+ import{r as o,j as b}from"./vendor-react-gJPiVnX5.js";import{s as E,b as C,n as f,e as x,a as M,M as _}from"./vendor-tanstack-query-core-7wuJJ5ZL.js";var p=o.createContext(void 0),g=e=>{const s=o.useContext(p);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},F=({client:e,children:s})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(p.Provider,{value:e,children:s})),R=o.createContext(!1),w=()=>o.useContext(R);R.Provider;function Q(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var d=o.createContext(Q()),O=()=>o.useContext(d),I=(e,s,u)=>{const r=u?.state.error&&typeof e.throwOnError=="function"?E(e.throwOnError,[u.state.error,u]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(s.isReset()||(e.retryOnMount=!1))},T=e=>{o.useEffect(()=>{e.clearReset()},[e])},P=({result:e,errorResetBoundary:s,throwOnError:u,query:r,suspense:n})=>e.isError&&!s.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||E(u,[e.error,r])),N=e=>{if(e.suspense){const u=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>u(r(...n)):u(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},q=(e,s)=>e.isLoading&&e.isFetching&&!s,B=(e,s)=>e?.suspense&&s.isPending,y=(e,s,u)=>s.fetchOptimistic(e).catch(()=>{u.clearReset()});function k(e,s,u){const r=w(),n=O(),i=g(),t=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(t);const l=i.getQueryCache().get(t.queryHash);t._optimisticResults=r?"isRestoring":"optimistic",N(t),I(t,n,l),T(n);const S=!i.getQueryCache().get(t.queryHash),[a]=o.useState(()=>new s(i,t)),c=a.getOptimisticResult(t),h=!r&&e.subscribed!==!1;if(o.useSyncExternalStore(o.useCallback(m=>{const v=h?a.subscribe(C.batchCalls(m)):f;return a.updateResult(),v},[a,h]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o.useEffect(()=>{a.setOptions(t)},[t,a]),B(t,c))throw y(t,a,n);if(P({result:c,errorResetBoundary:n,throwOnError:t.throwOnError,query:l,suspense:t.suspense}))throw c.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(t,c),t.experimental_prefetchInRender&&!x.isServer()&&q(c,r)&&(S?y(t,a,n):l?.promise)?.catch(f).finally(()=>{a.updateResult()}),t.notifyOnChangeProps?c:a.trackResult(c)}function H(e,s){return k(e,M)}function D(e,s){const u=g(),[r]=o.useState(()=>new _(u,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);const n=o.useSyncExternalStore(o.useCallback(t=>r.subscribe(C.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=o.useCallback((t,l)=>{r.mutate(t,l).catch(f)},[r]);if(n.error&&E(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:i,mutateAsync:n.mutate}}export{F as Q,H as a,g as b,D as u};
@@ -0,0 +1 @@
1
+ import{g as ze,T as q,q as E,E as we,r as xe,j as Je,D as Re,e as b,k as Ce,C as $e,B as Ge,a as Ve,t as Ye,u as J,n as Qe,G as ae,w as Xe,c as Ze,v as et,m as z,H as Ie,R as tt,o as rt,i as nt,s as ot,l as Pe,F as st}from"./vendor-tanstack-router-core-Cr7bYUZv.js";import{r as c,j as a,R as O}from"./vendor-react-gJPiVnX5.js";import{u as g}from"./vendor-tanstack-react-store-EvTi3ahh.js";import{r as it}from"./vendor-react-dom-BnNs-kzm.js";import{b as Le,c as be}from"./vendor-tanstack-store-BC7mA7pq.js";var $=c.use,H=typeof window<"u"?c.useLayoutEffect:c.useEffect;function se(e){const t=c.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function at(e,t,r={},n={}){c.useEffect(()=>{if(!e.current||n.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},r);return i.observe(e.current),()=>{i.disconnect()}},[t,r,n.disabled,e])}function ct(e){const t=c.useRef(null);return c.useImperativeHandle(e,()=>t.current,[]),t}function ut({promise:e}){if($)return $(e);const t=ze(e);if(t[q].status==="pending")throw t;if(t[q].status==="error")throw t[q].error;return t[q].data}function ir(e){const t=a.jsx(lt,{...e});return e.fallback?a.jsx(c.Suspense,{fallback:e.fallback,children:t}):t}function lt(e){const t=ut(e);return e.children(t)}function ce(e){const t=e.errorComponent??ue;return a.jsx(dt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:n})=>r?c.createElement(t,{error:r,reset:n}):e.children})}var dt=class extends c.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const r=e.getResetKey();return t.error&&t.resetKey!==r?{resetKey:r,error:null}:{resetKey:r}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ue({error:e}){const[t,r]=c.useState(!1);return a.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[a.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),a.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(n=>!n),children:t?"Hide Error":"Show Error"})]}),a.jsx("div",{style:{height:".25rem"}}),t?a.jsx("div",{children:a.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?a.jsx("code",{children:e.message}):null})}):null]})}function ft({children:e,fallback:t=null}){return le()?a.jsx(O.Fragment,{children:e}):a.jsx(O.Fragment,{children:t})}function le(){return O.useSyncExternalStore(ht,()=>!0,()=>!1)}function ht(){return()=>{}}var _e=c.createContext(null);function S(e){return c.useContext(_e)}var G=c.createContext(void 0),pt=c.createContext(void 0),mt={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function _(e){const t=S(),r=c.useContext(e.from?pt:G),n=e.from??r,i=n?e.from?t.stores.getRouteMatchStore(n):t.stores.matchStores.get(n):void 0,o=c.useRef(void 0);return g(i??mt,s=>{if((e.shouldThrow??!0)&&!s&&E(),s===void 0)return;const u=e.select?e.select(s):s;if(e.structuralSharing??t.options.defaultStructuralSharing){const h=we(o.current,u);return o.current=h,h}return u})}function Te(e){return _({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Me(e){const{select:t,...r}=e;return _({...r,select:n=>t?t(n.loaderDeps):n.loaderDeps})}function ke(e){return _({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function Ee(e){return _({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ae(e){const t=S();return c.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function Be(e){return _({...e,select:t=>e.select?e.select(t.context):t.context})}function gt(e,t){const r=S(),n=ct(t),{activeProps:i,inactiveProps:o,activeOptions:s,to:u,preload:h,preloadDelay:l,preloadIntentProximity:d,hashScrollIntoView:f,replace:y,startTransition:p,resetScroll:v,viewTransition:I,children:P,target:A,disabled:C,style:W,className:V,onClick:Y,onBlur:Q,onFocus:X,onMouseEnter:Z,onMouseLeave:ee,onTouchStart:te,ignoreBlocker:Oe,params:Jt,search:$t,hash:Gt,state:Vt,mask:Yt,reloadDocument:Qt,unsafeRelative:Xt,from:Zt,_fromLocation:er,...de}=e,re=le(),B=c.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),j=g(r.stores.location,m=>m,(m,R)=>m.href===R.href),x=c.useMemo(()=>{const m={_fromLocation:j,...B};return r.buildLocation(m)},[r,j,B]),fe=x.maskedLocation?x.maskedLocation.publicHref:x.publicHref,he=x.maskedLocation?x.maskedLocation.external:x.external,F=c.useMemo(()=>Ct(fe,he,r.history,C),[C,he,fe,r.history]),D=c.useMemo(()=>{if(F?.external)return xe(F.href,r.protocolAllowlist)?void 0:F.href;if(!It(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),xe(u,r.protocolAllowlist)?void 0:u}catch{}},[u,F,r.protocolAllowlist]),ne=c.useMemo(()=>{if(D)return!1;if(s?.exact){if(!Je(j.pathname,x.pathname,r.basepath))return!1}else{const m=Re(j.pathname,r.basepath),R=Re(x.pathname,r.basepath);if(!(m.startsWith(R)&&(m.length===R.length||m[R.length]==="/")))return!1}return(s?.includeSearch??!0)&&!b(j.search,x.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:s?.includeHash?re&&j.hash===x.hash:!0},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,j,D,re,x.hash,x.pathname,x.search,r.basepath]),K=ne?Ce(i,{})??yt:ie,U=ne?ie:Ce(o,{})??ie,pe=[V,K.className,U.className].filter(Boolean).join(" "),me=(W||K.style||U.style)&&{...W,...K.style,...U.style},[We,ge]=c.useState(!1),ye=c.useRef(!1),T=e.reloadDocument||D?!1:h??r.options.defaultPreload,oe=l??r.options.defaultPreloadDelay??0,w=c.useCallback(()=>{r.preloadRoute({...B,_builtLocation:x}).catch(m=>{console.warn(m),console.warn($e)})},[r,B,x]);at(n,c.useCallback(m=>{m?.isIntersecting&&w()},[w]),Rt,{disabled:!!C||T!=="viewport"}),c.useEffect(()=>{ye.current||!C&&T==="render"&&(w(),ye.current=!0)},[C,w,T]);const Ke=m=>{const R=m.currentTarget.getAttribute("target"),L=A!==void 0?A:R;if(!C&&!Pt(m)&&!m.defaultPrevented&&(!L||L==="_self")&&m.button===0){m.preventDefault(),it.flushSync(()=>{ge(!0)});const qe=r.subscribe("onResolved",()=>{qe(),ge(!1)});r.navigate({...B,replace:y,resetScroll:v,hashScrollIntoView:f,startTransition:p,viewTransition:I,ignoreBlocker:Oe})}};if(D)return{...de,ref:n,href:D,...P&&{children:P},...A&&{target:A},...C&&{disabled:C},...W&&{style:W},...V&&{className:V},...Y&&{onClick:Y},...Q&&{onBlur:Q},...X&&{onFocus:X},...Z&&{onMouseEnter:Z},...ee&&{onMouseLeave:ee},...te&&{onTouchStart:te}};const ve=m=>{if(C||T!=="intent")return;if(!oe){w();return}const R=m.currentTarget;if(N.has(R))return;const L=setTimeout(()=>{N.delete(R),w()},oe);N.set(R,L)},Ue=m=>{C||T!=="intent"||w()},Se=m=>{if(C||!T||!oe)return;const R=m.currentTarget,L=N.get(R);L&&(clearTimeout(L),N.delete(R))};return{...de,...K,...U,href:F?.href,ref:n,onClick:M([Y,Ke]),onBlur:M([Q,Se]),onFocus:M([X,ve]),onMouseEnter:M([Z,ve]),onMouseLeave:M([ee,Se]),onTouchStart:M([te,Ue]),disabled:!!C,target:A,...me&&{style:me},...pe&&{className:pe},...C&&vt,...ne&&St,...re&&We&&xt}}var ie={},yt={className:"active"},vt={role:"link","aria-disabled":!0},St={"data-status":"active","aria-current":"page"},xt={"data-transitioning":"transitioning"},N=new WeakMap,Rt={rootMargin:"100px"},M=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function Ct(e,t,r,n){if(!n)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function It(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Fe=c.forwardRef((e,t)=>{const{_asChild:r,...n}=e,{type:i,...o}=gt(n,t),s=typeof n.children=="function"?n.children({isActive:o["data-status"]==="active"}):n.children;if(!r){const{disabled:u,...h}=o;return c.createElement("a",h,s)}return c.createElement(r,o,s)});function Pt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var bt=class extends Ve{constructor(e){super(e),this.useMatch=t=>_({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Be({...t,from:this.id}),this.useSearch=t=>Ee({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ke({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Me({...t,from:this.id}),this.useLoaderData=t=>Te({...t,from:this.id}),this.useNavigate=()=>Ae({from:this.fullPath}),this.Link=O.forwardRef((t,r)=>a.jsx(Fe,{ref:r,from:this.fullPath,...t}))}};function jt(e){return new bt(e)}function ar(){return e=>Lt(e)}var wt=class extends Ge{constructor(e){super(e),this.useMatch=t=>_({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Be({...t,from:this.id}),this.useSearch=t=>Ee({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>ke({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Me({...t,from:this.id}),this.useLoaderData=t=>Te({...t,from:this.id}),this.useNavigate=()=>Ae({from:this.fullPath}),this.Link=O.forwardRef((t,r)=>a.jsx(Fe,{ref:r,from:this.fullPath,...t}))}};function Lt(e){return new wt(e)}function cr(e){return new _t(e,{silent:!0}).createRoute}var _t=class{constructor(e,t){this.path=e,this.createRoute=r=>{const n=jt(r);return n.isRoot=!1,n},this.silent=t?.silent}};function ur(e,t){let r,n,i,o;const s=()=>(r||(r=e().then(h=>{r=void 0,n=h[t]}).catch(h=>{if(i=h,Ye(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const l=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(l)||(sessionStorage.setItem(l,"1"),o=!0)}})),r),u=function(l){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!n)if($)$(s());else throw s();return c.createElement(n,l)};return u.preload=s,u}function Tt(e){const t=S(),r=`not-found-${g(t.stores.location,n=>n.pathname)}-${g(t.stores.status,n=>n)}`;return a.jsx(ce,{getResetKey:()=>r,onCatch:(n,i)=>{if(J(n))e.onCatch?.(n,i);else throw n},errorComponent:({error:n})=>{if(J(n))return e.fallback?.(n);throw n},children:e.children})}function Mt(){return a.jsx("p",{children:"Not Found"})}function k(e){return a.jsx(a.Fragment,{children:e.children})}function De(e,t,r){return t.options.notFoundComponent?a.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?a.jsx(e.options.defaultNotFoundComponent,{...r}):a.jsx(Mt,{})}function kt(){return Qe(S()),null}var Ne=c.memo(function({matchId:t}){const r=S(),n=r.stores.matchStores.get(t);n||E();const i=g(r.stores.loadedAt,s=>s),o=g(n,s=>s);return a.jsx(Et,{router:r,matchId:t,resetKey:i,matchState:c.useMemo(()=>{const s=o.routeId,u=r.routesById[s].parentRoute?.id;return{routeId:s,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:u}},[o._displayPending,o.routeId,o.ssr,r.routesById])})});function Et({router:e,matchId:t,resetKey:r,matchState:n}){const i=e.routesById[n.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,s=o?a.jsx(o,{}):null,u=i.options.errorComponent??e.options.defaultErrorComponent,h=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,d=n.ssr===!1||n.ssr==="data-only",f=(!i.isRoot||i.options.wrapInSuspense||d)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||d))?c.Suspense:k,y=u?ce:k,p=l?Tt:k;return a.jsxs(i.isRoot?i.options.shellComponent??k:k,{children:[a.jsx(G.Provider,{value:t,children:a.jsx(f,{fallback:s,children:a.jsx(y,{getResetKey:()=>r,errorComponent:u||ue,onCatch:(v,I)=>{if(J(v))throw v.routeId??=n.routeId,v;h?.(v,I)},children:a.jsx(p,{fallback:v=>{if(v.routeId??=n.routeId,!l||v.routeId&&v.routeId!==n.routeId||!v.routeId&&!i.isRoot)throw v;return c.createElement(l,v)},children:d||n._displayPending?a.jsx(ft,{fallback:s,children:a.jsx(je,{matchId:t})}):a.jsx(je,{matchId:t})})})})}),n.parentRouteId===ae?a.jsxs(a.Fragment,{children:[a.jsx(At,{resetKey:r}),e.options.scrollRestoration&&Xe?a.jsx(kt,{}):null]}):null]})}function At({resetKey:e}){const t=S(),r=c.useRef(void 0);return H(()=>{const n=t.latestLocation.href;(r.current===void 0||r.current!==n)&&(t.emit({type:"onRendered",...z(t.stores.location.get(),t.stores.resolvedLocation.get())}),r.current=n)},[t.latestLocation.state.__TSR_key,e,t]),null}var je=c.memo(function({matchId:t}){const r=S(),n=(d,f)=>r.getMatch(d.id)?._nonReactive[f]??d._nonReactive[f],i=r.stores.matchStores.get(t);i||E();const o=g(i,d=>d),s=o.routeId,u=r.routesById[s],h=c.useMemo(()=>{const d=(r.routesById[s].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:s,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return d?JSON.stringify(d):void 0},[s,o.loaderDeps,o._strictParams,o._strictSearch,r.options.defaultRemountDeps,r.routesById]),l=c.useMemo(()=>{const d=u.options.component??r.options.defaultComponent;return d?a.jsx(d,{},h):a.jsx(Bt,{})},[h,u.options.component,r.options.defaultComponent]);if(o._displayPending)throw n(o,"displayPendingPromise");if(o._forcePending)throw n(o,"minPendingPromise");if(o.status==="pending"){const d=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(d){const f=r.getMatch(o.id);if(f&&!f._nonReactive.minPendingPromise){const y=Ze();f._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n(o,"loadPromise")}if(o.status==="notFound")return J(o.error)||E(),De(r,u,o.error);if(o.status==="redirected")throw et(o.error)||E(),n(o,"loadPromise");if(o.status==="error")throw o.error;return l}),Bt=c.memo(function(){const t=S(),r=c.useContext(G);let n,i=!1,o;{const l=r?t.stores.matchStores.get(r):void 0;[n,i]=g(l,d=>[d?.routeId,d?.globalNotFound??!1]),o=g(t.stores.matchesId,d=>d[d.findIndex(f=>f===r)+1])}const s=n?t.routesById[n]:void 0,u=t.options.defaultPendingComponent?a.jsx(t.options.defaultPendingComponent,{}):null;if(i)return s||E(),De(t,s,void 0);if(!o)return null;const h=a.jsx(Ne,{matchId:o});return n===ae?a.jsx(c.Suspense,{fallback:u,children:h}):h});function Ft(){const e=S(),t=c.useRef({router:e,mounted:!1}),[r,n]=c.useState(!1),i=g(e.stores.isLoading,f=>f),o=g(e.stores.hasPending,f=>f),s=se(i),u=i||r||o,h=se(u),l=i||o,d=se(l);return e.startTransition=f=>{n(!0),c.startTransition(()=>{f(),n(!1)})},c.useEffect(()=>{const f=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ie(e.latestLocation.publicHref)!==Ie(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{f()}},[e,e.history]),H(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),H(()=>{s&&!i&&e.emit({type:"onLoad",...z(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,i]),H(()=>{d&&!l&&e.emit({type:"onBeforeRouteMount",...z(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,d,e]),H(()=>{if(h&&!u){const f=z(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),Le(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,h,e]),null}function Dt(){const e=S(),t=e.routesById[ae].options.pendingComponent??e.options.defaultPendingComponent,r=t?a.jsx(t,{}):null,n=a.jsxs(typeof document<"u"&&e.ssr?k:c.Suspense,{fallback:r,children:[a.jsx(Ft,{}),a.jsx(Nt,{})]});return e.options.InnerWrap?a.jsx(e.options.InnerWrap,{children:n}):n}function Nt(){const e=S(),t=g(e.stores.firstId,i=>i),r=g(e.stores.loadedAt,i=>i),n=t?a.jsx(Ne,{matchId:t}):null;return a.jsx(G.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?n:a.jsx(ce,{getResetKey:()=>r,errorComponent:ue,onCatch:void 0,children:n})})}var Ht=e=>({createMutableStore:be,createReadonlyStore:be,batch:Le}),lr=e=>new Ot(e),Ot=class extends tt{constructor(e){super(e,Ht)}};function Wt({router:e,children:t,...r}){rt(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const n=a.jsx(_e.Provider,{value:e,children:t});return e.options.Wrap?a.jsx(e.options.Wrap,{children:n}):n}function dr({router:e,...t}){return a.jsx(Wt,{router:e,...t,children:a.jsx(Dt,{})})}function fr(e){const t=S({warn:e?.router===void 0}),r=e?.router||t,n=c.useRef(void 0);return g(r.stores.__store,i=>{if(e?.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const o=we(n.current,e.select(i));return n.current=o,o}return e.select(i)}return i})}function He(e){const{attrs:t,children:r,nonce:n}=e;switch(e.tag){case"title":return a.jsx("title",{...t,suppressHydrationWarning:!0,children:r});case"meta":return a.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return a.jsx("link",{...t,precedence:t?.precedence??(t?.rel==="stylesheet"?"default":void 0),nonce:n,suppressHydrationWarning:!0});case"style":return e.inlineCss,a.jsx("style",{...t,dangerouslySetInnerHTML:{__html:r},nonce:n});case"script":return a.jsx(Kt,{attrs:t,children:r});default:return null}}function Kt({attrs:e,children:t}){S();const r=le(),n=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(c.useEffect(()=>{if(!n){if(e?.src){const i=(()=>{try{const s=document.baseURI||window.location.href;return new URL(e.src,s).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(s=>s.src===i))return;const o=document.createElement("script");for(const[s,u]of Object.entries(e))s!=="suppressHydrationWarning"&&u!==void 0&&u!==!1&&o.setAttribute(s,typeof u=="boolean"?"":String(u));return document.head.appendChild(o),()=>{o.parentNode&&o.parentNode.removeChild(o)}}if(typeof t=="string"){const i=typeof e?.type=="string"?e.type:"text/javascript",o=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(u=>{if(!(u instanceof HTMLScriptElement))return!1;const h=u.getAttribute("type")??"text/javascript",l=u.getAttribute("nonce")??void 0;return u.textContent===t&&h===i&&l===o}))return;const s=document.createElement("script");if(s.textContent=t,e)for(const[u,h]of Object.entries(e))u!=="suppressHydrationWarning"&&h!==void 0&&h!==!1&&s.setAttribute(u,typeof h=="boolean"?"":String(h));return document.head.appendChild(s),()=>{s.parentNode&&s.parentNode.removeChild(s)}}}},[e,t,n]),n&&typeof t=="string")return a.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return a.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return a.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var Ut=e=>{const t=S(),r=t.options.ssr?.nonce,n=g(t.stores.matches,l=>l.map(d=>d.meta).filter(Boolean),b),i=c.useMemo(()=>{const l=[],d={};let f;for(let y=n.length-1;y>=0;y--){const p=n[y];for(let v=p.length-1;v>=0;v--){const I=p[v];if(I)if(I.title)f||(f={tag:"title",children:I.title});else if("script:ld+json"in I)try{const P=JSON.stringify(I["script:ld+json"]);l.push({tag:"script",attrs:{type:"application/ld+json"},children:nt(P)})}catch{}else{const P=I.name??I.property;if(P){if(d[P])continue;d[P]=!0}l.push({tag:"meta",attrs:{...I,nonce:r}})}}}return f&&l.push(f),r&&l.push({tag:"meta",attrs:{property:"csp-nonce",content:r}}),l.reverse(),l},[n,r]),o=g(t.stores.matches,l=>{const d=l.map(p=>p.links).filter(Boolean).flat(1).map(p=>({tag:"link",attrs:{...p,nonce:r}})),f=t.ssr?.manifest,y=l.map(p=>f?.routes[p.routeId]?.assets??[]).filter(Boolean).flat(1).flatMap(p=>p.tag==="link"?ot(f,p)?[]:[{tag:"link",attrs:{...p.attrs,crossOrigin:Pe(e,"stylesheet")??p.attrs?.crossOrigin,suppressHydrationWarning:!0,nonce:r}}]:p.tag==="style"?[{tag:"style",attrs:{...p.attrs,nonce:r},children:p.children,...p.inlineCss?{inlineCss:!0}:{}}]:[]);return[...d,...y]},b),s=g(t.stores.matches,l=>{const d=[];return l.map(f=>t.looseRoutesById[f.routeId]).forEach(f=>t.ssr?.manifest?.routes[f.id]?.preloads?.filter(Boolean).forEach(y=>{const p=st(y);d.push({tag:"link",attrs:{rel:"modulepreload",href:p.href,crossOrigin:Pe(e,"modulepreload")??p.crossOrigin,nonce:r}})})),d},b),u=g(t.stores.matches,l=>l.map(d=>d.styles).flat(1).filter(Boolean).map(({children:d,...f})=>({tag:"style",attrs:{...f,nonce:r},children:d})),b),h=g(t.stores.matches,l=>l.map(d=>d.headScripts).flat(1).filter(Boolean).map(({children:d,...f})=>({tag:"script",attrs:{...f,nonce:r},children:d})),b);return qt([...i,...s,...o,...u,...h],l=>JSON.stringify(l))};function qt(e,t){const r=new Set;return e.filter(n=>{const i=t(n);return r.has(i)?!1:(r.add(i),!0)})}function hr(e){const t=Ut(e.assetCrossOrigin),r=S().options.ssr?.nonce;return a.jsx(a.Fragment,{children:t.map(n=>c.createElement(He,{...n,key:`tsr-meta-${JSON.stringify(n)}`,nonce:r}))})}var pr=()=>{const e=S(),t=e.options.ssr?.nonce,r=o=>{const s=[],u=e.ssr?.manifest;return u?(o.map(h=>e.looseRoutesById[h.routeId]).forEach(h=>u.routes[h.id]?.assets?.filter(l=>l.tag==="script").forEach(l=>{s.push({tag:"script",attrs:{...l.attrs,nonce:t},children:l.children})})),s):[]},n=o=>o.map(s=>s.scripts).flat(1).filter(Boolean).map(({children:s,...u})=>({tag:"script",attrs:{...u,suppressHydrationWarning:!0,nonce:t},children:s})),i=g(e.stores.matches,r,b);return zt(e,g(e.stores.matches,n,b),i)};function zt(e,t,r){let n;e.serverSsr&&(n=e.serverSsr.takeBufferedScripts());const i=[...t,...r];return n&&i.unshift(n),a.jsx(a.Fragment,{children:i.map((o,s)=>c.createElement(He,{...o,key:`tsr-scripts-${o.tag}-${s}`}))})}export{ir as A,hr as H,Fe as L,Bt as O,dr as R,pr as S,ar as a,lr as b,cr as c,S as d,fr as e,ur as l,Ae as u};
@@ -0,0 +1 @@
1
+ import{i}from"./vendor-tanstack-start-client-core-C-00BBOu.js";import{A as a,R as e}from"./vendor-tanstack-react-router-sIZLK-LU.js";import{j as o}from"./vendor-react-gJPiVnX5.js";async function n(){const r=await i();return window.$_TSR?.h(),r}var t;function p(){return t||(t=n()),o.jsx(a,{promise:t,children:r=>o.jsx(e,{router:r})})}export{p as S};
@@ -0,0 +1 @@
1
+ import{r as s}from"./vendor-react-gJPiVnX5.js";import{w as a}from"./vendor-use-sync-external-store-ZvKHXaIn.js";function i(e,t){return e===t}function S(e,t,n=i){const o=s.useCallback(c=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(c);return u},[e]),r=s.useCallback(()=>e?.get(),[e]);return a.useSyncExternalStoreWithSelector(o,r,r,t,n)}export{S as u};