headroom-cms 0.1.1

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 (237) hide show
  1. package/README.md +282 -0
  2. package/admin/assets/AdminsPage-CnrQqwKA.js +1 -0
  3. package/admin/assets/AllContentPage-ByN1h3PP.js +1 -0
  4. package/admin/assets/ApiKeysPage-FgNHZPBS.js +1 -0
  5. package/admin/assets/AuditPage-DAPpo-sj.js +1 -0
  6. package/admin/assets/BlockEditor-CZTwex-o.js +179 -0
  7. package/admin/assets/BlockEditor-Cp_wZ2xN.css +1 -0
  8. package/admin/assets/BlockTypeEditPage-Buuwbx1P.js +1 -0
  9. package/admin/assets/BlockTypesPage-Dj0qmsqX.js +1 -0
  10. package/admin/assets/BulkActionBar-BMcUBJSH.js +1 -0
  11. package/admin/assets/CollectionEditPage-CLgQu2HS.js +1 -0
  12. package/admin/assets/CollectionsPage-BnCaxALz.js +1 -0
  13. package/admin/assets/ContentCreatePage-CJI326o-.js +1 -0
  14. package/admin/assets/ContentEditPage-A4i8P2Jd.js +3 -0
  15. package/admin/assets/ContentListPage-Bc4mBIkB.js +1 -0
  16. package/admin/assets/CustomBlockPreview-CCssn6vF.js +479 -0
  17. package/admin/assets/FieldBuilder-YJGSk0nY.js +3 -0
  18. package/admin/assets/LoginPage-Jrne8-Wr.js +1 -0
  19. package/admin/assets/MediaPage-DfPQBmNf.css +1 -0
  20. package/admin/assets/MediaPage-_qNXqsZg.js +1 -0
  21. package/admin/assets/SiteSettingsPage-CoZnavij.js +1 -0
  22. package/admin/assets/SitesPage-ETqFT3nO.js +1 -0
  23. package/admin/assets/TagsPage-BGpp0XZM.js +1 -0
  24. package/admin/assets/UsersPage-CKRJpAb6.js +1 -0
  25. package/admin/assets/WebhookEditPage-BOcLe5OJ.js +1 -0
  26. package/admin/assets/WebhooksPage-Czco583Y.js +1 -0
  27. package/admin/assets/badge-0Z1nL6DI.js +1 -0
  28. package/admin/assets/card-D1-S-QZ6.js +1 -0
  29. package/admin/assets/check-BGA0ADyt.js +1 -0
  30. package/admin/assets/checkbox-BPqrj_XS.js +1 -0
  31. package/admin/assets/command-ChD319uJ.js +1 -0
  32. package/admin/assets/contentStatus-DfWHjFVB.js +1 -0
  33. package/admin/assets/copy-BqH9rXYM.js +1 -0
  34. package/admin/assets/core.esm-Csvubn5Q.js +5 -0
  35. package/admin/assets/format-CZ9bpk32.js +1 -0
  36. package/admin/assets/index-DOqKbrpW.css +1 -0
  37. package/admin/assets/index-Ds50UTAc.js +18 -0
  38. package/admin/assets/lib-BrI1UB_t.js +38 -0
  39. package/admin/assets/media-url-DIg_vSyf.js +1 -0
  40. package/admin/assets/module-RjUF93sV.js +716 -0
  41. package/admin/assets/native-48B9X9Wg.js +1 -0
  42. package/admin/assets/plus-BgHSYWJN.js +1 -0
  43. package/admin/assets/radix-DQ3amgxj.js +51 -0
  44. package/admin/assets/react-vendor-DNVhVxD7.js +4 -0
  45. package/admin/assets/search-DIzcfCVh.js +1 -0
  46. package/admin/assets/select-CJXZv4wv.js +1 -0
  47. package/admin/assets/sortable.esm-Zh-9QRSf.js +1 -0
  48. package/admin/assets/table-B3EHrN_H.js +1 -0
  49. package/admin/assets/tanstack-BO6c-AOu.js +1 -0
  50. package/admin/assets/trash-2-Gny2Upn-.js +1 -0
  51. package/admin/assets/useAdminResolver-BsQc_N4z.js +1 -0
  52. package/admin/assets/useContent-CSobIico.js +1 -0
  53. package/admin/assets/useDebouncedValue-Bf8UizjU.js +1 -0
  54. package/admin/assets/useMedia-CQnmMz4N.js +1 -0
  55. package/admin/assets/useTags-CYqbj5cK.js +1 -0
  56. package/admin/assets/useWebhooks-DXgtQ3aU.js +1 -0
  57. package/admin/index.html +21 -0
  58. package/admin/vite.svg +1 -0
  59. package/dist/admin-site.d.ts +30 -0
  60. package/dist/admin-site.d.ts.map +1 -0
  61. package/dist/admin-site.js +80 -0
  62. package/dist/admin-site.js.map +1 -0
  63. package/dist/api.d.ts +26 -0
  64. package/dist/api.d.ts.map +1 -0
  65. package/dist/api.js +91 -0
  66. package/dist/api.js.map +1 -0
  67. package/dist/auth.d.ts +27 -0
  68. package/dist/auth.d.ts.map +1 -0
  69. package/dist/auth.js +86 -0
  70. package/dist/auth.js.map +1 -0
  71. package/dist/cdn.d.ts +27 -0
  72. package/dist/cdn.d.ts.map +1 -0
  73. package/dist/cdn.js +382 -0
  74. package/dist/cdn.js.map +1 -0
  75. package/dist/image.d.ts +21 -0
  76. package/dist/image.d.ts.map +1 -0
  77. package/dist/image.js +48 -0
  78. package/dist/image.js.map +1 -0
  79. package/dist/index.d.ts +85 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +124 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/storage.d.ts +21 -0
  84. package/dist/storage.d.ts.map +1 -0
  85. package/dist/storage.js +125 -0
  86. package/dist/storage.js.map +1 -0
  87. package/dist/webhooks.d.ts +23 -0
  88. package/dist/webhooks.d.ts.map +1 -0
  89. package/dist/webhooks.js +91 -0
  90. package/dist/webhooks.js.map +1 -0
  91. package/lambda/api/bootstrap +0 -0
  92. package/lambda/api/resource.enc +0 -0
  93. package/lambda/functions/custom-message/index.mjs +112 -0
  94. package/lambda/functions/custom-message/resource.enc +1 -0
  95. package/lambda/image-lambda/index.mjs +188 -0
  96. package/lambda/image-lambda/node_modules/.package-lock.json +160 -0
  97. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/README.md +46 -0
  98. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/lib/glib-2.0/include/glibconfig.h +220 -0
  99. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/lib/index.js +1 -0
  100. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/lib/libvips-cpp.so.42 +0 -0
  101. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/package.json +42 -0
  102. package/lambda/image-lambda/node_modules/@img/sharp-libvips-linux-arm64/versions.json +30 -0
  103. package/lambda/image-lambda/node_modules/@img/sharp-linux-arm64/LICENSE +191 -0
  104. package/lambda/image-lambda/node_modules/@img/sharp-linux-arm64/README.md +18 -0
  105. package/lambda/image-lambda/node_modules/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node +0 -0
  106. package/lambda/image-lambda/node_modules/@img/sharp-linux-arm64/package.json +46 -0
  107. package/lambda/image-lambda/node_modules/color/LICENSE +21 -0
  108. package/lambda/image-lambda/node_modules/color/README.md +123 -0
  109. package/lambda/image-lambda/node_modules/color/index.js +496 -0
  110. package/lambda/image-lambda/node_modules/color/package.json +47 -0
  111. package/lambda/image-lambda/node_modules/color-convert/CHANGELOG.md +54 -0
  112. package/lambda/image-lambda/node_modules/color-convert/LICENSE +21 -0
  113. package/lambda/image-lambda/node_modules/color-convert/README.md +68 -0
  114. package/lambda/image-lambda/node_modules/color-convert/conversions.js +839 -0
  115. package/lambda/image-lambda/node_modules/color-convert/index.js +81 -0
  116. package/lambda/image-lambda/node_modules/color-convert/package.json +48 -0
  117. package/lambda/image-lambda/node_modules/color-convert/route.js +97 -0
  118. package/lambda/image-lambda/node_modules/color-name/LICENSE +8 -0
  119. package/lambda/image-lambda/node_modules/color-name/README.md +11 -0
  120. package/lambda/image-lambda/node_modules/color-name/index.js +152 -0
  121. package/lambda/image-lambda/node_modules/color-name/package.json +28 -0
  122. package/lambda/image-lambda/node_modules/color-string/LICENSE +21 -0
  123. package/lambda/image-lambda/node_modules/color-string/README.md +62 -0
  124. package/lambda/image-lambda/node_modules/color-string/index.js +242 -0
  125. package/lambda/image-lambda/node_modules/color-string/package.json +39 -0
  126. package/lambda/image-lambda/node_modules/detect-libc/LICENSE +201 -0
  127. package/lambda/image-lambda/node_modules/detect-libc/README.md +163 -0
  128. package/lambda/image-lambda/node_modules/detect-libc/index.d.ts +14 -0
  129. package/lambda/image-lambda/node_modules/detect-libc/lib/detect-libc.js +313 -0
  130. package/lambda/image-lambda/node_modules/detect-libc/lib/elf.js +39 -0
  131. package/lambda/image-lambda/node_modules/detect-libc/lib/filesystem.js +51 -0
  132. package/lambda/image-lambda/node_modules/detect-libc/lib/process.js +24 -0
  133. package/lambda/image-lambda/node_modules/detect-libc/package.json +44 -0
  134. package/lambda/image-lambda/node_modules/is-arrayish/LICENSE +21 -0
  135. package/lambda/image-lambda/node_modules/is-arrayish/README.md +16 -0
  136. package/lambda/image-lambda/node_modules/is-arrayish/index.js +9 -0
  137. package/lambda/image-lambda/node_modules/is-arrayish/package.json +45 -0
  138. package/lambda/image-lambda/node_modules/semver/LICENSE +15 -0
  139. package/lambda/image-lambda/node_modules/semver/README.md +665 -0
  140. package/lambda/image-lambda/node_modules/semver/bin/semver.js +191 -0
  141. package/lambda/image-lambda/node_modules/semver/classes/comparator.js +143 -0
  142. package/lambda/image-lambda/node_modules/semver/classes/index.js +7 -0
  143. package/lambda/image-lambda/node_modules/semver/classes/range.js +557 -0
  144. package/lambda/image-lambda/node_modules/semver/classes/semver.js +333 -0
  145. package/lambda/image-lambda/node_modules/semver/functions/clean.js +8 -0
  146. package/lambda/image-lambda/node_modules/semver/functions/cmp.js +54 -0
  147. package/lambda/image-lambda/node_modules/semver/functions/coerce.js +62 -0
  148. package/lambda/image-lambda/node_modules/semver/functions/compare-build.js +9 -0
  149. package/lambda/image-lambda/node_modules/semver/functions/compare-loose.js +5 -0
  150. package/lambda/image-lambda/node_modules/semver/functions/compare.js +7 -0
  151. package/lambda/image-lambda/node_modules/semver/functions/diff.js +60 -0
  152. package/lambda/image-lambda/node_modules/semver/functions/eq.js +5 -0
  153. package/lambda/image-lambda/node_modules/semver/functions/gt.js +5 -0
  154. package/lambda/image-lambda/node_modules/semver/functions/gte.js +5 -0
  155. package/lambda/image-lambda/node_modules/semver/functions/inc.js +21 -0
  156. package/lambda/image-lambda/node_modules/semver/functions/lt.js +5 -0
  157. package/lambda/image-lambda/node_modules/semver/functions/lte.js +5 -0
  158. package/lambda/image-lambda/node_modules/semver/functions/major.js +5 -0
  159. package/lambda/image-lambda/node_modules/semver/functions/minor.js +5 -0
  160. package/lambda/image-lambda/node_modules/semver/functions/neq.js +5 -0
  161. package/lambda/image-lambda/node_modules/semver/functions/parse.js +18 -0
  162. package/lambda/image-lambda/node_modules/semver/functions/patch.js +5 -0
  163. package/lambda/image-lambda/node_modules/semver/functions/prerelease.js +8 -0
  164. package/lambda/image-lambda/node_modules/semver/functions/rcompare.js +5 -0
  165. package/lambda/image-lambda/node_modules/semver/functions/rsort.js +5 -0
  166. package/lambda/image-lambda/node_modules/semver/functions/satisfies.js +12 -0
  167. package/lambda/image-lambda/node_modules/semver/functions/sort.js +5 -0
  168. package/lambda/image-lambda/node_modules/semver/functions/valid.js +8 -0
  169. package/lambda/image-lambda/node_modules/semver/index.js +91 -0
  170. package/lambda/image-lambda/node_modules/semver/internal/constants.js +37 -0
  171. package/lambda/image-lambda/node_modules/semver/internal/debug.js +11 -0
  172. package/lambda/image-lambda/node_modules/semver/internal/identifiers.js +29 -0
  173. package/lambda/image-lambda/node_modules/semver/internal/lrucache.js +42 -0
  174. package/lambda/image-lambda/node_modules/semver/internal/parse-options.js +17 -0
  175. package/lambda/image-lambda/node_modules/semver/internal/re.js +223 -0
  176. package/lambda/image-lambda/node_modules/semver/package.json +78 -0
  177. package/lambda/image-lambda/node_modules/semver/preload.js +4 -0
  178. package/lambda/image-lambda/node_modules/semver/range.bnf +16 -0
  179. package/lambda/image-lambda/node_modules/semver/ranges/gtr.js +6 -0
  180. package/lambda/image-lambda/node_modules/semver/ranges/intersects.js +9 -0
  181. package/lambda/image-lambda/node_modules/semver/ranges/ltr.js +6 -0
  182. package/lambda/image-lambda/node_modules/semver/ranges/max-satisfying.js +27 -0
  183. package/lambda/image-lambda/node_modules/semver/ranges/min-satisfying.js +26 -0
  184. package/lambda/image-lambda/node_modules/semver/ranges/min-version.js +63 -0
  185. package/lambda/image-lambda/node_modules/semver/ranges/outside.js +82 -0
  186. package/lambda/image-lambda/node_modules/semver/ranges/simplify.js +49 -0
  187. package/lambda/image-lambda/node_modules/semver/ranges/subset.js +249 -0
  188. package/lambda/image-lambda/node_modules/semver/ranges/to-comparators.js +10 -0
  189. package/lambda/image-lambda/node_modules/semver/ranges/valid.js +13 -0
  190. package/lambda/image-lambda/node_modules/sharp/LICENSE +191 -0
  191. package/lambda/image-lambda/node_modules/sharp/README.md +118 -0
  192. package/lambda/image-lambda/node_modules/sharp/install/check.js +41 -0
  193. package/lambda/image-lambda/node_modules/sharp/lib/channel.js +174 -0
  194. package/lambda/image-lambda/node_modules/sharp/lib/colour.js +180 -0
  195. package/lambda/image-lambda/node_modules/sharp/lib/composite.js +210 -0
  196. package/lambda/image-lambda/node_modules/sharp/lib/constructor.js +452 -0
  197. package/lambda/image-lambda/node_modules/sharp/lib/index.d.ts +1754 -0
  198. package/lambda/image-lambda/node_modules/sharp/lib/index.js +16 -0
  199. package/lambda/image-lambda/node_modules/sharp/lib/input.js +658 -0
  200. package/lambda/image-lambda/node_modules/sharp/lib/is.js +169 -0
  201. package/lambda/image-lambda/node_modules/sharp/lib/libvips.js +203 -0
  202. package/lambda/image-lambda/node_modules/sharp/lib/operation.js +958 -0
  203. package/lambda/image-lambda/node_modules/sharp/lib/output.js +1587 -0
  204. package/lambda/image-lambda/node_modules/sharp/lib/resize.js +587 -0
  205. package/lambda/image-lambda/node_modules/sharp/lib/sharp.js +114 -0
  206. package/lambda/image-lambda/node_modules/sharp/lib/utility.js +296 -0
  207. package/lambda/image-lambda/node_modules/sharp/package.json +222 -0
  208. package/lambda/image-lambda/node_modules/sharp/src/binding.gyp +280 -0
  209. package/lambda/image-lambda/node_modules/sharp/src/common.cc +1091 -0
  210. package/lambda/image-lambda/node_modules/sharp/src/common.h +393 -0
  211. package/lambda/image-lambda/node_modules/sharp/src/metadata.cc +320 -0
  212. package/lambda/image-lambda/node_modules/sharp/src/metadata.h +85 -0
  213. package/lambda/image-lambda/node_modules/sharp/src/operations.cc +475 -0
  214. package/lambda/image-lambda/node_modules/sharp/src/operations.h +125 -0
  215. package/lambda/image-lambda/node_modules/sharp/src/pipeline.cc +1758 -0
  216. package/lambda/image-lambda/node_modules/sharp/src/pipeline.h +393 -0
  217. package/lambda/image-lambda/node_modules/sharp/src/sharp.cc +40 -0
  218. package/lambda/image-lambda/node_modules/sharp/src/stats.cc +183 -0
  219. package/lambda/image-lambda/node_modules/sharp/src/stats.h +59 -0
  220. package/lambda/image-lambda/node_modules/sharp/src/utilities.cc +269 -0
  221. package/lambda/image-lambda/node_modules/sharp/src/utilities.h +19 -0
  222. package/lambda/image-lambda/node_modules/simple-swizzle/LICENSE +21 -0
  223. package/lambda/image-lambda/node_modules/simple-swizzle/README.md +43 -0
  224. package/lambda/image-lambda/node_modules/simple-swizzle/index.js +29 -0
  225. package/lambda/image-lambda/node_modules/simple-swizzle/package.json +36 -0
  226. package/lambda/webhook-worker/bootstrap +0 -0
  227. package/lambda/webhook-worker/resource.enc +0 -0
  228. package/package.json +50 -0
  229. package/src/admin-site.ts +108 -0
  230. package/src/api.ts +113 -0
  231. package/src/auth.ts +110 -0
  232. package/src/cdn.ts +449 -0
  233. package/src/image.ts +62 -0
  234. package/src/index.ts +216 -0
  235. package/src/sst-env.d.ts +143 -0
  236. package/src/storage.ts +138 -0
  237. package/src/webhooks.ts +114 -0
@@ -0,0 +1,4 @@
1
+ function en(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var no=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ao(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function a(){var n=!1;try{n=this instanceof a}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}),r}var St={exports:{}},F={};var Zt;function rn(){if(Zt)return F;Zt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),R=Symbol.iterator;function y(u){return u===null||typeof u!="object"?null:(u=R&&u[R]||u["@@iterator"],typeof u=="function"?u:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,x={};function C(u,w,$){this.props=u,this.context=w,this.refs=x,this.updater=$||L}C.prototype.isReactComponent={},C.prototype.setState=function(u,w){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,w,"setState")},C.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};function T(){}T.prototype=C.prototype;function N(u,w,$){this.props=u,this.context=w,this.refs=x,this.updater=$||L}var W=N.prototype=new T;W.constructor=N,M(W,C.prototype),W.isPureReactComponent=!0;var B=Array.isArray;function h(){}var _={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function j(u,w,$){var A=$.ref;return{$$typeof:e,type:u,key:w,ref:A!==void 0?A:null,props:$}}function Z(u,w){return j(u.type,w,u.props)}function te(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function Me(u){var w={"=":"=0",":":"=2"};return"$"+u.replace(/[=:]/g,function($){return w[$]})}var _e=/\/+/g;function de(u,w){return typeof u=="object"&&u!==null&&u.key!=null?Me(""+u.key):w.toString(36)}function je(u){switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:switch(typeof u.status=="string"?u.then(h,h):(u.status="pending",u.then(function(w){u.status==="pending"&&(u.status="fulfilled",u.value=w)},function(w){u.status==="pending"&&(u.status="rejected",u.reason=w)})),u.status){case"fulfilled":return u.value;case"rejected":throw u.reason}}throw u}function G(u,w,$,A,H){var z=typeof u;(z==="undefined"||z==="boolean")&&(u=null);var K=!1;if(u===null)K=!0;else switch(z){case"bigint":case"string":case"number":K=!0;break;case"object":switch(u.$$typeof){case e:case t:K=!0;break;case v:return K=u._init,G(K(u._payload),w,$,A,H)}}if(K)return H=H(u),K=A===""?"."+de(u,0):A,B(H)?($="",K!=null&&($=K.replace(_e,"$&/")+"/"),G(H,w,$,"",function(ae){return ae})):H!=null&&(te(H)&&(H=Z(H,$+(H.key==null||u&&u.key===H.key?"":(""+H.key).replace(_e,"$&/")+"/")+K)),w.push(H)),1;K=0;var ue=A===""?".":A+":";if(B(u))for(var ie=0;ie<u.length;ie++)A=u[ie],z=ue+de(A,ie),K+=G(A,w,$,z,H);else if(ie=y(u),typeof ie=="function")for(u=ie.call(u),ie=0;!(A=u.next()).done;)A=A.value,z=ue+de(A,ie++),K+=G(A,w,$,z,H);else if(z==="object"){if(typeof u.then=="function")return G(je(u),w,$,A,H);throw w=String(u),Error("Objects are not valid as a React child (found: "+(w==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":w)+"). If you meant to render a collection of children, use an array instead.")}return K}function we(u,w,$){if(u==null)return u;var A=[],H=0;return G(u,A,"","",function(z){return w.call($,z,H++)}),A}function Oe(u){if(u._status===-1){var w=u._result;w=w(),w.then(function($){(u._status===0||u._status===-1)&&(u._status=1,u._result=$)},function($){(u._status===0||u._status===-1)&&(u._status=2,u._result=$)}),u._status===-1&&(u._status=0,u._result=w)}if(u._status===1)return u._result.default;throw u._result}var Ee=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var w=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(w))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},he={map:we,forEach:function(u,w,$){we(u,function(){w.apply(this,arguments)},$)},count:function(u){var w=0;return we(u,function(){w++}),w},toArray:function(u){return we(u,function(w){return w})||[]},only:function(u){if(!te(u))throw Error("React.Children.only expected to receive a single React element child.");return u}};return F.Activity=E,F.Children=he,F.Component=C,F.Fragment=r,F.Profiler=n,F.PureComponent=N,F.StrictMode=a,F.Suspense=c,F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,F.__COMPILER_RUNTIME={__proto__:null,c:function(u){return _.H.useMemoCache(u)}},F.cache=function(u){return function(){return u.apply(null,arguments)}},F.cacheSignal=function(){return null},F.cloneElement=function(u,w,$){if(u==null)throw Error("The argument must be a React element, but you passed "+u+".");var A=M({},u.props),H=u.key;if(w!=null)for(z in w.key!==void 0&&(H=""+w.key),w)!Y.call(w,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&w.ref===void 0||(A[z]=w[z]);var z=arguments.length-2;if(z===1)A.children=$;else if(1<z){for(var K=Array(z),ue=0;ue<z;ue++)K[ue]=arguments[ue+2];A.children=K}return j(u.type,H,A)},F.createContext=function(u){return u={$$typeof:l,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null},u.Provider=u,u.Consumer={$$typeof:o,_context:u},u},F.createElement=function(u,w,$){var A,H={},z=null;if(w!=null)for(A in w.key!==void 0&&(z=""+w.key),w)Y.call(w,A)&&A!=="key"&&A!=="__self"&&A!=="__source"&&(H[A]=w[A]);var K=arguments.length-2;if(K===1)H.children=$;else if(1<K){for(var ue=Array(K),ie=0;ie<K;ie++)ue[ie]=arguments[ie+2];H.children=ue}if(u&&u.defaultProps)for(A in K=u.defaultProps,K)H[A]===void 0&&(H[A]=K[A]);return j(u,z,H)},F.createRef=function(){return{current:null}},F.forwardRef=function(u){return{$$typeof:s,render:u}},F.isValidElement=te,F.lazy=function(u){return{$$typeof:v,_payload:{_status:-1,_result:u},_init:Oe}},F.memo=function(u,w){return{$$typeof:f,type:u,compare:w===void 0?null:w}},F.startTransition=function(u){var w=_.T,$={};_.T=$;try{var A=u(),H=_.S;H!==null&&H($,A),typeof A=="object"&&A!==null&&typeof A.then=="function"&&A.then(h,Ee)}catch(z){Ee(z)}finally{w!==null&&$.types!==null&&(w.types=$.types),_.T=w}},F.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},F.use=function(u){return _.H.use(u)},F.useActionState=function(u,w,$){return _.H.useActionState(u,w,$)},F.useCallback=function(u,w){return _.H.useCallback(u,w)},F.useContext=function(u){return _.H.useContext(u)},F.useDebugValue=function(){},F.useDeferredValue=function(u,w){return _.H.useDeferredValue(u,w)},F.useEffect=function(u,w){return _.H.useEffect(u,w)},F.useEffectEvent=function(u){return _.H.useEffectEvent(u)},F.useId=function(){return _.H.useId()},F.useImperativeHandle=function(u,w,$){return _.H.useImperativeHandle(u,w,$)},F.useInsertionEffect=function(u,w){return _.H.useInsertionEffect(u,w)},F.useLayoutEffect=function(u,w){return _.H.useLayoutEffect(u,w)},F.useMemo=function(u,w){return _.H.useMemo(u,w)},F.useOptimistic=function(u,w){return _.H.useOptimistic(u,w)},F.useReducer=function(u,w,$){return _.H.useReducer(u,w,$)},F.useRef=function(u){return _.H.useRef(u)},F.useState=function(u){return _.H.useState(u)},F.useSyncExternalStore=function(u,w,$){return _.H.useSyncExternalStore(u,w,$)},F.useTransition=function(){return _.H.useTransition()},F.version="19.2.4",F}var er;function nn(){return er||(er=1,St.exports=rn()),St.exports}var p=nn();const an=tn(p),oo=en({__proto__:null,default:an},[p]);var tr="popstate";function on(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return Ze("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Le(n)}return sn(t,r,null,e)}function I(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ne(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ln(){return Math.random().toString(36).substring(2,10)}function rr(e,t){return{usr:e.state,key:e.key,idx:t}}function Ze(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Te(t):t,state:r,key:t&&t.key||a||ln()}}function Le({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Te(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function sn(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",c=null,f=v();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function v(){return(l.state||{idx:null}).idx}function E(){s="POP";let x=v(),C=x==null?null:x-f;f=x,c&&c({action:s,location:M.location,delta:C})}function R(x,C){s="PUSH";let T=Ze(M.location,x,C);f=v()+1;let N=rr(T,f),W=M.createHref(T);try{l.pushState(N,"",W)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;n.location.assign(W)}o&&c&&c({action:s,location:M.location,delta:1})}function y(x,C){s="REPLACE";let T=Ze(M.location,x,C);f=v();let N=rr(T,f),W=M.createHref(T);l.replaceState(N,"",W),o&&c&&c({action:s,location:M.location,delta:0})}function L(x){let C=n.location.origin!=="null"?n.location.origin:n.location.href,T=typeof x=="string"?x:Le(x);return T=T.replace(/ $/,"%20"),I(C,`No window.location.(origin|href) available to create URL for href: ${T}`),new URL(T,C)}let M={get action(){return s},get location(){return e(n,l)},listen(x){if(c)throw new Error("A history only accepts one active listener");return n.addEventListener(tr,E),c=x,()=>{n.removeEventListener(tr,E),c=null}},createHref(x){return t(n,x)},createURL:L,encodeLocation(x){let C=L(x);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:R,replace:y,go(x){return l.go(x)}};return M}var un=new Set(["lazy","caseSensitive","path","id","index","children"]);function cn(e){return e.index===!0}function mt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(I(n.index!==!0||!n.children,"Cannot specify children on an index route"),I(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),cn(n)){let c={...n,...t(n),id:s};return a[s]=c,c}else{let c={...n,...t(n),id:s,children:void 0};return a[s]=c,n.children&&(c.children=mt(n.children,t,l,a)),c}})}function Pe(e,t,r="/"){return ft(e,t,r,!1)}function ft(e,t,r,a){let n=typeof t=="string"?Te(t):t,o=pe(n.pathname||"/",r);if(o==null)return null;let l=Rr(e);dn(l);let s=null;for(let c=0;s==null&&c<l.length;++c){let f=xn(o);s=Rn(l[c],f,a)}return s}function fn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],handle:r.handle}}function Rr(e,t=[],r=[],a=""){let n=(o,l,s)=>{let c={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};c.relativePath.startsWith("/")&&(I(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length));let f=ge([a,c.relativePath]),v=r.concat(c);o.children&&o.children.length>0&&(I(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Rr(o.children,t,v,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:wn(f,o.index),routesMeta:v})};return e.forEach((o,l)=>{if(o.path===""||!o.path?.includes("?"))n(o,l);else for(let s of br(o.path))n(o,l,s)}),t}function br(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let l=br(a.join("/")),s=[];return s.push(...l.map(c=>c===""?o:[o,c].join("/"))),n&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function dn(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:En(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var hn=/^:[\w-]+$/,mn=3,pn=2,vn=1,yn=10,gn=-2,nr=e=>e==="*";function wn(e,t){let r=e.split("/"),a=r.length;return r.some(nr)&&(a+=gn),t&&(a+=pn),r.filter(n=>!nr(n)).reduce((n,o)=>n+(hn.test(o)?mn:o===""?vn:yn),a)}function En(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Rn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s<a.length;++s){let c=a[s],f=s===a.length-1,v=o==="/"?t:t.slice(o.length)||"/",E=pt({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},v),R=c.route;if(!E&&f&&r&&!a[a.length-1].route.index&&(E=pt({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},v)),!E)return null;Object.assign(n,E.params),l.push({params:n,pathname:ge([o,E.pathname]),pathnameBase:Pn(ge([o,E.pathnameBase])),route:R}),E.pathnameBase!=="/"&&(o=ge([o,E.pathnameBase]))}return l}function pt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=bn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],l=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((f,{paramName:v,isOptional:E},R)=>{if(v==="*"){let L=s[R]||"";l=o.slice(0,o.length-L.length).replace(/(.)\/+$/,"$1")}const y=s[R];return E&&!y?f[v]=void 0:f[v]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function bn(e,t=!1,r=!0){ne(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,c)=>(a.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function xn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ne(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function pe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Cn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Te(e):e;return{pathname:r?r.startsWith("/")?r:Sn(r,t):t,search:Ln(a),hash:Tn(n)}}function Sn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Pt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function yt(e){let t=xr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function gt(e,t,r,a=!1){let n;typeof e=="string"?n=Te(e):(n={...e},I(!n.pathname||!n.pathname.includes("?"),Pt("?","pathname","search",n)),I(!n.pathname||!n.pathname.includes("#"),Pt("#","pathname","hash",n)),I(!n.search||!n.search.includes("#"),Pt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let E=t.length-1;if(!a&&l.startsWith("..")){let R=l.split("/");for(;R[0]==="..";)R.shift(),E-=1;n.pathname=R.join("/")}s=E>=0?t[E]:"/"}let c=Cn(n,s),f=l&&l!=="/"&&l.endsWith("/"),v=(o||l===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(f||v)&&(c.pathname+="/"),c}var ge=e=>e.join("/").replace(/\/\/+/g,"/"),Pn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ln=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Cr=["POST","PUT","PATCH","DELETE"],Dn=new Set(Cr),Mn=["GET",...Cr],_n=new Set(Mn),On=new Set([301,302,303,307,308]),$n=new Set([307,308]),Lt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},An={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ge={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$t=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Sr="remix-router-transitions",Pr=Symbol("ResetLoaderData");function kn(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";I(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.mapRouteProperties||Nn,n={},o=mt(e.routes,a,void 0,n),l,s=e.basename||"/",c=e.dataStrategy||In,f=e.patchRoutesOnNavigation,v={...e.future},E=null,R=new Set,y=null,L=null,M=null,x=e.hydrationData!=null,C=Pe(o,e.history.location,s),T=!1,N=null;if(C==null&&!f){let i=ce(404,{pathname:e.history.location.pathname}),{matches:d,route:m}=mr(o);C=d,N={[m.id]:i}}C&&!e.hydrationData&&at(C,o,e.history.location.pathname).active&&(C=null);let W;if(C)if(C.some(i=>i.route.lazy))W=!1;else if(!C.some(i=>i.route.loader))W=!0;else{let i=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null;if(d){let m=C.findIndex(g=>d[g.route.id]!==void 0);W=C.slice(0,m+1).every(g=>!_t(g.route,i,d))}else W=C.every(m=>!_t(m.route,i,d))}else{W=!1,C=[];let i=at(null,o,e.history.location.pathname);i.active&&i.matches&&(T=!0,C=i.matches)}let B,h={historyAction:e.history.action,location:e.history.location,matches:C,initialized:W,navigation:Lt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},_="POP",Y=!1,j,Z=!1,te=new Map,Me=null,_e=!1,de=!1,je=new Set,G=new Map,we=0,Oe=-1,Ee=new Map,he=new Set,u=new Map,w=new Map,$=new Set,A=new Map,H,z=null;function K(){if(E=e.history.listen(({action:i,location:d,delta:m})=>{if(H){H(),H=void 0;return}ne(A.size===0||m!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let g=Gt({currentLocation:h.location,nextLocation:d,historyAction:i});if(g&&m!=null){let S=new Promise(O=>{H=O});e.history.go(m*-1),nt(g,{state:"blocked",location:d,proceed(){nt(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),S.then(()=>e.history.go(m))},reset(){let O=new Map(h.blockers);O.set(g,Ge),ae({blockers:O})}});return}return $e(i,d)}),r){Qn(t,te);let i=()=>Zn(t,te);t.addEventListener("pagehide",i),Me=()=>t.removeEventListener("pagehide",i)}return h.initialized||$e("POP",h.location,{initialHydration:!0}),B}function ue(){E&&E(),Me&&Me(),R.clear(),j&&j.abort(),h.fetchers.forEach((i,d)=>bt(d)),h.blockers.forEach((i,d)=>Jt(d))}function ie(i){return R.add(i),()=>R.delete(i)}function ae(i,d={}){h={...h,...i};let m=[],g=[];h.fetchers.forEach((S,O)=>{S.state==="idle"&&($.has(O)?m.push(O):g.push(O))}),$.forEach(S=>{!h.fetchers.has(S)&&!G.has(S)&&m.push(S)}),[...R].forEach(S=>S(h,{deletedFetchers:m,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),m.forEach(S=>bt(S)),g.forEach(S=>h.fetchers.delete(S))}function He(i,d,{flushSync:m}={}){let g=h.actionData!=null&&h.navigation.formMethod!=null&&me(h.navigation.formMethod)&&h.navigation.state==="loading"&&i.state?._isRedirect!==!0,S;d.actionData?Object.keys(d.actionData).length>0?S=d.actionData:S=null:g?S=h.actionData:S=null;let O=d.loaderData?dr(h.loaderData,d.loaderData,d.matches||[],d.errors):h.loaderData,k=h.blockers;k.size>0&&(k=new Map(k),k.forEach((b,U)=>k.set(U,Ge)));let P=Y===!0||h.navigation.formMethod!=null&&me(h.navigation.formMethod)&&i.state?._isRedirect!==!0;l&&(o=l,l=void 0),_e||_==="POP"||(_==="PUSH"?e.history.push(i,i.state):_==="REPLACE"&&e.history.replace(i,i.state));let D;if(_==="POP"){let b=te.get(h.location.pathname);b&&b.has(i.pathname)?D={currentLocation:h.location,nextLocation:i}:te.has(i.pathname)&&(D={currentLocation:i,nextLocation:h.location})}else if(Z){let b=te.get(h.location.pathname);b?b.add(i.pathname):(b=new Set([i.pathname]),te.set(h.location.pathname,b)),D={currentLocation:h.location,nextLocation:i}}ae({...d,actionData:S,loaderData:O,historyAction:_,location:i,initialized:!0,navigation:Lt,revalidation:"idle",restoreScrollPosition:Xt(i,d.matches||h.matches),preventScrollReset:P,blockers:k},{viewTransitionOpts:D,flushSync:m===!0}),_="POP",Y=!1,Z=!1,_e=!1,de=!1,z?.resolve(),z=null}async function It(i,d){if(typeof i=="number"){e.history.go(i);return}let m=Mt(h.location,h.matches,s,i,d?.fromRouteId,d?.relative),{path:g,submission:S,error:O}=ar(!1,m,d),k=h.location,P=Ze(h.location,g,d&&d.state);P={...P,...e.history.encodeLocation(P)};let D=d&&d.replace!=null?d.replace:void 0,b="PUSH";D===!0?b="REPLACE":D===!1||S!=null&&me(S.formMethod)&&S.formAction===h.location.pathname+h.location.search&&(b="REPLACE");let U=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,V=(d&&d.flushSync)===!0,Q=Gt({currentLocation:k,nextLocation:P,historyAction:b});if(Q){nt(Q,{state:"blocked",location:P,proceed(){nt(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),It(i,d)},reset(){let oe=new Map(h.blockers);oe.set(Q,Ge),ae({blockers:oe})}});return}await $e(b,P,{submission:S,pendingError:O,preventScrollReset:U,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:V})}function Hr(){z||(z=ea()),Rt(),ae({revalidation:"loading"});let i=z.promise;return h.navigation.state==="submitting"?i:h.navigation.state==="idle"?($e(h.historyAction,h.location,{startUninterruptedRevalidation:!0}),i):($e(_||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation,enableViewTransition:Z===!0}),i)}async function $e(i,d,m){j&&j.abort(),j=null,_=i,_e=(m&&m.startUninterruptedRevalidation)===!0,qr(h.location,h.matches),Y=(m&&m.preventScrollReset)===!0,Z=(m&&m.enableViewTransition)===!0;let g=l||o,S=m&&m.overrideNavigation,O=m?.initialHydration&&h.matches&&h.matches.length>0&&!T?h.matches:Pe(g,d,s),k=(m&&m.flushSync)===!0;if(O&&h.initialized&&!de&&Kn(h.location,d)&&!(m&&m.submission&&me(m.submission.formMethod))){He(d,{matches:O},{flushSync:k});return}let P=at(O,g,d.pathname);if(P.active&&P.matches&&(O=P.matches),!O){let{error:X,notFoundMatches:q,route:re}=xt(d.pathname);He(d,{matches:q,loaderData:{},errors:{[re.id]:X}},{flushSync:k});return}j=new AbortController;let D=Be(e.history,d,j.signal,m&&m.submission),b;if(m&&m.pendingError)b=[ke(O).route.id,{type:"error",error:m.pendingError}];else if(m&&m.submission&&me(m.submission.formMethod)){let X=await Ir(D,d,m.submission,O,P.active,{replace:m.replace,flushSync:k});if(X.shortCircuited)return;if(X.pendingActionResult){let[q,re]=X.pendingActionResult;if(se(re)&&et(re.error)&&re.error.status===404){j=null,He(d,{matches:X.matches,loaderData:{},errors:{[q]:re.error}});return}}O=X.matches||O,b=X.pendingActionResult,S=Tt(d,m.submission),k=!1,P.active=!1,D=Be(e.history,D.url,D.signal)}let{shortCircuited:U,matches:V,loaderData:Q,errors:oe}=await zr(D,d,O,P.active,S,m&&m.submission,m&&m.fetcherSubmission,m&&m.replace,m&&m.initialHydration===!0,k,b);U||(j=null,He(d,{matches:V||O,...hr(b),loaderData:Q,errors:oe}))}async function Ir(i,d,m,g,S,O={}){Rt();let k=qn(d,m);if(ae({navigation:k},{flushSync:O.flushSync===!0}),S){let b=await ot(g,d.pathname,i.signal);if(b.type==="aborted")return{shortCircuited:!0};if(b.type==="error"){let U=ke(b.partialMatches).route.id;return{matches:b.partialMatches,pendingActionResult:[U,{type:"error",error:b.error}]}}else if(b.matches)g=b.matches;else{let{notFoundMatches:U,error:V,route:Q}=xt(d.pathname);return{matches:U,pendingActionResult:[Q.id,{type:"error",error:V}]}}}let P,D=Qe(g,d);if(!D.route.action&&!D.route.lazy)P={type:"error",error:ce(405,{method:i.method,pathname:d.pathname,routeId:D.route.id})};else if(P=(await Ye("action",h,i,[D],g,null))[D.route.id],i.signal.aborted)return{shortCircuited:!0};if(Fe(P)){let b;return O&&O.replace!=null?b=O.replace:b=ur(P.response.headers.get("Location"),new URL(i.url),s)===h.location.pathname+h.location.search,await Ae(i,P,!0,{submission:m,replace:b}),{shortCircuited:!0}}if(se(P)){let b=ke(g,D.route.id);return(O&&O.replace)!==!0&&(_="PUSH"),{matches:g,pendingActionResult:[b.route.id,P]}}return{matches:g,pendingActionResult:[D.route.id,P]}}async function zr(i,d,m,g,S,O,k,P,D,b,U){let V=S||Tt(d,O),Q=O||k||vr(V),oe=!_e&&!D;if(g){if(oe){let le=zt(U);ae({navigation:V,...le!==void 0?{actionData:le}:{}},{flushSync:b})}let J=await ot(m,d.pathname,i.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let le=ke(J.partialMatches).route.id;return{matches:J.partialMatches,loaderData:{},errors:{[le]:J.error}}}else if(J.matches)m=J.matches;else{let{error:le,notFoundMatches:st,route:Je}=xt(d.pathname);return{matches:st,loaderData:{},errors:{[Je.id]:le}}}}let X=l||o,[q,re]=ir(e.history,h,m,Q,d,D===!0,de,je,$,u,he,X,s,U);if(Oe=++we,q.length===0&&re.length===0){let J=Vt();return He(d,{matches:m,loaderData:{},errors:U&&se(U[1])?{[U[0]]:U[1].error}:null,...hr(U),...J?{fetchers:new Map(h.fetchers)}:{}},{flushSync:b}),{shortCircuited:!0}}if(oe){let J={};if(!g){J.navigation=V;let le=zt(U);le!==void 0&&(J.actionData=le)}re.length>0&&(J.fetchers=Br(re)),ae(J,{flushSync:b})}re.forEach(J=>{Ce(J.key),J.controller&&G.set(J.key,J.controller)});let Ie=()=>re.forEach(J=>Ce(J.key));j&&j.signal.addEventListener("abort",Ie);let{loaderResults:Ve,fetcherResults:be}=await Bt(h,m,q,re,i);if(i.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Ie),re.forEach(J=>G.delete(J.key));let ye=ut(Ve);if(ye)return await Ae(i,ye.result,!0,{replace:P}),{shortCircuited:!0};if(ye=ut(be),ye)return he.add(ye.key),await Ae(i,ye.result,!0,{replace:P}),{shortCircuited:!0};let{loaderData:Ct,errors:Ke}=fr(h,m,Ve,U,re,be);D&&h.errors&&(Ke={...h.errors,...Ke});let Ne=Vt(),it=Kt(Oe),lt=Ne||it||re.length>0;return{matches:m,loaderData:Ct,errors:Ke,...lt?{fetchers:new Map(h.fetchers)}:{}}}function zt(i){if(i&&!se(i[1]))return{[i[0]]:i[1].data};if(h.actionData)return Object.keys(h.actionData).length===0?null:h.actionData}function Br(i){return i.forEach(d=>{let m=h.fetchers.get(d.key),g=qe(void 0,m?m.data:void 0);h.fetchers.set(d.key,g)}),new Map(h.fetchers)}async function Wr(i,d,m,g){Ce(i);let S=(g&&g.flushSync)===!0,O=l||o,k=Mt(h.location,h.matches,s,m,d,g?.relative),P=Pe(O,k,s),D=at(P,O,k);if(D.active&&D.matches&&(P=D.matches),!P){Re(i,d,ce(404,{pathname:k}),{flushSync:S});return}let{path:b,submission:U,error:V}=ar(!0,k,g);if(V){Re(i,d,V,{flushSync:S});return}let Q=Qe(P,b),oe=(g&&g.preventScrollReset)===!0;if(U&&me(U.formMethod)){await Yr(i,d,b,Q,P,D.active,S,oe,U);return}u.set(i,{routeId:d,path:b}),await Vr(i,d,b,Q,P,D.active,S,oe,U)}async function Yr(i,d,m,g,S,O,k,P,D){Rt(),u.delete(i);function b(ee){if(!ee.route.action&&!ee.route.lazy){let ze=ce(405,{method:D.formMethod,pathname:m,routeId:d});return Re(i,d,ze,{flushSync:k}),!0}return!1}if(!O&&b(g))return;let U=h.fetchers.get(i);xe(i,Xn(D,U),{flushSync:k});let V=new AbortController,Q=Be(e.history,m,V.signal,D);if(O){let ee=await ot(S,m,Q.signal);if(ee.type==="aborted")return;if(ee.type==="error"){Re(i,d,ee.error,{flushSync:k});return}else if(ee.matches){if(S=ee.matches,g=Qe(S,m),b(g))return}else{Re(i,d,ce(404,{pathname:m}),{flushSync:k});return}}G.set(i,V);let oe=we,q=(await Ye("action",h,Q,[g],S,i))[g.route.id];if(Q.signal.aborted){G.get(i)===V&&G.delete(i);return}if($.has(i)){if(Fe(q)||se(q)){xe(i,Se(void 0));return}}else{if(Fe(q))if(G.delete(i),Oe>oe){xe(i,Se(void 0));return}else return he.add(i),xe(i,qe(D)),Ae(Q,q,!1,{fetcherSubmission:D,preventScrollReset:P});if(se(q)){Re(i,d,q.error);return}}let re=h.navigation.location||h.location,Ie=Be(e.history,re,V.signal),Ve=l||o,be=h.navigation.state!=="idle"?Pe(Ve,h.navigation.location,s):h.matches;I(be,"Didn't find any matches after fetcher action");let ye=++we;Ee.set(i,ye);let Ct=qe(D,q.data);h.fetchers.set(i,Ct);let[Ke,Ne]=ir(e.history,h,be,D,re,!1,de,je,$,u,he,Ve,s,[g.route.id,q]);Ne.filter(ee=>ee.key!==i).forEach(ee=>{let ze=ee.key,Qt=h.fetchers.get(ze),Zr=qe(void 0,Qt?Qt.data:void 0);h.fetchers.set(ze,Zr),Ce(ze),ee.controller&&G.set(ze,ee.controller)}),ae({fetchers:new Map(h.fetchers)});let it=()=>Ne.forEach(ee=>Ce(ee.key));V.signal.addEventListener("abort",it);let{loaderResults:lt,fetcherResults:J}=await Bt(h,be,Ke,Ne,Ie);if(V.signal.aborted)return;V.signal.removeEventListener("abort",it),Ee.delete(i),G.delete(i),Ne.forEach(ee=>G.delete(ee.key));let le=ut(lt);if(le)return Ae(Ie,le.result,!1,{preventScrollReset:P});if(le=ut(J),le)return he.add(le.key),Ae(Ie,le.result,!1,{preventScrollReset:P});let{loaderData:st,errors:Je}=fr(h,be,lt,void 0,Ne,J);if(h.fetchers.has(i)){let ee=Se(q.data);h.fetchers.set(i,ee)}Kt(ye),h.navigation.state==="loading"&&ye>Oe?(I(_,"Expected pending action"),j&&j.abort(),He(h.navigation.location,{matches:be,loaderData:st,errors:Je,fetchers:new Map(h.fetchers)})):(ae({errors:Je,loaderData:dr(h.loaderData,st,be,Je),fetchers:new Map(h.fetchers)}),de=!1)}async function Vr(i,d,m,g,S,O,k,P,D){let b=h.fetchers.get(i);xe(i,qe(D,b?b.data:void 0),{flushSync:k});let U=new AbortController,V=Be(e.history,m,U.signal);if(O){let q=await ot(S,m,V.signal);if(q.type==="aborted")return;if(q.type==="error"){Re(i,d,q.error,{flushSync:k});return}else if(q.matches)S=q.matches,g=Qe(S,m);else{Re(i,d,ce(404,{pathname:m}),{flushSync:k});return}}G.set(i,U);let Q=we,X=(await Ye("loader",h,V,[g],S,i))[g.route.id];if(G.get(i)===U&&G.delete(i),!V.signal.aborted){if($.has(i)){xe(i,Se(void 0));return}if(Fe(X))if(Oe>Q){xe(i,Se(void 0));return}else{he.add(i),await Ae(V,X,!1,{preventScrollReset:P});return}if(se(X)){Re(i,d,X.error);return}xe(i,Se(X.data))}}async function Ae(i,d,m,{submission:g,fetcherSubmission:S,preventScrollReset:O,replace:k}={}){d.response.headers.has("X-Remix-Revalidate")&&(de=!0);let P=d.response.headers.get("Location");I(P,"Expected a Location header on the redirect Response"),P=ur(P,new URL(i.url),s);let D=Ze(h.location,P,{_isRedirect:!0});if(r){let X=!1;if(d.response.headers.has("X-Remix-Reload-Document"))X=!0;else if($t.test(P)){const q=e.history.createURL(P);X=q.origin!==t.location.origin||pe(q.pathname,s)==null}if(X){k?t.location.replace(P):t.location.assign(P);return}}j=null;let b=k===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:U,formAction:V,formEncType:Q}=h.navigation;!g&&!S&&U&&V&&Q&&(g=vr(h.navigation));let oe=g||S;if($n.has(d.response.status)&&oe&&me(oe.formMethod))await $e(b,D,{submission:{...oe,formAction:P},preventScrollReset:O||Y,enableViewTransition:m?Z:void 0});else{let X=Tt(D,g);await $e(b,D,{overrideNavigation:X,fetcherSubmission:S,preventScrollReset:O||Y,enableViewTransition:m?Z:void 0})}}async function Ye(i,d,m,g,S,O){let k,P={};try{k=await zn(c,i,d,m,g,S,O,n,a)}catch(D){return g.forEach(b=>{P[b.route.id]={type:"error",error:D}}),P}for(let[D,b]of Object.entries(k))if(Jn(b)){let U=b.result;P[D]={type:"redirect",response:Yn(U,m,D,S,s)}}else P[D]=await Wn(b);return P}async function Bt(i,d,m,g,S){let O=Ye("loader",i,S,m,d,null),k=Promise.all(g.map(async b=>{if(b.matches&&b.match&&b.controller){let V=(await Ye("loader",i,Be(e.history,b.path,b.controller.signal),[b.match],b.matches,b.key))[b.match.route.id];return{[b.key]:V}}else return Promise.resolve({[b.key]:{type:"error",error:ce(404,{pathname:b.path})}})})),P=await O,D=(await k).reduce((b,U)=>Object.assign(b,U),{});return{loaderResults:P,fetcherResults:D}}function Rt(){de=!0,u.forEach((i,d)=>{G.has(d)&&je.add(d),Ce(d)})}function xe(i,d,m={}){h.fetchers.set(i,d),ae({fetchers:new Map(h.fetchers)},{flushSync:(m&&m.flushSync)===!0})}function Re(i,d,m,g={}){let S=ke(h.matches,d);bt(i),ae({errors:{[S.route.id]:m},fetchers:new Map(h.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function Wt(i){return w.set(i,(w.get(i)||0)+1),$.has(i)&&$.delete(i),h.fetchers.get(i)||An}function bt(i){let d=h.fetchers.get(i);G.has(i)&&!(d&&d.state==="loading"&&Ee.has(i))&&Ce(i),u.delete(i),Ee.delete(i),he.delete(i),$.delete(i),je.delete(i),h.fetchers.delete(i)}function Kr(i){let d=(w.get(i)||0)-1;d<=0?(w.delete(i),$.add(i)):w.set(i,d),ae({fetchers:new Map(h.fetchers)})}function Ce(i){let d=G.get(i);d&&(d.abort(),G.delete(i))}function Yt(i){for(let d of i){let m=Wt(d),g=Se(m.data);h.fetchers.set(d,g)}}function Vt(){let i=[],d=!1;for(let m of he){let g=h.fetchers.get(m);I(g,`Expected fetcher: ${m}`),g.state==="loading"&&(he.delete(m),i.push(m),d=!0)}return Yt(i),d}function Kt(i){let d=[];for(let[m,g]of Ee)if(g<i){let S=h.fetchers.get(m);I(S,`Expected fetcher: ${m}`),S.state==="loading"&&(Ce(m),Ee.delete(m),d.push(m))}return Yt(d),d.length>0}function Jr(i,d){let m=h.blockers.get(i)||Ge;return A.get(i)!==d&&A.set(i,d),m}function Jt(i){h.blockers.delete(i),A.delete(i)}function nt(i,d){let m=h.blockers.get(i)||Ge;I(m.state==="unblocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="proceeding"||m.state==="blocked"&&d.state==="unblocked"||m.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${m.state} -> ${d.state}`);let g=new Map(h.blockers);g.set(i,d),ae({blockers:g})}function Gt({currentLocation:i,nextLocation:d,historyAction:m}){if(A.size===0)return;A.size>1&&ne(!1,"A router only supports one blocker at a time");let g=Array.from(A.entries()),[S,O]=g[g.length-1],k=h.blockers.get(S);if(!(k&&k.state==="proceeding")&&O({currentLocation:i,nextLocation:d,historyAction:m}))return S}function xt(i){let d=ce(404,{pathname:i}),m=l||o,{matches:g,route:S}=mr(m);return{notFoundMatches:g,route:S,error:d}}function Gr(i,d,m){if(y=i,M=d,L=m||null,!x&&h.navigation===Lt){x=!0;let g=Xt(h.location,h.matches);g!=null&&ae({restoreScrollPosition:g})}return()=>{y=null,M=null,L=null}}function qt(i,d){return L&&L(i,d.map(g=>fn(g,h.loaderData)))||i.key}function qr(i,d){if(y&&M){let m=qt(i,d);y[m]=M()}}function Xt(i,d){if(y){let m=qt(i,d),g=y[m];if(typeof g=="number")return g}return null}function at(i,d,m){if(f)if(i){if(Object.keys(i[0].params).length>0)return{active:!0,matches:ft(d,m,s,!0)}}else return{active:!0,matches:ft(d,m,s,!0)||[]};return{active:!1,matches:null}}async function ot(i,d,m){if(!f)return{type:"success",matches:i};let g=i;for(;;){let S=l==null,O=l||o,k=n;try{await f({path:d,matches:g,patch:(b,U)=>{m.aborted||sr(b,U,O,k,a)}})}catch(b){return{type:"error",error:b,partialMatches:g}}finally{S&&!m.aborted&&(o=[...o])}if(m.aborted)return{type:"aborted"};let P=Pe(O,d,s);if(P)return{type:"success",matches:P};let D=ft(O,d,s,!0);if(!D||g.length===D.length&&g.every((b,U)=>b.route.id===D[U].route.id))return{type:"success",matches:null};g=D}}function Xr(i){n={},l=mt(i,a,void 0,n)}function Qr(i,d){let m=l==null;sr(i,d,l||o,n,a),m&&(o=[...o],ae({}))}return B={get basename(){return s},get future(){return v},get state(){return h},get routes(){return o},get window(){return t},initialize:K,subscribe:ie,enableScrollRestoration:Gr,navigate:It,fetch:Wr,revalidate:Hr,createHref:i=>e.history.createHref(i),encodeLocation:i=>e.history.encodeLocation(i),getFetcher:Wt,deleteFetcher:Kr,dispose:ue,getBlocker:Jr,deleteBlocker:Jt,patchRoutes:Qr,_internalFetchControllers:G,_internalSetRoutes:Xr},B}function Fn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Mt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let f of t)if(l.push(f),f.route.id===n){s=f;break}}else l=t,s=t[t.length-1];let c=gt(a||".",yt(l),pe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&s){let f=At(c.search);if(s.route.index&&!f)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&f){let v=new URLSearchParams(c.search),E=v.getAll("index");v.delete("index"),E.filter(y=>y).forEach(y=>v.append("index",y));let R=v.toString();c.search=R?`?${R}`:""}}return r!=="/"&&(c.pathname=c.pathname==="/"?r:ge([r,c.pathname])),Le(c)}function ar(e,t,r){if(!r||!Fn(r))return{path:t};if(r.formMethod&&!Gn(r.formMethod))return{path:t,error:ce(405,{method:r.formMethod})};let a=()=>({path:t,error:ce(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Tr(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!me(o))return a();let E=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((R,[y,L])=>`${R}${y}=${L}
2
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:E}}}else if(r.formEncType==="application/json"){if(!me(o))return a();try{let E=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}I(typeof FormData=="function","FormData is not available in this environment");let s,c;if(r.formData)s=Ot(r.formData),c=r.formData;else if(r.body instanceof FormData)s=Ot(r.body),c=r.body;else if(r.body instanceof URLSearchParams)s=r.body,c=cr(s);else if(r.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(r.body),c=cr(s)}catch{return a()}let f={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(me(f.formMethod))return{path:t,submission:f};let v=Te(t);return e&&v.search&&At(v.search)&&s.append("index",""),v.search=`?${s}`,{path:Le(v),submission:f}}function or(e,t,r=!1){let a=e.findIndex(n=>n.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function ir(e,t,r,a,n,o,l,s,c,f,v,E,R,y){let L=y?se(y[1])?y[1].error:y[1].data:void 0,M=e.createURL(t.location),x=e.createURL(n),C=r;o&&t.errors?C=or(r,Object.keys(t.errors)[0],!0):y&&se(y[1])&&(C=or(r,y[0]));let T=y?y[1].statusCode:void 0,N=T&&T>=400,W=C.filter((h,_)=>{let{route:Y}=h;if(Y.lazy)return!0;if(Y.loader==null)return!1;if(o)return _t(Y,t.loaderData,t.errors);if(Un(t.loaderData,t.matches[_],h))return!0;let j=t.matches[_],Z=h;return lr(h,{currentUrl:M,currentParams:j.params,nextUrl:x,nextParams:Z.params,...a,actionResult:L,actionStatus:T,defaultShouldRevalidate:N?!1:l||M.pathname+M.search===x.pathname+x.search||M.search!==x.search||jn(j,Z)})}),B=[];return f.forEach((h,_)=>{if(o||!r.some(Me=>Me.route.id===h.routeId)||c.has(_))return;let Y=Pe(E,h.path,R);if(!Y){B.push({key:_,routeId:h.routeId,path:h.path,matches:null,match:null,controller:null});return}let j=t.fetchers.get(_),Z=Qe(Y,h.path),te=!1;v.has(_)?te=!1:s.has(_)?(s.delete(_),te=!0):j&&j.state!=="idle"&&j.data===void 0?te=l:te=lr(Z,{currentUrl:M,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:r[r.length-1].params,...a,actionResult:L,actionStatus:T,defaultShouldRevalidate:N?!1:l}),te&&B.push({key:_,routeId:h.routeId,path:h.path,matches:Y,match:Z,controller:new AbortController})}),[W,B]}function _t(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&t[e.id]!==void 0,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function Un(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function jn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function lr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function sr(e,t,r,a,n){let o;if(e){let c=a[e];I(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),o=c.children}else o=r;let l=t.filter(c=>!o.some(f=>Lr(c,f))),s=mt(l,n,[e||"_","patch",String(o?.length||"0")],a);o.push(...s)}function Lr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>t.children?.some(n=>Lr(r,n))):!1}async function Hn(e,t,r){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let n=r[e.id];I(n,"No route found in manifest");let o={};for(let l in a){let c=n[l]!==void 0&&l!=="hasErrorBoundary";ne(!c,`Route "${n.id}" has a static property "${l}" defined but its lazy function is also returning a value for this property. The lazy route property "${l}" will be ignored.`),!c&&!un.has(l)&&(o[l]=a[l])}Object.assign(n,o),Object.assign(n,{...t(n),lazy:void 0})}async function In({matches:e}){let t=e.filter(a=>a.shouldLoad);return(await Promise.all(t.map(a=>a.resolve()))).reduce((a,n,o)=>Object.assign(a,{[t[o].route.id]:n}),{})}async function zn(e,t,r,a,n,o,l,s,c,f){let v=o.map(y=>y.route.lazy?Hn(y.route,c,s):void 0),E=o.map((y,L)=>{let M=v[L],x=n.some(T=>T.route.id===y.route.id);return{...y,shouldLoad:x,resolve:async T=>(T&&a.method==="GET"&&(y.route.lazy||y.route.loader)&&(x=!0),x?Bn(t,a,y,M,T,f):Promise.resolve({type:"data",result:void 0}))}}),R=await e({matches:E,request:a,params:o[0].params,fetcherKey:l,context:f});try{await Promise.all(v)}catch{}return R}async function Bn(e,t,r,a,n,o){let l,s,c=f=>{let v,E=new Promise((L,M)=>v=M);s=()=>v(),t.signal.addEventListener("abort",s);let R=L=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):f({request:t,params:r.params,context:o},...L!==void 0?[L]:[]),y=(async()=>{try{return{type:"data",result:await(n?n(M=>R(M)):R())}}catch(L){return{type:"error",result:L}}})();return Promise.race([y,E])};try{let f=r.route[e];if(a)if(f){let v,[E]=await Promise.all([c(f).catch(R=>{v=R}),a]);if(v!==void 0)throw v;l=E}else if(await a,f=r.route[e],f)l=await c(f);else if(e==="action"){let v=new URL(t.url),E=v.pathname+v.search;throw ce(405,{method:t.method,pathname:E,routeId:r.route.id})}else return{type:"data",result:void 0};else if(f)l=await c(f);else{let v=new URL(t.url),E=v.pathname+v.search;throw ce(404,{pathname:E})}}catch(f){return{type:"error",result:f}}finally{s&&t.signal.removeEventListener("abort",s)}return l}async function Wn(e){let{result:t,type:r}=e;if(Dr(t)){let a;try{let n=t.headers.get("Content-Type");n&&/\bapplication\/json\b/.test(n)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new vt(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?pr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new vt(t.init?.status||500,void 0,t.data),statusCode:et(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:et(t)?t.status:void 0}:pr(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Yn(e,t,r,a,n){let o=e.headers.get("Location");if(I(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!$t.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Mt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function ur(e,t,r){if($t.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=pe(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Be(e,t,r,a){let n=e.createURL(Tr(t)).toString(),o={signal:r};if(a&&me(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=Ot(a.formData):o.body=a.formData}return new Request(n,o)}function Ot(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function cr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Vn(e,t,r,a=!1,n=!1){let o={},l=null,s,c=!1,f={},v=r&&se(r[1])?r[1].error:void 0;return e.forEach(E=>{if(!(E.route.id in t))return;let R=E.route.id,y=t[R];if(I(!Fe(y),"Cannot handle redirect results in processLoaderData"),se(y)){let L=y.error;if(v!==void 0&&(L=v,v=void 0),l=l||{},n)l[R]=L;else{let M=ke(e,R);l[M.route.id]==null&&(l[M.route.id]=L)}a||(o[R]=Pr),c||(c=!0,s=et(y.error)?y.error.status:500),y.headers&&(f[R]=y.headers)}else o[R]=y.data,y.statusCode&&y.statusCode!==200&&!c&&(s=y.statusCode),y.headers&&(f[R]=y.headers)}),v!==void 0&&r&&(l={[r[0]]:v},o[r[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:f}}function fr(e,t,r,a,n,o){let{loaderData:l,errors:s}=Vn(t,r,a);return n.forEach(c=>{let{key:f,match:v,controller:E}=c,R=o[f];if(I(R,"Did not find corresponding fetcher result"),!(E&&E.signal.aborted))if(se(R)){let y=ke(e.matches,v?.route.id);s&&s[y.route.id]||(s={...s,[y.route.id]:R.error}),e.fetchers.delete(f)}else if(Fe(R))I(!1,"Unhandled fetcher revalidation redirect");else{let y=Se(R.data);e.fetchers.set(f,y)}}),{loaderData:l,errors:s}}function dr(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Pr).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function hr(e){return e?se(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ke(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function mr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ce(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(s=`Invalid request method "${a.toUpperCase()}"`)),new vt(e||500,l,new Error(s),!0)}function ut(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Fe(n))return{key:a,result:n}}}function Tr(e){let t=typeof e=="string"?Te(e):e;return Le({...t,hash:""})}function Kn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Jn(e){return Dr(e.result)&&On.has(e.result.status)}function se(e){return e.type==="error"}function Fe(e){return(e&&e.type)==="redirect"}function pr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Dr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Gn(e){return _n.has(e.toUpperCase())}function me(e){return Dn.has(e.toUpperCase())}function At(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qe(e,t){let r=typeof t=="string"?Te(t).search:t.search;if(e[e.length-1].route.index&&At(r||""))return e[e.length-1];let a=xr(e);return a[a.length-1]}function vr(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Tt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function qn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Xn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Se(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Qn(e,t){try{let r=e.sessionStorage.getItem(Sr);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function Zn(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Sr,JSON.stringify(r))}catch(a){ne(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function ea(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ue=p.createContext(null);Ue.displayName="DataRouter";var tt=p.createContext(null);tt.displayName="DataRouterState";var Nt=p.createContext({isTransitioning:!1});Nt.displayName="ViewTransition";var Mr=p.createContext(new Map);Mr.displayName="Fetchers";var ta=p.createContext(null);ta.displayName="Await";var ve=p.createContext(null);ve.displayName="Navigation";var wt=p.createContext(null);wt.displayName="Location";var fe=p.createContext({outlet:null,matches:[],isDataRoute:!1});fe.displayName="Route";var kt=p.createContext(null);kt.displayName="RouteError";function ra(e,{relative:t}={}){I(We(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=p.useContext(ve),{hash:n,pathname:o,search:l}=rt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:ge([r,o])),a.createHref({pathname:s,search:l,hash:n})}function We(){return p.useContext(wt)!=null}function De(){return I(We(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(wt).location}var _r="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Or(e){p.useContext(ve).static||p.useLayoutEffect(e)}function $r(){let{isDataRoute:e}=p.useContext(fe);return e?ya():na()}function na(){I(We(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Ue),{basename:t,navigator:r}=p.useContext(ve),{matches:a}=p.useContext(fe),{pathname:n}=De(),o=JSON.stringify(yt(a)),l=p.useRef(!1);return Or(()=>{l.current=!0}),p.useCallback((c,f={})=>{if(ne(l.current,_r),!l.current)return;if(typeof c=="number"){r.go(c);return}let v=gt(c,JSON.parse(o),n,f.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:ge([t,v.pathname])),(f.replace?r.replace:r.push)(v,f.state,f)},[t,r,o,n,e])}var aa=p.createContext(null);function oa(e){let t=p.useContext(fe).outlet;return t&&p.createElement(aa.Provider,{value:e},t)}function io(){let{matches:e}=p.useContext(fe),t=e[e.length-1];return t?t.params:{}}function rt(e,{relative:t}={}){let{matches:r}=p.useContext(fe),{pathname:a}=De(),n=JSON.stringify(yt(r));return p.useMemo(()=>gt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function ia(e,t,r,a){I(We(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n,static:o}=p.useContext(ve),{matches:l}=p.useContext(fe),s=l[l.length-1],c=s?s.params:{},f=s?s.pathname:"/",v=s?s.pathnameBase:"/",E=s&&s.route;{let T=E&&E.path||"";Ar(f,!E||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
+
4
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let R=De(),y;y=R;let L=y.pathname||"/",M=L;if(v!=="/"){let T=v.replace(/^\//,"").split("/");M="/"+L.replace(/^\//,"").split("/").slice(T.length).join("/")}let x=!o&&r&&r.matches&&r.matches.length>0?r.matches:Pe(e,{pathname:M});return ne(E||x!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ne(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),fa(x&&x.map(T=>Object.assign({},T,{params:Object.assign({},c,T.params),pathname:ge([v,n.encodeLocation?n.encodeLocation(T.pathname).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?v:ge([v,n.encodeLocation?n.encodeLocation(T.pathnameBase).pathname:T.pathnameBase])})),l,r,a)}function la(){let e=va(),t=et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:o},"ErrorBoundary")," or"," ",p.createElement("code",{style:o},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:n},r):null,l)}var sa=p.createElement(la,null),ua=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?p.createElement(fe.Provider,{value:this.props.routeContext},p.createElement(kt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ca({routeContext:e,match:t,children:r}){let a=p.useContext(Ue);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(fe.Provider,{value:e},r)}function fa(e,t=[],r=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let n=e,o=r?.errors;if(o!=null){let c=n.findIndex(f=>f.route.id&&o?.[f.route.id]!==void 0);I(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let l=!1,s=-1;if(r)for(let c=0;c<n.length;c++){let f=n[c];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=c),f.route.id){let{loaderData:v,errors:E}=r,R=f.route.loader&&!v.hasOwnProperty(f.route.id)&&(!E||E[f.route.id]===void 0);if(f.route.lazy||R){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((c,f,v)=>{let E,R=!1,y=null,L=null;r&&(E=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||sa,l&&(s<0&&v===0?(Ar("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,L=null):s===v&&(R=!0,L=f.route.hydrateFallbackElement||null)));let M=t.concat(n.slice(0,v+1)),x=()=>{let C;return E?C=y:R?C=L:f.route.Component?C=p.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=c,p.createElement(ca,{match:f,routeContext:{outlet:c,matches:M,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||v===0)?p.createElement(ua,{location:r.location,revalidation:r.revalidation,component:y,error:E,children:x(),routeContext:{outlet:null,matches:M,isDataRoute:!0}}):x()},null)}function Ft(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function da(e){let t=p.useContext(Ue);return I(t,Ft(e)),t}function ha(e){let t=p.useContext(tt);return I(t,Ft(e)),t}function ma(e){let t=p.useContext(fe);return I(t,Ft(e)),t}function Ut(e){let t=ma(e),r=t.matches[t.matches.length-1];return I(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function pa(){return Ut("useRouteId")}function va(){let e=p.useContext(kt),t=ha("useRouteError"),r=Ut("useRouteError");return e!==void 0?e:t.errors?.[r]}function ya(){let{router:e}=da("useNavigate"),t=Ut("useNavigate"),r=p.useRef(!1);return Or(()=>{r.current=!0}),p.useCallback(async(n,o={})=>{ne(r.current,_r),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var yr={};function Ar(e,t,r){!t&&!yr[e]&&(yr[e]=!0,ne(!1,r))}var gr={};function wr(e,t){!e&&!gr[t]&&(gr[t]=!0,console.warn(t))}function ga(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ne(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ne(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ne(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var wa=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function lo({router:e,flushSync:t}){let[r,a]=p.useState(e.state),[n,o]=p.useState(),[l,s]=p.useState({isTransitioning:!1}),[c,f]=p.useState(),[v,E]=p.useState(),[R,y]=p.useState(),L=p.useRef(new Map),M=p.useCallback((N,{deletedFetchers:W,flushSync:B,viewTransitionOpts:h})=>{N.fetchers.forEach((Y,j)=>{Y.data!==void 0&&L.current.set(j,Y.data)}),W.forEach(Y=>L.current.delete(Y)),wr(B===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let _=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(wr(h==null||_,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!h||!_){t&&B?t(()=>a(N)):p.startTransition(()=>a(N));return}if(t&&B){t(()=>{v&&(c&&c.resolve(),v.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:h.currentLocation,nextLocation:h.nextLocation})});let Y=e.window.document.startViewTransition(()=>{t(()=>a(N))});Y.finished.finally(()=>{t(()=>{f(void 0),E(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>E(Y));return}v?(c&&c.resolve(),v.skipTransition(),y({state:N,currentLocation:h.currentLocation,nextLocation:h.nextLocation})):(o(N),s({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}))},[e.window,t,v,c]);p.useLayoutEffect(()=>e.subscribe(M),[e,M]),p.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new wa)},[l]),p.useEffect(()=>{if(c&&n&&e.window){let N=n,W=c.promise,B=e.window.document.startViewTransition(async()=>{p.startTransition(()=>a(N)),await W});B.finished.finally(()=>{f(void 0),E(void 0),o(void 0),s({isTransitioning:!1})}),E(B)}},[n,c,e.window]),p.useEffect(()=>{c&&n&&r.location.key===n.location.key&&c.resolve()},[c,v,r.location,n]),p.useEffect(()=>{!l.isTransitioning&&R&&(o(R.state),s({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),y(void 0))},[l.isTransitioning,R]);let x=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:N=>e.navigate(N),push:(N,W,B)=>e.navigate(N,{state:W,preventScrollReset:B?.preventScrollReset}),replace:(N,W,B)=>e.navigate(N,{replace:!0,state:W,preventScrollReset:B?.preventScrollReset})}),[e]),C=e.basename||"/",T=p.useMemo(()=>({router:e,navigator:x,static:!1,basename:C}),[e,x,C]);return p.createElement(p.Fragment,null,p.createElement(Ue.Provider,{value:T},p.createElement(tt.Provider,{value:r},p.createElement(Mr.Provider,{value:L.current},p.createElement(Nt.Provider,{value:l},p.createElement(ba,{basename:C,location:r.location,navigationType:r.historyAction,navigator:x},p.createElement(Ea,{routes:e.routes,future:e.future,state:r})))))),null)}var Ea=p.memo(Ra);function Ra({routes:e,future:t,state:r}){return ia(e,void 0,r,t)}function so({to:e,replace:t,state:r,relative:a}){I(We(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=p.useContext(ve);ne(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=p.useContext(fe),{pathname:l}=De(),s=$r(),c=gt(e,yt(o),l,a==="path"),f=JSON.stringify(c);return p.useEffect(()=>{s(JSON.parse(f),{replace:t,state:r,relative:a})},[s,f,a,t,r]),null}function uo(e){return oa(e.context)}function ba({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){I(!We(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=p.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=Te(r));let{pathname:c="/",search:f="",hash:v="",state:E=null,key:R="default"}=r,y=p.useMemo(()=>{let L=pe(c,l);return L==null?null:{location:{pathname:L,search:f,hash:v,state:E,key:R},navigationType:a}},[l,c,f,v,E,R,a]);return ne(y!=null,`<Router basename="${l}"> is not able to match the URL "${c}${f}${v}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:p.createElement(ve.Provider,{value:s},p.createElement(wt.Provider,{children:t,value:y}))}var dt="get",ht="application/x-www-form-urlencoded";function Et(e){return e!=null&&typeof e.tagName=="string"}function xa(e){return Et(e)&&e.tagName.toLowerCase()==="button"}function Ca(e){return Et(e)&&e.tagName.toLowerCase()==="form"}function Sa(e){return Et(e)&&e.tagName.toLowerCase()==="input"}function Pa(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function La(e,t){return e.button===0&&(!t||t==="_self")&&!Pa(e)}var ct=null;function Ta(){if(ct===null)try{new FormData(document.createElement("form"),0),ct=!1}catch{ct=!0}return ct}var Da=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dt(e){return e!=null&&!Da.has(e)?(ne(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ht}"`),null):e}function Ma(e,t){let r,a,n,o,l;if(Ca(e)){let s=e.getAttribute("action");a=s?pe(s,t):null,r=e.getAttribute("method")||dt,n=Dt(e.getAttribute("enctype"))||ht,o=new FormData(e)}else if(xa(e)||Sa(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(a=c?pe(c,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||dt,n=Dt(e.getAttribute("formenctype"))||Dt(s.getAttribute("enctype"))||ht,o=new FormData(s,e),!Ta()){let{name:f,type:v,value:E}=e;if(v==="image"){let R=f?`${f}.`:"";o.append(`${R}x`,"0"),o.append(`${R}y`,"0")}else f&&o.append(f,E)}}else{if(Et(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=dt,a=null,n=ht,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function _a(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Oa(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $a(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await _a(o,r);return l.links?l.links():[]}return[]}));return Fa(a.flat(1).filter(Oa).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Er(e,t,r,a,n,o){let l=(c,f)=>r[f]?c.route.id!==r[f].route.id:!0,s=(c,f)=>r[f].pathname!==c.pathname||r[f].route.path?.endsWith("*")&&r[f].params["*"]!==c.params["*"];return o==="assets"?t.filter((c,f)=>l(c,f)||s(c,f)):o==="data"?t.filter((c,f)=>{let v=a.routes[c.route.id];if(!v||!v.hasLoader)return!1;if(l(c,f)||s(c,f))return!0;if(c.route.shouldRevalidate){let E=c.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function Aa(e,t){return Na(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let n=[a.module];return a.imports&&(n=n.concat(a.imports)),n}).flat(1))}function Na(e){return[...new Set(e)]}function ka(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Fa(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(ka(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}function Ua(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function ja(){let e=p.useContext(Ue);return jt(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ha(){let e=p.useContext(tt);return jt(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ht=p.createContext(void 0);Ht.displayName="FrameworkContext";function Nr(){let e=p.useContext(Ht);return jt(e,"You must render this element inside a <HydratedRouter> element"),e}function Ia(e,t){let r=p.useContext(Ht),[a,n]=p.useState(!1),[o,l]=p.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:f,onMouseLeave:v,onTouchStart:E}=t,R=p.useRef(null);p.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let M=C=>{C.forEach(T=>{l(T.isIntersecting)})},x=new IntersectionObserver(M,{threshold:.5});return R.current&&x.observe(R.current),()=>{x.disconnect()}}},[e]),p.useEffect(()=>{if(a){let M=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(M)}}},[a]);let y=()=>{n(!0)},L=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,R,{}]:[o,R,{onFocus:Xe(s,y),onBlur:Xe(c,L),onMouseEnter:Xe(f,y),onMouseLeave:Xe(v,L),onTouchStart:Xe(E,y)}]:[!1,R,{}]}function Xe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function za({page:e,...t}){let{router:r}=ja(),a=p.useMemo(()=>Pe(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?p.createElement(Wa,{page:e,matches:a,...t}):null}function Ba(e){let{manifest:t,routeModules:r}=Nr(),[a,n]=p.useState([]);return p.useEffect(()=>{let o=!1;return $a(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function Wa({page:e,matches:t,...r}){let a=De(),{manifest:n,routeModules:o}=Nr(),{loaderData:l,matches:s}=Ha(),c=p.useMemo(()=>Er(e,t,s,n,a,"data"),[e,t,s,n,a]),f=p.useMemo(()=>Er(e,t,s,n,a,"assets"),[e,t,s,n,a]),v=p.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let y=new Set,L=!1;if(t.forEach(x=>{let C=n.routes[x.route.id];!C||!C.hasLoader||(!c.some(T=>T.route.id===x.route.id)&&x.route.id in l&&o[x.route.id]?.shouldRevalidate||C.hasClientLoader?L=!0:y.add(x.route.id))}),y.size===0)return[];let M=Ua(e);return L&&y.size>0&&M.searchParams.set("_routes",t.filter(x=>y.has(x.route.id)).map(x=>x.route.id).join(",")),[M.pathname+M.search]},[l,a,n,c,t,e,o]),E=p.useMemo(()=>Aa(f,n),[f,n]),R=Ba(f);return p.createElement(p.Fragment,null,v.map(y=>p.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),E.map(y=>p.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),R.map(({key:y,link:L})=>p.createElement("link",{key:y,...L})))}function Ya(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{kr&&(window.__reactRouterVersion="7.1.5")}catch{}function co(e,t){return kn({basename:t?.basename,future:t?.future,history:on({window:t?.window}),hydrationData:Va(),routes:e,mapRouteProperties:ga,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function Va(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ka(e.errors)}),e}function Ka(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new vt(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let l=new o(n.message);l.stack="",r[a]=l}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}var Fr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ur=p.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:c,to:f,preventScrollReset:v,viewTransition:E,...R},y){let{basename:L}=p.useContext(ve),M=typeof f=="string"&&Fr.test(f),x,C=!1;if(typeof f=="string"&&M&&(x=f,kr))try{let j=new URL(window.location.href),Z=f.startsWith("//")?new URL(j.protocol+f):new URL(f),te=pe(Z.pathname,L);Z.origin===j.origin&&te!=null?f=te+Z.search+Z.hash:C=!0}catch{ne(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=ra(f,{relative:n}),[N,W,B]=Ia(a,R),h=Xa(f,{replace:l,state:s,target:c,preventScrollReset:v,relative:n,viewTransition:E});function _(j){t&&t(j),j.defaultPrevented||h(j)}let Y=p.createElement("a",{...R,...B,href:x||T,onClick:C||o?t:_,ref:Ya(y,W),target:c,"data-discover":!M&&r==="render"?"true":void 0});return N&&!M?p.createElement(p.Fragment,null,Y,p.createElement(za,{page:T})):Y});Ur.displayName="Link";var Ja=p.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:c,...f},v){let E=rt(l,{relative:f.relative}),R=De(),y=p.useContext(tt),{navigator:L,basename:M}=p.useContext(ve),x=y!=null&&ro(E)&&s===!0,C=L.encodeLocation?L.encodeLocation(E).pathname:E.pathname,T=R.pathname,N=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(T=T.toLowerCase(),N=N?N.toLowerCase():null,C=C.toLowerCase()),N&&M&&(N=pe(N,M)||N);const W=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let B=T===C||!n&&T.startsWith(C)&&T.charAt(W)==="/",h=N!=null&&(N===C||!n&&N.startsWith(C)&&N.charAt(C.length)==="/"),_={isActive:B,isPending:h,isTransitioning:x},Y=B?t:void 0,j;typeof a=="function"?j=a(_):j=[a,B?"active":null,h?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let Z=typeof o=="function"?o(_):o;return p.createElement(Ur,{...f,"aria-current":Y,className:j,ref:v,style:Z,to:l,viewTransition:s},typeof c=="function"?c(_):c)});Ja.displayName="NavLink";var Ga=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=dt,action:s,onSubmit:c,relative:f,preventScrollReset:v,viewTransition:E,...R},y)=>{let L=eo(),M=to(s,{relative:f}),x=l.toLowerCase()==="get"?"get":"post",C=typeof s=="string"&&Fr.test(s),T=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let W=N.nativeEvent.submitter,B=W?.getAttribute("formmethod")||l;L(W||N.currentTarget,{fetcherKey:t,method:B,navigate:r,replace:n,state:o,relative:f,preventScrollReset:v,viewTransition:E})};return p.createElement("form",{ref:y,method:x,action:M,onSubmit:a?c:T,...R,"data-discover":!C&&e==="render"?"true":void 0})});Ga.displayName="Form";function qa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jr(e){let t=p.useContext(Ue);return I(t,qa(e)),t}function Xa(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=$r(),c=De(),f=rt(e,{relative:o});return p.useCallback(v=>{if(La(v,t)){v.preventDefault();let E=r!==void 0?r:Le(c)===Le(f);s(e,{replace:E,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[c,s,f,r,a,t,e,n,o,l])}var Qa=0,Za=()=>`__${String(++Qa)}__`;function eo(){let{router:e}=jr("useSubmit"),{basename:t}=p.useContext(ve),r=pa();return p.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:c,body:f}=Ma(a,t);if(n.navigate===!1){let v=n.fetcherKey||Za();await e.fetch(v,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:f,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:f,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function to(e,{relative:t}={}){let{basename:r}=p.useContext(ve),a=p.useContext(fe);I(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...rt(e||".",{relative:t})},l=De();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),c=s.getAll("index");if(c.some(v=>v==="")){s.delete("index"),c.filter(E=>E).forEach(E=>s.append("index",E));let v=s.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:ge([r,o.pathname])),Le(o)}function ro(e,t={}){let r=p.useContext(Nt);I(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=jr("useViewTransitionState"),n=rt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=pe(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=pe(r.nextLocation.pathname,a)||r.nextLocation.pathname;return pt(n.pathname,l)!=null||pt(n.pathname,o)!=null}new TextEncoder;export{Ur as L,so as N,uo as O,an as R,nn as a,oo as b,no as c,ao as d,$r as e,Ja as f,tn as g,co as h,lo as i,p as r,io as u};
@@ -0,0 +1 @@
1
+ import{n as c}from"./index-Ds50UTAc.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
@@ -0,0 +1 @@
1
+ import{j as e}from"./tanstack-BO6c-AOu.js";import"./react-vendor-DNVhVxD7.js";import{n,x as s}from"./index-Ds50UTAc.js";import{C as d}from"./check-BGA0ADyt.js";import{a0 as c,a1 as u,a2 as m,a3 as p,a4 as x,a5 as f,a6 as g,a7 as h,a8 as v,a9 as b,aa as j,ab as w,ac as y,ad as S,ae as z}from"./radix-DQ3amgxj.js";const N=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],l=n("chevron-down",N);const _=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],k=n("chevron-up",_);function V({...t}){return e.jsx(c,{"data-slot":"select",...t})}function G({...t}){return e.jsx(S,{"data-slot":"select-group",...t})}function R({...t}){return e.jsx(p,{"data-slot":"select-value",...t})}function q({className:t,size:a="default",children:o,...r}){return e.jsxs(u,{"data-slot":"select-trigger","data-size":a,className:s("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[o,e.jsx(m,{asChild:!0,children:e.jsx(l,{className:"size-4 opacity-50"})})]})}function E({className:t,children:a,position:o="item-aligned",align:r="center",...i}){return e.jsx(x,{children:e.jsxs(f,{"data-slot":"select-content",className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,align:r,...i,children:[e.jsx(C,{}),e.jsx(g,{className:s("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(I,{})]})})}function P({className:t,...a}){return e.jsx(z,{"data-slot":"select-label",className:s("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function $({className:t,children:a,...o}){return e.jsxs(h,{"data-slot":"select-item",className:s("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...o,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(d,{className:"size-4"})})}),e.jsx(b,{children:a})]})}function A({className:t,...a}){return e.jsx(y,{"data-slot":"select-separator",className:s("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function C({className:t,...a}){return e.jsx(j,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(k,{className:"size-4"})})}function I({className:t,...a}){return e.jsx(w,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(l,{className:"size-4"})})}export{k as C,V as S,q as a,R as b,E as c,$ as d,A as e,G as f,P as g,l as h};
@@ -0,0 +1 @@
1
+ import{j}from"./tanstack-BO6c-AOu.js";import{r as g,R as Y}from"./react-vendor-DNVhVxD7.js";import{x as ue}from"./index-Ds50UTAc.js";import{J as de,K as fe,M as ge}from"./radix-DQ3amgxj.js";import{g as pe,h as be,i as q,e as ve,d as me,j as xe,k as Ie,C as B,l as he,K as N}from"./core.esm-Csvubn5Q.js";function Ke({className:e,...r}){return j.jsx("textarea",{"data-slot":"textarea",className:ue("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}function Pe({...e}){return j.jsx(de,{"data-slot":"collapsible",...e})}function Xe({...e}){return j.jsx(fe,{"data-slot":"collapsible-trigger",...e})}function _e({...e}){return j.jsx(ge,{"data-slot":"collapsible-content",...e})}function F(e,r,t){const n=e.slice();return n.splice(t<0?n.length+t:t,0,n.splice(r,1)[0]),n}function ye(e,r){return e.reduce((t,n,s)=>{const a=r.get(n);return a&&(t[s]=a),t},Array(e.length))}function O(e){return e!==null&&e>=0}function Re(e,r){if(e===r)return!0;if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}function Ce(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const H=e=>{let{rects:r,activeIndex:t,overIndex:n,index:s}=e;const a=F(r,n,t),o=r[s],i=a[s];return!i||!o?null:{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}},A={scaleX:1,scaleY:1},Ge=e=>{var r;let{activeIndex:t,activeNodeRect:n,index:s,rects:a,overIndex:o}=e;const i=(r=a[t])!=null?r:n;if(!i)return null;if(s===t){const c=a[o];return c?{x:0,y:t<o?c.top+c.height-(i.top+i.height):c.top-i.top,...A}:null}const d=De(a,s,t);return s>t&&s<=o?{x:0,y:-i.height-d,...A}:s<t&&s>=o?{x:0,y:i.height+d,...A}:{x:0,y:0,...A}};function De(e,r,t){const n=e[r],s=e[r-1],a=e[r+1];return n?t<r?s?n.top-(s.top+s.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const U="Sortable",V=Y.createContext({activeIndex:-1,containerId:U,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:H,disabled:{draggable:!1,droppable:!1}});function Ye(e){let{children:r,id:t,items:n,strategy:s=H,disabled:a=!1}=e;const{active:o,dragOverlay:i,droppableRects:d,over:c,measureDroppableContainers:l}=pe(),b=be(U,t),m=i.rect!==null,f=g.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),T=o!=null,y=o?f.indexOf(o.id):-1,v=c?f.indexOf(c.id):-1,E=g.useRef(f),R=!Re(f,E.current),C=v!==-1&&y===-1||R,p=Ce(a);q(()=>{R&&T&&l(f)},[R,f,T,l]),g.useEffect(()=>{E.current=f},[f]);const D=g.useMemo(()=>({activeIndex:y,containerId:b,disabled:p,disableTransforms:C,items:f,overIndex:v,useDragOverlay:m,sortedRects:ye(f,d),strategy:s}),[y,b,p.draggable,p.droppable,C,f,v,d,m,s]);return Y.createElement(V.Provider,{value:D},r)}const we=e=>{let{id:r,items:t,activeIndex:n,overIndex:s}=e;return F(t,n,s).indexOf(r)},Se=e=>{let{containerId:r,isSorting:t,wasDragging:n,index:s,items:a,newIndex:o,previousItems:i,previousContainerId:d,transition:c}=e;return!c||!n||i!==a&&s===o?!1:t?!0:o!==s&&r===d},Te={duration:200,easing:"ease"},J="transform",Ee=B.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:r,index:t,node:n,rect:s}=e;const[a,o]=g.useState(null),i=g.useRef(t);return q(()=>{if(!r&&t!==i.current&&n.current){const d=s.current;if(d){const c=he(n.current,{ignoreTransform:!0}),l={x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height};(l.x||l.y)&&o(l)}}t!==i.current&&(i.current=t)},[r,t,n,s]),g.useEffect(()=>{a&&o(null)},[a]),a}function qe(e){let{animateLayoutChanges:r=Se,attributes:t,disabled:n,data:s,getNewIndex:a=we,id:o,strategy:i,resizeObserverConfig:d,transition:c=Te}=e;const{items:l,containerId:b,activeIndex:m,disabled:f,disableTransforms:T,sortedRects:y,overIndex:v,useDragOverlay:E,strategy:R}=g.useContext(V),C=Ae(n,f),p=l.indexOf(o),D=g.useMemo(()=>({sortable:{containerId:b,index:p,items:l},...s}),[b,s,p,l]),x=g.useMemo(()=>l.slice(l.indexOf(o)),[l,o]),{rect:$,node:z,isOver:Q,setNodeRef:k}=ve({id:o,data:D,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...d}}),{active:w,activatorEvent:W,activeNodeRect:Z,attributes:ee,setNodeRef:K,listeners:te,isDragging:L,over:re,setActivatorNodeRef:ne,transform:se}=me({id:o,data:D,attributes:{...Ne,...t},disabled:C.draggable}),oe=xe(k,K),I=!!w,P=I&&!T&&O(m)&&O(v),X=!E&&L,_=X&&P?se:null,ae=P?_??(i??R)({rects:y,activeNodeRect:Z,activeIndex:m,overIndex:v,index:p}):null,S=O(m)&&O(v)?a({id:o,items:l,activeIndex:m,overIndex:v}):p,h=w?.id,u=g.useRef({activeId:h,items:l,newIndex:S,containerId:b}),ie=l!==u.current.items,G=r({active:w,containerId:b,isDragging:L,isSorting:I,id:o,index:p,items:l,newIndex:u.current.newIndex,previousItems:u.current.items,previousContainerId:u.current.containerId,transition:c,wasDragging:u.current.activeId!=null}),M=Oe({disabled:!G,index:p,node:z,rect:$});return g.useEffect(()=>{I&&u.current.newIndex!==S&&(u.current.newIndex=S),b!==u.current.containerId&&(u.current.containerId=b),l!==u.current.items&&(u.current.items=l)},[I,S,b,l]),g.useEffect(()=>{if(h===u.current.activeId)return;if(h!=null&&u.current.activeId==null){u.current.activeId=h;return}const ce=setTimeout(()=>{u.current.activeId=h},50);return()=>clearTimeout(ce)},[h]),{active:w,activeIndex:m,attributes:ee,data:D,rect:$,index:p,newIndex:S,items:l,isOver:Q,isSorting:I,isDragging:L,listeners:te,node:z,overIndex:v,over:re,setNodeRef:oe,setActivatorNodeRef:ne,setDroppableNodeRef:k,setDraggableNodeRef:K,transform:M??ae,transition:le()};function le(){if(M||ie&&u.current.newIndex===p)return Ee;if(!(X&&!Ie(W)||!c)&&(I||G))return B.Transition.toString({...c,property:J})}}function Ae(e,r){var t,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:r.draggable,droppable:(n=e?.droppable)!=null?n:r.droppable}}N.Down,N.Right,N.Up,N.Left;export{Pe as C,Ye as S,Ke as T,F as a,Xe as b,_e as c,qe as u,Ge as v};
@@ -0,0 +1 @@
1
+ import{j as t}from"./tanstack-BO6c-AOu.js";import"./react-vendor-DNVhVxD7.js";import{x as l}from"./index-Ds50UTAc.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function d({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function c({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function x({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,d as a,b,i as c,c as d,x as e};
@@ -0,0 +1 @@
1
+ import{r as y}from"./react-vendor-DNVhVxD7.js";var _={exports:{}},A={};var tt;function St(){if(tt)return A;tt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var n in r)n!=="key"&&(a[n]=r[n])}else a=r;return r=a.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:a}}return A.Fragment=e,A.jsx=s,A.jsxs=s,A}var et;function Ft(){return et||(et=1,_.exports=St()),_.exports}var Et=Ft(),T=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(){}},E=typeof window>"u"||"Deno"in globalThis;function b(){}function Mt(t,e){return typeof t=="function"?t(e):t}function H(t){return typeof t=="number"&&t>=0&&t!==1/0}function ht(t,e){return Math.max(t+(e||0)-Date.now(),0)}function D(t,e){return typeof t=="function"?t(e):t}function P(t,e){return typeof t=="function"?t(e):t}function st(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:n}=t;if(o){if(i){if(e.queryHash!==$(o,e.options))return!1}else if(!q(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof n=="boolean"&&e.isStale()!==n||r&&r!==e.state.fetchStatus||a&&!a(e))}function it(t,e){const{exact:s,status:i,predicate:r,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(M(e.options.mutationKey)!==M(a))return!1}else if(!q(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function $(t,e){return(e?.queryKeyHashFn||M)(t)}function M(t){return JSON.stringify(t,(e,s)=>N(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function q(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!q(t[s],e[s])):!1}function ct(t,e){if(t===e)return t;const s=rt(t)&&rt(e);if(s||N(t)&&N(e)){const i=s?t:Object.keys(t),r=i.length,a=s?e:Object.keys(e),o=a.length,n=s?[]:{};let u=0;for(let l=0;l<o;l++){const h=s?l:a[l];(!s&&i.includes(h)||s)&&t[h]===void 0&&e[h]===void 0?(n[h]=void 0,u++):(n[h]=ct(t[h],e[h]),n[h]===t[h]&&t[h]!==void 0&&u++)}return r===o&&u===r?t:n}return e}function j(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 rt(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function N(t){if(!nt(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!nt(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nt(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qt(t){return new Promise(e=>{setTimeout(e,t)})}function G(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?ct(t,e):e}function xt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Dt(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var V=Symbol();function lt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===V?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Tt=class extends T{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Y=new Tt,At=class extends T{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&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.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},k=new At;function B(){let t,e;const s=new Promise((r,a)=>{t=r,e=a});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}function qt(t){return Math.min(1e3*2**t,3e4)}function ft(t){return(t??"online")==="online"?k.isOnline():!0}var dt=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function K(t){return t instanceof dt}function pt(t){let e=!1,s=0,i=!1,r;const a=B(),o=c=>{i||(f(new dt(c)),t.abort?.())},n=()=>{e=!0},u=()=>{e=!1},l=()=>Y.isFocused()&&(t.networkMode==="always"||k.isOnline())&&t.canRun(),h=()=>ft(t.networkMode)&&t.canRun(),O=c=>{i||(i=!0,t.onSuccess?.(c),r?.(),a.resolve(c))},f=c=>{i||(i=!0,t.onError?.(c),r?.(),a.reject(c))},w=()=>new Promise(c=>{r=g=>{(i||l())&&c(g)},t.onPause?.()}).then(()=>{r=void 0,i||t.onContinue?.()}),p=()=>{if(i)return;let c;const g=s===0?t.initialPromise:void 0;try{c=g??t.fn()}catch(v){c=Promise.reject(v)}Promise.resolve(c).then(O).catch(v=>{if(i)return;const R=t.retry??(E?0:3),S=t.retryDelay??qt,F=typeof S=="function"?S(s,v):S,Z=R===!0||typeof R=="number"&&s<R||typeof R=="function"&&R(s,v);if(e||!Z){f(v);return}s++,t.onFail?.(s,v),Qt(F).then(()=>l()?void 0:w()).then(()=>{e?f(v):p()})})};return{promise:a,cancel:o,continue:()=>(r?.(),a),cancelRetry:n,continueRetry:u,canStart:h,start:()=>(h()?p():w().then(p),a)}}function It(){let t=[],e=0,s=n=>{n()},i=n=>{n()},r=n=>setTimeout(n,0);const a=n=>{e?t.push(n):r(()=>{s(n)})},o=()=>{const n=t;t=[],n.length&&r(()=>{i(()=>{n.forEach(u=>{s(u)})})})};return{batch:n=>{let u;e++;try{u=n()}finally{e--,e||o()}return u},batchCalls:n=>(...u)=>{a(()=>{n(...u)})},schedule:a,setNotifyFunction:n=>{s=n},setBatchNotifyFunction:n=>{i=n},setScheduler:n=>{r=n}}}var d=It(),yt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(E?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Ut=class extends yt{#e;#t;#s;#i;#a;#n;constructor(t){super(),this.#n=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#s=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=jt(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=G(this.state.data,t,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#r({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>P(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ht(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.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.#i&&(this.#n?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const n=this.observers.find(u=>u.options.queryFn);n&&this.setOptions(n.options)}const s=new AbortController,i=n=>{Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(this.#n=!0,s.signal)})},r=()=>{const n=lt(this.options,e),u={queryKey:this.queryKey,meta:this.meta};return i(u),this.#n=!1,this.options.persister?this.options.persister(n,u,this):n(u)},a={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(a),this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#r({type:"fetch",meta:a.fetchOptions?.meta});const o=n=>{K(n)&&n.silent||this.#r({type:"error",error:n}),K(n)||(this.#s.config.onError?.(n,this),this.#s.config.onSettled?.(this.state.data,n,this)),this.scheduleGc()};return this.#i=pt({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:n=>{if(n===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(n)}catch(u){o(u);return}this.#s.config.onSuccess?.(n,this),this.#s.config.onSettled?.(n,this.state.error,this),this.scheduleGc()},onError:o,onFail:(n,u)=>{this.#r({type:"failed",failureCount:n,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#r(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,...vt(s.data,this.options),fetchMeta:t.meta??null};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return K(i)&&i.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),d.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function vt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jt(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 T{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,s){const i=e.queryKey,r=e.queryHash??$(i,e);let a=this.get(r);return a||(a=new Ut({cache:this,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){d.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>st(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>st(t,s)):e}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){d.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){d.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lt=class extends yt{#e;#t;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||mt(),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.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){this.#s=pt({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,r)=>{this.#i({type:"failed",failureCount:i,error:r})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const e=this.state.status==="pending",s=!this.#s.canStart();try{if(!e){this.#i({type:"pending",variables:t,isPaused:s}),await this.#t.config.onMutate?.(t,this);const r=await this.options.onMutate?.(t);r!==this.state.context&&this.#i({type:"pending",context:r,variables:t,isPaused:s})}const i=await this.#s.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#i({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#i({type:"error",error:i})}}finally{this.#t.runNext(this)}}#i(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),d.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _t=class extends T{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(t,e,s){const i=new Lt({mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);s?s.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=U(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=U(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){d.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>it(e,s))}findAll(t={}){return this.getAll().filter(e=>it(t,e))}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return d.batch(()=>Promise.all(t.map(e=>e.continue().catch(b))))}};function U(t){return t.options.scope?.id}function L(t){return{onFetch:(e,s)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let n={pages:[],pageParams:[]},u=0;const l=async()=>{let h=!1;const O=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},f=lt(e.options,e.fetchOptions),w=async(p,c,g)=>{if(h)return Promise.reject();if(c==null&&p.pages.length)return Promise.resolve(p);const v={queryKey:e.queryKey,pageParam:c,direction:g?"backward":"forward",meta:e.options.meta};O(v);const R=await f(v),{maxPages:S}=e.options,F=g?Dt:xt;return{pages:F(p.pages,R,S),pageParams:F(p.pageParams,c,S)}};if(r&&a.length){const p=r==="backward",c=p?gt:z,g={pages:a,pageParams:o},v=c(i,g);n=await w(g,v,p)}else{const p=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:z(i,n);if(u>0&&c==null)break;n=await w(n,c),u++}while(u<p)}return n};e.options.persister?e.fetchFn=()=>e.options.persister?.(l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function z(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 gt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function Kt(t,e){return e?z(t,e)!=null:!1}function Ht(t,e){return!e||!t.getPreviousPageParam?!1:gt(t,e)!=null}var re=class{#e;#t;#s;#i;#a;#n;#r;#o;constructor(t={}){this.#e=t.queryCache||new kt,this.#t=t.mutationCache||new _t,this.#s=t.defaultOptions||{},this.#i=new Map,this.#a=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#r=Y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=k.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#r?.(),this.#r=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#e.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(D(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(i.queryHash)?.state.data,o=Mt(e,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return d.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;d.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#e,i={type:"active",...t};return d.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=d.batch(()=>this.#e.findAll(t).map(r=>r.cancel(s)));return Promise.all(i).then(b).catch(b)}invalidateQueries(t,e={}){return d.batch(()=>{if(this.#e.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none")return Promise.resolve();const s={...t,type:t?.refetchType??t?.type??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=d.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()).map(r=>{let a=r.fetch(void 0,s);return s.throwOnError||(a=a.catch(b)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(b)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#e.build(this,e);return s.isStaleByTime(D(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(b).catch(b)}fetchInfiniteQuery(t){return t.behavior=L(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(b).catch(b)}ensureInfiniteQueryData(t){return t.behavior=L(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return k.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#i.set(M(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{q(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#a.set(M(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#a.values()];let s={};return e.forEach(i=>{q(t,i.mutationKey)&&(s={...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=$(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===V&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bt=class extends T{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#r=B(),this.options.experimental_prefetchInRender||this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#a;#n;#r;#o;#y;#f;#d;#h;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),at(this.#t,this.options)?this.#l():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#R(),this.#t.removeObserver(this)}setOptions(t,e){const s=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof P(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),s._defaulted&&!j(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&ot(this.#t,i,this.options,s)&&this.#l(),this.updateResult(e),r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(s.staleTime,this.#t))&&this.#v();const a=this.#m();r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||a!==this.#u)&&this.#g(a)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return Gt(this,s)&&(this.#i=s,this.#n=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){const s={};return Object.keys(t).forEach(i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})}),s}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(b)),e}#v(){this.#O();const t=D(this.options.staleTime,this.#t);if(E||this.#i.isStale||!H(t))return;const s=ht(this.#i.dataUpdatedAt,t)+1;this.#h=setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(t){this.#R(),this.#u=t,!(E||P(this.options.enabled,this.#t)===!1||!H(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Y.isFocused())&&this.#l()},this.#u))}#b(){this.#v(),this.#g(this.#m())}#O(){this.#h&&(clearTimeout(this.#h),this.#h=void 0)}#R(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#i,a=this.#a,o=this.#n,u=t!==s?t.state:this.#s,{state:l}=t;let h={...l},O=!1,f;if(e._optimisticResults){const m=this.hasListeners(),Q=!m&&at(t,e),x=m&&ot(t,s,e,i);(Q||x)&&(h={...h,...vt(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:p,status:c}=h;if(e.select&&h.data!==void 0)if(r&&h.data===a?.data&&e.select===this.#y)f=this.#f;else try{this.#y=e.select,f=e.select(h.data),f=G(r?.data,f,e),this.#f=f,this.#o=null}catch(m){this.#o=m}else f=h.data;if(e.placeholderData!==void 0&&f===void 0&&c==="pending"){let m;if(r?.isPlaceholderData&&e.placeholderData===o?.placeholderData)m=r.data;else if(m=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,e.select&&m!==void 0)try{m=e.select(m),this.#o=null}catch(Q){this.#o=Q}m!==void 0&&(c="success",f=G(r?.data,m,e),O=!0)}this.#o&&(w=this.#o,f=this.#f,p=Date.now(),c="error");const g=h.fetchStatus==="fetching",v=c==="pending",R=c==="error",S=v&&g,F=f!==void 0,C={status:c,fetchStatus:h.fetchStatus,isPending:v,isSuccess:c==="success",isError:R,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:R&&!F,isPaused:h.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:R&&F,isStale:X(t,e),refetch:this.refetch,promise:this.#r};if(this.options.experimental_prefetchInRender){const m=I=>{C.status==="error"?I.reject(C.error):C.data!==void 0&&I.resolve(C.data)},Q=()=>{const I=this.#r=C.promise=B();m(I)},x=this.#r;switch(x.status){case"pending":t.queryHash===s.queryHash&&m(x);break;case"fulfilled":(C.status==="error"||C.data!==x.value)&&Q();break;case"rejected":(C.status!=="error"||C.error!==x.reason)&&Q();break}}return C}updateResult(t){const e=this.#i,s=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#n=this.options,this.#a.data!==void 0&&(this.#d=this.#t),j(s,e))return;this.#i=s;const i={},r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#p.size)return!0;const n=new Set(o??this.#p);return this.options.throwOnError&&n.add("error"),Object.keys(this.#i).some(u=>{const l=u;return this.#i[l]!==e[l]&&n.has(l)})};t?.listeners!==!1&&r()&&(i.listeners=!0),this.#C({...i,...t})}#P(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){d.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Nt(t,e){return P(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function at(t,e){return Nt(t,e)||t.state.data!==void 0&&J(t,e,e.refetchOnMount)}function J(t,e,s){if(P(e.enabled,t)!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&X(t,e)}return!1}function ot(t,e,s,i){return(t!==e||P(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&X(t,s)}function X(t,e){return P(e.enabled,t)!==!1&&t.isStaleByTime(D(e.staleTime,t))}function Gt(t,e){return!j(t.getCurrentResult(),e)}var Bt=class extends bt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:L()},e)}getOptimisticResult(t){return t.behavior=L(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:s}=t,i=super.createResult(t,e),{isFetching:r,isRefetching:a,isError:o,isRefetchError:n}=i,u=s.fetchMeta?.fetchMore?.direction,l=o&&u==="forward",h=r&&u==="forward",O=o&&u==="backward",f=r&&u==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Kt(e,s.data),hasPreviousPage:Ht(e,s.data),isFetchNextPageError:l,isFetchingNextPage:h,isFetchPreviousPageError:O,isFetchingPreviousPage:f,isRefetchError:n&&!l&&!O,isRefetching:a&&!h&&!f}}},zt=class extends T{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),j(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&M(e.mutationKey)!==M(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.#a(),this.#n(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#a(),this.#n()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#a(){const t=this.#s?.state??mt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#n(t){d.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context;t?.type==="success"?(this.#i.onSuccess?.(t.data,e,s),this.#i.onSettled?.(t.data,null,e,s)):t?.type==="error"&&(this.#i.onError?.(t.error,e,s),this.#i.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach(e=>{e(this.#t)})})}},Ot=y.createContext(void 0),Rt=t=>{const e=y.useContext(Ot);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ne=({client:t,children:e})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Et.jsx(Ot.Provider,{value:t,children:e})),Pt=y.createContext(!1),Jt=()=>y.useContext(Pt);Pt.Provider;function Wt(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var $t=y.createContext(Wt()),Vt=()=>y.useContext($t);function Ct(t,e){return typeof t=="function"?t(...e):!!t}function W(){}var Yt=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Xt=t=>{y.useEffect(()=>{t.clearReset()},[t])},Zt=({result:t,errorResetBoundary:e,throwOnError:s,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&Ct(s,[t.error,i]),te=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...s)=>Math.max(e(...s),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},ee=(t,e)=>t.isLoading&&t.isFetching&&!e,se=(t,e)=>t?.suspense&&e.isPending,ut=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function wt(t,e,s){const i=Rt(),r=Jt(),a=Vt(),o=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?"isRestoring":"optimistic",te(o),Yt(o,a),Xt(a);const n=!i.getQueryCache().get(o.queryHash),[u]=y.useState(()=>new e(i,o)),l=u.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(h=>{const O=r?W:u.subscribe(d.batchCalls(h));return u.updateResult(),O},[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),se(o,l))throw ut(o,u,a);if(Zt({result:l,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash)}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!E&&ee(l,r)&&(n?ut(o,u,a):i.getQueryCache().get(o.queryHash)?.promise)?.catch(W).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?l:u.trackResult(l)}function ae(t,e){return wt(t,bt)}function oe(t,e){const s=Rt(),[i]=y.useState(()=>new zt(s,t));y.useEffect(()=>{i.setOptions(t)},[i,t]);const r=y.useSyncExternalStore(y.useCallback(o=>i.subscribe(d.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=y.useCallback((o,n)=>{i.mutate(o,n).catch(W)},[i]);if(r.error&&Ct(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}function ue(t,e){return wt(t,Bt)}export{re as Q,Rt as a,oe as b,ne as c,ue as d,Et as j,ae as u};
@@ -0,0 +1 @@
1
+ import{n as a}from"./index-Ds50UTAc.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
@@ -0,0 +1 @@
1
+ import{r as t}from"./react-vendor-DNVhVxD7.js";import{a6 as n}from"./index-Ds50UTAc.js";function c(o){const r=[...new Set(o)],{data:e}=n(r);return{resolve:t.useCallback(s=>e?.users[s]?.email??s,[e]),isLoaded:!!e}}export{c as u};
@@ -0,0 +1 @@
1
+ import{u as o,a as u,b as c}from"./tanstack-BO6c-AOu.js";import{E as s}from"./index-Ds50UTAc.js";function y(e,t,n,i){const a=s(),r=new URLSearchParams({collection:t});return i&&r.set("cursor",i),n?.q&&r.set("q",n.q),n?.search&&r.set("search",n.search),n?.tag&&r.set("tag",n.tag),n?.status&&r.set("status",n.status),n?.sort&&r.set("sort",n.sort),o({queryKey:["sites",e,"content",t,n??{},i??""],queryFn:()=>a.apiFetch(`/v1/admin/sites/${e}/content?${r.toString()}`),enabled:!!e&&!!t})}function v(e,t){const n=s(),i=new URLSearchParams;t&&i.set("cursor",t);const a=i.toString();return o({queryKey:["sites",e,"content","__all__",t??""],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content${a?`?${a}`:""}`),enabled:!!e})}function m(e,t){const n=s();return o({queryKey:["sites",e,"content-detail",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}`),enabled:!!e&&!!t})}function q(e){const t=s(),n=u();return c({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/content`,{method:"POST",body:JSON.stringify({collection:i.collection,params:{title:i.title,slug:i.slug,body:{}}})}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",e,"content"]})})}function p(e,t){const n=s(),i=u();return c({mutationFn:a=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/draft`,{method:"PUT",body:JSON.stringify(a)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function $(e,t,n){const i=s();return o({queryKey:["sites",e,"content-published",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/published`),enabled:!!e&&!!t&&n})}function F(e,t){const n=s(),i=u();return c({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/publish`,{method:"POST"}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),i.invalidateQueries({queryKey:["sites",e,"content-published",t]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function K(e,t){const n=s(),i=u();return c({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/unpublish`,{method:"POST"}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),i.invalidateQueries({queryKey:["sites",e,"content-published",t]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function S(e,t){const n=s(),i=u();return c({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}`,{method:"DELETE"}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function f(e){const t=s(),n=u();return c({mutationFn:i=>Promise.allSettled(i.map(a=>t.apiFetch(`/v1/admin/sites/${e}/content/${a}/publish`,{method:"POST"}))),onSettled:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function b(e){const t=s(),n=u();return c({mutationFn:i=>Promise.allSettled(i.map(a=>t.apiFetch(`/v1/admin/sites/${e}/content/${a}/unpublish`,{method:"POST"}))),onSettled:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function Q(e){const t=s(),n=u();return c({mutationFn:i=>Promise.allSettled(i.map(a=>t.apiFetch(`/v1/admin/sites/${e}/content/${a}`,{method:"DELETE"}))),onSettled:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function g(e,t){const n=s(),i=u();return c({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/discard`,{method:"POST"}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function P(e,t,n){const i=s();return o({queryKey:["sites",e,"content-detail",t,"versions",n],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions/${n}`),enabled:!!e&&!!t&&!!n})}function C(e,t){const n=s();return o({queryKey:["sites",e,"content-detail",t,"versions"],queryFn:async()=>({items:(await n.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions`)).versions??[]}),enabled:!!e&&!!t})}function h(e,t,n){const i=s();return o({queryKey:["sites",e,"content-references",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/references`),enabled:!!e&&!!t&&n})}export{f as a,b,Q as c,y as d,q as e,p as f,$ as g,P as h,C as i,m as j,F as k,K as l,S as m,g as n,h as o,v as u};
@@ -0,0 +1 @@
1
+ import{r as o}from"./react-vendor-DNVhVxD7.js";function n(e,t){const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r}export{n as u};
@@ -0,0 +1 @@
1
+ import{n as v,x as c,B as q,X as N,I as D,E as r}from"./index-Ds50UTAc.js";import{j as o,a as u,b as d,u as h,d as k}from"./tanstack-BO6c-AOu.js";import{r as y}from"./react-vendor-DNVhVxD7.js";import{x as z,y as M,z as A,B as T,E as I,F as C,G as K,H as O}from"./radix-DQ3amgxj.js";import{B as P}from"./badge-0Z1nL6DI.js";const E=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],V=v("ellipsis",E);const U=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],W=v("file",U);const Q=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],X=v("upload",Q);function Y({...e}){return o.jsx(z,{"data-slot":"alert-dialog",...e})}function L({...e}){return o.jsx(K,{"data-slot":"alert-dialog-portal",...e})}function _({className:e,...t}){return o.jsx(O,{"data-slot":"alert-dialog-overlay",className:c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Z({className:e,size:t="default",...i}){return o.jsxs(L,{children:[o.jsx(_,{}),o.jsx(M,{"data-slot":"alert-dialog-content","data-size":t,className:c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...i})]})}function ee({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:c("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function te({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:c("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function ae({className:e,...t}){return o.jsx(A,{"data-slot":"alert-dialog-title",className:c("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function ie({className:e,...t}){return o.jsx(T,{"data-slot":"alert-dialog-description",className:c("text-muted-foreground text-sm",e),...t})}function se({className:e,variant:t="default",size:i="default",...a}){return o.jsx(q,{variant:t,size:i,asChild:!0,children:o.jsx(C,{"data-slot":"alert-dialog-action",className:c(e),...a})})}function ne({className:e,variant:t="outline",size:i="default",...a}){return o.jsx(q,{variant:t,size:i,asChild:!0,children:o.jsx(I,{"data-slot":"alert-dialog-cancel",className:c(e),...a})})}function oe({tags:e,onChange:t,placeholder:i,suggestions:a}){const[n,F]=y.useState(""),[p,m]=y.useState(-1),[b,g]=y.useState(!1),w=y.useRef(null),f=n&&a?a.filter(s=>s.toLowerCase().startsWith(n.toLowerCase())&&!e.includes(s)):[];function x(s){const l=s.trim().toLowerCase();l&&!e.includes(l)&&t([...e,l]),F(""),m(-1),g(!1)}function S(s){if(s.key==="ArrowDown"&&f.length>0){s.preventDefault(),m(l=>Math.min(l+1,f.length-1));return}if(s.key==="ArrowUp"&&f.length>0){s.preventDefault(),m(l=>Math.max(l-1,0));return}if(s.key==="Enter"||s.key===","){s.preventDefault(),p>=0&&p<f.length?x(f[p]):x(n);return}if(s.key==="Escape"){g(!1),m(-1);return}s.key==="Backspace"&&!n&&e.length>0&&t(e.slice(0,-1))}function $(s){t(e.filter(l=>l!==s))}return o.jsxs("div",{className:"relative",ref:w,children:[o.jsxs("div",{className:"flex flex-wrap gap-1 rounded-md border p-2 focus-within:ring-1 focus-within:ring-ring",children:[e.map(s=>o.jsxs(P,{variant:"secondary",className:"gap-1",children:[s,o.jsx("button",{type:"button",onClick:()=>$(s),className:"ml-0.5 rounded-full hover:bg-muted",children:o.jsx(N,{className:"h-3 w-3"})})]},s)),o.jsx(D,{value:n,onChange:s=>{F(s.target.value),m(-1),g(!0)},onKeyDown:S,onFocus:()=>g(!0),onBlur:()=>{setTimeout(()=>g(!1),150)},placeholder:e.length===0?i??"Add tags...":"",className:"min-w-[80px] flex-1 border-0 p-0 shadow-none focus-visible:ring-0"})]}),b&&f.length>0&&o.jsx("div",{className:"absolute z-10 mt-1 max-h-48 w-full overflow-auto rounded-md border bg-popover p-1 shadow-md",children:f.map((s,l)=>o.jsx("button",{type:"button",className:`w-full rounded-sm px-2 py-1.5 text-left text-sm ${l===p?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,onMouseDown:j=>{j.preventDefault(),x(s)},children:s},s))})]})}function re(e,t){const i=r();return h({queryKey:["sites",e,"media","item",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/media/${t}`),enabled:!!e&&!!t})}function le(e,t){const i=r(),a=new URLSearchParams;t?.tag&&a.set("tag",t.tag),t?.folderId!==void 0&&a.set("folderId",t.folderId),t?.q&&a.set("q",t.q),t?.sort&&a.set("sort",t.sort),t?.limit&&a.set("limit",String(t.limit));const n=a.toString();return h({queryKey:["sites",e,"media",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/media${n?`?${n}`:""}`),enabled:!!e})}function de(e,t){const i=r();return k({queryKey:["sites",e,"media","infinite",t],queryFn:({pageParam:a})=>{const n=new URLSearchParams;return a&&n.set("cursor",a),t?.tag&&n.set("tag",t.tag),t?.folderId!==void 0&&n.set("folderId",t.folderId),t?.q&&n.set("q",t.q),t?.sort&&n.set("sort",t.sort),t?.limit&&n.set("limit",String(t.limit)),i.apiFetch(`/v1/admin/sites/${e}/media?${n.toString()}`)},initialPageParam:void 0,getNextPageParam:a=>a.hasMore?a.cursor??void 0:void 0,enabled:!!e})}function ce(e){const t=r();return d({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/media/upload-url`,{method:"POST",body:JSON.stringify(i)})})}function ue(e){const t=r(),i=u();return d({mutationFn:a=>t.apiFetch(`/v1/admin/sites/${e}/media/${a.mediaId}/complete`,{method:"POST",body:JSON.stringify({filename:a.filename,alt:a.alt,caption:a.caption,folderId:a.folderId})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"media"]})})}function fe(e,t){const i=r(),a=u();return d({mutationFn:n=>i.apiFetch(`/v1/admin/sites/${e}/media/${t}`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:()=>a.invalidateQueries({queryKey:["sites",e,"media"]})})}function me(e,t){const i=r(),a=u();return d({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/media/${t}`,{method:"DELETE"}),onSuccess:()=>a.invalidateQueries({queryKey:["sites",e,"media"]})})}function ge(e){const t=r();return h({queryKey:["sites",e,"media","folders"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/media/folders`),enabled:!!e})}function pe(e){const t=r(),i=u();return d({mutationFn:a=>t.apiFetch(`/v1/admin/sites/${e}/media/folders`,{method:"POST",body:JSON.stringify({name:a})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"media","folders"]})})}function ye(e){const t=r(),i=u();return d({mutationFn:({folderId:a,name:n})=>t.apiFetch(`/v1/admin/sites/${e}/media/folders/${a}`,{method:"PUT",body:JSON.stringify({name:n})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"media","folders"]})})}function he(e){const t=r(),i=u();return d({mutationFn:a=>t.apiFetch(`/v1/admin/sites/${e}/media/folders/${a}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"media","folders"]})})}function xe(e){const t=r(),i=u();return d({mutationFn:a=>t.apiFetch(`/v1/admin/sites/${e}/media/bulk`,{method:"POST",body:JSON.stringify(a)}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"media"]})})}function ve(e){const t=r();return d({mutationFn:({filename:i,size:a})=>t.apiFetch(`/v1/admin/sites/${e}/media/check-duplicate?filename=${encodeURIComponent(i)}&size=${a}`)})}function Fe(e,t){const i=r(),a=u();return d({mutationFn:n=>i.apiFetch(`/v1/admin/sites/${e}/media/${t}/save-transform`,{method:"POST",body:JSON.stringify(n)}),onSuccess:()=>a.invalidateQueries({queryKey:["sites",e,"media"]})})}function qe(e,t){const i=r();return h({queryKey:["sites",e,"media","usage",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/media/${t}/usage`),enabled:!!e&&!!t})}export{Y as A,V as E,W as F,oe as T,X as U,ue as a,ge as b,de as c,re as d,Z as e,ee as f,ae as g,ie as h,te as i,ne as j,se as k,Fe as l,fe as m,me as n,qe as o,pe as p,ye as q,he as r,xe as s,ve as t,ce as u,le as v};
@@ -0,0 +1 @@
1
+ import{u as r,a as i,b as u}from"./tanstack-BO6c-AOu.js";import{E as a}from"./index-Ds50UTAc.js";function m(e){const t=a();return r({queryKey:["sites",e,"tags"],queryFn:async()=>(await t.apiFetch(`/v1/admin/sites/${e}/tags`)).tags,enabled:!!e})}function y(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags`,{method:"POST",body:JSON.stringify({tag:n})}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}function d(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}export{y as a,d as b,m as u};
@@ -0,0 +1 @@
1
+ import{u,a,b as o}from"./tanstack-BO6c-AOu.js";import{E as n}from"./index-Ds50UTAc.js";function y(e){const s=n();return u({queryKey:["sites",e,"webhooks"],queryFn:async()=>({items:(await s.apiFetch(`/v1/admin/sites/${e}/webhooks`)).webhooks}),enabled:!!e})}function d(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`),enabled:!!e&&!!s})}function m(e){const s=n(),t=a();return o({mutationFn:i=>s.apiFetch(`/v1/admin/sites/${e}/webhooks`,{method:"POST",body:JSON.stringify(i)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function h(e,s){const t=n(),i=a();return o({mutationFn:c=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"PUT",body:JSON.stringify(c)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"webhooks"]})}})}function l(e,s){const t=n(),i=a();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function k(e,s){const t=n();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/test`,{method:"POST"})})}function v(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s,"deliveries"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/deliveries`),enabled:!!e&&!!s})}export{d as a,m as b,h as c,l as d,k as e,v as f,y as u};
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>admin</title>
8
+ <script type="module" crossorigin src="/assets/index-Ds50UTAc.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-DNVhVxD7.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/tanstack-BO6c-AOu.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/radix-DQ3amgxj.js">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DOqKbrpW.css">
13
+ </head>
14
+ <body>
15
+ <script>
16
+ // Polyfill Node globals required by amazon-cognito-identity-js
17
+ globalThis.global = globalThis;
18
+ </script>
19
+ <div id="root"></div>
20
+ </body>
21
+ </html>
package/admin/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Admin Site Infrastructure
3
+ *
4
+ * Admin UI static site deployment.
5
+ * Dev mode: standard StaticSite with Vite build from source.
6
+ * Package mode: pre-built files with placeholder substitution.
7
+ */
8
+ import type { ApiResources } from "./api.js";
9
+ import type { CdnResources } from "./cdn.js";
10
+ import type { AuthResources } from "./auth.js";
11
+ export interface AdminSiteArgs {
12
+ api: ApiResources;
13
+ cdn: CdnResources;
14
+ auth: AuthResources;
15
+ pkgRoot: string;
16
+ dev?: {
17
+ /** Path to admin UI source, e.g. "packages/admin" */
18
+ adminPath: string;
19
+ };
20
+ domain?: {
21
+ name: string;
22
+ certificateArn: string;
23
+ };
24
+ }
25
+ export declare function createAdminSite(name: string, args: AdminSiteArgs): {
26
+ site: sst.aws.StaticSite;
27
+ url: PulumiOutput<string>;
28
+ };
29
+ export type AdminSiteResources = ReturnType<typeof createAdminSite>;
30
+ //# sourceMappingURL=admin-site.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-site.d.ts","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,YAAY,CAAC;IAClB,GAAG,EAAE,YAAY,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE;QACJ,qDAAqD;QACrD,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa;;;EA4EhE;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Admin Site Infrastructure
3
+ *
4
+ * Admin UI static site deployment.
5
+ * Dev mode: standard StaticSite with Vite build from source.
6
+ * Package mode: pre-built files with placeholder substitution.
7
+ */
8
+ import fs from "fs";
9
+ import path from "path";
10
+ export function createAdminSite(name, args) {
11
+ const { api, cdn, auth } = args;
12
+ const domainConfig = args.domain
13
+ ? {
14
+ name: args.domain.name,
15
+ cert: args.domain.certificateArn,
16
+ }
17
+ : undefined;
18
+ if (args.dev) {
19
+ // Dev mode: standard StaticSite with Vite build
20
+ const site = new sst.aws.StaticSite(`${name}Admin`, {
21
+ path: args.dev.adminPath,
22
+ build: {
23
+ command: "pnpm build",
24
+ output: "dist",
25
+ },
26
+ environment: {
27
+ VITE_API_URL: api.api.url,
28
+ VITE_CDN_URL: cdn.url,
29
+ VITE_USER_POOL_ID: auth.userPool.id,
30
+ VITE_USER_POOL_CLIENT_ID: auth.userPoolClient.id,
31
+ VITE_AWS_REGION: aws.getRegionOutput().name,
32
+ },
33
+ domain: domainConfig,
34
+ });
35
+ return { site, url: site.url };
36
+ }
37
+ // Package mode: copy pre-built files, replace placeholders at deploy time
38
+ const adminSrc = path.join(args.pkgRoot, "admin");
39
+ // Must be relative — SST's StaticSite prepends CWD to the path
40
+ const workDir = ".headroom/admin";
41
+ // Copy pre-built admin files to a working directory
42
+ // (avoid modifying files in node_modules)
43
+ fs.mkdirSync(workDir, { recursive: true });
44
+ fs.cpSync(adminSrc, workDir, { recursive: true });
45
+ const site = new sst.aws.StaticSite(`${name}Admin`, {
46
+ path: workDir,
47
+ build: {
48
+ // Replace placeholder env vars in the pre-built JS/HTML files
49
+ command: $interpolate `node -e "
50
+ const fs = require('fs');
51
+ const path = require('path');
52
+ const replacements = {
53
+ '__HEADROOM_API_URL__': '${api.api.url}',
54
+ '__HEADROOM_CDN_URL__': '${cdn.url}',
55
+ '__HEADROOM_USER_POOL_ID__': '${auth.userPool.id}',
56
+ '__HEADROOM_USER_POOL_CLIENT_ID__': '${auth.userPoolClient.id}',
57
+ '__HEADROOM_AWS_REGION__': '${aws.getRegionOutput().name}',
58
+ };
59
+ function walk(d) {
60
+ for (const f of fs.readdirSync(d)) {
61
+ const full = path.join(d, f);
62
+ if (fs.statSync(full).isDirectory()) walk(full);
63
+ else if (f.endsWith('.js') || f.endsWith('.html')) {
64
+ let content = fs.readFileSync(full, 'utf8');
65
+ for (const [k, v] of Object.entries(replacements)) {
66
+ content = content.replaceAll(k, v);
67
+ }
68
+ fs.writeFileSync(full, content);
69
+ }
70
+ }
71
+ }
72
+ walk('.');
73
+ "`,
74
+ output: ".",
75
+ },
76
+ domain: domainConfig,
77
+ });
78
+ return { site, url: site.url };
79
+ }
80
+ //# sourceMappingURL=admin-site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-site.js","sourceRoot":"","sources":["../src/admin-site.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAoBxB,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAAmB;IAC/D,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAEhC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM;QAC9B,CAAC,CAAC;YACE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;SACjC;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,gDAAgD;QAChD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,OAAO,EAAE;YAClD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS;YACxB,KAAK,EAAE;gBACL,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,MAAM;aACf;YACD,WAAW,EAAE;gBACX,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG;gBACzB,YAAY,EAAE,GAAG,CAAC,GAAG;gBACrB,iBAAiB,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;gBACnC,wBAAwB,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE;gBAChD,eAAe,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,IAAI;aAC5C;YACD,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,+DAA+D;IAC/D,MAAM,OAAO,GAAG,iBAAiB,CAAC;IAElC,oDAAoD;IACpD,0CAA0C;IAC1C,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,OAAO,EAAE;QAClD,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,8DAA8D;YAC9D,OAAO,EAAE,YAAY,CAAA;;;;qCAIU,GAAG,CAAC,GAAG,CAAC,GAAG;qCACX,GAAG,CAAC,GAAG;0CACF,IAAI,CAAC,QAAQ,CAAC,EAAE;iDACT,IAAI,CAAC,cAAc,CAAC,EAAE;wCAC/B,GAAG,CAAC,eAAe,EAAE,CAAC,IAAI;;;;;;;;;;;;;;;;QAgB1D;YACF,MAAM,EAAE,GAAG;SACZ;QACD,MAAM,EAAE,YAAY;KACrB,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;AACjC,CAAC"}
package/dist/api.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * API Infrastructure
3
+ *
4
+ * Go Lambda function serving the Headroom API with access to all resources.
5
+ * Supports dev mode (Go source with live reload) and package mode (pre-compiled binary).
6
+ */
7
+ import type { StorageResources } from "./storage.js";
8
+ import type { AuthResources } from "./auth.js";
9
+ import type { WebhookResources } from "./webhooks.js";
10
+ import type { ImageResources } from "./image.js";
11
+ export interface ApiArgs {
12
+ storage: StorageResources;
13
+ auth: AuthResources;
14
+ webhooks: WebhookResources;
15
+ image: ImageResources;
16
+ pkgRoot: string;
17
+ dev?: {
18
+ /** Go source path, e.g. "packages/api" */
19
+ handler: string;
20
+ };
21
+ }
22
+ export declare function createApi(name: string, args: ApiArgs): {
23
+ api: sst.aws.Function;
24
+ };
25
+ export type ApiResources = ReturnType<typeof createApi>;
26
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE;QACJ,0CAA0C;QAC1C,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;;EAqFpD;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC"}