convex-cms 0.0.8 → 0.0.9-alpha.3

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 (158) hide show
  1. package/README.md +11 -1
  2. package/admin/src/components/BulkActionBar.tsx +6 -5
  3. package/admin/src/components/ContentEntryEditor.tsx +10 -9
  4. package/admin/src/components/ContentTypeFormModal.tsx +4 -3
  5. package/admin/src/components/Header.tsx +1 -1
  6. package/admin/src/components/RouteGuard.tsx +1 -1
  7. package/admin/src/components/Sidebar.tsx +3 -2
  8. package/admin/src/components/TaxonomyEditor.tsx +4 -3
  9. package/admin/src/components/TermTree.tsx +8 -6
  10. package/admin/src/components/VersionCompare.tsx +3 -2
  11. package/admin/src/components/VersionHistory.tsx +4 -3
  12. package/admin/src/components/fields/CategoryField.tsx +3 -2
  13. package/admin/src/components/fields/MediaField.tsx +6 -5
  14. package/admin/src/components/fields/ReferenceField.tsx +6 -5
  15. package/admin/src/components/fields/TagField.tsx +5 -4
  16. package/admin/src/components/filters/TaxonomyFilter.tsx +4 -3
  17. package/admin/src/components/media/MediaAssetEditDialog.tsx +4 -3
  18. package/admin/src/components/media/MediaFolderEditDialog.tsx +3 -2
  19. package/admin/src/components/media/MediaMoveModal.tsx +4 -3
  20. package/admin/src/components/media/MediaTaxonomyPicker.tsx +6 -5
  21. package/admin/src/contexts/AuthContext.tsx +1 -1
  22. package/admin/src/contexts/SettingsConfigContext.tsx +19 -5
  23. package/admin/src/embed/contexts/ApiContext.tsx +6 -2
  24. package/admin/src/hooks/usePermissions.ts +1 -1
  25. package/admin/src/routes/__root.tsx +7 -3
  26. package/admin-dist/nitro.json +1 -1
  27. package/admin-dist/public/assets/{CmsEmptyState-6-PLaXtD.js → CmsEmptyState-BM4e6N83.js} +1 -1
  28. package/admin-dist/public/assets/{CmsPageHeader-SoF4Epu9.js → CmsPageHeader-uor3DPIk.js} +1 -1
  29. package/admin-dist/public/assets/{CmsStatusBadge-D7kYaohx.js → CmsStatusBadge-D8N18LJx.js} +1 -1
  30. package/admin-dist/public/assets/{CmsSurface-BvksBm6W.js → CmsSurface-BEcY-WpI.js} +1 -1
  31. package/admin-dist/public/assets/{CmsToolbar-DlZPMe2B.js → CmsToolbar-DE-bu3W8.js} +1 -1
  32. package/admin-dist/public/assets/ContentEntryEditor-BdkIMCUk.js +4 -0
  33. package/admin-dist/public/assets/TaxonomyFilter-a1-O9DPs.js +1 -0
  34. package/admin-dist/public/assets/{_contentTypeId-DTv8UoTp.js → _contentTypeId-XIkYOLyY.js} +1 -1
  35. package/admin-dist/public/assets/{_entryId-D3lr5Dvy.js → _entryId-DyP15QpI.js} +1 -1
  36. package/admin-dist/public/assets/{alert-BAHTL6ao.js → alert-DHBQuuib.js} +1 -1
  37. package/admin-dist/public/assets/{badge-oJv4Eai8.js → badge-BOhWFWzb.js} +1 -1
  38. package/admin-dist/public/assets/{circle-check-big-3OHxNDhO.js → circle-check-big-DjTNapen.js} +1 -1
  39. package/admin-dist/public/assets/{command-DwgQs69u.js → command-BIc5_8gL.js} +1 -1
  40. package/admin-dist/public/assets/content-C3N8Ugra.js +1 -0
  41. package/admin-dist/public/assets/content-types-D0wh1eUF.js +1 -0
  42. package/admin-dist/public/assets/{index-DOkgTSx0.js → index-B-g3F_ri.js} +1 -1
  43. package/admin-dist/public/assets/main-BapBJgQD.js +102 -0
  44. package/admin-dist/public/assets/media-8uh1MwDi.js +1 -0
  45. package/admin-dist/public/assets/{new._contentTypeId-VF63rpic.js → new._contentTypeId-S96rFbgY.js} +1 -1
  46. package/admin-dist/public/assets/{pencil-CX1CiTDD.js → pencil-DgaZav4e.js} +1 -1
  47. package/admin-dist/public/assets/{refresh-cw-Cm-YOeFI.js → refresh-cw-BBut4hAU.js} +1 -1
  48. package/admin-dist/public/assets/{rotate-ccw-B45JsL5f.js → rotate-ccw-DVCkojZZ.js} +1 -1
  49. package/admin-dist/public/assets/{scroll-area-b3A1HHR7.js → scroll-area-DPC4uXzf.js} +1 -1
  50. package/admin-dist/public/assets/{search-DKKh_DdH.js → search-CSyHHglh.js} +1 -1
  51. package/admin-dist/public/assets/{settings-CGVDEV1r.js → settings-cEqPsoJ0.js} +1 -1
  52. package/admin-dist/public/assets/{switch-BTMY8Qnk.js → switch-O2BviO8Q.js} +1 -1
  53. package/admin-dist/public/assets/{tabs-DUQwUoIb.js → tabs-p1MWhOqY.js} +1 -1
  54. package/admin-dist/public/assets/{tanstack-adapter-f7AHmQ5L.js → tanstack-adapter-CDrxoPZD.js} +1 -1
  55. package/admin-dist/public/assets/taxonomies-DJ9UbjXW.js +1 -0
  56. package/admin-dist/public/assets/{trash-D7e0uKd9.js → trash-RnpP6lXF.js} +1 -1
  57. package/admin-dist/public/assets/{useBreadcrumbLabel-CF2KYwsw.js → useBreadcrumbLabel-zbIWXlkc.js} +1 -1
  58. package/admin-dist/public/assets/{usePermissions-DWBImEOW.js → usePermissions-4CTlK-vU.js} +1 -1
  59. package/admin-dist/server/_chunks/_libs/@floating-ui/core.mjs +71 -65
  60. package/admin-dist/server/_chunks/_libs/@floating-ui/dom.mjs +1 -1
  61. package/admin-dist/server/_chunks/_libs/@floating-ui/utils.mjs +8 -8
  62. package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +12 -30
  63. package/admin-dist/server/_chunks/_libs/@tanstack/react-store.mjs +1 -56
  64. package/admin-dist/server/_chunks/_libs/@tanstack/router-core.mjs +130 -114
  65. package/admin-dist/server/_chunks/_libs/@tanstack/store.mjs +1 -134
  66. package/admin-dist/server/_chunks/_libs/react-dom.mjs +5 -5
  67. package/admin-dist/server/_chunks/_libs/react.mjs +1 -1
  68. package/admin-dist/server/_libs/isbot.mjs +1 -1
  69. package/admin-dist/server/_libs/use-sync-external-store.mjs +1 -76
  70. package/admin-dist/server/_ssr/{CmsEmptyState-BM8DghTl.mjs → CmsEmptyState-BA0Lc5xs.mjs} +1 -1
  71. package/admin-dist/server/_ssr/{CmsPageHeader-BHUmrIWD.mjs → CmsPageHeader-PMyecILZ.mjs} +1 -1
  72. package/admin-dist/server/_ssr/{CmsStatusBadge-D0Zb0oRl.mjs → CmsStatusBadge-CInuN2bZ.mjs} +2 -2
  73. package/admin-dist/server/_ssr/{CmsSurface-B2eBr-47.mjs → CmsSurface-CH1PIfcS.mjs} +1 -1
  74. package/admin-dist/server/_ssr/{CmsToolbar-BCrwg7OL.mjs → CmsToolbar-IuhSA7gR.mjs} +1 -1
  75. package/admin-dist/server/_ssr/{ContentEntryEditor-Cjfm0uhr.mjs → ContentEntryEditor-Bzhir4fQ.mjs} +38 -31
  76. package/admin-dist/server/_ssr/{TaxonomyFilter-C4pD0kfM.mjs → TaxonomyFilter-r4izSMBh.mjs} +6 -5
  77. package/admin-dist/server/_ssr/{_contentTypeId-CiDiX-p7.mjs → _contentTypeId-BWEbjqxY.mjs} +11 -13
  78. package/admin-dist/server/_ssr/{_entryId-9GxatOkL.mjs → _entryId-B5xoXoJf.mjs} +12 -14
  79. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-CBTan6ii.mjs +4 -0
  80. package/admin-dist/server/_ssr/{badge-EI998zba.mjs → badge-DXrjBRqZ.mjs} +1 -1
  81. package/admin-dist/server/_ssr/{command-BLAWQhUw.mjs → command-Cj90OdCX.mjs} +1 -1
  82. package/admin-dist/server/_ssr/config.server-BOr7Jxr4.mjs +0 -3
  83. package/admin-dist/server/_ssr/{content-BHX39L4D.mjs → content-DKRI-YqL.mjs} +14 -15
  84. package/admin-dist/server/_ssr/{content-types-DCzrBhTH.mjs → content-types-BzgRcS8K.mjs} +7 -9
  85. package/admin-dist/server/_ssr/{index-DwM_5VNP.mjs → index-BPf6_agY.mjs} +4 -6
  86. package/admin-dist/server/_ssr/index.mjs +11 -10
  87. package/admin-dist/server/_ssr/{media-CbzgTRRQ.mjs → media-MpjxOZL8.mjs} +23 -21
  88. package/admin-dist/server/_ssr/{new._contentTypeId-6Ph-Gtlw.mjs → new._contentTypeId-DSb4qR9j.mjs} +11 -13
  89. package/admin-dist/server/_ssr/{router-vd1nySeP.mjs → router-Dk9ikPNc.mjs} +61 -47
  90. package/admin-dist/server/_ssr/{scroll-area--B9snFTJ.mjs → scroll-area-JwVD_6MZ.mjs} +1 -1
  91. package/admin-dist/server/_ssr/{settings-DlTO2JSj.mjs → settings-KVJNe0GM.mjs} +8 -10
  92. package/admin-dist/server/_ssr/{switch-C05NgNW0.mjs → switch-DvREvRv4.mjs} +1 -1
  93. package/admin-dist/server/_ssr/{tabs-DAk2J5xy.mjs → tabs-B0h57pFf.mjs} +1 -1
  94. package/admin-dist/server/_ssr/{tanstack-adapter-DWbaPByn.mjs → tanstack-adapter-gmM64LnW.mjs} +1 -1
  95. package/admin-dist/server/_ssr/{taxonomies-B8nqce6u.mjs → taxonomies-BbBNx260.mjs} +17 -16
  96. package/admin-dist/server/_ssr/{trash-zdlZgpTo.mjs → trash-JAzYGh7A.mjs} +8 -10
  97. package/admin-dist/server/_ssr/{useBreadcrumbLabel-DpEKyG1h.mjs → useBreadcrumbLabel-BWIujj97.mjs} +1 -1
  98. package/admin-dist/server/_ssr/{usePermissions-olYRd9S9.mjs → usePermissions-CcLDCSwa.mjs} +1 -1
  99. package/admin-dist/server/index.mjs +162 -162
  100. package/dist/cli/commands/init.d.ts.map +1 -1
  101. package/dist/cli/commands/init.js +18 -29
  102. package/dist/cli/commands/init.js.map +1 -1
  103. package/dist/cli/templates/admin.d.ts +4 -3
  104. package/dist/cli/templates/admin.d.ts.map +1 -1
  105. package/dist/cli/templates/admin.js +152 -195
  106. package/dist/cli/templates/admin.js.map +1 -1
  107. package/dist/cli/templates/cmsClient.d.ts +2 -2
  108. package/dist/cli/templates/cmsClient.d.ts.map +1 -1
  109. package/dist/cli/templates/cmsClient.js +58 -27
  110. package/dist/cli/templates/cmsClient.js.map +1 -1
  111. package/dist/cli/templates/content.d.ts +10 -0
  112. package/dist/cli/templates/content.d.ts.map +1 -0
  113. package/dist/cli/templates/content.js +257 -0
  114. package/dist/cli/templates/content.js.map +1 -0
  115. package/dist/cli/templates/index.d.ts +3 -2
  116. package/dist/cli/templates/index.d.ts.map +1 -1
  117. package/dist/cli/templates/index.js +3 -2
  118. package/dist/cli/templates/index.js.map +1 -1
  119. package/dist/cli/templates/schemas/blog.d.ts +4 -3
  120. package/dist/cli/templates/schemas/blog.d.ts.map +1 -1
  121. package/dist/cli/templates/schemas/blog.js +44 -13
  122. package/dist/cli/templates/schemas/blog.js.map +1 -1
  123. package/dist/cli/templates/schemas/docs.d.ts +4 -3
  124. package/dist/cli/templates/schemas/docs.d.ts.map +1 -1
  125. package/dist/cli/templates/schemas/docs.js +43 -12
  126. package/dist/cli/templates/schemas/docs.js.map +1 -1
  127. package/dist/cli/templates/schemas/index.d.ts +6 -4
  128. package/dist/cli/templates/schemas/index.d.ts.map +1 -1
  129. package/dist/cli/templates/schemas/index.js +6 -4
  130. package/dist/cli/templates/schemas/index.js.map +1 -1
  131. package/dist/cli/templates/schemas/landing.d.ts +4 -3
  132. package/dist/cli/templates/schemas/landing.d.ts.map +1 -1
  133. package/dist/cli/templates/schemas/landing.js +62 -15
  134. package/dist/cli/templates/schemas/landing.js.map +1 -1
  135. package/dist/cli/utils/fileUtils.d.ts.map +1 -1
  136. package/dist/cli/utils/fileUtils.js +6 -5
  137. package/dist/cli/utils/fileUtils.js.map +1 -1
  138. package/dist/client/admin/index.d.ts +2 -1
  139. package/dist/client/admin/index.d.ts.map +1 -1
  140. package/dist/client/admin/index.js.map +1 -1
  141. package/dist/client/admin/types.d.ts +14 -1
  142. package/dist/client/admin/types.d.ts.map +1 -1
  143. package/dist/client/index.d.ts +1 -1
  144. package/dist/client/index.d.ts.map +1 -1
  145. package/dist/client/index.js.map +1 -1
  146. package/dist/react/index.d.ts +176 -0
  147. package/dist/react/index.d.ts.map +1 -1
  148. package/dist/react/index.js +162 -0
  149. package/dist/react/index.js.map +1 -1
  150. package/package.json +1 -1
  151. package/admin-dist/public/assets/ContentEntryEditor-C6n9xLS9.js +0 -4
  152. package/admin-dist/public/assets/TaxonomyFilter-CFX1_g8s.js +0 -1
  153. package/admin-dist/public/assets/content-CKQ4QwW2.js +0 -1
  154. package/admin-dist/public/assets/content-types-BrttaLpc.js +0 -1
  155. package/admin-dist/public/assets/main-DV6oxWnU.js +0 -102
  156. package/admin-dist/public/assets/media-B2i-mCbx.js +0 -1
  157. package/admin-dist/public/assets/taxonomies-DvMppdiD.js +0 -1
  158. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-CC7UrHKE.mjs +0 -4
@@ -0,0 +1,102 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trash-RnpP6lXF.js","assets/CmsPageHeader-uor3DPIk.js","assets/CmsToolbar-DE-bu3W8.js","assets/search-CSyHHglh.js","assets/CmsEmptyState-BM4e6N83.js","assets/CmsSurface-BEcY-WpI.js","assets/badge-BOhWFWzb.js","assets/alert-DHBQuuib.js","assets/rotate-ccw-DVCkojZZ.js","assets/tanstack-adapter-CDrxoPZD.js","assets/taxonomies-DJ9UbjXW.js","assets/pencil-DgaZav4e.js","assets/scroll-area-DPC4uXzf.js","assets/settings-cEqPsoJ0.js","assets/usePermissions-4CTlK-vU.js","assets/switch-O2BviO8Q.js","assets/media-8uh1MwDi.js","assets/tabs-p1MWhOqY.js","assets/refresh-cw-BBut4hAU.js","assets/TaxonomyFilter-a1-O9DPs.js","assets/command-BIc5_8gL.js","assets/content-types-D0wh1eUF.js","assets/content-C3N8Ugra.js","assets/circle-check-big-DjTNapen.js","assets/CmsStatusBadge-D8N18LJx.js","assets/index-B-g3F_ri.js","assets/_entryId-DyP15QpI.js","assets/ContentEntryEditor-BdkIMCUk.js","assets/useBreadcrumbLabel-zbIWXlkc.js","assets/_contentTypeId-XIkYOLyY.js","assets/new._contentTypeId-S96rFbgY.js"])))=>i.map(i=>d[i]);
2
+ function QT(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const c=Object.getOwnPropertyDescriptor(s,i);c&&Object.defineProperty(e,i,c.get?c:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function WS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qh={exports:{}},Bi={};var _0;function GT(){if(_0)return Bi;_0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(s,i,c){var u=null;if(c!==void 0&&(u=""+c),i.key!==void 0&&(u=""+i.key),"key"in i){c={};for(var f in i)f!=="key"&&(c[f]=i[f])}else c=i;return i=c.ref,{$$typeof:e,type:s,key:u,ref:i!==void 0?i:null,props:c}}return Bi.Fragment=t,Bi.jsx=r,Bi.jsxs=r,Bi}var C0;function YT(){return C0||(C0=1,qh.exports=GT()),qh.exports}var g=YT(),Fh={exports:{}},Re={};var E0;function KT(){if(E0)return Re;E0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function _(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function O(D,Q,ne){this.props=D,this.context=Q,this.refs=C,this.updater=ne||E}O.prototype.isReactComponent={},O.prototype.setState=function(D,Q){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,Q,"setState")},O.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function M(){}M.prototype=O.prototype;function k(D,Q,ne){this.props=D,this.context=Q,this.refs=C,this.updater=ne||E}var N=k.prototype=new M;N.constructor=k,x(N,O.prototype),N.isPureReactComponent=!0;var U=Array.isArray;function H(){}var L={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function Y(D,Q,ne){var re=ne.ref;return{$$typeof:e,type:D,key:Q,ref:re!==void 0?re:null,props:ne}}function ie(D,Q){return Y(D.type,Q,D.props)}function ae(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function oe(D){var Q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ne){return Q[ne]})}var le=/\/+/g;function ce(D,Q){return typeof D=="object"&&D!==null&&D.key!=null?oe(""+D.key):Q.toString(36)}function me(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(H,H):(D.status="pending",D.then(function(Q){D.status==="pending"&&(D.status="fulfilled",D.value=Q)},function(Q){D.status==="pending"&&(D.status="rejected",D.reason=Q)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function I(D,Q,ne,re,ue){var ye=typeof D;(ye==="undefined"||ye==="boolean")&&(D=null);var X=!1;if(D===null)X=!0;else switch(ye){case"bigint":case"string":case"number":X=!0;break;case"object":switch(D.$$typeof){case e:case t:X=!0;break;case y:return X=D._init,I(X(D._payload),Q,ne,re,ue)}}if(X)return ue=ue(D),X=re===""?"."+ce(D,0):re,U(ue)?(ne="",X!=null&&(ne=X.replace(le,"$&/")+"/"),I(ue,Q,ne,"",function(Ee){return Ee})):ue!=null&&(ae(ue)&&(ue=ie(ue,ne+(ue.key==null||D&&D.key===ue.key?"":(""+ue.key).replace(le,"$&/")+"/")+X)),Q.push(ue)),1;X=0;var xe=re===""?".":re+":";if(U(D))for(var Ce=0;Ce<D.length;Ce++)re=D[Ce],ye=xe+ce(re,Ce),X+=I(re,Q,ne,ye,ue);else if(Ce=_(D),typeof Ce=="function")for(D=Ce.call(D),Ce=0;!(re=D.next()).done;)re=re.value,ye=xe+ce(re,Ce++),X+=I(re,Q,ne,ye,ue);else if(ye==="object"){if(typeof D.then=="function")return I(me(D),Q,ne,re,ue);throw Q=String(D),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return X}function K(D,Q,ne){if(D==null)return D;var re=[],ue=0;return I(D,re,"","",function(ye){return Q.call(ne,ye,ue++)}),re}function V(D){if(D._status===-1){var Q=D._result;Q=Q(),Q.then(function(ne){(D._status===0||D._status===-1)&&(D._status=1,D._result=ne)},function(ne){(D._status===0||D._status===-1)&&(D._status=2,D._result=ne)}),D._status===-1&&(D._status=0,D._result=Q)}if(D._status===1)return D._result.default;throw D._result}var te=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},ve={map:K,forEach:function(D,Q,ne){K(D,function(){Q.apply(this,arguments)},ne)},count:function(D){var Q=0;return K(D,function(){Q++}),Q},toArray:function(D){return K(D,function(Q){return Q})||[]},only:function(D){if(!ae(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Re.Activity=v,Re.Children=ve,Re.Component=O,Re.Fragment=r,Re.Profiler=i,Re.PureComponent=k,Re.StrictMode=s,Re.Suspense=h,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Re.__COMPILER_RUNTIME={__proto__:null,c:function(D){return L.H.useMemoCache(D)}},Re.cache=function(D){return function(){return D.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(D,Q,ne){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var re=x({},D.props),ue=D.key;if(Q!=null)for(ye in Q.key!==void 0&&(ue=""+Q.key),Q)!z.call(Q,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&Q.ref===void 0||(re[ye]=Q[ye]);var ye=arguments.length-2;if(ye===1)re.children=ne;else if(1<ye){for(var X=Array(ye),xe=0;xe<ye;xe++)X[xe]=arguments[xe+2];re.children=X}return Y(D.type,ue,re)},Re.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},Re.createElement=function(D,Q,ne){var re,ue={},ye=null;if(Q!=null)for(re in Q.key!==void 0&&(ye=""+Q.key),Q)z.call(Q,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=Q[re]);var X=arguments.length-2;if(X===1)ue.children=ne;else if(1<X){for(var xe=Array(X),Ce=0;Ce<X;Ce++)xe[Ce]=arguments[Ce+2];ue.children=xe}if(D&&D.defaultProps)for(re in X=D.defaultProps,X)ue[re]===void 0&&(ue[re]=X[re]);return Y(D,ye,ue)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(D){return{$$typeof:f,render:D}},Re.isValidElement=ae,Re.lazy=function(D){return{$$typeof:y,_payload:{_status:-1,_result:D},_init:V}},Re.memo=function(D,Q){return{$$typeof:p,type:D,compare:Q===void 0?null:Q}},Re.startTransition=function(D){var Q=L.T,ne={};L.T=ne;try{var re=D(),ue=L.S;ue!==null&&ue(ne,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(H,te)}catch(ye){te(ye)}finally{Q!==null&&ne.types!==null&&(Q.types=ne.types),L.T=Q}},Re.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Re.use=function(D){return L.H.use(D)},Re.useActionState=function(D,Q,ne){return L.H.useActionState(D,Q,ne)},Re.useCallback=function(D,Q){return L.H.useCallback(D,Q)},Re.useContext=function(D){return L.H.useContext(D)},Re.useDebugValue=function(){},Re.useDeferredValue=function(D,Q){return L.H.useDeferredValue(D,Q)},Re.useEffect=function(D,Q){return L.H.useEffect(D,Q)},Re.useEffectEvent=function(D){return L.H.useEffectEvent(D)},Re.useId=function(){return L.H.useId()},Re.useImperativeHandle=function(D,Q,ne){return L.H.useImperativeHandle(D,Q,ne)},Re.useInsertionEffect=function(D,Q){return L.H.useInsertionEffect(D,Q)},Re.useLayoutEffect=function(D,Q){return L.H.useLayoutEffect(D,Q)},Re.useMemo=function(D,Q){return L.H.useMemo(D,Q)},Re.useOptimistic=function(D,Q){return L.H.useOptimistic(D,Q)},Re.useReducer=function(D,Q,ne){return L.H.useReducer(D,Q,ne)},Re.useRef=function(D){return L.H.useRef(D)},Re.useState=function(D){return L.H.useState(D)},Re.useSyncExternalStore=function(D,Q,ne){return L.H.useSyncExternalStore(D,Q,ne)},Re.useTransition=function(){return L.H.useTransition()},Re.version="19.2.4",Re}var R0;function bc(){return R0||(R0=1,Fh.exports=KT()),Fh.exports}var w=bc();const Ft=WS(w),Yu=QT({__proto__:null,default:Ft},[w]);var Vh={exports:{}},qi={},Hh={exports:{}},Zh={};var T0;function XT(){return T0||(T0=1,(function(e){function t(I,K){var V=I.length;I.push(K);e:for(;0<V;){var te=V-1>>>1,ve=I[te];if(0<i(ve,K))I[te]=K,I[V]=ve,V=te;else break e}}function r(I){return I.length===0?null:I[0]}function s(I){if(I.length===0)return null;var K=I[0],V=I.pop();if(V!==K){I[0]=V;e:for(var te=0,ve=I.length,D=ve>>>1;te<D;){var Q=2*(te+1)-1,ne=I[Q],re=Q+1,ue=I[re];if(0>i(ne,V))re<ve&&0>i(ue,ne)?(I[te]=ue,I[re]=V,te=re):(I[te]=ne,I[Q]=V,te=Q);else if(re<ve&&0>i(ue,V))I[te]=ue,I[re]=V,te=re;else break e}}return K}function i(I,K){var V=I.sortIndex-K.sortIndex;return V!==0?V:I.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],y=1,v=null,b=3,_=!1,E=!1,x=!1,C=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function N(I){for(var K=r(p);K!==null;){if(K.callback===null)s(p);else if(K.startTime<=I)s(p),K.sortIndex=K.expirationTime,t(h,K);else break;K=r(p)}}function U(I){if(x=!1,N(I),!E)if(r(h)!==null)E=!0,H||(H=!0,oe());else{var K=r(p);K!==null&&me(U,K.startTime-I)}}var H=!1,L=-1,z=5,Y=-1;function ie(){return C?!0:!(e.unstable_now()-Y<z)}function ae(){if(C=!1,H){var I=e.unstable_now();Y=I;var K=!0;try{e:{E=!1,x&&(x=!1,M(L),L=-1),_=!0;var V=b;try{t:{for(N(I),v=r(h);v!==null&&!(v.expirationTime>I&&ie());){var te=v.callback;if(typeof te=="function"){v.callback=null,b=v.priorityLevel;var ve=te(v.expirationTime<=I);if(I=e.unstable_now(),typeof ve=="function"){v.callback=ve,N(I),K=!0;break t}v===r(h)&&s(h),N(I)}else s(h);v=r(h)}if(v!==null)K=!0;else{var D=r(p);D!==null&&me(U,D.startTime-I),K=!1}}break e}finally{v=null,b=V,_=!1}K=void 0}}finally{K?oe():H=!1}}}var oe;if(typeof k=="function")oe=function(){k(ae)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,ce=le.port2;le.port1.onmessage=ae,oe=function(){ce.postMessage(null)}}else oe=function(){O(ae,0)};function me(I,K){L=O(function(){I(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(I){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var V=b;b=K;try{return I()}finally{b=V}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(I,K){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var V=b;b=I;try{return K()}finally{b=V}},e.unstable_scheduleCallback=function(I,K,V){var te=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?te+V:te):V=te,I){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=V+ve,I={id:y++,callback:K,priorityLevel:I,startTime:V,expirationTime:ve,sortIndex:-1},V>te?(I.sortIndex=V,t(p,I),r(h)===null&&I===r(p)&&(x?(M(L),L=-1):x=!0,me(U,V-te))):(I.sortIndex=ve,t(h,I),E||_||(E=!0,H||(H=!0,oe()))),I},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(I){var K=b;return function(){var V=b;b=K;try{return I.apply(this,arguments)}finally{b=V}}}})(Zh)),Zh}var A0;function JT(){return A0||(A0=1,Hh.exports=XT()),Hh.exports}var Qh={exports:{}},qt={};var O0;function WT(){if(O0)return qt;O0=1;var e=bc();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function c(h,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:h,containerInfo:p,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,qt.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(h,p,null,y)},qt.flushSync=function(h){var p=u.T,y=s.p;try{if(u.T=null,s.p=2,h)return h()}finally{u.T=p,s.p=y,s.d.f()}},qt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(h,p))},qt.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},qt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?s.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:_}):y==="script"&&s.d.X(h,{crossOrigin:v,integrity:b,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},qt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);s.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(h)},qt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin);s.d.L(h,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},qt.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=f(p.as,p.crossOrigin);s.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(h)},qt.requestFormReset=function(h){s.d.r(h)},qt.unstable_batchedUpdates=function(h,p){return h(p)},qt.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},qt.useFormStatus=function(){return u.H.useHostTransitionStatus()},qt.version="19.2.4",qt}var k0;function ex(){if(k0)return Qh.exports;k0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qh.exports=WT(),Qh.exports}var M0;function eA(){if(M0)return qi;M0=1;var e=JT(),t=bc(),r=ex();function s(n){var o="https://react.dev/errors/"+n;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var o=n,a=n;if(n.alternate)for(;o.return;)o=o.return;else{n=o;do o=n,(o.flags&4098)!==0&&(a=o.return),n=o.return;while(n)}return o.tag===3?a:null}function u(n){if(n.tag===13){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function f(n){if(n.tag===31){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(s(188))}function p(n){var o=n.alternate;if(!o){if(o=c(n),o===null)throw Error(s(188));return o!==n?null:n}for(var a=n,l=o;;){var d=a.return;if(d===null)break;var m=d.alternate;if(m===null){if(l=d.return,l!==null){a=l;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===a)return h(d),n;if(m===l)return h(d),o;m=m.sibling}throw Error(s(188))}if(a.return!==l.return)a=d,l=m;else{for(var S=!1,R=d.child;R;){if(R===a){S=!0,a=d,l=m;break}if(R===l){S=!0,l=d,a=m;break}R=R.sibling}if(!S){for(R=m.child;R;){if(R===a){S=!0,a=m,l=d;break}if(R===l){S=!0,l=m,a=d;break}R=R.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?n:o}function y(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n;for(n=n.child;n!==null;){if(o=y(n),o!==null)return o;n=n.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),k=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function oe(n){return n===null||typeof n!="object"?null:(n=ae&&n[ae]||n["@@iterator"],typeof n=="function"?n:null)}var le=Symbol.for("react.client.reference");function ce(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===le?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case x:return"Fragment";case O:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case H:return"SuspenseList";case Y:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case k:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case N:var o=n.render;return n=n.displayName,n||(n=o.displayName||o.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return o=n.displayName||null,o!==null?o:ce(n.type)||"Memo";case z:o=n._payload,n=n._init;try{return ce(n(o))}catch{}}return null}var me=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},te=[],ve=-1;function D(n){return{current:n}}function Q(n){0>ve||(n.current=te[ve],te[ve]=null,ve--)}function ne(n,o){ve++,te[ve]=n.current,n.current=o}var re=D(null),ue=D(null),ye=D(null),X=D(null);function xe(n,o){switch(ne(ye,o),ne(ue,n),ne(re,null),o.nodeType){case 9:case 11:n=(n=o.documentElement)&&(n=n.namespaceURI)?Zb(n):0;break;default:if(n=o.tagName,o=o.namespaceURI)o=Zb(o),n=Qb(o,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Q(re),ne(re,n)}function Ce(){Q(re),Q(ue),Q(ye)}function Ee(n){n.memoizedState!==null&&ne(X,n);var o=re.current,a=Qb(o,n.type);o!==a&&(ne(ue,n),ne(re,a))}function Oe(n){ue.current===n&&(Q(re),Q(ue)),X.current===n&&(Q(X),Li._currentValue=V)}var ze,lt;function Rt(n){if(ze===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);ze=o&&o[1]||"",lt=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+ze+n+lt}var ln=!1;function _n(n,o){if(!n||ln)return"";ln=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(o){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(Z){var F=Z}Reflect.construct(n,[],ee)}else{try{ee.call()}catch(Z){F=Z}n.call(ee.prototype)}}else{try{throw Error()}catch(Z){F=Z}(ee=n())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(Z){if(Z&&F&&typeof Z.stack=="string")return[Z.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),S=m[0],R=m[1];if(S&&R){var j=S.split(`
5
+ `),q=R.split(`
6
+ `);for(d=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;d<q.length&&!q[d].includes("DetermineComponentFrameRoot");)d++;if(l===j.length||d===q.length)for(l=j.length-1,d=q.length-1;1<=l&&0<=d&&j[l]!==q[d];)d--;for(;1<=l&&0<=d;l--,d--)if(j[l]!==q[d]){if(l!==1||d!==1)do if(l--,d--,0>d||j[l]!==q[d]){var G=`
7
+ `+j[l].replace(" at new "," at ");return n.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",n.displayName)),G}while(1<=l&&0<=d);break}}}finally{ln=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?Rt(a):""}function Ut(n,o){switch(n.tag){case 26:case 27:case 5:return Rt(n.type);case 16:return Rt("Lazy");case 13:return n.child!==o&&o!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return _n(n.type,!1);case 11:return _n(n.type.render,!1);case 1:return _n(n.type,!0);case 31:return Rt("Activity");default:return""}}function yt(n){try{var o="",a=null;do o+=Ut(n,a),a=n,n=n.return;while(n);return o}catch(l){return`
8
+ Error generating stack: `+l.message+`
9
+ `+l.stack}}var se=Object.prototype.hasOwnProperty,ke=e.unstable_scheduleCallback,Ue=e.unstable_cancelCallback,De=e.unstable_shouldYield,jt=e.unstable_requestPaint,Ht=e.unstable_now,Of=e.unstable_getCurrentPriorityLevel,nt=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,Bt=e.unstable_NormalPriority,Mc=e.unstable_LowPriority,Rg=e.unstable_IdlePriority,OR=e.log,kR=e.unstable_setDisableYieldValue,Ya=null,un=null;function Zr(n){if(typeof OR=="function"&&kR(n),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(Ya,n)}catch{}}var fn=Math.clz32?Math.clz32:jR,MR=Math.log,NR=Math.LN2;function jR(n){return n>>>=0,n===0?32:31-(MR(n)/NR|0)|0}var Nc=256,jc=262144,zc=4194304;function $o(n){var o=n&42;if(o!==0)return o;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Dc(n,o,a){var l=n.pendingLanes;if(l===0)return 0;var d=0,m=n.suspendedLanes,S=n.pingedLanes;n=n.warmLanes;var R=l&134217727;return R!==0?(l=R&~m,l!==0?d=$o(l):(S&=R,S!==0?d=$o(S):a||(a=R&~n,a!==0&&(d=$o(a))))):(R=l&~m,R!==0?d=$o(R):S!==0?d=$o(S):a||(a=l&~n,a!==0&&(d=$o(a)))),d===0?0:o!==0&&o!==d&&(o&m)===0&&(m=d&-d,a=o&-o,m>=a||m===32&&(a&4194048)!==0)?o:d}function Ka(n,o){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&o)===0}function zR(n,o){switch(n){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tg(){var n=zc;return zc<<=1,(zc&62914560)===0&&(zc=4194304),n}function kf(n){for(var o=[],a=0;31>a;a++)o.push(n);return o}function Xa(n,o){n.pendingLanes|=o,o!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function DR(n,o,a,l,d,m){var S=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var R=n.entanglements,j=n.expirationTimes,q=n.hiddenUpdates;for(a=S&~a;0<a;){var G=31-fn(a),ee=1<<G;R[G]=0,j[G]=-1;var F=q[G];if(F!==null)for(q[G]=null,G=0;G<F.length;G++){var Z=F[G];Z!==null&&(Z.lane&=-536870913)}a&=~ee}l!==0&&Ag(n,l,0),m!==0&&d===0&&n.tag!==0&&(n.suspendedLanes|=m&~(S&~o))}function Ag(n,o,a){n.pendingLanes|=o,n.suspendedLanes&=~o;var l=31-fn(o);n.entangledLanes|=o,n.entanglements[l]=n.entanglements[l]|1073741824|a&261930}function Og(n,o){var a=n.entangledLanes|=o;for(n=n.entanglements;a;){var l=31-fn(a),d=1<<l;d&o|n[l]&o&&(n[l]|=o),a&=~d}}function kg(n,o){var a=o&-o;return a=(a&42)!==0?1:Mf(a),(a&(n.suspendedLanes|o))!==0?0:a}function Mf(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Nf(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Mg(){var n=K.p;return n!==0?n:(n=window.event,n===void 0?32:g0(n.type))}function Ng(n,o){var a=K.p;try{return K.p=n,o()}finally{K.p=a}}var Qr=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Qr,Kt="__reactProps$"+Qr,As="__reactContainer$"+Qr,jf="__reactEvents$"+Qr,PR="__reactListeners$"+Qr,LR="__reactHandles$"+Qr,jg="__reactResources$"+Qr,Ja="__reactMarker$"+Qr;function zf(n){delete n[Dt],delete n[Kt],delete n[jf],delete n[PR],delete n[LR]}function Os(n){var o=n[Dt];if(o)return o;for(var a=n.parentNode;a;){if(o=a[As]||a[Dt]){if(a=o.alternate,o.child!==null||a!==null&&a.child!==null)for(n=e0(n);n!==null;){if(a=n[Dt])return a;n=e0(n)}return o}n=a,a=n.parentNode}return null}function ks(n){if(n=n[Dt]||n[As]){var o=n.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return n}return null}function Wa(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n.stateNode;throw Error(s(33))}function Ms(n){var o=n[jg];return o||(o=n[jg]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Mt(n){n[Ja]=!0}var zg=new Set,Dg={};function Uo(n,o){Ns(n,o),Ns(n+"Capture",o)}function Ns(n,o){for(Dg[n]=o,n=0;n<o.length;n++)zg.add(o[n])}var IR=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pg={},Lg={};function $R(n){return se.call(Lg,n)?!0:se.call(Pg,n)?!1:IR.test(n)?Lg[n]=!0:(Pg[n]=!0,!1)}function Pc(n,o,a){if($R(o))if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(o);return;case"boolean":var l=o.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(o);return}}n.setAttribute(o,""+a)}}function Lc(n,o,a){if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttribute(o,""+a)}}function yr(n,o,a,l){if(l===null)n.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(o,a,""+l)}}function Cn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ig(n){var o=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function UR(n,o,a){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,o);if(!n.hasOwnProperty(o)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,m=l.set;return Object.defineProperty(n,o,{configurable:!0,get:function(){return d.call(this)},set:function(S){a=""+S,m.call(this,S)}}),Object.defineProperty(n,o,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){n._valueTracker=null,delete n[o]}}}}function Df(n){if(!n._valueTracker){var o=Ig(n)?"checked":"value";n._valueTracker=UR(n,o,""+n[o])}}function $g(n){if(!n)return!1;var o=n._valueTracker;if(!o)return!0;var a=o.getValue(),l="";return n&&(l=Ig(n)?n.checked?"true":"false":n.value),n=l,n!==a?(o.setValue(n),!0):!1}function Ic(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var BR=/[\n"\\]/g;function En(n){return n.replace(BR,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Pf(n,o,a,l,d,m,S,R){n.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.type=S:n.removeAttribute("type"),o!=null?S==="number"?(o===0&&n.value===""||n.value!=o)&&(n.value=""+Cn(o)):n.value!==""+Cn(o)&&(n.value=""+Cn(o)):S!=="submit"&&S!=="reset"||n.removeAttribute("value"),o!=null?Lf(n,S,Cn(o)):a!=null?Lf(n,S,Cn(a)):l!=null&&n.removeAttribute("value"),d==null&&m!=null&&(n.defaultChecked=!!m),d!=null&&(n.checked=d&&typeof d!="function"&&typeof d!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?n.name=""+Cn(R):n.removeAttribute("name")}function Ug(n,o,a,l,d,m,S,R){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(n.type=m),o!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||o!=null)){Df(n);return}a=a!=null?""+Cn(a):"",o=o!=null?""+Cn(o):a,R||o===n.value||(n.value=o),n.defaultValue=o}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=R?n.checked:!!l,n.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(n.name=S),Df(n)}function Lf(n,o,a){o==="number"&&Ic(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function js(n,o,a,l){if(n=n.options,o){o={};for(var d=0;d<a.length;d++)o["$"+a[d]]=!0;for(a=0;a<n.length;a++)d=o.hasOwnProperty("$"+n[a].value),n[a].selected!==d&&(n[a].selected=d),d&&l&&(n[a].defaultSelected=!0)}else{for(a=""+Cn(a),o=null,d=0;d<n.length;d++){if(n[d].value===a){n[d].selected=!0,l&&(n[d].defaultSelected=!0);return}o!==null||n[d].disabled||(o=n[d])}o!==null&&(o.selected=!0)}}function Bg(n,o,a){if(o!=null&&(o=""+Cn(o),o!==n.value&&(n.value=o),a==null)){n.defaultValue!==o&&(n.defaultValue=o);return}n.defaultValue=a!=null?""+Cn(a):""}function qg(n,o,a,l){if(o==null){if(l!=null){if(a!=null)throw Error(s(92));if(me(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),o=a}a=Cn(o),n.defaultValue=a,l=n.textContent,l===a&&l!==""&&l!==null&&(n.value=l),Df(n)}function zs(n,o){if(o){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=o;return}}n.textContent=o}var qR=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Fg(n,o,a){var l=o.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="":l?n.setProperty(o,a):typeof a!="number"||a===0||qR.has(o)?o==="float"?n.cssFloat=a:n[o]=(""+a).trim():n[o]=a+"px"}function Vg(n,o,a){if(o!=null&&typeof o!="object")throw Error(s(62));if(n=n.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||o!=null&&o.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var d in o)l=o[d],o.hasOwnProperty(d)&&a[d]!==l&&Fg(n,d,l)}else for(var m in o)o.hasOwnProperty(m)&&Fg(n,m,o[m])}function If(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var FR=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),VR=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $c(n){return VR.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function vr(){}var $f=null;function Uf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ds=null,Ps=null;function Hg(n){var o=ks(n);if(o&&(n=o.stateNode)){var a=n[Kt]||null;e:switch(n=o.stateNode,o.type){case"input":if(Pf(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),o=a.name,a.type==="radio"&&o!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+En(""+o)+'"][type="radio"]'),o=0;o<a.length;o++){var l=a[o];if(l!==n&&l.form===n.form){var d=l[Kt]||null;if(!d)throw Error(s(90));Pf(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(o=0;o<a.length;o++)l=a[o],l.form===n.form&&$g(l)}break e;case"textarea":Bg(n,a.value,a.defaultValue);break e;case"select":o=a.value,o!=null&&js(n,!!a.multiple,o,!1)}}}var Bf=!1;function Zg(n,o,a){if(Bf)return n(o,a);Bf=!0;try{var l=n(o);return l}finally{if(Bf=!1,(Ds!==null||Ps!==null)&&(Rl(),Ds&&(o=Ds,n=Ps,Ps=Ds=null,Hg(o),n)))for(o=0;o<n.length;o++)Hg(n[o])}}function ei(n,o){var a=n.stateNode;if(a===null)return null;var l=a[Kt]||null;if(l===null)return null;a=l[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(s(231,o,typeof a));return a}var br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qf=!1;if(br)try{var ti={};Object.defineProperty(ti,"passive",{get:function(){qf=!0}}),window.addEventListener("test",ti,ti),window.removeEventListener("test",ti,ti)}catch{qf=!1}var Gr=null,Ff=null,Uc=null;function Qg(){if(Uc)return Uc;var n,o=Ff,a=o.length,l,d="value"in Gr?Gr.value:Gr.textContent,m=d.length;for(n=0;n<a&&o[n]===d[n];n++);var S=a-n;for(l=1;l<=S&&o[a-l]===d[m-l];l++);return Uc=d.slice(n,1<l?1-l:void 0)}function Bc(n){var o=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&o===13&&(n=13)):n=o,n===10&&(n=13),32<=n||n===13?n:0}function qc(){return!0}function Gg(){return!1}function Xt(n){function o(a,l,d,m,S){this._reactName=a,this._targetInst=d,this.type=l,this.nativeEvent=m,this.target=S,this.currentTarget=null;for(var R in n)n.hasOwnProperty(R)&&(a=n[R],this[R]=a?a(m):m[R]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?qc:Gg,this.isPropagationStopped=Gg,this}return v(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=qc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=qc)},persist:function(){},isPersistent:qc}),o}var Bo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fc=Xt(Bo),ni=v({},Bo,{view:0,detail:0}),HR=Xt(ni),Vf,Hf,ri,Vc=v({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ri&&(ri&&n.type==="mousemove"?(Vf=n.screenX-ri.screenX,Hf=n.screenY-ri.screenY):Hf=Vf=0,ri=n),Vf)},movementY:function(n){return"movementY"in n?n.movementY:Hf}}),Yg=Xt(Vc),ZR=v({},Vc,{dataTransfer:0}),QR=Xt(ZR),GR=v({},ni,{relatedTarget:0}),Zf=Xt(GR),YR=v({},Bo,{animationName:0,elapsedTime:0,pseudoElement:0}),KR=Xt(YR),XR=v({},Bo,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),JR=Xt(XR),WR=v({},Bo,{data:0}),Kg=Xt(WR),e2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},n2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r2(n){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(n):(n=n2[n])?!!o[n]:!1}function Qf(){return r2}var o2=v({},ni,{key:function(n){if(n.key){var o=e2[n.key]||n.key;if(o!=="Unidentified")return o}return n.type==="keypress"?(n=Bc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?t2[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qf,charCode:function(n){return n.type==="keypress"?Bc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Bc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),s2=Xt(o2),a2=v({},Vc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xg=Xt(a2),i2=v({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qf}),c2=Xt(i2),l2=v({},Bo,{propertyName:0,elapsedTime:0,pseudoElement:0}),u2=Xt(l2),f2=v({},Vc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),d2=Xt(f2),h2=v({},Bo,{newState:0,oldState:0}),p2=Xt(h2),m2=[9,13,27,32],Gf=br&&"CompositionEvent"in window,oi=null;br&&"documentMode"in document&&(oi=document.documentMode);var g2=br&&"TextEvent"in window&&!oi,Jg=br&&(!Gf||oi&&8<oi&&11>=oi),Wg=" ",ey=!1;function ty(n,o){switch(n){case"keyup":return m2.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ny(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ls=!1;function y2(n,o){switch(n){case"compositionend":return ny(o);case"keypress":return o.which!==32?null:(ey=!0,Wg);case"textInput":return n=o.data,n===Wg&&ey?null:n;default:return null}}function v2(n,o){if(Ls)return n==="compositionend"||!Gf&&ty(n,o)?(n=Qg(),Uc=Ff=Gr=null,Ls=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Jg&&o.locale!=="ko"?null:o.data;default:return null}}var b2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ry(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o==="input"?!!b2[n.type]:o==="textarea"}function oy(n,o,a,l){Ds?Ps?Ps.push(l):Ps=[l]:Ds=l,o=jl(o,"onChange"),0<o.length&&(a=new Fc("onChange","change",null,a,l),n.push({event:a,listeners:o}))}var si=null,ai=null;function w2(n){Ub(n,0)}function Hc(n){var o=Wa(n);if($g(o))return n}function sy(n,o){if(n==="change")return o}var ay=!1;if(br){var Yf;if(br){var Kf="oninput"in document;if(!Kf){var iy=document.createElement("div");iy.setAttribute("oninput","return;"),Kf=typeof iy.oninput=="function"}Yf=Kf}else Yf=!1;ay=Yf&&(!document.documentMode||9<document.documentMode)}function cy(){si&&(si.detachEvent("onpropertychange",ly),ai=si=null)}function ly(n){if(n.propertyName==="value"&&Hc(ai)){var o=[];oy(o,ai,n,Uf(n)),Zg(w2,o)}}function S2(n,o,a){n==="focusin"?(cy(),si=o,ai=a,si.attachEvent("onpropertychange",ly)):n==="focusout"&&cy()}function x2(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Hc(ai)}function _2(n,o){if(n==="click")return Hc(o)}function C2(n,o){if(n==="input"||n==="change")return Hc(o)}function E2(n,o){return n===o&&(n!==0||1/n===1/o)||n!==n&&o!==o}var dn=typeof Object.is=="function"?Object.is:E2;function ii(n,o){if(dn(n,o))return!0;if(typeof n!="object"||n===null||typeof o!="object"||o===null)return!1;var a=Object.keys(n),l=Object.keys(o);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var d=a[l];if(!se.call(o,d)||!dn(n[d],o[d]))return!1}return!0}function uy(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function fy(n,o){var a=uy(n);n=0;for(var l;a;){if(a.nodeType===3){if(l=n+a.textContent.length,n<=o&&l>=o)return{node:a,offset:o-n};n=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=uy(a)}}function dy(n,o){return n&&o?n===o?!0:n&&n.nodeType===3?!1:o&&o.nodeType===3?dy(n,o.parentNode):"contains"in n?n.contains(o):n.compareDocumentPosition?!!(n.compareDocumentPosition(o)&16):!1:!1}function hy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var o=Ic(n.document);o instanceof n.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)n=o.contentWindow;else break;o=Ic(n.document)}return o}function Xf(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o&&(o==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||o==="textarea"||n.contentEditable==="true")}var R2=br&&"documentMode"in document&&11>=document.documentMode,Is=null,Jf=null,ci=null,Wf=!1;function py(n,o,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Wf||Is==null||Is!==Ic(l)||(l=Is,"selectionStart"in l&&Xf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ci&&ii(ci,l)||(ci=l,l=jl(Jf,"onSelect"),0<l.length&&(o=new Fc("onSelect","select",null,o,a),n.push({event:o,listeners:l}),o.target=Is)))}function qo(n,o){var a={};return a[n.toLowerCase()]=o.toLowerCase(),a["Webkit"+n]="webkit"+o,a["Moz"+n]="moz"+o,a}var $s={animationend:qo("Animation","AnimationEnd"),animationiteration:qo("Animation","AnimationIteration"),animationstart:qo("Animation","AnimationStart"),transitionrun:qo("Transition","TransitionRun"),transitionstart:qo("Transition","TransitionStart"),transitioncancel:qo("Transition","TransitionCancel"),transitionend:qo("Transition","TransitionEnd")},ed={},my={};br&&(my=document.createElement("div").style,"AnimationEvent"in window||(delete $s.animationend.animation,delete $s.animationiteration.animation,delete $s.animationstart.animation),"TransitionEvent"in window||delete $s.transitionend.transition);function Fo(n){if(ed[n])return ed[n];if(!$s[n])return n;var o=$s[n],a;for(a in o)if(o.hasOwnProperty(a)&&a in my)return ed[n]=o[a];return n}var gy=Fo("animationend"),yy=Fo("animationiteration"),vy=Fo("animationstart"),T2=Fo("transitionrun"),A2=Fo("transitionstart"),O2=Fo("transitioncancel"),by=Fo("transitionend"),wy=new Map,td="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");td.push("scrollEnd");function Fn(n,o){wy.set(n,o),Uo(o,[n])}var Zc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Rn=[],Us=0,nd=0;function Qc(){for(var n=Us,o=nd=Us=0;o<n;){var a=Rn[o];Rn[o++]=null;var l=Rn[o];Rn[o++]=null;var d=Rn[o];Rn[o++]=null;var m=Rn[o];if(Rn[o++]=null,l!==null&&d!==null){var S=l.pending;S===null?d.next=d:(d.next=S.next,S.next=d),l.pending=d}m!==0&&Sy(a,d,m)}}function Gc(n,o,a,l){Rn[Us++]=n,Rn[Us++]=o,Rn[Us++]=a,Rn[Us++]=l,nd|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function rd(n,o,a,l){return Gc(n,o,a,l),Yc(n)}function Vo(n,o){return Gc(n,null,null,o),Yc(n)}function Sy(n,o,a){n.lanes|=a;var l=n.alternate;l!==null&&(l.lanes|=a);for(var d=!1,m=n.return;m!==null;)m.childLanes|=a,l=m.alternate,l!==null&&(l.childLanes|=a),m.tag===22&&(n=m.stateNode,n===null||n._visibility&1||(d=!0)),n=m,m=m.return;return n.tag===3?(m=n.stateNode,d&&o!==null&&(d=31-fn(a),n=m.hiddenUpdates,l=n[d],l===null?n[d]=[o]:l.push(o),o.lane=a|536870912),m):null}function Yc(n){if(50<ki)throw ki=0,dh=null,Error(s(185));for(var o=n.return;o!==null;)n=o,o=n.return;return n.tag===3?n.stateNode:null}var Bs={};function k2(n,o,a,l){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(n,o,a,l){return new k2(n,o,a,l)}function od(n){return n=n.prototype,!(!n||!n.isReactComponent)}function wr(n,o){var a=n.alternate;return a===null?(a=hn(n.tag,o,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=o,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,o=n.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function xy(n,o){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=o,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,o=a.dependencies,n.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),n}function Kc(n,o,a,l,d,m){var S=0;if(l=n,typeof n=="function")od(n)&&(S=1);else if(typeof n=="string")S=DT(n,a,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case Y:return n=hn(31,a,o,d),n.elementType=Y,n.lanes=m,n;case x:return Ho(a.children,d,m,o);case C:S=8,d|=24;break;case O:return n=hn(12,a,o,d|2),n.elementType=O,n.lanes=m,n;case U:return n=hn(13,a,o,d),n.elementType=U,n.lanes=m,n;case H:return n=hn(19,a,o,d),n.elementType=H,n.lanes=m,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:S=10;break e;case M:S=9;break e;case N:S=11;break e;case L:S=14;break e;case z:S=16,l=null;break e}S=29,a=Error(s(130,n===null?"null":typeof n,"")),l=null}return o=hn(S,a,o,d),o.elementType=n,o.type=l,o.lanes=m,o}function Ho(n,o,a,l){return n=hn(7,n,l,o),n.lanes=a,n}function sd(n,o,a){return n=hn(6,n,null,o),n.lanes=a,n}function _y(n){var o=hn(18,null,null,0);return o.stateNode=n,o}function ad(n,o,a){return o=hn(4,n.children!==null?n.children:[],n.key,o),o.lanes=a,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}var Cy=new WeakMap;function Tn(n,o){if(typeof n=="object"&&n!==null){var a=Cy.get(n);return a!==void 0?a:(o={value:n,source:o,stack:yt(o)},Cy.set(n,o),o)}return{value:n,source:o,stack:yt(o)}}var qs=[],Fs=0,Xc=null,li=0,An=[],On=0,Yr=null,er=1,tr="";function Sr(n,o){qs[Fs++]=li,qs[Fs++]=Xc,Xc=n,li=o}function Ey(n,o,a){An[On++]=er,An[On++]=tr,An[On++]=Yr,Yr=n;var l=er;n=tr;var d=32-fn(l)-1;l&=~(1<<d),a+=1;var m=32-fn(o)+d;if(30<m){var S=d-d%5;m=(l&(1<<S)-1).toString(32),l>>=S,d-=S,er=1<<32-fn(o)+d|a<<d|l,tr=m+n}else er=1<<m|a<<d|l,tr=n}function id(n){n.return!==null&&(Sr(n,1),Ey(n,1,0))}function cd(n){for(;n===Xc;)Xc=qs[--Fs],qs[Fs]=null,li=qs[--Fs],qs[Fs]=null;for(;n===Yr;)Yr=An[--On],An[On]=null,tr=An[--On],An[On]=null,er=An[--On],An[On]=null}function Ry(n,o){An[On++]=er,An[On++]=tr,An[On++]=Yr,er=o.id,tr=o.overflow,Yr=n}var Pt=null,rt=null,Be=!1,Kr=null,kn=!1,ld=Error(s(519));function Xr(n){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ui(Tn(o,n)),ld}function Ty(n){var o=n.stateNode,a=n.type,l=n.memoizedProps;switch(o[Dt]=n,o[Kt]=l,a){case"dialog":Le("cancel",o),Le("close",o);break;case"iframe":case"object":case"embed":Le("load",o);break;case"video":case"audio":for(a=0;a<Ni.length;a++)Le(Ni[a],o);break;case"source":Le("error",o);break;case"img":case"image":case"link":Le("error",o),Le("load",o);break;case"details":Le("toggle",o);break;case"input":Le("invalid",o),Ug(o,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Le("invalid",o);break;case"textarea":Le("invalid",o),qg(o,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||o.textContent===""+a||l.suppressHydrationWarning===!0||Vb(o.textContent,a)?(l.popover!=null&&(Le("beforetoggle",o),Le("toggle",o)),l.onScroll!=null&&Le("scroll",o),l.onScrollEnd!=null&&Le("scrollend",o),l.onClick!=null&&(o.onclick=vr),o=!0):o=!1,o||Xr(n,!0)}function Ay(n){for(Pt=n.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:kn=!1;return;case 27:case 3:kn=!0;return;default:Pt=Pt.return}}function Vs(n){if(n!==Pt)return!1;if(!Be)return Ay(n),Be=!0,!1;var o=n.tag,a;if((a=o!==3&&o!==27)&&((a=o===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||Th(n.type,n.memoizedProps)),a=!a),a&&rt&&Xr(n),Ay(n),o===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));rt=Wb(n)}else if(o===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));rt=Wb(n)}else o===27?(o=rt,fo(n.type)?(n=Nh,Nh=null,rt=n):rt=o):rt=Pt?Nn(n.stateNode.nextSibling):null;return!0}function Zo(){rt=Pt=null,Be=!1}function ud(){var n=Kr;return n!==null&&(tn===null?tn=n:tn.push.apply(tn,n),Kr=null),n}function ui(n){Kr===null?Kr=[n]:Kr.push(n)}var fd=D(null),Qo=null,xr=null;function Jr(n,o,a){ne(fd,o._currentValue),o._currentValue=a}function _r(n){n._currentValue=fd.current,Q(fd)}function dd(n,o,a){for(;n!==null;){var l=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,l!==null&&(l.childLanes|=o)):l!==null&&(l.childLanes&o)!==o&&(l.childLanes|=o),n===a)break;n=n.return}}function hd(n,o,a,l){var d=n.child;for(d!==null&&(d.return=n);d!==null;){var m=d.dependencies;if(m!==null){var S=d.child;m=m.firstContext;e:for(;m!==null;){var R=m;m=d;for(var j=0;j<o.length;j++)if(R.context===o[j]){m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),dd(m.return,a,n),l||(S=null);break e}m=R.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(s(341));S.lanes|=a,m=S.alternate,m!==null&&(m.lanes|=a),dd(S,a,n),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===n){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function Hs(n,o,a,l){n=null;for(var d=o,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var R=d.type;dn(d.pendingProps.value,S.value)||(n!==null?n.push(R):n=[R])}}else if(d===X.current){if(S=d.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(n!==null?n.push(Li):n=[Li])}d=d.return}n!==null&&hd(o,n,a,l),o.flags|=262144}function Jc(n){for(n=n.firstContext;n!==null;){if(!dn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Go(n){Qo=n,xr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Lt(n){return Oy(Qo,n)}function Wc(n,o){return Qo===null&&Go(n),Oy(n,o)}function Oy(n,o){var a=o._currentValue;if(o={context:o,memoizedValue:a,next:null},xr===null){if(n===null)throw Error(s(308));xr=o,n.dependencies={lanes:0,firstContext:o},n.flags|=524288}else xr=xr.next=o;return a}var M2=typeof AbortController<"u"?AbortController:function(){var n=[],o=this.signal={aborted:!1,addEventListener:function(a,l){n.push(l)}};this.abort=function(){o.aborted=!0,n.forEach(function(a){return a()})}},N2=e.unstable_scheduleCallback,j2=e.unstable_NormalPriority,vt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pd(){return{controller:new M2,data:new Map,refCount:0}}function fi(n){n.refCount--,n.refCount===0&&N2(j2,function(){n.controller.abort()})}var di=null,md=0,Zs=0,Qs=null;function z2(n,o){if(di===null){var a=di=[];md=0,Zs=vh(),Qs={status:"pending",value:void 0,then:function(l){a.push(l)}}}return md++,o.then(ky,ky),o}function ky(){if(--md===0&&di!==null){Qs!==null&&(Qs.status="fulfilled");var n=di;di=null,Zs=0,Qs=null;for(var o=0;o<n.length;o++)(0,n[o])()}}function D2(n,o){var a=[],l={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return n.then(function(){l.status="fulfilled",l.value=o;for(var d=0;d<a.length;d++)(0,a[d])(o)},function(d){for(l.status="rejected",l.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),l}var My=I.S;I.S=function(n,o){pb=Ht(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&z2(n,o),My!==null&&My(n,o)};var Yo=D(null);function gd(){var n=Yo.current;return n!==null?n:We.pooledCache}function el(n,o){o===null?ne(Yo,Yo.current):ne(Yo,o.pool)}function Ny(){var n=gd();return n===null?null:{parent:vt._currentValue,pool:n}}var Gs=Error(s(460)),yd=Error(s(474)),tl=Error(s(542)),nl={then:function(){}};function jy(n){return n=n.status,n==="fulfilled"||n==="rejected"}function zy(n,o,a){switch(a=n[a],a===void 0?n.push(o):a!==o&&(o.then(vr,vr),o=a),o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Py(n),n;default:if(typeof o.status=="string")o.then(vr,vr);else{if(n=We,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=o,n.status="pending",n.then(function(l){if(o.status==="pending"){var d=o;d.status="fulfilled",d.value=l}},function(l){if(o.status==="pending"){var d=o;d.status="rejected",d.reason=l}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Py(n),n}throw Xo=o,Gs}}function Ko(n){try{var o=n._init;return o(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xo=a,Gs):a}}var Xo=null;function Dy(){if(Xo===null)throw Error(s(459));var n=Xo;return Xo=null,n}function Py(n){if(n===Gs||n===tl)throw Error(s(483))}var Ys=null,hi=0;function rl(n){var o=hi;return hi+=1,Ys===null&&(Ys=[]),zy(Ys,n,o)}function pi(n,o){o=o.props.ref,n.ref=o!==void 0?o:null}function ol(n,o){throw o.$$typeof===b?Error(s(525)):(n=Object.prototype.toString.call(o),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":n)))}function Ly(n){function o($,P){if(n){var B=$.deletions;B===null?($.deletions=[P],$.flags|=16):B.push(P)}}function a($,P){if(!n)return null;for(;P!==null;)o($,P),P=P.sibling;return null}function l($){for(var P=new Map;$!==null;)$.key!==null?P.set($.key,$):P.set($.index,$),$=$.sibling;return P}function d($,P){return $=wr($,P),$.index=0,$.sibling=null,$}function m($,P,B){return $.index=B,n?(B=$.alternate,B!==null?(B=B.index,B<P?($.flags|=67108866,P):B):($.flags|=67108866,P)):($.flags|=1048576,P)}function S($){return n&&$.alternate===null&&($.flags|=67108866),$}function R($,P,B,J){return P===null||P.tag!==6?(P=sd(B,$.mode,J),P.return=$,P):(P=d(P,B),P.return=$,P)}function j($,P,B,J){var be=B.type;return be===x?G($,P,B.props.children,J,B.key):P!==null&&(P.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===z&&Ko(be)===P.type)?(P=d(P,B.props),pi(P,B),P.return=$,P):(P=Kc(B.type,B.key,B.props,null,$.mode,J),pi(P,B),P.return=$,P)}function q($,P,B,J){return P===null||P.tag!==4||P.stateNode.containerInfo!==B.containerInfo||P.stateNode.implementation!==B.implementation?(P=ad(B,$.mode,J),P.return=$,P):(P=d(P,B.children||[]),P.return=$,P)}function G($,P,B,J,be){return P===null||P.tag!==7?(P=Ho(B,$.mode,J,be),P.return=$,P):(P=d(P,B),P.return=$,P)}function ee($,P,B){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=sd(""+P,$.mode,B),P.return=$,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case _:return B=Kc(P.type,P.key,P.props,null,$.mode,B),pi(B,P),B.return=$,B;case E:return P=ad(P,$.mode,B),P.return=$,P;case z:return P=Ko(P),ee($,P,B)}if(me(P)||oe(P))return P=Ho(P,$.mode,B,null),P.return=$,P;if(typeof P.then=="function")return ee($,rl(P),B);if(P.$$typeof===k)return ee($,Wc($,P),B);ol($,P)}return null}function F($,P,B,J){var be=P!==null?P.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return be!==null?null:R($,P,""+B,J);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case _:return B.key===be?j($,P,B,J):null;case E:return B.key===be?q($,P,B,J):null;case z:return B=Ko(B),F($,P,B,J)}if(me(B)||oe(B))return be!==null?null:G($,P,B,J,null);if(typeof B.then=="function")return F($,P,rl(B),J);if(B.$$typeof===k)return F($,P,Wc($,B),J);ol($,B)}return null}function Z($,P,B,J,be){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return $=$.get(B)||null,R(P,$,""+J,be);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case _:return $=$.get(J.key===null?B:J.key)||null,j(P,$,J,be);case E:return $=$.get(J.key===null?B:J.key)||null,q(P,$,J,be);case z:return J=Ko(J),Z($,P,B,J,be)}if(me(J)||oe(J))return $=$.get(B)||null,G(P,$,J,be,null);if(typeof J.then=="function")return Z($,P,B,rl(J),be);if(J.$$typeof===k)return Z($,P,B,Wc(P,J),be);ol(P,J)}return null}function fe($,P,B,J){for(var be=null,qe=null,ge=P,Me=P=0,$e=null;ge!==null&&Me<B.length;Me++){ge.index>Me?($e=ge,ge=null):$e=ge.sibling;var Fe=F($,ge,B[Me],J);if(Fe===null){ge===null&&(ge=$e);break}n&&ge&&Fe.alternate===null&&o($,ge),P=m(Fe,P,Me),qe===null?be=Fe:qe.sibling=Fe,qe=Fe,ge=$e}if(Me===B.length)return a($,ge),Be&&Sr($,Me),be;if(ge===null){for(;Me<B.length;Me++)ge=ee($,B[Me],J),ge!==null&&(P=m(ge,P,Me),qe===null?be=ge:qe.sibling=ge,qe=ge);return Be&&Sr($,Me),be}for(ge=l(ge);Me<B.length;Me++)$e=Z(ge,$,Me,B[Me],J),$e!==null&&(n&&$e.alternate!==null&&ge.delete($e.key===null?Me:$e.key),P=m($e,P,Me),qe===null?be=$e:qe.sibling=$e,qe=$e);return n&&ge.forEach(function(yo){return o($,yo)}),Be&&Sr($,Me),be}function _e($,P,B,J){if(B==null)throw Error(s(151));for(var be=null,qe=null,ge=P,Me=P=0,$e=null,Fe=B.next();ge!==null&&!Fe.done;Me++,Fe=B.next()){ge.index>Me?($e=ge,ge=null):$e=ge.sibling;var yo=F($,ge,Fe.value,J);if(yo===null){ge===null&&(ge=$e);break}n&&ge&&yo.alternate===null&&o($,ge),P=m(yo,P,Me),qe===null?be=yo:qe.sibling=yo,qe=yo,ge=$e}if(Fe.done)return a($,ge),Be&&Sr($,Me),be;if(ge===null){for(;!Fe.done;Me++,Fe=B.next())Fe=ee($,Fe.value,J),Fe!==null&&(P=m(Fe,P,Me),qe===null?be=Fe:qe.sibling=Fe,qe=Fe);return Be&&Sr($,Me),be}for(ge=l(ge);!Fe.done;Me++,Fe=B.next())Fe=Z(ge,$,Me,Fe.value,J),Fe!==null&&(n&&Fe.alternate!==null&&ge.delete(Fe.key===null?Me:Fe.key),P=m(Fe,P,Me),qe===null?be=Fe:qe.sibling=Fe,qe=Fe);return n&&ge.forEach(function(ZT){return o($,ZT)}),Be&&Sr($,Me),be}function Je($,P,B,J){if(typeof B=="object"&&B!==null&&B.type===x&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case _:e:{for(var be=B.key;P!==null;){if(P.key===be){if(be=B.type,be===x){if(P.tag===7){a($,P.sibling),J=d(P,B.props.children),J.return=$,$=J;break e}}else if(P.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===z&&Ko(be)===P.type){a($,P.sibling),J=d(P,B.props),pi(J,B),J.return=$,$=J;break e}a($,P);break}else o($,P);P=P.sibling}B.type===x?(J=Ho(B.props.children,$.mode,J,B.key),J.return=$,$=J):(J=Kc(B.type,B.key,B.props,null,$.mode,J),pi(J,B),J.return=$,$=J)}return S($);case E:e:{for(be=B.key;P!==null;){if(P.key===be)if(P.tag===4&&P.stateNode.containerInfo===B.containerInfo&&P.stateNode.implementation===B.implementation){a($,P.sibling),J=d(P,B.children||[]),J.return=$,$=J;break e}else{a($,P);break}else o($,P);P=P.sibling}J=ad(B,$.mode,J),J.return=$,$=J}return S($);case z:return B=Ko(B),Je($,P,B,J)}if(me(B))return fe($,P,B,J);if(oe(B)){if(be=oe(B),typeof be!="function")throw Error(s(150));return B=be.call(B),_e($,P,B,J)}if(typeof B.then=="function")return Je($,P,rl(B),J);if(B.$$typeof===k)return Je($,P,Wc($,B),J);ol($,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,P!==null&&P.tag===6?(a($,P.sibling),J=d(P,B),J.return=$,$=J):(a($,P),J=sd(B,$.mode,J),J.return=$,$=J),S($)):a($,P)}return function($,P,B,J){try{hi=0;var be=Je($,P,B,J);return Ys=null,be}catch(ge){if(ge===Gs||ge===tl)throw ge;var qe=hn(29,ge,null,$.mode);return qe.lanes=J,qe.return=$,qe}}}var Jo=Ly(!0),Iy=Ly(!1),Wr=!1;function vd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bd(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function eo(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function to(n,o,a){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Ze&2)!==0){var d=l.pending;return d===null?o.next=o:(o.next=d.next,d.next=o),l.pending=o,o=Yc(n),Sy(n,null,a),o}return Gc(n,l,o,a),Yc(n)}function mi(n,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194048)!==0)){var l=o.lanes;l&=n.pendingLanes,a|=l,o.lanes=a,Og(n,a)}}function wd(n,o){var a=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var d=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?d=m=S:m=m.next=S,a=a.next}while(a!==null);m===null?d=m=o:m=m.next=o}else d=m=o;a={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=o:n.next=o,a.lastBaseUpdate=o}var Sd=!1;function gi(){if(Sd){var n=Qs;if(n!==null)throw n}}function yi(n,o,a,l){Sd=!1;var d=n.updateQueue;Wr=!1;var m=d.firstBaseUpdate,S=d.lastBaseUpdate,R=d.shared.pending;if(R!==null){d.shared.pending=null;var j=R,q=j.next;j.next=null,S===null?m=q:S.next=q,S=j;var G=n.alternate;G!==null&&(G=G.updateQueue,R=G.lastBaseUpdate,R!==S&&(R===null?G.firstBaseUpdate=q:R.next=q,G.lastBaseUpdate=j))}if(m!==null){var ee=d.baseState;S=0,G=q=j=null,R=m;do{var F=R.lane&-536870913,Z=F!==R.lane;if(Z?(Ie&F)===F:(l&F)===F){F!==0&&F===Zs&&(Sd=!0),G!==null&&(G=G.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var fe=n,_e=R;F=o;var Je=a;switch(_e.tag){case 1:if(fe=_e.payload,typeof fe=="function"){ee=fe.call(Je,ee,F);break e}ee=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=_e.payload,F=typeof fe=="function"?fe.call(Je,ee,F):fe,F==null)break e;ee=v({},ee,F);break e;case 2:Wr=!0}}F=R.callback,F!==null&&(n.flags|=64,Z&&(n.flags|=8192),Z=d.callbacks,Z===null?d.callbacks=[F]:Z.push(F))}else Z={lane:F,tag:R.tag,payload:R.payload,callback:R.callback,next:null},G===null?(q=G=Z,j=ee):G=G.next=Z,S|=F;if(R=R.next,R===null){if(R=d.shared.pending,R===null)break;Z=R,R=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);G===null&&(j=ee),d.baseState=j,d.firstBaseUpdate=q,d.lastBaseUpdate=G,m===null&&(d.shared.lanes=0),ao|=S,n.lanes=S,n.memoizedState=ee}}function $y(n,o){if(typeof n!="function")throw Error(s(191,n));n.call(o)}function Uy(n,o){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)$y(a[n],o)}var Ks=D(null),sl=D(0);function By(n,o){n=Nr,ne(sl,n),ne(Ks,o),Nr=n|o.baseLanes}function xd(){ne(sl,Nr),ne(Ks,Ks.current)}function _d(){Nr=sl.current,Q(Ks),Q(sl)}var pn=D(null),Mn=null;function no(n){var o=n.alternate;ne(pt,pt.current&1),ne(pn,n),Mn===null&&(o===null||Ks.current!==null||o.memoizedState!==null)&&(Mn=n)}function Cd(n){ne(pt,pt.current),ne(pn,n),Mn===null&&(Mn=n)}function qy(n){n.tag===22?(ne(pt,pt.current),ne(pn,n),Mn===null&&(Mn=n)):ro()}function ro(){ne(pt,pt.current),ne(pn,pn.current)}function mn(n){Q(pn),Mn===n&&(Mn=null),Q(pt)}var pt=D(0);function al(n){for(var o=n;o!==null;){if(o.tag===13){var a=o.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||kh(a)||Mh(a)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Cr=0,Te=null,Ke=null,bt=null,il=!1,Xs=!1,Wo=!1,cl=0,vi=0,Js=null,P2=0;function ut(){throw Error(s(321))}function Ed(n,o){if(o===null)return!1;for(var a=0;a<o.length&&a<n.length;a++)if(!dn(n[a],o[a]))return!1;return!0}function Rd(n,o,a,l,d,m){return Cr=m,Te=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,I.H=n===null||n.memoizedState===null?Ev:Bd,Wo=!1,m=a(l,d),Wo=!1,Xs&&(m=Vy(o,a,l,d)),Fy(n),m}function Fy(n){I.H=Si;var o=Ke!==null&&Ke.next!==null;if(Cr=0,bt=Ke=Te=null,il=!1,vi=0,Js=null,o)throw Error(s(300));n===null||wt||(n=n.dependencies,n!==null&&Jc(n)&&(wt=!0))}function Vy(n,o,a,l){Te=n;var d=0;do{if(Xs&&(Js=null),vi=0,Xs=!1,25<=d)throw Error(s(301));if(d+=1,bt=Ke=null,n.updateQueue!=null){var m=n.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}I.H=Rv,m=o(a,l)}while(Xs);return m}function L2(){var n=I.H,o=n.useState()[0];return o=typeof o.then=="function"?bi(o):o,n=n.useState()[0],(Ke!==null?Ke.memoizedState:null)!==n&&(Te.flags|=1024),o}function Td(){var n=cl!==0;return cl=0,n}function Ad(n,o,a){o.updateQueue=n.updateQueue,o.flags&=-2053,n.lanes&=~a}function Od(n){if(il){for(n=n.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}il=!1}Cr=0,bt=Ke=Te=null,Xs=!1,vi=cl=0,Js=null}function Zt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Te.memoizedState=bt=n:bt=bt.next=n,bt}function mt(){if(Ke===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=Ke.next;var o=bt===null?Te.memoizedState:bt.next;if(o!==null)bt=o,Ke=n;else{if(n===null)throw Te.alternate===null?Error(s(467)):Error(s(310));Ke=n,n={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},bt===null?Te.memoizedState=bt=n:bt=bt.next=n}return bt}function ll(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bi(n){var o=vi;return vi+=1,Js===null&&(Js=[]),n=zy(Js,n,o),o=Te,(bt===null?o.memoizedState:bt.next)===null&&(o=o.alternate,I.H=o===null||o.memoizedState===null?Ev:Bd),n}function ul(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return bi(n);if(n.$$typeof===k)return Lt(n)}throw Error(s(438,String(n)))}function kd(n){var o=null,a=Te.updateQueue;if(a!==null&&(o=a.memoCache),o==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(o={data:l.data.map(function(d){return d.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),a===null&&(a=ll(),Te.updateQueue=a),a.memoCache=o,a=o.data[o.index],a===void 0)for(a=o.data[o.index]=Array(n),l=0;l<n;l++)a[l]=ie;return o.index++,a}function Er(n,o){return typeof o=="function"?o(n):o}function fl(n){var o=mt();return Md(o,Ke,n)}function Md(n,o,a){var l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var d=n.baseQueue,m=l.pending;if(m!==null){if(d!==null){var S=d.next;d.next=m.next,m.next=S}o.baseQueue=d=m,l.pending=null}if(m=n.baseState,d===null)n.memoizedState=m;else{o=d.next;var R=S=null,j=null,q=o,G=!1;do{var ee=q.lane&-536870913;if(ee!==q.lane?(Ie&ee)===ee:(Cr&ee)===ee){var F=q.revertLane;if(F===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ee===Zs&&(G=!0);else if((Cr&F)===F){q=q.next,F===Zs&&(G=!0);continue}else ee={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(R=j=ee,S=m):j=j.next=ee,Te.lanes|=F,ao|=F;ee=q.action,Wo&&a(m,ee),m=q.hasEagerState?q.eagerState:a(m,ee)}else F={lane:ee,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(R=j=F,S=m):j=j.next=F,Te.lanes|=ee,ao|=ee;q=q.next}while(q!==null&&q!==o);if(j===null?S=m:j.next=R,!dn(m,n.memoizedState)&&(wt=!0,G&&(a=Qs,a!==null)))throw a;n.memoizedState=m,n.baseState=S,n.baseQueue=j,l.lastRenderedState=m}return d===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Nd(n){var o=mt(),a=o.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=n;var l=a.dispatch,d=a.pending,m=o.memoizedState;if(d!==null){a.pending=null;var S=d=d.next;do m=n(m,S.action),S=S.next;while(S!==d);dn(m,o.memoizedState)||(wt=!0),o.memoizedState=m,o.baseQueue===null&&(o.baseState=m),a.lastRenderedState=m}return[m,l]}function Hy(n,o,a){var l=Te,d=mt(),m=Be;if(m){if(a===void 0)throw Error(s(407));a=a()}else a=o();var S=!dn((Ke||d).memoizedState,a);if(S&&(d.memoizedState=a,wt=!0),d=d.queue,Dd(Gy.bind(null,l,d,n),[n]),d.getSnapshot!==o||S||bt!==null&&bt.memoizedState.tag&1){if(l.flags|=2048,Ws(9,{destroy:void 0},Qy.bind(null,l,d,a,o),null),We===null)throw Error(s(349));m||(Cr&127)!==0||Zy(l,o,a)}return a}function Zy(n,o,a){n.flags|=16384,n={getSnapshot:o,value:a},o=Te.updateQueue,o===null?(o=ll(),Te.updateQueue=o,o.stores=[n]):(a=o.stores,a===null?o.stores=[n]:a.push(n))}function Qy(n,o,a,l){o.value=a,o.getSnapshot=l,Yy(o)&&Ky(n)}function Gy(n,o,a){return a(function(){Yy(o)&&Ky(n)})}function Yy(n){var o=n.getSnapshot;n=n.value;try{var a=o();return!dn(n,a)}catch{return!0}}function Ky(n){var o=Vo(n,2);o!==null&&nn(o,n,2)}function jd(n){var o=Zt();if(typeof n=="function"){var a=n;if(n=a(),Wo){Zr(!0);try{a()}finally{Zr(!1)}}}return o.memoizedState=o.baseState=n,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:n},o}function Xy(n,o,a,l){return n.baseState=a,Md(n,Ke,typeof l=="function"?l:Er)}function I2(n,o,a,l,d){if(pl(n))throw Error(s(485));if(n=o.action,n!==null){var m={payload:d,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){m.listeners.push(S)}};I.T!==null?a(!0):m.isTransition=!1,l(m),a=o.pending,a===null?(m.next=o.pending=m,Jy(o,m)):(m.next=a.next,o.pending=a.next=m)}}function Jy(n,o){var a=o.action,l=o.payload,d=n.state;if(o.isTransition){var m=I.T,S={};I.T=S;try{var R=a(d,l),j=I.S;j!==null&&j(S,R),Wy(n,o,R)}catch(q){zd(n,o,q)}finally{m!==null&&S.types!==null&&(m.types=S.types),I.T=m}}else try{m=a(d,l),Wy(n,o,m)}catch(q){zd(n,o,q)}}function Wy(n,o,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){ev(n,o,l)},function(l){return zd(n,o,l)}):ev(n,o,a)}function ev(n,o,a){o.status="fulfilled",o.value=a,tv(o),n.state=a,o=n.pending,o!==null&&(a=o.next,a===o?n.pending=null:(a=a.next,o.next=a,Jy(n,a)))}function zd(n,o,a){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do o.status="rejected",o.reason=a,tv(o),o=o.next;while(o!==l)}n.action=null}function tv(n){n=n.listeners;for(var o=0;o<n.length;o++)(0,n[o])()}function nv(n,o){return o}function rv(n,o){if(Be){var a=We.formState;if(a!==null){e:{var l=Te;if(Be){if(rt){t:{for(var d=rt,m=kn;d.nodeType!==8;){if(!m){d=null;break t}if(d=Nn(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){rt=Nn(d.nextSibling),l=d.data==="F!";break e}}Xr(l)}l=!1}l&&(o=a[0])}}return a=Zt(),a.memoizedState=a.baseState=o,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nv,lastRenderedState:o},a.queue=l,a=xv.bind(null,Te,l),l.dispatch=a,l=jd(!1),m=Ud.bind(null,Te,!1,l.queue),l=Zt(),d={state:o,dispatch:null,action:n,pending:null},l.queue=d,a=I2.bind(null,Te,d,m,a),d.dispatch=a,l.memoizedState=n,[o,a,!1]}function ov(n){var o=mt();return sv(o,Ke,n)}function sv(n,o,a){if(o=Md(n,o,nv)[0],n=fl(Er)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var l=bi(o)}catch(S){throw S===Gs?tl:S}else l=o;o=mt();var d=o.queue,m=d.dispatch;return a!==o.memoizedState&&(Te.flags|=2048,Ws(9,{destroy:void 0},$2.bind(null,d,a),null)),[l,m,n]}function $2(n,o){n.action=o}function av(n){var o=mt(),a=Ke;if(a!==null)return sv(o,a,n);mt(),o=o.memoizedState,a=mt();var l=a.queue.dispatch;return a.memoizedState=n,[o,l,!1]}function Ws(n,o,a,l){return n={tag:n,create:a,deps:l,inst:o,next:null},o=Te.updateQueue,o===null&&(o=ll(),Te.updateQueue=o),a=o.lastEffect,a===null?o.lastEffect=n.next=n:(l=a.next,a.next=n,n.next=l,o.lastEffect=n),n}function iv(){return mt().memoizedState}function dl(n,o,a,l){var d=Zt();Te.flags|=n,d.memoizedState=Ws(1|o,{destroy:void 0},a,l===void 0?null:l)}function hl(n,o,a,l){var d=mt();l=l===void 0?null:l;var m=d.memoizedState.inst;Ke!==null&&l!==null&&Ed(l,Ke.memoizedState.deps)?d.memoizedState=Ws(o,m,a,l):(Te.flags|=n,d.memoizedState=Ws(1|o,m,a,l))}function cv(n,o){dl(8390656,8,n,o)}function Dd(n,o){hl(2048,8,n,o)}function U2(n){Te.flags|=4;var o=Te.updateQueue;if(o===null)o=ll(),Te.updateQueue=o,o.events=[n];else{var a=o.events;a===null?o.events=[n]:a.push(n)}}function lv(n){var o=mt().memoizedState;return U2({ref:o,nextImpl:n}),function(){if((Ze&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function uv(n,o){return hl(4,2,n,o)}function fv(n,o){return hl(4,4,n,o)}function dv(n,o){if(typeof o=="function"){n=n();var a=o(n);return function(){typeof a=="function"?a():o(null)}}if(o!=null)return n=n(),o.current=n,function(){o.current=null}}function hv(n,o,a){a=a!=null?a.concat([n]):null,hl(4,4,dv.bind(null,o,n),a)}function Pd(){}function pv(n,o){var a=mt();o=o===void 0?null:o;var l=a.memoizedState;return o!==null&&Ed(o,l[1])?l[0]:(a.memoizedState=[n,o],n)}function mv(n,o){var a=mt();o=o===void 0?null:o;var l=a.memoizedState;if(o!==null&&Ed(o,l[1]))return l[0];if(l=n(),Wo){Zr(!0);try{n()}finally{Zr(!1)}}return a.memoizedState=[l,o],l}function Ld(n,o,a){return a===void 0||(Cr&1073741824)!==0&&(Ie&261930)===0?n.memoizedState=o:(n.memoizedState=a,n=gb(),Te.lanes|=n,ao|=n,a)}function gv(n,o,a,l){return dn(a,o)?a:Ks.current!==null?(n=Ld(n,a,l),dn(n,o)||(wt=!0),n):(Cr&42)===0||(Cr&1073741824)!==0&&(Ie&261930)===0?(wt=!0,n.memoizedState=a):(n=gb(),Te.lanes|=n,ao|=n,o)}function yv(n,o,a,l,d){var m=K.p;K.p=m!==0&&8>m?m:8;var S=I.T,R={};I.T=R,Ud(n,!1,o,a);try{var j=d(),q=I.S;if(q!==null&&q(R,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var G=D2(j,l);wi(n,o,G,vn(n))}else wi(n,o,l,vn(n))}catch(ee){wi(n,o,{then:function(){},status:"rejected",reason:ee},vn())}finally{K.p=m,S!==null&&R.types!==null&&(S.types=R.types),I.T=S}}function B2(){}function Id(n,o,a,l){if(n.tag!==5)throw Error(s(476));var d=vv(n).queue;yv(n,d,o,V,a===null?B2:function(){return bv(n),a(l)})}function vv(n){var o=n.memoizedState;if(o!==null)return o;o={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:V},next:null};var a={};return o.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:a},next:null},n.memoizedState=o,n=n.alternate,n!==null&&(n.memoizedState=o),o}function bv(n){var o=vv(n);o.next===null&&(o=n.alternate.memoizedState),wi(n,o.next.queue,{},vn())}function $d(){return Lt(Li)}function wv(){return mt().memoizedState}function Sv(){return mt().memoizedState}function q2(n){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var a=vn();n=eo(a);var l=to(o,n,a);l!==null&&(nn(l,o,a),mi(l,o,a)),o={cache:pd()},n.payload=o;return}o=o.return}}function F2(n,o,a){var l=vn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},pl(n)?_v(o,a):(a=rd(n,o,a,l),a!==null&&(nn(a,n,l),Cv(a,o,l)))}function xv(n,o,a){var l=vn();wi(n,o,a,l)}function wi(n,o,a,l){var d={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(pl(n))_v(o,d);else{var m=n.alternate;if(n.lanes===0&&(m===null||m.lanes===0)&&(m=o.lastRenderedReducer,m!==null))try{var S=o.lastRenderedState,R=m(S,a);if(d.hasEagerState=!0,d.eagerState=R,dn(R,S))return Gc(n,o,d,0),We===null&&Qc(),!1}catch{}if(a=rd(n,o,d,l),a!==null)return nn(a,n,l),Cv(a,o,l),!0}return!1}function Ud(n,o,a,l){if(l={lane:2,revertLane:vh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pl(n)){if(o)throw Error(s(479))}else o=rd(n,a,l,2),o!==null&&nn(o,n,2)}function pl(n){var o=n.alternate;return n===Te||o!==null&&o===Te}function _v(n,o){Xs=il=!0;var a=n.pending;a===null?o.next=o:(o.next=a.next,a.next=o),n.pending=o}function Cv(n,o,a){if((a&4194048)!==0){var l=o.lanes;l&=n.pendingLanes,a|=l,o.lanes=a,Og(n,a)}}var Si={readContext:Lt,use:ul,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Si.useEffectEvent=ut;var Ev={readContext:Lt,use:ul,useCallback:function(n,o){return Zt().memoizedState=[n,o===void 0?null:o],n},useContext:Lt,useEffect:cv,useImperativeHandle:function(n,o,a){a=a!=null?a.concat([n]):null,dl(4194308,4,dv.bind(null,o,n),a)},useLayoutEffect:function(n,o){return dl(4194308,4,n,o)},useInsertionEffect:function(n,o){dl(4,2,n,o)},useMemo:function(n,o){var a=Zt();o=o===void 0?null:o;var l=n();if(Wo){Zr(!0);try{n()}finally{Zr(!1)}}return a.memoizedState=[l,o],l},useReducer:function(n,o,a){var l=Zt();if(a!==void 0){var d=a(o);if(Wo){Zr(!0);try{a(o)}finally{Zr(!1)}}}else d=o;return l.memoizedState=l.baseState=d,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:d},l.queue=n,n=n.dispatch=F2.bind(null,Te,n),[l.memoizedState,n]},useRef:function(n){var o=Zt();return n={current:n},o.memoizedState=n},useState:function(n){n=jd(n);var o=n.queue,a=xv.bind(null,Te,o);return o.dispatch=a,[n.memoizedState,a]},useDebugValue:Pd,useDeferredValue:function(n,o){var a=Zt();return Ld(a,n,o)},useTransition:function(){var n=jd(!1);return n=yv.bind(null,Te,n.queue,!0,!1),Zt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,o,a){var l=Te,d=Zt();if(Be){if(a===void 0)throw Error(s(407));a=a()}else{if(a=o(),We===null)throw Error(s(349));(Ie&127)!==0||Zy(l,o,a)}d.memoizedState=a;var m={value:a,getSnapshot:o};return d.queue=m,cv(Gy.bind(null,l,m,n),[n]),l.flags|=2048,Ws(9,{destroy:void 0},Qy.bind(null,l,m,a,o),null),a},useId:function(){var n=Zt(),o=We.identifierPrefix;if(Be){var a=tr,l=er;a=(l&~(1<<32-fn(l)-1)).toString(32)+a,o="_"+o+"R_"+a,a=cl++,0<a&&(o+="H"+a.toString(32)),o+="_"}else a=P2++,o="_"+o+"r_"+a.toString(32)+"_";return n.memoizedState=o},useHostTransitionStatus:$d,useFormState:rv,useActionState:rv,useOptimistic:function(n){var o=Zt();o.memoizedState=o.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=a,o=Ud.bind(null,Te,!0,a),a.dispatch=o,[n,o]},useMemoCache:kd,useCacheRefresh:function(){return Zt().memoizedState=q2.bind(null,Te)},useEffectEvent:function(n){var o=Zt(),a={impl:n};return o.memoizedState=a,function(){if((Ze&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Bd={readContext:Lt,use:ul,useCallback:pv,useContext:Lt,useEffect:Dd,useImperativeHandle:hv,useInsertionEffect:uv,useLayoutEffect:fv,useMemo:mv,useReducer:fl,useRef:iv,useState:function(){return fl(Er)},useDebugValue:Pd,useDeferredValue:function(n,o){var a=mt();return gv(a,Ke.memoizedState,n,o)},useTransition:function(){var n=fl(Er)[0],o=mt().memoizedState;return[typeof n=="boolean"?n:bi(n),o]},useSyncExternalStore:Hy,useId:wv,useHostTransitionStatus:$d,useFormState:ov,useActionState:ov,useOptimistic:function(n,o){var a=mt();return Xy(a,Ke,n,o)},useMemoCache:kd,useCacheRefresh:Sv};Bd.useEffectEvent=lv;var Rv={readContext:Lt,use:ul,useCallback:pv,useContext:Lt,useEffect:Dd,useImperativeHandle:hv,useInsertionEffect:uv,useLayoutEffect:fv,useMemo:mv,useReducer:Nd,useRef:iv,useState:function(){return Nd(Er)},useDebugValue:Pd,useDeferredValue:function(n,o){var a=mt();return Ke===null?Ld(a,n,o):gv(a,Ke.memoizedState,n,o)},useTransition:function(){var n=Nd(Er)[0],o=mt().memoizedState;return[typeof n=="boolean"?n:bi(n),o]},useSyncExternalStore:Hy,useId:wv,useHostTransitionStatus:$d,useFormState:av,useActionState:av,useOptimistic:function(n,o){var a=mt();return Ke!==null?Xy(a,Ke,n,o):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:kd,useCacheRefresh:Sv};Rv.useEffectEvent=lv;function qd(n,o,a,l){o=n.memoizedState,a=a(l,o),a=a==null?o:v({},o,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var Fd={enqueueSetState:function(n,o,a){n=n._reactInternals;var l=vn(),d=eo(l);d.payload=o,a!=null&&(d.callback=a),o=to(n,d,l),o!==null&&(nn(o,n,l),mi(o,n,l))},enqueueReplaceState:function(n,o,a){n=n._reactInternals;var l=vn(),d=eo(l);d.tag=1,d.payload=o,a!=null&&(d.callback=a),o=to(n,d,l),o!==null&&(nn(o,n,l),mi(o,n,l))},enqueueForceUpdate:function(n,o){n=n._reactInternals;var a=vn(),l=eo(a);l.tag=2,o!=null&&(l.callback=o),o=to(n,l,a),o!==null&&(nn(o,n,a),mi(o,n,a))}};function Tv(n,o,a,l,d,m,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,m,S):o.prototype&&o.prototype.isPureReactComponent?!ii(a,l)||!ii(d,m):!0}function Av(n,o,a,l){n=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(a,l),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(a,l),o.state!==n&&Fd.enqueueReplaceState(o,o.state,null)}function es(n,o){var a=o;if("ref"in o){a={};for(var l in o)l!=="ref"&&(a[l]=o[l])}if(n=n.defaultProps){a===o&&(a=v({},a));for(var d in n)a[d]===void 0&&(a[d]=n[d])}return a}function Ov(n){Zc(n)}function kv(n){console.error(n)}function Mv(n){Zc(n)}function ml(n,o){try{var a=n.onUncaughtError;a(o.value,{componentStack:o.stack})}catch(l){setTimeout(function(){throw l})}}function Nv(n,o,a){try{var l=n.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Vd(n,o,a){return a=eo(a),a.tag=3,a.payload={element:null},a.callback=function(){ml(n,o)},a}function jv(n){return n=eo(n),n.tag=3,n}function zv(n,o,a,l){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var m=l.value;n.payload=function(){return d(m)},n.callback=function(){Nv(o,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(n.callback=function(){Nv(o,a,l),typeof d!="function"&&(io===null?io=new Set([this]):io.add(this));var R=l.stack;this.componentDidCatch(l.value,{componentStack:R!==null?R:""})})}function V2(n,o,a,l,d){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(o=a.alternate,o!==null&&Hs(o,a,d,!0),a=pn.current,a!==null){switch(a.tag){case 31:case 13:return Mn===null?Tl():a.alternate===null&&ft===0&&(ft=3),a.flags&=-257,a.flags|=65536,a.lanes=d,l===nl?a.flags|=16384:(o=a.updateQueue,o===null?a.updateQueue=new Set([l]):o.add(l),mh(n,l,d)),!1;case 22:return a.flags|=65536,l===nl?a.flags|=16384:(o=a.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=o):(a=o.retryQueue,a===null?o.retryQueue=new Set([l]):a.add(l)),mh(n,l,d)),!1}throw Error(s(435,a.tag))}return mh(n,l,d),Tl(),!1}if(Be)return o=pn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=d,l!==ld&&(n=Error(s(422),{cause:l}),ui(Tn(n,a)))):(l!==ld&&(o=Error(s(423),{cause:l}),ui(Tn(o,a))),n=n.current.alternate,n.flags|=65536,d&=-d,n.lanes|=d,l=Tn(l,a),d=Vd(n.stateNode,l,d),wd(n,d),ft!==4&&(ft=2)),!1;var m=Error(s(520),{cause:l});if(m=Tn(m,a),Oi===null?Oi=[m]:Oi.push(m),ft!==4&&(ft=2),o===null)return!0;l=Tn(l,a),a=o;do{switch(a.tag){case 3:return a.flags|=65536,n=d&-d,a.lanes|=n,n=Vd(a.stateNode,l,n),wd(a,n),!1;case 1:if(o=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(io===null||!io.has(m))))return a.flags|=65536,d&=-d,a.lanes|=d,d=jv(d),zv(d,n,a,l),wd(a,d),!1}a=a.return}while(a!==null);return!1}var Hd=Error(s(461)),wt=!1;function It(n,o,a,l){o.child=n===null?Iy(o,null,a,l):Jo(o,n.child,a,l)}function Dv(n,o,a,l,d){a=a.render;var m=o.ref;if("ref"in l){var S={};for(var R in l)R!=="ref"&&(S[R]=l[R])}else S=l;return Go(o),l=Rd(n,o,a,S,m,d),R=Td(),n!==null&&!wt?(Ad(n,o,d),Rr(n,o,d)):(Be&&R&&id(o),o.flags|=1,It(n,o,l,d),o.child)}function Pv(n,o,a,l,d){if(n===null){var m=a.type;return typeof m=="function"&&!od(m)&&m.defaultProps===void 0&&a.compare===null?(o.tag=15,o.type=m,Lv(n,o,m,l,d)):(n=Kc(a.type,null,l,o,o.mode,d),n.ref=o.ref,n.return=o,o.child=n)}if(m=n.child,!Wd(n,d)){var S=m.memoizedProps;if(a=a.compare,a=a!==null?a:ii,a(S,l)&&n.ref===o.ref)return Rr(n,o,d)}return o.flags|=1,n=wr(m,l),n.ref=o.ref,n.return=o,o.child=n}function Lv(n,o,a,l,d){if(n!==null){var m=n.memoizedProps;if(ii(m,l)&&n.ref===o.ref)if(wt=!1,o.pendingProps=l=m,Wd(n,d))(n.flags&131072)!==0&&(wt=!0);else return o.lanes=n.lanes,Rr(n,o,d)}return Zd(n,o,a,l,d)}function Iv(n,o,a,l){var d=l.children,m=n!==null?n.memoizedState:null;if(n===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((o.flags&128)!==0){if(m=m!==null?m.baseLanes|a:a,n!==null){for(l=o.child=n.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~m}else l=0,o.child=null;return $v(n,o,m,a,l)}if((a&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},n!==null&&el(o,m!==null?m.cachePool:null),m!==null?By(o,m):xd(),qy(o);else return l=o.lanes=536870912,$v(n,o,m!==null?m.baseLanes|a:a,a,l)}else m!==null?(el(o,m.cachePool),By(o,m),ro(),o.memoizedState=null):(n!==null&&el(o,null),xd(),ro());return It(n,o,d,a),o.child}function xi(n,o){return n!==null&&n.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function $v(n,o,a,l,d){var m=gd();return m=m===null?null:{parent:vt._currentValue,pool:m},o.memoizedState={baseLanes:a,cachePool:m},n!==null&&el(o,null),xd(),qy(o),n!==null&&Hs(n,o,l,!0),o.childLanes=d,null}function gl(n,o){return o=vl({mode:o.mode,children:o.children},n.mode),o.ref=n.ref,n.child=o,o.return=n,o}function Uv(n,o,a){return Jo(o,n.child,null,a),n=gl(o,o.pendingProps),n.flags|=2,mn(o),o.memoizedState=null,n}function H2(n,o,a){var l=o.pendingProps,d=(o.flags&128)!==0;if(o.flags&=-129,n===null){if(Be){if(l.mode==="hidden")return n=gl(o,l),o.lanes=536870912,xi(null,n);if(Cd(o),(n=rt)?(n=Jb(n,kn),n=n!==null&&n.data==="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:Yr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},a=_y(n),a.return=o,o.child=a,Pt=o,rt=null)):n=null,n===null)throw Xr(o);return o.lanes=536870912,null}return gl(o,l)}var m=n.memoizedState;if(m!==null){var S=m.dehydrated;if(Cd(o),d)if(o.flags&256)o.flags&=-257,o=Uv(n,o,a);else if(o.memoizedState!==null)o.child=n.child,o.flags|=128,o=null;else throw Error(s(558));else if(wt||Hs(n,o,a,!1),d=(a&n.childLanes)!==0,wt||d){if(l=We,l!==null&&(S=kg(l,a),S!==0&&S!==m.retryLane))throw m.retryLane=S,Vo(n,S),nn(l,n,S),Hd;Tl(),o=Uv(n,o,a)}else n=m.treeContext,rt=Nn(S.nextSibling),Pt=o,Be=!0,Kr=null,kn=!1,n!==null&&Ry(o,n),o=gl(o,l),o.flags|=4096;return o}return n=wr(n.child,{mode:l.mode,children:l.children}),n.ref=o.ref,o.child=n,n.return=o,n}function yl(n,o){var a=o.ref;if(a===null)n!==null&&n.ref!==null&&(o.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(n===null||n.ref!==a)&&(o.flags|=4194816)}}function Zd(n,o,a,l,d){return Go(o),a=Rd(n,o,a,l,void 0,d),l=Td(),n!==null&&!wt?(Ad(n,o,d),Rr(n,o,d)):(Be&&l&&id(o),o.flags|=1,It(n,o,a,d),o.child)}function Bv(n,o,a,l,d,m){return Go(o),o.updateQueue=null,a=Vy(o,l,a,d),Fy(n),l=Td(),n!==null&&!wt?(Ad(n,o,m),Rr(n,o,m)):(Be&&l&&id(o),o.flags|=1,It(n,o,a,m),o.child)}function qv(n,o,a,l,d){if(Go(o),o.stateNode===null){var m=Bs,S=a.contextType;typeof S=="object"&&S!==null&&(m=Lt(S)),m=new a(l,m),o.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Fd,o.stateNode=m,m._reactInternals=o,m=o.stateNode,m.props=l,m.state=o.memoizedState,m.refs={},vd(o),S=a.contextType,m.context=typeof S=="object"&&S!==null?Lt(S):Bs,m.state=o.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(qd(o,a,S,l),m.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&Fd.enqueueReplaceState(m,m.state,null),yi(o,l,m,d),gi(),m.state=o.memoizedState),typeof m.componentDidMount=="function"&&(o.flags|=4194308),l=!0}else if(n===null){m=o.stateNode;var R=o.memoizedProps,j=es(a,R);m.props=j;var q=m.context,G=a.contextType;S=Bs,typeof G=="object"&&G!==null&&(S=Lt(G));var ee=a.getDerivedStateFromProps;G=typeof ee=="function"||typeof m.getSnapshotBeforeUpdate=="function",R=o.pendingProps!==R,G||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(R||q!==S)&&Av(o,m,l,S),Wr=!1;var F=o.memoizedState;m.state=F,yi(o,l,m,d),gi(),q=o.memoizedState,R||F!==q||Wr?(typeof ee=="function"&&(qd(o,a,ee,l),q=o.memoizedState),(j=Wr||Tv(o,a,j,l,F,q,S))?(G||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(o.flags|=4194308)):(typeof m.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=l,o.memoizedState=q),m.props=l,m.state=q,m.context=S,l=j):(typeof m.componentDidMount=="function"&&(o.flags|=4194308),l=!1)}else{m=o.stateNode,bd(n,o),S=o.memoizedProps,G=es(a,S),m.props=G,ee=o.pendingProps,F=m.context,q=a.contextType,j=Bs,typeof q=="object"&&q!==null&&(j=Lt(q)),R=a.getDerivedStateFromProps,(q=typeof R=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==ee||F!==j)&&Av(o,m,l,j),Wr=!1,F=o.memoizedState,m.state=F,yi(o,l,m,d),gi();var Z=o.memoizedState;S!==ee||F!==Z||Wr||n!==null&&n.dependencies!==null&&Jc(n.dependencies)?(typeof R=="function"&&(qd(o,a,R,l),Z=o.memoizedState),(G=Wr||Tv(o,a,G,l,F,Z,j)||n!==null&&n.dependencies!==null&&Jc(n.dependencies))?(q||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,Z,j),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,Z,j)),typeof m.componentDidUpdate=="function"&&(o.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(o.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(o.flags|=1024),o.memoizedProps=l,o.memoizedState=Z),m.props=l,m.state=Z,m.context=j,l=G):(typeof m.componentDidUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(o.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===n.memoizedProps&&F===n.memoizedState||(o.flags|=1024),l=!1)}return m=l,yl(n,o),l=(o.flags&128)!==0,m||l?(m=o.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:m.render(),o.flags|=1,n!==null&&l?(o.child=Jo(o,n.child,null,d),o.child=Jo(o,null,a,d)):It(n,o,a,d),o.memoizedState=m.state,n=o.child):n=Rr(n,o,d),n}function Fv(n,o,a,l){return Zo(),o.flags|=256,It(n,o,a,l),o.child}var Qd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gd(n){return{baseLanes:n,cachePool:Ny()}}function Yd(n,o,a){return n=n!==null?n.childLanes&~a:0,o&&(n|=yn),n}function Vv(n,o,a){var l=o.pendingProps,d=!1,m=(o.flags&128)!==0,S;if((S=m)||(S=n!==null&&n.memoizedState===null?!1:(pt.current&2)!==0),S&&(d=!0,o.flags&=-129),S=(o.flags&32)!==0,o.flags&=-33,n===null){if(Be){if(d?no(o):ro(),(n=rt)?(n=Jb(n,kn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:Yr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},a=_y(n),a.return=o,o.child=a,Pt=o,rt=null)):n=null,n===null)throw Xr(o);return Mh(n)?o.lanes=32:o.lanes=536870912,null}var R=l.children;return l=l.fallback,d?(ro(),d=o.mode,R=vl({mode:"hidden",children:R},d),l=Ho(l,d,a,null),R.return=o,l.return=o,R.sibling=l,o.child=R,l=o.child,l.memoizedState=Gd(a),l.childLanes=Yd(n,S,a),o.memoizedState=Qd,xi(null,l)):(no(o),Kd(o,R))}var j=n.memoizedState;if(j!==null&&(R=j.dehydrated,R!==null)){if(m)o.flags&256?(no(o),o.flags&=-257,o=Xd(n,o,a)):o.memoizedState!==null?(ro(),o.child=n.child,o.flags|=128,o=null):(ro(),R=l.fallback,d=o.mode,l=vl({mode:"visible",children:l.children},d),R=Ho(R,d,a,null),R.flags|=2,l.return=o,R.return=o,l.sibling=R,o.child=l,Jo(o,n.child,null,a),l=o.child,l.memoizedState=Gd(a),l.childLanes=Yd(n,S,a),o.memoizedState=Qd,o=xi(null,l));else if(no(o),Mh(R)){if(S=R.nextSibling&&R.nextSibling.dataset,S)var q=S.dgst;S=q,l=Error(s(419)),l.stack="",l.digest=S,ui({value:l,source:null,stack:null}),o=Xd(n,o,a)}else if(wt||Hs(n,o,a,!1),S=(a&n.childLanes)!==0,wt||S){if(S=We,S!==null&&(l=kg(S,a),l!==0&&l!==j.retryLane))throw j.retryLane=l,Vo(n,l),nn(S,n,l),Hd;kh(R)||Tl(),o=Xd(n,o,a)}else kh(R)?(o.flags|=192,o.child=n.child,o=null):(n=j.treeContext,rt=Nn(R.nextSibling),Pt=o,Be=!0,Kr=null,kn=!1,n!==null&&Ry(o,n),o=Kd(o,l.children),o.flags|=4096);return o}return d?(ro(),R=l.fallback,d=o.mode,j=n.child,q=j.sibling,l=wr(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,q!==null?R=wr(q,R):(R=Ho(R,d,a,null),R.flags|=2),R.return=o,l.return=o,l.sibling=R,o.child=l,xi(null,l),l=o.child,R=n.child.memoizedState,R===null?R=Gd(a):(d=R.cachePool,d!==null?(j=vt._currentValue,d=d.parent!==j?{parent:j,pool:j}:d):d=Ny(),R={baseLanes:R.baseLanes|a,cachePool:d}),l.memoizedState=R,l.childLanes=Yd(n,S,a),o.memoizedState=Qd,xi(n.child,l)):(no(o),a=n.child,n=a.sibling,a=wr(a,{mode:"visible",children:l.children}),a.return=o,a.sibling=null,n!==null&&(S=o.deletions,S===null?(o.deletions=[n],o.flags|=16):S.push(n)),o.child=a,o.memoizedState=null,a)}function Kd(n,o){return o=vl({mode:"visible",children:o},n.mode),o.return=n,n.child=o}function vl(n,o){return n=hn(22,n,null,o),n.lanes=0,n}function Xd(n,o,a){return Jo(o,n.child,null,a),n=Kd(o,o.pendingProps.children),n.flags|=2,o.memoizedState=null,n}function Hv(n,o,a){n.lanes|=o;var l=n.alternate;l!==null&&(l.lanes|=o),dd(n.return,o,a)}function Jd(n,o,a,l,d,m){var S=n.memoizedState;S===null?n.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:d,treeForkCount:m}:(S.isBackwards=o,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=a,S.tailMode=d,S.treeForkCount=m)}function Zv(n,o,a){var l=o.pendingProps,d=l.revealOrder,m=l.tail;l=l.children;var S=pt.current,R=(S&2)!==0;if(R?(S=S&1|2,o.flags|=128):S&=1,ne(pt,S),It(n,o,l,a),l=Be?li:0,!R&&n!==null&&(n.flags&128)!==0)e:for(n=o.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Hv(n,a,o);else if(n.tag===19)Hv(n,a,o);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===o)break e;for(;n.sibling===null;){if(n.return===null||n.return===o)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(d){case"forwards":for(a=o.child,d=null;a!==null;)n=a.alternate,n!==null&&al(n)===null&&(d=a),a=a.sibling;a=d,a===null?(d=o.child,o.child=null):(d=a.sibling,a.sibling=null),Jd(o,!1,d,a,m,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=o.child,o.child=null;d!==null;){if(n=d.alternate,n!==null&&al(n)===null){o.child=d;break}n=d.sibling,d.sibling=a,a=d,d=n}Jd(o,!0,a,null,m,l);break;case"together":Jd(o,!1,null,null,void 0,l);break;default:o.memoizedState=null}return o.child}function Rr(n,o,a){if(n!==null&&(o.dependencies=n.dependencies),ao|=o.lanes,(a&o.childLanes)===0)if(n!==null){if(Hs(n,o,a,!1),(a&o.childLanes)===0)return null}else return null;if(n!==null&&o.child!==n.child)throw Error(s(153));if(o.child!==null){for(n=o.child,a=wr(n,n.pendingProps),o.child=a,a.return=o;n.sibling!==null;)n=n.sibling,a=a.sibling=wr(n,n.pendingProps),a.return=o;a.sibling=null}return o.child}function Wd(n,o){return(n.lanes&o)!==0?!0:(n=n.dependencies,!!(n!==null&&Jc(n)))}function Z2(n,o,a){switch(o.tag){case 3:xe(o,o.stateNode.containerInfo),Jr(o,vt,n.memoizedState.cache),Zo();break;case 27:case 5:Ee(o);break;case 4:xe(o,o.stateNode.containerInfo);break;case 10:Jr(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Cd(o),null;break;case 13:var l=o.memoizedState;if(l!==null)return l.dehydrated!==null?(no(o),o.flags|=128,null):(a&o.child.childLanes)!==0?Vv(n,o,a):(no(o),n=Rr(n,o,a),n!==null?n.sibling:null);no(o);break;case 19:var d=(n.flags&128)!==0;if(l=(a&o.childLanes)!==0,l||(Hs(n,o,a,!1),l=(a&o.childLanes)!==0),d){if(l)return Zv(n,o,a);o.flags|=128}if(d=o.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ne(pt,pt.current),l)break;return null;case 22:return o.lanes=0,Iv(n,o,a,o.pendingProps);case 24:Jr(o,vt,n.memoizedState.cache)}return Rr(n,o,a)}function Qv(n,o,a){if(n!==null)if(n.memoizedProps!==o.pendingProps)wt=!0;else{if(!Wd(n,a)&&(o.flags&128)===0)return wt=!1,Z2(n,o,a);wt=(n.flags&131072)!==0}else wt=!1,Be&&(o.flags&1048576)!==0&&Ey(o,li,o.index);switch(o.lanes=0,o.tag){case 16:e:{var l=o.pendingProps;if(n=Ko(o.elementType),o.type=n,typeof n=="function")od(n)?(l=es(n,l),o.tag=1,o=qv(null,o,n,l,a)):(o.tag=0,o=Zd(null,o,n,l,a));else{if(n!=null){var d=n.$$typeof;if(d===N){o.tag=11,o=Dv(null,o,n,l,a);break e}else if(d===L){o.tag=14,o=Pv(null,o,n,l,a);break e}}throw o=ce(n)||n,Error(s(306,o,""))}}return o;case 0:return Zd(n,o,o.type,o.pendingProps,a);case 1:return l=o.type,d=es(l,o.pendingProps),qv(n,o,l,d,a);case 3:e:{if(xe(o,o.stateNode.containerInfo),n===null)throw Error(s(387));l=o.pendingProps;var m=o.memoizedState;d=m.element,bd(n,o),yi(o,l,null,a);var S=o.memoizedState;if(l=S.cache,Jr(o,vt,l),l!==m.cache&&hd(o,[vt],a,!0),gi(),l=S.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:S.cache},o.updateQueue.baseState=m,o.memoizedState=m,o.flags&256){o=Fv(n,o,l,a);break e}else if(l!==d){d=Tn(Error(s(424)),o),ui(d),o=Fv(n,o,l,a);break e}else for(n=o.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,rt=Nn(n.firstChild),Pt=o,Be=!0,Kr=null,kn=!0,a=Iy(o,null,l,a),o.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Zo(),l===d){o=Rr(n,o,a);break e}It(n,o,l,a)}o=o.child}return o;case 26:return yl(n,o),n===null?(a=o0(o.type,null,o.pendingProps,null))?o.memoizedState=a:Be||(a=o.type,n=o.pendingProps,l=zl(ye.current).createElement(a),l[Dt]=o,l[Kt]=n,$t(l,a,n),Mt(l),o.stateNode=l):o.memoizedState=o0(o.type,n.memoizedProps,o.pendingProps,n.memoizedState),null;case 27:return Ee(o),n===null&&Be&&(l=o.stateNode=t0(o.type,o.pendingProps,ye.current),Pt=o,kn=!0,d=rt,fo(o.type)?(Nh=d,rt=Nn(l.firstChild)):rt=d),It(n,o,o.pendingProps.children,a),yl(n,o),n===null&&(o.flags|=4194304),o.child;case 5:return n===null&&Be&&((d=l=rt)&&(l=xT(l,o.type,o.pendingProps,kn),l!==null?(o.stateNode=l,Pt=o,rt=Nn(l.firstChild),kn=!1,d=!0):d=!1),d||Xr(o)),Ee(o),d=o.type,m=o.pendingProps,S=n!==null?n.memoizedProps:null,l=m.children,Th(d,m)?l=null:S!==null&&Th(d,S)&&(o.flags|=32),o.memoizedState!==null&&(d=Rd(n,o,L2,null,null,a),Li._currentValue=d),yl(n,o),It(n,o,l,a),o.child;case 6:return n===null&&Be&&((n=a=rt)&&(a=_T(a,o.pendingProps,kn),a!==null?(o.stateNode=a,Pt=o,rt=null,n=!0):n=!1),n||Xr(o)),null;case 13:return Vv(n,o,a);case 4:return xe(o,o.stateNode.containerInfo),l=o.pendingProps,n===null?o.child=Jo(o,null,l,a):It(n,o,l,a),o.child;case 11:return Dv(n,o,o.type,o.pendingProps,a);case 7:return It(n,o,o.pendingProps,a),o.child;case 8:return It(n,o,o.pendingProps.children,a),o.child;case 12:return It(n,o,o.pendingProps.children,a),o.child;case 10:return l=o.pendingProps,Jr(o,o.type,l.value),It(n,o,l.children,a),o.child;case 9:return d=o.type._context,l=o.pendingProps.children,Go(o),d=Lt(d),l=l(d),o.flags|=1,It(n,o,l,a),o.child;case 14:return Pv(n,o,o.type,o.pendingProps,a);case 15:return Lv(n,o,o.type,o.pendingProps,a);case 19:return Zv(n,o,a);case 31:return H2(n,o,a);case 22:return Iv(n,o,a,o.pendingProps);case 24:return Go(o),l=Lt(vt),n===null?(d=gd(),d===null&&(d=We,m=pd(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=a),d=m),o.memoizedState={parent:l,cache:d},vd(o),Jr(o,vt,d)):((n.lanes&a)!==0&&(bd(n,o),yi(o,null,null,a),gi()),d=n.memoizedState,m=o.memoizedState,d.parent!==l?(d={parent:l,cache:l},o.memoizedState=d,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=d),Jr(o,vt,l)):(l=m.cache,Jr(o,vt,l),l!==d.cache&&hd(o,[vt],a,!0))),It(n,o,o.pendingProps.children,a),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Tr(n){n.flags|=4}function eh(n,o,a,l,d){if((o=(n.mode&32)!==0)&&(o=!1),o){if(n.flags|=16777216,(d&335544128)===d)if(n.stateNode.complete)n.flags|=8192;else if(wb())n.flags|=8192;else throw Xo=nl,yd}else n.flags&=-16777217}function Gv(n,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!l0(o))if(wb())n.flags|=8192;else throw Xo=nl,yd}function bl(n,o){o!==null&&(n.flags|=4),n.flags&16384&&(o=n.tag!==22?Tg():536870912,n.lanes|=o,ra|=o)}function _i(n,o){if(!Be)switch(n.tailMode){case"hidden":o=n.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?o||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function ot(n){var o=n.alternate!==null&&n.alternate.child===n.child,a=0,l=0;if(o)for(var d=n.child;d!==null;)a|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=n,d=d.sibling;else for(d=n.child;d!==null;)a|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=n,d=d.sibling;return n.subtreeFlags|=l,n.childLanes=a,o}function Q2(n,o,a){var l=o.pendingProps;switch(cd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(o),null;case 1:return ot(o),null;case 3:return a=o.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),_r(vt),Ce(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(Vs(o)?Tr(o):n===null||n.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,ud())),ot(o),null;case 26:var d=o.type,m=o.memoizedState;return n===null?(Tr(o),m!==null?(ot(o),Gv(o,m)):(ot(o),eh(o,d,null,l,a))):m?m!==n.memoizedState?(Tr(o),ot(o),Gv(o,m)):(ot(o),o.flags&=-16777217):(n=n.memoizedProps,n!==l&&Tr(o),ot(o),eh(o,d,n,l,a)),null;case 27:if(Oe(o),a=ye.current,d=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==l&&Tr(o);else{if(!l){if(o.stateNode===null)throw Error(s(166));return ot(o),null}n=re.current,Vs(o)?Ty(o):(n=t0(d,l,a),o.stateNode=n,Tr(o))}return ot(o),null;case 5:if(Oe(o),d=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==l&&Tr(o);else{if(!l){if(o.stateNode===null)throw Error(s(166));return ot(o),null}if(m=re.current,Vs(o))Ty(o);else{var S=zl(ye.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?S.createElement(d,{is:l.is}):S.createElement(d)}}m[Dt]=o,m[Kt]=l;e:for(S=o.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===o)break e;for(;S.sibling===null;){if(S.return===null||S.return===o)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}o.stateNode=m;e:switch($t(m,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Tr(o)}}return ot(o),eh(o,o.type,n===null?null:n.memoizedProps,o.pendingProps,a),null;case 6:if(n&&o.stateNode!=null)n.memoizedProps!==l&&Tr(o);else{if(typeof l!="string"&&o.stateNode===null)throw Error(s(166));if(n=ye.current,Vs(o)){if(n=o.stateNode,a=o.memoizedProps,l=null,d=Pt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}n[Dt]=o,n=!!(n.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Vb(n.nodeValue,a)),n||Xr(o,!0)}else n=zl(n).createTextNode(l),n[Dt]=o,o.stateNode=n}return ot(o),null;case 31:if(a=o.memoizedState,n===null||n.memoizedState!==null){if(l=Vs(o),a!==null){if(n===null){if(!l)throw Error(s(318));if(n=o.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[Dt]=o}else Zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ot(o),n=!1}else a=ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return o.flags&256?(mn(o),o):(mn(o),null);if((o.flags&128)!==0)throw Error(s(558))}return ot(o),null;case 13:if(l=o.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(d=Vs(o),l!==null&&l.dehydrated!==null){if(n===null){if(!d)throw Error(s(318));if(d=o.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[Dt]=o}else Zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ot(o),d=!1}else d=ud(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),d=!0;if(!d)return o.flags&256?(mn(o),o):(mn(o),null)}return mn(o),(o.flags&128)!==0?(o.lanes=a,o):(a=l!==null,n=n!==null&&n.memoizedState!==null,a&&(l=o.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==d&&(l.flags|=2048)),a!==n&&a&&(o.child.flags|=8192),bl(o,o.updateQueue),ot(o),null);case 4:return Ce(),n===null&&xh(o.stateNode.containerInfo),ot(o),null;case 10:return _r(o.type),ot(o),null;case 19:if(Q(pt),l=o.memoizedState,l===null)return ot(o),null;if(d=(o.flags&128)!==0,m=l.rendering,m===null)if(d)_i(l,!1);else{if(ft!==0||n!==null&&(n.flags&128)!==0)for(n=o.child;n!==null;){if(m=al(n),m!==null){for(o.flags|=128,_i(l,!1),n=m.updateQueue,o.updateQueue=n,bl(o,n),o.subtreeFlags=0,n=a,a=o.child;a!==null;)xy(a,n),a=a.sibling;return ne(pt,pt.current&1|2),Be&&Sr(o,l.treeForkCount),o.child}n=n.sibling}l.tail!==null&&Ht()>Cl&&(o.flags|=128,d=!0,_i(l,!1),o.lanes=4194304)}else{if(!d)if(n=al(m),n!==null){if(o.flags|=128,d=!0,n=n.updateQueue,o.updateQueue=n,bl(o,n),_i(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Be)return ot(o),null}else 2*Ht()-l.renderingStartTime>Cl&&a!==536870912&&(o.flags|=128,d=!0,_i(l,!1),o.lanes=4194304);l.isBackwards?(m.sibling=o.child,o.child=m):(n=l.last,n!==null?n.sibling=m:o.child=m,l.last=m)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Ht(),n.sibling=null,a=pt.current,ne(pt,d?a&1|2:a&1),Be&&Sr(o,l.treeForkCount),n):(ot(o),null);case 22:case 23:return mn(o),_d(),l=o.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(o.flags|=8192):l&&(o.flags|=8192),l?(a&536870912)!==0&&(o.flags&128)===0&&(ot(o),o.subtreeFlags&6&&(o.flags|=8192)):ot(o),a=o.updateQueue,a!==null&&bl(o,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),l=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(l=o.memoizedState.cachePool.pool),l!==a&&(o.flags|=2048),n!==null&&Q(Yo),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),o.memoizedState.cache!==a&&(o.flags|=2048),_r(vt),ot(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function G2(n,o){switch(cd(o),o.tag){case 1:return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return _r(vt),Ce(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 26:case 27:case 5:return Oe(o),null;case 31:if(o.memoizedState!==null){if(mn(o),o.alternate===null)throw Error(s(340));Zo()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 13:if(mn(o),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Zo()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return Q(pt),null;case 4:return Ce(),null;case 10:return _r(o.type),null;case 22:case 23:return mn(o),_d(),n!==null&&Q(Yo),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 24:return _r(vt),null;case 25:return null;default:return null}}function Yv(n,o){switch(cd(o),o.tag){case 3:_r(vt),Ce();break;case 26:case 27:case 5:Oe(o);break;case 4:Ce();break;case 31:o.memoizedState!==null&&mn(o);break;case 13:mn(o);break;case 19:Q(pt);break;case 10:_r(o.type);break;case 22:case 23:mn(o),_d(),n!==null&&Q(Yo);break;case 24:_r(vt)}}function Ci(n,o){try{var a=o.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var d=l.next;a=d;do{if((a.tag&n)===n){l=void 0;var m=a.create,S=a.inst;l=m(),S.destroy=l}a=a.next}while(a!==d)}}catch(R){Ge(o,o.return,R)}}function oo(n,o,a){try{var l=o.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var m=d.next;l=m;do{if((l.tag&n)===n){var S=l.inst,R=S.destroy;if(R!==void 0){S.destroy=void 0,d=o;var j=a,q=R;try{q()}catch(G){Ge(d,j,G)}}}l=l.next}while(l!==m)}}catch(G){Ge(o,o.return,G)}}function Kv(n){var o=n.updateQueue;if(o!==null){var a=n.stateNode;try{Uy(o,a)}catch(l){Ge(n,n.return,l)}}}function Xv(n,o,a){a.props=es(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(l){Ge(n,o,l)}}function Ei(n,o){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof a=="function"?n.refCleanup=a(l):a.current=l}}catch(d){Ge(n,o,d)}}function nr(n,o){var a=n.ref,l=n.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(d){Ge(n,o,d)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){Ge(n,o,d)}else a.current=null}function Jv(n){var o=n.type,a=n.memoizedProps,l=n.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(d){Ge(n,n.return,d)}}function th(n,o,a){try{var l=n.stateNode;gT(l,n.type,a,o),l[Kt]=o}catch(d){Ge(n,n.return,d)}}function Wv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&fo(n.type)||n.tag===4}function nh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Wv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&fo(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function rh(n,o,a){var l=n.tag;if(l===5||l===6)n=n.stateNode,o?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,o):(o=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.appendChild(n),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=vr));else if(l!==4&&(l===27&&fo(n.type)&&(a=n.stateNode,o=null),n=n.child,n!==null))for(rh(n,o,a),n=n.sibling;n!==null;)rh(n,o,a),n=n.sibling}function wl(n,o,a){var l=n.tag;if(l===5||l===6)n=n.stateNode,o?a.insertBefore(n,o):a.appendChild(n);else if(l!==4&&(l===27&&fo(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(wl(n,o,a),n=n.sibling;n!==null;)wl(n,o,a),n=n.sibling}function eb(n){var o=n.stateNode,a=n.memoizedProps;try{for(var l=n.type,d=o.attributes;d.length;)o.removeAttributeNode(d[0]);$t(o,l,a),o[Dt]=n,o[Kt]=a}catch(m){Ge(n,n.return,m)}}var Ar=!1,St=!1,oh=!1,tb=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function Y2(n,o){if(n=n.containerInfo,Eh=Bl,n=hy(n),Xf(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else e:{a=(a=n.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var d=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var S=0,R=-1,j=-1,q=0,G=0,ee=n,F=null;t:for(;;){for(var Z;ee!==a||d!==0&&ee.nodeType!==3||(R=S+d),ee!==m||l!==0&&ee.nodeType!==3||(j=S+l),ee.nodeType===3&&(S+=ee.nodeValue.length),(Z=ee.firstChild)!==null;)F=ee,ee=Z;for(;;){if(ee===n)break t;if(F===a&&++q===d&&(R=S),F===m&&++G===l&&(j=S),(Z=ee.nextSibling)!==null)break;ee=F,F=ee.parentNode}ee=Z}a=R===-1||j===-1?null:{start:R,end:j}}else a=null}a=a||{start:0,end:0}}else a=null;for(Rh={focusedElem:n,selectionRange:a},Bl=!1,Nt=o;Nt!==null;)if(o=Nt,n=o.child,(o.subtreeFlags&1028)!==0&&n!==null)n.return=o,Nt=n;else for(;Nt!==null;){switch(o=Nt,m=o.alternate,n=o.flags,o.tag){case 0:if((n&4)!==0&&(n=o.updateQueue,n=n!==null?n.events:null,n!==null))for(a=0;a<n.length;a++)d=n[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&m!==null){n=void 0,a=o,d=m.memoizedProps,m=m.memoizedState,l=a.stateNode;try{var fe=es(a.type,d);n=l.getSnapshotBeforeUpdate(fe,m),l.__reactInternalSnapshotBeforeUpdate=n}catch(_e){Ge(a,a.return,_e)}}break;case 3:if((n&1024)!==0){if(n=o.stateNode.containerInfo,a=n.nodeType,a===9)Oh(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Oh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=o.sibling,n!==null){n.return=o.return,Nt=n;break}Nt=o.return}}function nb(n,o,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:kr(n,a),l&4&&Ci(5,a);break;case 1:if(kr(n,a),l&4)if(n=a.stateNode,o===null)try{n.componentDidMount()}catch(S){Ge(a,a.return,S)}else{var d=es(a.type,o.memoizedProps);o=o.memoizedState;try{n.componentDidUpdate(d,o,n.__reactInternalSnapshotBeforeUpdate)}catch(S){Ge(a,a.return,S)}}l&64&&Kv(a),l&512&&Ei(a,a.return);break;case 3:if(kr(n,a),l&64&&(n=a.updateQueue,n!==null)){if(o=null,a.child!==null)switch(a.child.tag){case 27:case 5:o=a.child.stateNode;break;case 1:o=a.child.stateNode}try{Uy(n,o)}catch(S){Ge(a,a.return,S)}}break;case 27:o===null&&l&4&&eb(a);case 26:case 5:kr(n,a),o===null&&l&4&&Jv(a),l&512&&Ei(a,a.return);break;case 12:kr(n,a);break;case 31:kr(n,a),l&4&&sb(n,a);break;case 13:kr(n,a),l&4&&ab(n,a),l&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=oT.bind(null,a),CT(n,a))));break;case 22:if(l=a.memoizedState!==null||Ar,!l){o=o!==null&&o.memoizedState!==null||St,d=Ar;var m=St;Ar=l,(St=o)&&!m?Mr(n,a,(a.subtreeFlags&8772)!==0):kr(n,a),Ar=d,St=m}break;case 30:break;default:kr(n,a)}}function rb(n){var o=n.alternate;o!==null&&(n.alternate=null,rb(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&zf(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var st=null,Jt=!1;function Or(n,o,a){for(a=a.child;a!==null;)ob(n,o,a),a=a.sibling}function ob(n,o,a){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Ya,a)}catch{}switch(a.tag){case 26:St||nr(a,o),Or(n,o,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:St||nr(a,o);var l=st,d=Jt;fo(a.type)&&(st=a.stateNode,Jt=!1),Or(n,o,a),zi(a.stateNode),st=l,Jt=d;break;case 5:St||nr(a,o);case 6:if(l=st,d=Jt,st=null,Or(n,o,a),st=l,Jt=d,st!==null)if(Jt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(m){Ge(a,o,m)}else try{st.removeChild(a.stateNode)}catch(m){Ge(a,o,m)}break;case 18:st!==null&&(Jt?(n=st,Kb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),fa(n)):Kb(st,a.stateNode));break;case 4:l=st,d=Jt,st=a.stateNode.containerInfo,Jt=!0,Or(n,o,a),st=l,Jt=d;break;case 0:case 11:case 14:case 15:oo(2,a,o),St||oo(4,a,o),Or(n,o,a);break;case 1:St||(nr(a,o),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Xv(a,o,l)),Or(n,o,a);break;case 21:Or(n,o,a);break;case 22:St=(l=St)||a.memoizedState!==null,Or(n,o,a),St=l;break;default:Or(n,o,a)}}function sb(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{fa(n)}catch(a){Ge(o,o.return,a)}}}function ab(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{fa(n)}catch(a){Ge(o,o.return,a)}}function K2(n){switch(n.tag){case 31:case 13:case 19:var o=n.stateNode;return o===null&&(o=n.stateNode=new tb),o;case 22:return n=n.stateNode,o=n._retryCache,o===null&&(o=n._retryCache=new tb),o;default:throw Error(s(435,n.tag))}}function Sl(n,o){var a=K2(n);o.forEach(function(l){if(!a.has(l)){a.add(l);var d=sT.bind(null,n,l);l.then(d,d)}})}function Wt(n,o){var a=o.deletions;if(a!==null)for(var l=0;l<a.length;l++){var d=a[l],m=n,S=o,R=S;e:for(;R!==null;){switch(R.tag){case 27:if(fo(R.type)){st=R.stateNode,Jt=!1;break e}break;case 5:st=R.stateNode,Jt=!1;break e;case 3:case 4:st=R.stateNode.containerInfo,Jt=!0;break e}R=R.return}if(st===null)throw Error(s(160));ob(m,S,d),st=null,Jt=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ib(o,n),o=o.sibling}var Vn=null;function ib(n,o){var a=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Wt(o,n),en(n),l&4&&(oo(3,n,n.return),Ci(3,n),oo(5,n,n.return));break;case 1:Wt(o,n),en(n),l&512&&(St||a===null||nr(a,a.return)),l&64&&Ar&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var d=Vn;if(Wt(o,n),en(n),l&512&&(St||a===null||nr(a,a.return)),l&4){var m=a!==null?a.memoizedState:null;if(l=n.memoizedState,a===null)if(l===null)if(n.stateNode===null){e:{l=n.type,a=n.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":m=d.getElementsByTagName("title")[0],(!m||m[Ja]||m[Dt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(l),d.head.insertBefore(m,d.querySelector("head > title"))),$t(m,l,a),m[Dt]=n,Mt(m),l=m;break e;case"link":var S=i0("link","href",d).get(l+(a.href||""));if(S){for(var R=0;R<S.length;R++)if(m=S[R],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(R,1);break t}}m=d.createElement(l),$t(m,l,a),d.head.appendChild(m);break;case"meta":if(S=i0("meta","content",d).get(l+(a.content||""))){for(R=0;R<S.length;R++)if(m=S[R],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(R,1);break t}}m=d.createElement(l),$t(m,l,a),d.head.appendChild(m);break;default:throw Error(s(468,l))}m[Dt]=n,Mt(m),l=m}n.stateNode=l}else c0(d,n.type,n.stateNode);else n.stateNode=a0(d,l,n.memoizedProps);else m!==l?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,l===null?c0(d,n.type,n.stateNode):a0(d,l,n.memoizedProps)):l===null&&n.stateNode!==null&&th(n,n.memoizedProps,a.memoizedProps)}break;case 27:Wt(o,n),en(n),l&512&&(St||a===null||nr(a,a.return)),a!==null&&l&4&&th(n,n.memoizedProps,a.memoizedProps);break;case 5:if(Wt(o,n),en(n),l&512&&(St||a===null||nr(a,a.return)),n.flags&32){d=n.stateNode;try{zs(d,"")}catch(fe){Ge(n,n.return,fe)}}l&4&&n.stateNode!=null&&(d=n.memoizedProps,th(n,d,a!==null?a.memoizedProps:d)),l&1024&&(oh=!0);break;case 6:if(Wt(o,n),en(n),l&4){if(n.stateNode===null)throw Error(s(162));l=n.memoizedProps,a=n.stateNode;try{a.nodeValue=l}catch(fe){Ge(n,n.return,fe)}}break;case 3:if(Ll=null,d=Vn,Vn=Dl(o.containerInfo),Wt(o,n),Vn=d,en(n),l&4&&a!==null&&a.memoizedState.isDehydrated)try{fa(o.containerInfo)}catch(fe){Ge(n,n.return,fe)}oh&&(oh=!1,cb(n));break;case 4:l=Vn,Vn=Dl(n.stateNode.containerInfo),Wt(o,n),en(n),Vn=l;break;case 12:Wt(o,n),en(n);break;case 31:Wt(o,n),en(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Sl(n,l)));break;case 13:Wt(o,n),en(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(_l=Ht()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Sl(n,l)));break;case 22:d=n.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,q=Ar,G=St;if(Ar=q||d,St=G||j,Wt(o,n),St=G,Ar=q,en(n),l&8192)e:for(o=n.stateNode,o._visibility=d?o._visibility&-2:o._visibility|1,d&&(a===null||j||Ar||St||ts(n)),a=null,o=n;;){if(o.tag===5||o.tag===26){if(a===null){j=a=o;try{if(m=j.stateNode,d)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{R=j.stateNode;var ee=j.memoizedProps.style,F=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;R.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(fe){Ge(j,j.return,fe)}}}else if(o.tag===6){if(a===null){j=o;try{j.stateNode.nodeValue=d?"":j.memoizedProps}catch(fe){Ge(j,j.return,fe)}}}else if(o.tag===18){if(a===null){j=o;try{var Z=j.stateNode;d?Xb(Z,!0):Xb(j.stateNode,!1)}catch(fe){Ge(j,j.return,fe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===n)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break e;for(;o.sibling===null;){if(o.return===null||o.return===n)break e;a===o&&(a=null),o=o.return}a===o&&(a=null),o.sibling.return=o.return,o=o.sibling}l&4&&(l=n.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Sl(n,a))));break;case 19:Wt(o,n),en(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Sl(n,l)));break;case 30:break;case 21:break;default:Wt(o,n),en(n)}}function en(n){var o=n.flags;if(o&2){try{for(var a,l=n.return;l!==null;){if(Wv(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var d=a.stateNode,m=nh(n);wl(n,m,d);break;case 5:var S=a.stateNode;a.flags&32&&(zs(S,""),a.flags&=-33);var R=nh(n);wl(n,R,S);break;case 3:case 4:var j=a.stateNode.containerInfo,q=nh(n);rh(n,q,j);break;default:throw Error(s(161))}}catch(G){Ge(n,n.return,G)}n.flags&=-3}o&4096&&(n.flags&=-4097)}function cb(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var o=n;cb(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),n=n.sibling}}function kr(n,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)nb(n,o.alternate,o),o=o.sibling}function ts(n){for(n=n.child;n!==null;){var o=n;switch(o.tag){case 0:case 11:case 14:case 15:oo(4,o,o.return),ts(o);break;case 1:nr(o,o.return);var a=o.stateNode;typeof a.componentWillUnmount=="function"&&Xv(o,o.return,a),ts(o);break;case 27:zi(o.stateNode);case 26:case 5:nr(o,o.return),ts(o);break;case 22:o.memoizedState===null&&ts(o);break;case 30:ts(o);break;default:ts(o)}n=n.sibling}}function Mr(n,o,a){for(a=a&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var l=o.alternate,d=n,m=o,S=m.flags;switch(m.tag){case 0:case 11:case 15:Mr(d,m,a),Ci(4,m);break;case 1:if(Mr(d,m,a),l=m,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(q){Ge(l,l.return,q)}if(l=m,d=l.updateQueue,d!==null){var R=l.stateNode;try{var j=d.shared.hiddenCallbacks;if(j!==null)for(d.shared.hiddenCallbacks=null,d=0;d<j.length;d++)$y(j[d],R)}catch(q){Ge(l,l.return,q)}}a&&S&64&&Kv(m),Ei(m,m.return);break;case 27:eb(m);case 26:case 5:Mr(d,m,a),a&&l===null&&S&4&&Jv(m),Ei(m,m.return);break;case 12:Mr(d,m,a);break;case 31:Mr(d,m,a),a&&S&4&&sb(d,m);break;case 13:Mr(d,m,a),a&&S&4&&ab(d,m);break;case 22:m.memoizedState===null&&Mr(d,m,a),Ei(m,m.return);break;case 30:break;default:Mr(d,m,a)}o=o.sibling}}function sh(n,o){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(n=o.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&fi(a))}function ah(n,o){n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&fi(n))}function Hn(n,o,a,l){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)lb(n,o,a,l),o=o.sibling}function lb(n,o,a,l){var d=o.flags;switch(o.tag){case 0:case 11:case 15:Hn(n,o,a,l),d&2048&&Ci(9,o);break;case 1:Hn(n,o,a,l);break;case 3:Hn(n,o,a,l),d&2048&&(n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&fi(n)));break;case 12:if(d&2048){Hn(n,o,a,l),n=o.stateNode;try{var m=o.memoizedProps,S=m.id,R=m.onPostCommit;typeof R=="function"&&R(S,o.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(j){Ge(o,o.return,j)}}else Hn(n,o,a,l);break;case 31:Hn(n,o,a,l);break;case 13:Hn(n,o,a,l);break;case 23:break;case 22:m=o.stateNode,S=o.alternate,o.memoizedState!==null?m._visibility&2?Hn(n,o,a,l):Ri(n,o):m._visibility&2?Hn(n,o,a,l):(m._visibility|=2,ea(n,o,a,l,(o.subtreeFlags&10256)!==0||!1)),d&2048&&sh(S,o);break;case 24:Hn(n,o,a,l),d&2048&&ah(o.alternate,o);break;default:Hn(n,o,a,l)}}function ea(n,o,a,l,d){for(d=d&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var m=n,S=o,R=a,j=l,q=S.flags;switch(S.tag){case 0:case 11:case 15:ea(m,S,R,j,d),Ci(8,S);break;case 23:break;case 22:var G=S.stateNode;S.memoizedState!==null?G._visibility&2?ea(m,S,R,j,d):Ri(m,S):(G._visibility|=2,ea(m,S,R,j,d)),d&&q&2048&&sh(S.alternate,S);break;case 24:ea(m,S,R,j,d),d&&q&2048&&ah(S.alternate,S);break;default:ea(m,S,R,j,d)}o=o.sibling}}function Ri(n,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var a=n,l=o,d=l.flags;switch(l.tag){case 22:Ri(a,l),d&2048&&sh(l.alternate,l);break;case 24:Ri(a,l),d&2048&&ah(l.alternate,l);break;default:Ri(a,l)}o=o.sibling}}var Ti=8192;function ta(n,o,a){if(n.subtreeFlags&Ti)for(n=n.child;n!==null;)ub(n,o,a),n=n.sibling}function ub(n,o,a){switch(n.tag){case 26:ta(n,o,a),n.flags&Ti&&n.memoizedState!==null&&PT(a,Vn,n.memoizedState,n.memoizedProps);break;case 5:ta(n,o,a);break;case 3:case 4:var l=Vn;Vn=Dl(n.stateNode.containerInfo),ta(n,o,a),Vn=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Ti,Ti=16777216,ta(n,o,a),Ti=l):ta(n,o,a));break;default:ta(n,o,a)}}function fb(n){var o=n.alternate;if(o!==null&&(n=o.child,n!==null)){o.child=null;do o=n.sibling,n.sibling=null,n=o;while(n!==null)}}function Ai(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var l=o[a];Nt=l,hb(l,n)}fb(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)db(n),n=n.sibling}function db(n){switch(n.tag){case 0:case 11:case 15:Ai(n),n.flags&2048&&oo(9,n,n.return);break;case 3:Ai(n);break;case 12:Ai(n);break;case 22:var o=n.stateNode;n.memoizedState!==null&&o._visibility&2&&(n.return===null||n.return.tag!==13)?(o._visibility&=-3,xl(n)):Ai(n);break;default:Ai(n)}}function xl(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var l=o[a];Nt=l,hb(l,n)}fb(n)}for(n=n.child;n!==null;){switch(o=n,o.tag){case 0:case 11:case 15:oo(8,o,o.return),xl(o);break;case 22:a=o.stateNode,a._visibility&2&&(a._visibility&=-3,xl(o));break;default:xl(o)}n=n.sibling}}function hb(n,o){for(;Nt!==null;){var a=Nt;switch(a.tag){case 0:case 11:case 15:oo(8,a,o);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:fi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Nt=l;else e:for(a=n;Nt!==null;){l=Nt;var d=l.sibling,m=l.return;if(rb(l),l===a){Nt=null;break e}if(d!==null){d.return=m,Nt=d;break e}Nt=m}}}var X2={getCacheForType:function(n){var o=Lt(vt),a=o.data.get(n);return a===void 0&&(a=n(),o.data.set(n,a)),a},cacheSignal:function(){return Lt(vt).controller.signal}},J2=typeof WeakMap=="function"?WeakMap:Map,Ze=0,We=null,Pe=null,Ie=0,Qe=0,gn=null,so=!1,na=!1,ih=!1,Nr=0,ft=0,ao=0,ns=0,ch=0,yn=0,ra=0,Oi=null,tn=null,lh=!1,_l=0,pb=0,Cl=1/0,El=null,io=null,Tt=0,co=null,oa=null,jr=0,uh=0,fh=null,mb=null,ki=0,dh=null;function vn(){return(Ze&2)!==0&&Ie!==0?Ie&-Ie:I.T!==null?vh():Mg()}function gb(){if(yn===0)if((Ie&536870912)===0||Be){var n=jc;jc<<=1,(jc&3932160)===0&&(jc=262144),yn=n}else yn=536870912;return n=pn.current,n!==null&&(n.flags|=32),yn}function nn(n,o,a){(n===We&&(Qe===2||Qe===9)||n.cancelPendingCommit!==null)&&(sa(n,0),lo(n,Ie,yn,!1)),Xa(n,a),((Ze&2)===0||n!==We)&&(n===We&&((Ze&2)===0&&(ns|=a),ft===4&&lo(n,Ie,yn,!1)),rr(n))}function yb(n,o,a){if((Ze&6)!==0)throw Error(s(327));var l=!a&&(o&127)===0&&(o&n.expiredLanes)===0||Ka(n,o),d=l?tT(n,o):ph(n,o,!0),m=l;do{if(d===0){na&&!l&&lo(n,o,0,!1);break}else{if(a=n.current.alternate,m&&!W2(a)){d=ph(n,o,!1),m=!1;continue}if(d===2){if(m=o,n.errorRecoveryDisabledLanes&m)var S=0;else S=n.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){o=S;e:{var R=n;d=Oi;var j=R.current.memoizedState.isDehydrated;if(j&&(sa(R,S).flags|=256),S=ph(R,S,!1),S!==2){if(ih&&!j){R.errorRecoveryDisabledLanes|=m,ns|=m,d=4;break e}m=tn,tn=d,m!==null&&(tn===null?tn=m:tn.push.apply(tn,m))}d=S}if(m=!1,d!==2)continue}}if(d===1){sa(n,0),lo(n,o,0,!0);break}e:{switch(l=n,m=d,m){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:lo(l,o,yn,!so);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(d=_l+300-Ht(),10<d)){if(lo(l,o,yn,!so),Dc(l,0,!0)!==0)break e;jr=o,l.timeoutHandle=Gb(vb.bind(null,l,a,tn,El,lh,o,yn,ns,ra,so,m,"Throttled",-0,0),d);break e}vb(l,a,tn,El,lh,o,yn,ns,ra,so,m,null,-0,0)}}break}while(!0);rr(n)}function vb(n,o,a,l,d,m,S,R,j,q,G,ee,F,Z){if(n.timeoutHandle=-1,ee=o.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vr},ub(o,m,ee);var fe=(m&62914560)===m?_l-Ht():(m&4194048)===m?pb-Ht():0;if(fe=LT(ee,fe),fe!==null){jr=m,n.cancelPendingCommit=fe(Rb.bind(null,n,o,m,a,l,d,S,R,j,G,ee,null,F,Z)),lo(n,m,S,!q);return}}Rb(n,o,m,a,l,d,S,R,j)}function W2(n){for(var o=n;;){var a=o.tag;if((a===0||a===11||a===15)&&o.flags&16384&&(a=o.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var d=a[l],m=d.getSnapshot;d=d.value;try{if(!dn(m(),d))return!1}catch{return!1}}if(a=o.child,o.subtreeFlags&16384&&a!==null)a.return=o,o=a;else{if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function lo(n,o,a,l){o&=~ch,o&=~ns,n.suspendedLanes|=o,n.pingedLanes&=~o,l&&(n.warmLanes|=o),l=n.expirationTimes;for(var d=o;0<d;){var m=31-fn(d),S=1<<m;l[m]=-1,d&=~S}a!==0&&Ag(n,a,o)}function Rl(){return(Ze&6)===0?(Mi(0),!1):!0}function hh(){if(Pe!==null){if(Qe===0)var n=Pe.return;else n=Pe,xr=Qo=null,Od(n),Ys=null,hi=0,n=Pe;for(;n!==null;)Yv(n.alternate,n),n=n.return;Pe=null}}function sa(n,o){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,bT(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),jr=0,hh(),We=n,Pe=a=wr(n.current,null),Ie=o,Qe=0,gn=null,so=!1,na=Ka(n,o),ih=!1,ra=yn=ch=ns=ao=ft=0,tn=Oi=null,lh=!1,(o&8)!==0&&(o|=o&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=o;0<l;){var d=31-fn(l),m=1<<d;o|=n[d],l&=~m}return Nr=o,Qc(),a}function bb(n,o){Te=null,I.H=Si,o===Gs||o===tl?(o=Dy(),Qe=3):o===yd?(o=Dy(),Qe=4):Qe=o===Hd?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,gn=o,Pe===null&&(ft=1,ml(n,Tn(o,n.current)))}function wb(){var n=pn.current;return n===null?!0:(Ie&4194048)===Ie?Mn===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?n===Mn:!1}function Sb(){var n=I.H;return I.H=Si,n===null?Si:n}function xb(){var n=I.A;return I.A=X2,n}function Tl(){ft=4,so||(Ie&4194048)!==Ie&&pn.current!==null||(na=!0),(ao&134217727)===0&&(ns&134217727)===0||We===null||lo(We,Ie,yn,!1)}function ph(n,o,a){var l=Ze;Ze|=2;var d=Sb(),m=xb();(We!==n||Ie!==o)&&(El=null,sa(n,o)),o=!1;var S=ft;e:do try{if(Qe!==0&&Pe!==null){var R=Pe,j=gn;switch(Qe){case 8:hh(),S=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(o=!0);var q=Qe;if(Qe=0,gn=null,aa(n,R,j,q),a&&na){S=0;break e}break;default:q=Qe,Qe=0,gn=null,aa(n,R,j,q)}}eT(),S=ft;break}catch(G){bb(n,G)}while(!0);return o&&n.shellSuspendCounter++,xr=Qo=null,Ze=l,I.H=d,I.A=m,Pe===null&&(We=null,Ie=0,Qc()),S}function eT(){for(;Pe!==null;)_b(Pe)}function tT(n,o){var a=Ze;Ze|=2;var l=Sb(),d=xb();We!==n||Ie!==o?(El=null,Cl=Ht()+500,sa(n,o)):na=Ka(n,o);e:do try{if(Qe!==0&&Pe!==null){o=Pe;var m=gn;t:switch(Qe){case 1:Qe=0,gn=null,aa(n,o,m,1);break;case 2:case 9:if(jy(m)){Qe=0,gn=null,Cb(o);break}o=function(){Qe!==2&&Qe!==9||We!==n||(Qe=7),rr(n)},m.then(o,o);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:jy(m)?(Qe=0,gn=null,Cb(o)):(Qe=0,gn=null,aa(n,o,m,7));break;case 5:var S=null;switch(Pe.tag){case 26:S=Pe.memoizedState;case 5:case 27:var R=Pe;if(S?l0(S):R.stateNode.complete){Qe=0,gn=null;var j=R.sibling;if(j!==null)Pe=j;else{var q=R.return;q!==null?(Pe=q,Al(q)):Pe=null}break t}}Qe=0,gn=null,aa(n,o,m,5);break;case 6:Qe=0,gn=null,aa(n,o,m,6);break;case 8:hh(),ft=6;break e;default:throw Error(s(462))}}nT();break}catch(G){bb(n,G)}while(!0);return xr=Qo=null,I.H=l,I.A=d,Ze=a,Pe!==null?0:(We=null,Ie=0,Qc(),ft)}function nT(){for(;Pe!==null&&!De();)_b(Pe)}function _b(n){var o=Qv(n.alternate,n,Nr);n.memoizedProps=n.pendingProps,o===null?Al(n):Pe=o}function Cb(n){var o=n,a=o.alternate;switch(o.tag){case 15:case 0:o=Bv(a,o,o.pendingProps,o.type,void 0,Ie);break;case 11:o=Bv(a,o,o.pendingProps,o.type.render,o.ref,Ie);break;case 5:Od(o);default:Yv(a,o),o=Pe=xy(o,Nr),o=Qv(a,o,Nr)}n.memoizedProps=n.pendingProps,o===null?Al(n):Pe=o}function aa(n,o,a,l){xr=Qo=null,Od(o),Ys=null,hi=0;var d=o.return;try{if(V2(n,d,o,a,Ie)){ft=1,ml(n,Tn(a,n.current)),Pe=null;return}}catch(m){if(d!==null)throw Pe=d,m;ft=1,ml(n,Tn(a,n.current)),Pe=null;return}o.flags&32768?(Be||l===1?n=!0:na||(Ie&536870912)!==0?n=!1:(so=n=!0,(l===2||l===9||l===3||l===6)&&(l=pn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Eb(o,n)):Al(o)}function Al(n){var o=n;do{if((o.flags&32768)!==0){Eb(o,so);return}n=o.return;var a=Q2(o.alternate,o,Nr);if(a!==null){Pe=a;return}if(o=o.sibling,o!==null){Pe=o;return}Pe=o=n}while(o!==null);ft===0&&(ft=5)}function Eb(n,o){do{var a=G2(n.alternate,n);if(a!==null){a.flags&=32767,Pe=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!o&&(n=n.sibling,n!==null)){Pe=n;return}Pe=n=a}while(n!==null);ft=6,Pe=null}function Rb(n,o,a,l,d,m,S,R,j){n.cancelPendingCommit=null;do Ol();while(Tt!==0);if((Ze&6)!==0)throw Error(s(327));if(o!==null){if(o===n.current)throw Error(s(177));if(m=o.lanes|o.childLanes,m|=nd,DR(n,a,m,S,R,j),n===We&&(Pe=We=null,Ie=0),oa=o,co=n,jr=a,uh=m,fh=d,mb=l,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,aT(Bt,function(){return Mb(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||l){l=I.T,I.T=null,d=K.p,K.p=2,S=Ze,Ze|=4;try{Y2(n,o,a)}finally{Ze=S,K.p=d,I.T=l}}Tt=1,Tb(),Ab(),Ob()}}function Tb(){if(Tt===1){Tt=0;var n=co,o=oa,a=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||a){a=I.T,I.T=null;var l=K.p;K.p=2;var d=Ze;Ze|=4;try{ib(o,n);var m=Rh,S=hy(n.containerInfo),R=m.focusedElem,j=m.selectionRange;if(S!==R&&R&&R.ownerDocument&&dy(R.ownerDocument.documentElement,R)){if(j!==null&&Xf(R)){var q=j.start,G=j.end;if(G===void 0&&(G=q),"selectionStart"in R)R.selectionStart=q,R.selectionEnd=Math.min(G,R.value.length);else{var ee=R.ownerDocument||document,F=ee&&ee.defaultView||window;if(F.getSelection){var Z=F.getSelection(),fe=R.textContent.length,_e=Math.min(j.start,fe),Je=j.end===void 0?_e:Math.min(j.end,fe);!Z.extend&&_e>Je&&(S=Je,Je=_e,_e=S);var $=fy(R,_e),P=fy(R,Je);if($&&P&&(Z.rangeCount!==1||Z.anchorNode!==$.node||Z.anchorOffset!==$.offset||Z.focusNode!==P.node||Z.focusOffset!==P.offset)){var B=ee.createRange();B.setStart($.node,$.offset),Z.removeAllRanges(),_e>Je?(Z.addRange(B),Z.extend(P.node,P.offset)):(B.setEnd(P.node,P.offset),Z.addRange(B))}}}}for(ee=[],Z=R;Z=Z.parentNode;)Z.nodeType===1&&ee.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ee.length;R++){var J=ee[R];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Bl=!!Eh,Rh=Eh=null}finally{Ze=d,K.p=l,I.T=a}}n.current=o,Tt=2}}function Ab(){if(Tt===2){Tt=0;var n=co,o=oa,a=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||a){a=I.T,I.T=null;var l=K.p;K.p=2;var d=Ze;Ze|=4;try{nb(n,o.alternate,o)}finally{Ze=d,K.p=l,I.T=a}}Tt=3}}function Ob(){if(Tt===4||Tt===3){Tt=0,jt();var n=co,o=oa,a=jr,l=mb;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Tt=5:(Tt=0,oa=co=null,kb(n,n.pendingLanes));var d=n.pendingLanes;if(d===0&&(io=null),Nf(a),o=o.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(Ya,o,void 0,(o.current.flags&128)===128)}catch{}if(l!==null){o=I.T,d=K.p,K.p=2,I.T=null;try{for(var m=n.onRecoverableError,S=0;S<l.length;S++){var R=l[S];m(R.value,{componentStack:R.stack})}}finally{I.T=o,K.p=d}}(jr&3)!==0&&Ol(),rr(n),d=n.pendingLanes,(a&261930)!==0&&(d&42)!==0?n===dh?ki++:(ki=0,dh=n):ki=0,Mi(0)}}function kb(n,o){(n.pooledCacheLanes&=o)===0&&(o=n.pooledCache,o!=null&&(n.pooledCache=null,fi(o)))}function Ol(){return Tb(),Ab(),Ob(),Mb()}function Mb(){if(Tt!==5)return!1;var n=co,o=uh;uh=0;var a=Nf(jr),l=I.T,d=K.p;try{K.p=32>a?32:a,I.T=null,a=fh,fh=null;var m=co,S=jr;if(Tt=0,oa=co=null,jr=0,(Ze&6)!==0)throw Error(s(331));var R=Ze;if(Ze|=4,db(m.current),lb(m,m.current,S,a),Ze=R,Mi(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(Ya,m)}catch{}return!0}finally{K.p=d,I.T=l,kb(n,o)}}function Nb(n,o,a){o=Tn(a,o),o=Vd(n.stateNode,o,2),n=to(n,o,2),n!==null&&(Xa(n,2),rr(n))}function Ge(n,o,a){if(n.tag===3)Nb(n,n,a);else for(;o!==null;){if(o.tag===3){Nb(o,n,a);break}else if(o.tag===1){var l=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(io===null||!io.has(l))){n=Tn(a,n),a=jv(2),l=to(o,a,2),l!==null&&(zv(a,l,o,n),Xa(l,2),rr(l));break}}o=o.return}}function mh(n,o,a){var l=n.pingCache;if(l===null){l=n.pingCache=new J2;var d=new Set;l.set(o,d)}else d=l.get(o),d===void 0&&(d=new Set,l.set(o,d));d.has(a)||(ih=!0,d.add(a),n=rT.bind(null,n,o,a),o.then(n,n))}function rT(n,o,a){var l=n.pingCache;l!==null&&l.delete(o),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,We===n&&(Ie&a)===a&&(ft===4||ft===3&&(Ie&62914560)===Ie&&300>Ht()-_l?(Ze&2)===0&&sa(n,0):ch|=a,ra===Ie&&(ra=0)),rr(n)}function jb(n,o){o===0&&(o=Tg()),n=Vo(n,o),n!==null&&(Xa(n,o),rr(n))}function oT(n){var o=n.memoizedState,a=0;o!==null&&(a=o.retryLane),jb(n,a)}function sT(n,o){var a=0;switch(n.tag){case 31:case 13:var l=n.stateNode,d=n.memoizedState;d!==null&&(a=d.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(o),jb(n,a)}function aT(n,o){return ke(n,o)}var kl=null,ia=null,gh=!1,Ml=!1,yh=!1,uo=0;function rr(n){n!==ia&&n.next===null&&(ia===null?kl=ia=n:ia=ia.next=n),Ml=!0,gh||(gh=!0,cT())}function Mi(n,o){if(!yh&&Ml){yh=!0;do for(var a=!1,l=kl;l!==null;){if(n!==0){var d=l.pendingLanes;if(d===0)var m=0;else{var S=l.suspendedLanes,R=l.pingedLanes;m=(1<<31-fn(42|n)+1)-1,m&=d&~(S&~R),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,Lb(l,m))}else m=Ie,m=Dc(l,l===We?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Ka(l,m)||(a=!0,Lb(l,m));l=l.next}while(a);yh=!1}}function iT(){zb()}function zb(){Ml=gh=!1;var n=0;uo!==0&&vT()&&(n=uo);for(var o=Ht(),a=null,l=kl;l!==null;){var d=l.next,m=Db(l,o);m===0?(l.next=null,a===null?kl=d:a.next=d,d===null&&(ia=a)):(a=l,(n!==0||(m&3)!==0)&&(Ml=!0)),l=d}Tt!==0&&Tt!==5||Mi(n),uo!==0&&(uo=0)}function Db(n,o){for(var a=n.suspendedLanes,l=n.pingedLanes,d=n.expirationTimes,m=n.pendingLanes&-62914561;0<m;){var S=31-fn(m),R=1<<S,j=d[S];j===-1?((R&a)===0||(R&l)!==0)&&(d[S]=zR(R,o)):j<=o&&(n.expiredLanes|=R),m&=~R}if(o=We,a=Ie,a=Dc(n,n===o?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,a===0||n===o&&(Qe===2||Qe===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&Ue(l),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Ka(n,a)){if(o=a&-a,o===n.callbackPriority)return o;switch(l!==null&&Ue(l),Nf(a)){case 2:case 8:a=zt;break;case 32:a=Bt;break;case 268435456:a=Rg;break;default:a=Bt}return l=Pb.bind(null,n),a=ke(a,l),n.callbackPriority=o,n.callbackNode=a,o}return l!==null&&l!==null&&Ue(l),n.callbackPriority=2,n.callbackNode=null,2}function Pb(n,o){if(Tt!==0&&Tt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(Ol()&&n.callbackNode!==a)return null;var l=Ie;return l=Dc(n,n===We?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(yb(n,l,o),Db(n,Ht()),n.callbackNode!=null&&n.callbackNode===a?Pb.bind(null,n):null)}function Lb(n,o){if(Ol())return null;yb(n,o,!0)}function cT(){wT(function(){(Ze&6)!==0?ke(nt,iT):zb()})}function vh(){if(uo===0){var n=Zs;n===0&&(n=Nc,Nc<<=1,(Nc&261888)===0&&(Nc=256)),uo=n}return uo}function Ib(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:$c(""+n)}function $b(n,o){var a=o.ownerDocument.createElement("input");return a.name=o.name,a.value=o.value,n.id&&a.setAttribute("form",n.id),o.parentNode.insertBefore(a,o),n=new FormData(n),a.parentNode.removeChild(a),n}function lT(n,o,a,l,d){if(o==="submit"&&a&&a.stateNode===d){var m=Ib((d[Kt]||null).action),S=l.submitter;S&&(o=(o=S[Kt]||null)?Ib(o.formAction):S.getAttribute("formAction"),o!==null&&(m=o,S=null));var R=new Fc("action","action",null,l,d);n.push({event:R,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(uo!==0){var j=S?$b(d,S):new FormData(d);Id(a,{pending:!0,data:j,method:d.method,action:m},null,j)}}else typeof m=="function"&&(R.preventDefault(),j=S?$b(d,S):new FormData(d),Id(a,{pending:!0,data:j,method:d.method,action:m},m,j))},currentTarget:d}]})}}for(var bh=0;bh<td.length;bh++){var wh=td[bh],uT=wh.toLowerCase(),fT=wh[0].toUpperCase()+wh.slice(1);Fn(uT,"on"+fT)}Fn(gy,"onAnimationEnd"),Fn(yy,"onAnimationIteration"),Fn(vy,"onAnimationStart"),Fn("dblclick","onDoubleClick"),Fn("focusin","onFocus"),Fn("focusout","onBlur"),Fn(T2,"onTransitionRun"),Fn(A2,"onTransitionStart"),Fn(O2,"onTransitionCancel"),Fn(by,"onTransitionEnd"),Ns("onMouseEnter",["mouseout","mouseover"]),Ns("onMouseLeave",["mouseout","mouseover"]),Ns("onPointerEnter",["pointerout","pointerover"]),Ns("onPointerLeave",["pointerout","pointerover"]),Uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Uo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ni="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ni));function Ub(n,o){o=(o&4)!==0;for(var a=0;a<n.length;a++){var l=n[a],d=l.event;l=l.listeners;e:{var m=void 0;if(o)for(var S=l.length-1;0<=S;S--){var R=l[S],j=R.instance,q=R.currentTarget;if(R=R.listener,j!==m&&d.isPropagationStopped())break e;m=R,d.currentTarget=q;try{m(d)}catch(G){Zc(G)}d.currentTarget=null,m=j}else for(S=0;S<l.length;S++){if(R=l[S],j=R.instance,q=R.currentTarget,R=R.listener,j!==m&&d.isPropagationStopped())break e;m=R,d.currentTarget=q;try{m(d)}catch(G){Zc(G)}d.currentTarget=null,m=j}}}}function Le(n,o){var a=o[jf];a===void 0&&(a=o[jf]=new Set);var l=n+"__bubble";a.has(l)||(Bb(o,n,2,!1),a.add(l))}function Sh(n,o,a){var l=0;o&&(l|=4),Bb(a,n,l,o)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function xh(n){if(!n[Nl]){n[Nl]=!0,zg.forEach(function(a){a!=="selectionchange"&&(dT.has(a)||Sh(a,!1,n),Sh(a,!0,n))});var o=n.nodeType===9?n:n.ownerDocument;o===null||o[Nl]||(o[Nl]=!0,Sh("selectionchange",!1,o))}}function Bb(n,o,a,l){switch(g0(o)){case 2:var d=UT;break;case 8:d=BT;break;default:d=Lh}a=d.bind(null,o,a,n),d=void 0,!qf||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(d=!0),l?d!==void 0?n.addEventListener(o,a,{capture:!0,passive:d}):n.addEventListener(o,a,!0):d!==void 0?n.addEventListener(o,a,{passive:d}):n.addEventListener(o,a,!1)}function _h(n,o,a,l,d){var m=l;if((o&1)===0&&(o&2)===0&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var R=l.stateNode.containerInfo;if(R===d)break;if(S===4)for(S=l.return;S!==null;){var j=S.tag;if((j===3||j===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;R!==null;){if(S=Os(R),S===null)return;if(j=S.tag,j===5||j===6||j===26||j===27){l=m=S;continue e}R=R.parentNode}}l=l.return}Zg(function(){var q=m,G=Uf(a),ee=[];e:{var F=wy.get(n);if(F!==void 0){var Z=Fc,fe=n;switch(n){case"keypress":if(Bc(a)===0)break e;case"keydown":case"keyup":Z=s2;break;case"focusin":fe="focus",Z=Zf;break;case"focusout":fe="blur",Z=Zf;break;case"beforeblur":case"afterblur":Z=Zf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=QR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=c2;break;case gy:case yy:case vy:Z=KR;break;case by:Z=u2;break;case"scroll":case"scrollend":Z=HR;break;case"wheel":Z=d2;break;case"copy":case"cut":case"paste":Z=JR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=Xg;break;case"toggle":case"beforetoggle":Z=p2}var _e=(o&4)!==0,Je=!_e&&(n==="scroll"||n==="scrollend"),$=_e?F!==null?F+"Capture":null:F;_e=[];for(var P=q,B;P!==null;){var J=P;if(B=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||B===null||$===null||(J=ei(P,$),J!=null&&_e.push(ji(P,J,B))),Je)break;P=P.return}0<_e.length&&(F=new Z(F,fe,null,a,G),ee.push({event:F,listeners:_e}))}}if((o&7)===0){e:{if(F=n==="mouseover"||n==="pointerover",Z=n==="mouseout"||n==="pointerout",F&&a!==$f&&(fe=a.relatedTarget||a.fromElement)&&(Os(fe)||fe[As]))break e;if((Z||F)&&(F=G.window===G?G:(F=G.ownerDocument)?F.defaultView||F.parentWindow:window,Z?(fe=a.relatedTarget||a.toElement,Z=q,fe=fe?Os(fe):null,fe!==null&&(Je=c(fe),_e=fe.tag,fe!==Je||_e!==5&&_e!==27&&_e!==6)&&(fe=null)):(Z=null,fe=q),Z!==fe)){if(_e=Yg,J="onMouseLeave",$="onMouseEnter",P="mouse",(n==="pointerout"||n==="pointerover")&&(_e=Xg,J="onPointerLeave",$="onPointerEnter",P="pointer"),Je=Z==null?F:Wa(Z),B=fe==null?F:Wa(fe),F=new _e(J,P+"leave",Z,a,G),F.target=Je,F.relatedTarget=B,J=null,Os(G)===q&&(_e=new _e($,P+"enter",fe,a,G),_e.target=B,_e.relatedTarget=Je,J=_e),Je=J,Z&&fe)t:{for(_e=hT,$=Z,P=fe,B=0,J=$;J;J=_e(J))B++;J=0;for(var be=P;be;be=_e(be))J++;for(;0<B-J;)$=_e($),B--;for(;0<J-B;)P=_e(P),J--;for(;B--;){if($===P||P!==null&&$===P.alternate){_e=$;break t}$=_e($),P=_e(P)}_e=null}else _e=null;Z!==null&&qb(ee,F,Z,_e,!1),fe!==null&&Je!==null&&qb(ee,Je,fe,_e,!0)}}e:{if(F=q?Wa(q):window,Z=F.nodeName&&F.nodeName.toLowerCase(),Z==="select"||Z==="input"&&F.type==="file")var qe=sy;else if(ry(F))if(ay)qe=C2;else{qe=x2;var ge=S2}else Z=F.nodeName,!Z||Z.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?q&&If(q.elementType)&&(qe=sy):qe=_2;if(qe&&(qe=qe(n,q))){oy(ee,qe,a,G);break e}ge&&ge(n,F,q),n==="focusout"&&q&&F.type==="number"&&q.memoizedProps.value!=null&&Lf(F,"number",F.value)}switch(ge=q?Wa(q):window,n){case"focusin":(ry(ge)||ge.contentEditable==="true")&&(Is=ge,Jf=q,ci=null);break;case"focusout":ci=Jf=Is=null;break;case"mousedown":Wf=!0;break;case"contextmenu":case"mouseup":case"dragend":Wf=!1,py(ee,a,G);break;case"selectionchange":if(R2)break;case"keydown":case"keyup":py(ee,a,G)}var Me;if(Gf)e:{switch(n){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ls?ty(n,a)&&($e="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&($e="onCompositionStart");$e&&(Jg&&a.locale!=="ko"&&(Ls||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ls&&(Me=Qg()):(Gr=G,Ff="value"in Gr?Gr.value:Gr.textContent,Ls=!0)),ge=jl(q,$e),0<ge.length&&($e=new Kg($e,n,null,a,G),ee.push({event:$e,listeners:ge}),Me?$e.data=Me:(Me=ny(a),Me!==null&&($e.data=Me)))),(Me=g2?y2(n,a):v2(n,a))&&($e=jl(q,"onBeforeInput"),0<$e.length&&(ge=new Kg("onBeforeInput","beforeinput",null,a,G),ee.push({event:ge,listeners:$e}),ge.data=Me)),lT(ee,n,q,a,G)}Ub(ee,o)})}function ji(n,o,a){return{instance:n,listener:o,currentTarget:a}}function jl(n,o){for(var a=o+"Capture",l=[];n!==null;){var d=n,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=ei(n,a),d!=null&&l.unshift(ji(n,d,m)),d=ei(n,o),d!=null&&l.push(ji(n,d,m))),n.tag===3)return l;n=n.return}return[]}function hT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function qb(n,o,a,l,d){for(var m=o._reactName,S=[];a!==null&&a!==l;){var R=a,j=R.alternate,q=R.stateNode;if(R=R.tag,j!==null&&j===l)break;R!==5&&R!==26&&R!==27||q===null||(j=q,d?(q=ei(a,m),q!=null&&S.unshift(ji(a,q,j))):d||(q=ei(a,m),q!=null&&S.push(ji(a,q,j)))),a=a.return}S.length!==0&&n.push({event:o,listeners:S})}var pT=/\r\n?/g,mT=/\u0000|\uFFFD/g;function Fb(n){return(typeof n=="string"?n:""+n).replace(pT,`
10
+ `).replace(mT,"")}function Vb(n,o){return o=Fb(o),Fb(n)===o}function Xe(n,o,a,l,d,m){switch(a){case"children":typeof l=="string"?o==="body"||o==="textarea"&&l===""||zs(n,l):(typeof l=="number"||typeof l=="bigint")&&o!=="body"&&zs(n,""+l);break;case"className":Lc(n,"class",l);break;case"tabIndex":Lc(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Lc(n,a,l);break;case"style":Vg(n,l,m);break;case"data":if(o!=="object"){Lc(n,"data",l);break}case"src":case"href":if(l===""&&(o!=="a"||a!=="href")){n.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(a);break}l=$c(""+l),n.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(a==="formAction"?(o!=="input"&&Xe(n,o,"name",d.name,d,null),Xe(n,o,"formEncType",d.formEncType,d,null),Xe(n,o,"formMethod",d.formMethod,d,null),Xe(n,o,"formTarget",d.formTarget,d,null)):(Xe(n,o,"encType",d.encType,d,null),Xe(n,o,"method",d.method,d,null),Xe(n,o,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(a);break}l=$c(""+l),n.setAttribute(a,l);break;case"onClick":l!=null&&(n.onclick=vr);break;case"onScroll":l!=null&&Le("scroll",n);break;case"onScrollEnd":l!=null&&Le("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(d.children!=null)throw Error(s(60));n.innerHTML=a}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}a=$c(""+l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(a,""+l):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":l===!0?n.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(a,l):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(a,l):n.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(a):n.setAttribute(a,l);break;case"popover":Le("beforetoggle",n),Le("toggle",n),Pc(n,"popover",l);break;case"xlinkActuate":yr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":yr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":yr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":yr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":yr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":yr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":yr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":yr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":yr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Pc(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=FR.get(a)||a,Pc(n,a,l))}}function Ch(n,o,a,l,d,m){switch(a){case"style":Vg(n,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(d.children!=null)throw Error(s(60));n.innerHTML=a}}break;case"children":typeof l=="string"?zs(n,l):(typeof l=="number"||typeof l=="bigint")&&zs(n,""+l);break;case"onScroll":l!=null&&Le("scroll",n);break;case"onScrollEnd":l!=null&&Le("scrollend",n);break;case"onClick":l!=null&&(n.onclick=vr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),o=a.slice(2,d?a.length-7:void 0),m=n[Kt]||null,m=m!=null?m[a]:null,typeof m=="function"&&n.removeEventListener(o,m,d),typeof l=="function")){typeof m!="function"&&m!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(o,l,d);break e}a in n?n[a]=l:l===!0?n.setAttribute(a,""):Pc(n,a,l)}}}function $t(n,o,a){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",n),Le("load",n);var l=!1,d=!1,m;for(m in a)if(a.hasOwnProperty(m)){var S=a[m];if(S!=null)switch(m){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Xe(n,o,m,S,a,null)}}d&&Xe(n,o,"srcSet",a.srcSet,a,null),l&&Xe(n,o,"src",a.src,a,null);return;case"input":Le("invalid",n);var R=m=S=d=null,j=null,q=null;for(l in a)if(a.hasOwnProperty(l)){var G=a[l];if(G!=null)switch(l){case"name":d=G;break;case"type":S=G;break;case"checked":j=G;break;case"defaultChecked":q=G;break;case"value":m=G;break;case"defaultValue":R=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,o));break;default:Xe(n,o,l,G,a,null)}}Ug(n,m,R,j,q,S,d,!1);return;case"select":Le("invalid",n),l=S=m=null;for(d in a)if(a.hasOwnProperty(d)&&(R=a[d],R!=null))switch(d){case"value":m=R;break;case"defaultValue":S=R;break;case"multiple":l=R;default:Xe(n,o,d,R,a,null)}o=m,a=S,n.multiple=!!l,o!=null?js(n,!!l,o,!1):a!=null&&js(n,!!l,a,!0);return;case"textarea":Le("invalid",n),m=d=l=null;for(S in a)if(a.hasOwnProperty(S)&&(R=a[S],R!=null))switch(S){case"value":l=R;break;case"defaultValue":d=R;break;case"children":m=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:Xe(n,o,S,R,a,null)}qg(n,l,d,m);return;case"option":for(j in a)a.hasOwnProperty(j)&&(l=a[j],l!=null)&&(j==="selected"?n.selected=l&&typeof l!="function"&&typeof l!="symbol":Xe(n,o,j,l,a,null));return;case"dialog":Le("beforetoggle",n),Le("toggle",n),Le("cancel",n),Le("close",n);break;case"iframe":case"object":Le("load",n);break;case"video":case"audio":for(l=0;l<Ni.length;l++)Le(Ni[l],n);break;case"image":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"embed":case"source":case"link":Le("error",n),Le("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in a)if(a.hasOwnProperty(q)&&(l=a[q],l!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Xe(n,o,q,l,a,null)}return;default:if(If(o)){for(G in a)a.hasOwnProperty(G)&&(l=a[G],l!==void 0&&Ch(n,o,G,l,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(l=a[R],l!=null&&Xe(n,o,R,l,a,null))}function gT(n,o,a,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,S=null,R=null,j=null,q=null,G=null;for(Z in a){var ee=a[Z];if(a.hasOwnProperty(Z)&&ee!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":j=ee;default:l.hasOwnProperty(Z)||Xe(n,o,Z,null,l,ee)}}for(var F in l){var Z=l[F];if(ee=a[F],l.hasOwnProperty(F)&&(Z!=null||ee!=null))switch(F){case"type":m=Z;break;case"name":d=Z;break;case"checked":q=Z;break;case"defaultChecked":G=Z;break;case"value":S=Z;break;case"defaultValue":R=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,o));break;default:Z!==ee&&Xe(n,o,F,Z,l,ee)}}Pf(n,S,R,j,q,G,m,d);return;case"select":Z=S=R=F=null;for(m in a)if(j=a[m],a.hasOwnProperty(m)&&j!=null)switch(m){case"value":break;case"multiple":Z=j;default:l.hasOwnProperty(m)||Xe(n,o,m,null,l,j)}for(d in l)if(m=l[d],j=a[d],l.hasOwnProperty(d)&&(m!=null||j!=null))switch(d){case"value":F=m;break;case"defaultValue":R=m;break;case"multiple":S=m;default:m!==j&&Xe(n,o,d,m,l,j)}o=R,a=S,l=Z,F!=null?js(n,!!a,F,!1):!!l!=!!a&&(o!=null?js(n,!!a,o,!0):js(n,!!a,a?[]:"",!1));return;case"textarea":Z=F=null;for(R in a)if(d=a[R],a.hasOwnProperty(R)&&d!=null&&!l.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Xe(n,o,R,null,l,d)}for(S in l)if(d=l[S],m=a[S],l.hasOwnProperty(S)&&(d!=null||m!=null))switch(S){case"value":F=d;break;case"defaultValue":Z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==m&&Xe(n,o,S,d,l,m)}Bg(n,F,Z);return;case"option":for(var fe in a)F=a[fe],a.hasOwnProperty(fe)&&F!=null&&!l.hasOwnProperty(fe)&&(fe==="selected"?n.selected=!1:Xe(n,o,fe,null,l,F));for(j in l)F=l[j],Z=a[j],l.hasOwnProperty(j)&&F!==Z&&(F!=null||Z!=null)&&(j==="selected"?n.selected=F&&typeof F!="function"&&typeof F!="symbol":Xe(n,o,j,F,l,Z));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in a)F=a[_e],a.hasOwnProperty(_e)&&F!=null&&!l.hasOwnProperty(_e)&&Xe(n,o,_e,null,l,F);for(q in l)if(F=l[q],Z=a[q],l.hasOwnProperty(q)&&F!==Z&&(F!=null||Z!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(s(137,o));break;default:Xe(n,o,q,F,l,Z)}return;default:if(If(o)){for(var Je in a)F=a[Je],a.hasOwnProperty(Je)&&F!==void 0&&!l.hasOwnProperty(Je)&&Ch(n,o,Je,void 0,l,F);for(G in l)F=l[G],Z=a[G],!l.hasOwnProperty(G)||F===Z||F===void 0&&Z===void 0||Ch(n,o,G,F,l,Z);return}}for(var $ in a)F=a[$],a.hasOwnProperty($)&&F!=null&&!l.hasOwnProperty($)&&Xe(n,o,$,null,l,F);for(ee in l)F=l[ee],Z=a[ee],!l.hasOwnProperty(ee)||F===Z||F==null&&Z==null||Xe(n,o,ee,F,l,Z)}function Hb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,o=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var d=a[l],m=d.transferSize,S=d.initiatorType,R=d.duration;if(m&&R&&Hb(S)){for(S=0,R=d.responseEnd,l+=1;l<a.length;l++){var j=a[l],q=j.startTime;if(q>R)break;var G=j.transferSize,ee=j.initiatorType;G&&Hb(ee)&&(j=j.responseEnd,S+=G*(j<R?1:(R-q)/(j-q)))}if(--l,o+=8*(m+S)/(d.duration/1e3),n++,10<n)break}}if(0<n)return o/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Eh=null,Rh=null;function zl(n){return n.nodeType===9?n:n.ownerDocument}function Zb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qb(n,o){if(n===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&o==="foreignObject"?0:n}function Th(n,o){return n==="textarea"||n==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Ah=null;function vT(){var n=window.event;return n&&n.type==="popstate"?n===Ah?!1:(Ah=n,!0):(Ah=null,!1)}var Gb=typeof setTimeout=="function"?setTimeout:void 0,bT=typeof clearTimeout=="function"?clearTimeout:void 0,Yb=typeof Promise=="function"?Promise:void 0,wT=typeof queueMicrotask=="function"?queueMicrotask:typeof Yb<"u"?function(n){return Yb.resolve(null).then(n).catch(ST)}:Gb;function ST(n){setTimeout(function(){throw n})}function fo(n){return n==="head"}function Kb(n,o){var a=o,l=0;do{var d=a.nextSibling;if(n.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(l===0){n.removeChild(d),fa(o);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")zi(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,zi(a);for(var m=a.firstChild;m;){var S=m.nextSibling,R=m.nodeName;m[Ja]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&m.rel.toLowerCase()==="stylesheet"||a.removeChild(m),m=S}}else a==="body"&&zi(n.ownerDocument.body);a=d}while(a);fa(o)}function Xb(n,o){var a=n;n=0;do{var l=a.nextSibling;if(a.nodeType===1?o?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(o?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=l}while(a)}function Oh(n){var o=n.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var a=o;switch(o=o.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Oh(a),zf(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function xT(n,o,a,l){for(;n.nodeType===1;){var d=a;if(n.nodeName.toLowerCase()!==o.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[Ja])switch(o){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(m=n.getAttribute("rel"),m==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(m!==d.rel||n.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||n.getAttribute("title")!==(d.title==null?null:d.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(m=n.getAttribute("src"),(m!==(d.src==null?null:d.src)||n.getAttribute("type")!==(d.type==null?null:d.type)||n.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(o==="input"&&n.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&n.getAttribute("name")===m)return n}else return n;if(n=Nn(n.nextSibling),n===null)break}return null}function _T(n,o,a){if(o==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Nn(n.nextSibling),n===null))return null;return n}function Jb(n,o){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Nn(n.nextSibling),n===null))return null;return n}function kh(n){return n.data==="$?"||n.data==="$~"}function Mh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function CT(n,o){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=o;else if(n.data!=="$?"||a.readyState!=="loading")o();else{var l=function(){o(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function Nn(n){for(;n!=null;n=n.nextSibling){var o=n.nodeType;if(o===1||o===3)break;if(o===8){if(o=n.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return n}var Nh=null;function Wb(n){n=n.nextSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(o===0)return Nn(n.nextSibling);o--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||o++}n=n.nextSibling}return null}function e0(n){n=n.previousSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(o===0)return n;o--}else a!=="/$"&&a!=="/&"||o++}n=n.previousSibling}return null}function t0(n,o,a){switch(o=zl(a),n){case"html":if(n=o.documentElement,!n)throw Error(s(452));return n;case"head":if(n=o.head,!n)throw Error(s(453));return n;case"body":if(n=o.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function zi(n){for(var o=n.attributes;o.length;)n.removeAttributeNode(o[0]);zf(n)}var jn=new Map,n0=new Set;function Dl(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var zr=K.d;K.d={f:ET,r:RT,D:TT,C:AT,L:OT,m:kT,X:NT,S:MT,M:jT};function ET(){var n=zr.f(),o=Rl();return n||o}function RT(n){var o=ks(n);o!==null&&o.tag===5&&o.type==="form"?bv(o):zr.r(n)}var ca=typeof document>"u"?null:document;function r0(n,o,a){var l=ca;if(l&&typeof o=="string"&&o){var d=En(o);d='link[rel="'+n+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),n0.has(d)||(n0.add(d),n={rel:n,crossOrigin:a,href:o},l.querySelector(d)===null&&(o=l.createElement("link"),$t(o,"link",n),Mt(o),l.head.appendChild(o)))}}function TT(n){zr.D(n),r0("dns-prefetch",n,null)}function AT(n,o){zr.C(n,o),r0("preconnect",n,o)}function OT(n,o,a){zr.L(n,o,a);var l=ca;if(l&&n&&o){var d='link[rel="preload"][as="'+En(o)+'"]';o==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+En(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+En(a.imageSizes)+'"]')):d+='[href="'+En(n)+'"]';var m=d;switch(o){case"style":m=la(n);break;case"script":m=ua(n)}jn.has(m)||(n=v({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:n,as:o},a),jn.set(m,n),l.querySelector(d)!==null||o==="style"&&l.querySelector(Di(m))||o==="script"&&l.querySelector(Pi(m))||(o=l.createElement("link"),$t(o,"link",n),Mt(o),l.head.appendChild(o)))}}function kT(n,o){zr.m(n,o);var a=ca;if(a&&n){var l=o&&typeof o.as=="string"?o.as:"script",d='link[rel="modulepreload"][as="'+En(l)+'"][href="'+En(n)+'"]',m=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ua(n)}if(!jn.has(m)&&(n=v({rel:"modulepreload",href:n},o),jn.set(m,n),a.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Pi(m)))return}l=a.createElement("link"),$t(l,"link",n),Mt(l),a.head.appendChild(l)}}}function MT(n,o,a){zr.S(n,o,a);var l=ca;if(l&&n){var d=Ms(l).hoistableStyles,m=la(n);o=o||"default";var S=d.get(m);if(!S){var R={loading:0,preload:null};if(S=l.querySelector(Di(m)))R.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":o},a),(a=jn.get(m))&&jh(n,a);var j=S=l.createElement("link");Mt(j),$t(j,"link",n),j._p=new Promise(function(q,G){j.onload=q,j.onerror=G}),j.addEventListener("load",function(){R.loading|=1}),j.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Pl(S,o,l)}S={type:"stylesheet",instance:S,count:1,state:R},d.set(m,S)}}}function NT(n,o){zr.X(n,o);var a=ca;if(a&&n){var l=Ms(a).hoistableScripts,d=ua(n),m=l.get(d);m||(m=a.querySelector(Pi(d)),m||(n=v({src:n,async:!0},o),(o=jn.get(d))&&zh(n,o),m=a.createElement("script"),Mt(m),$t(m,"link",n),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function jT(n,o){zr.M(n,o);var a=ca;if(a&&n){var l=Ms(a).hoistableScripts,d=ua(n),m=l.get(d);m||(m=a.querySelector(Pi(d)),m||(n=v({src:n,async:!0,type:"module"},o),(o=jn.get(d))&&zh(n,o),m=a.createElement("script"),Mt(m),$t(m,"link",n),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(d,m))}}function o0(n,o,a,l){var d=(d=ye.current)?Dl(d):null;if(!d)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=la(a.href),a=Ms(d).hoistableStyles,l=a.get(o),l||(l={type:"style",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=la(a.href);var m=Ms(d).hoistableStyles,S=m.get(n);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(n,S),(m=d.querySelector(Di(n)))&&!m._p&&(S.instance=m,S.state.loading=5),jn.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jn.set(n,a),m||zT(d,n,a,S.state))),o&&l===null)throw Error(s(528,""));return S}if(o&&l!==null)throw Error(s(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ua(a),a=Ms(d).hoistableScripts,l=a.get(o),l||(l={type:"script",instance:null,count:0,state:null},a.set(o,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function la(n){return'href="'+En(n)+'"'}function Di(n){return'link[rel="stylesheet"]['+n+"]"}function s0(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function zT(n,o,a,l){n.querySelector('link[rel="preload"][as="style"]['+o+"]")?l.loading=1:(o=n.createElement("link"),l.preload=o,o.addEventListener("load",function(){return l.loading|=1}),o.addEventListener("error",function(){return l.loading|=2}),$t(o,"link",a),Mt(o),n.head.appendChild(o))}function ua(n){return'[src="'+En(n)+'"]'}function Pi(n){return"script[async]"+n}function a0(n,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var l=n.querySelector('style[data-href~="'+En(a.href)+'"]');if(l)return o.instance=l,Mt(l),l;var d=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Mt(l),$t(l,"style",d),Pl(l,a.precedence,n),o.instance=l;case"stylesheet":d=la(a.href);var m=n.querySelector(Di(d));if(m)return o.state.loading|=4,o.instance=m,Mt(m),m;l=s0(a),(d=jn.get(d))&&jh(l,d),m=(n.ownerDocument||n).createElement("link"),Mt(m);var S=m;return S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),$t(m,"link",l),o.state.loading|=4,Pl(m,a.precedence,n),o.instance=m;case"script":return m=ua(a.src),(d=n.querySelector(Pi(m)))?(o.instance=d,Mt(d),d):(l=a,(d=jn.get(m))&&(l=v({},a),zh(l,d)),n=n.ownerDocument||n,d=n.createElement("script"),Mt(d),$t(d,"link",l),n.head.appendChild(d),o.instance=d);case"void":return null;default:throw Error(s(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(l=o.instance,o.state.loading|=4,Pl(l,a.precedence,n));return o.instance}function Pl(n,o,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,m=d,S=0;S<l.length;S++){var R=l[S];if(R.dataset.precedence===o)m=R;else if(m!==d)break}m?m.parentNode.insertBefore(n,m.nextSibling):(o=a.nodeType===9?a.head:a,o.insertBefore(n,o.firstChild))}function jh(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.title==null&&(n.title=o.title)}function zh(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.integrity==null&&(n.integrity=o.integrity)}var Ll=null;function i0(n,o,a){if(Ll===null){var l=new Map,d=Ll=new Map;d.set(a,l)}else d=Ll,l=d.get(a),l||(l=new Map,d.set(a,l));if(l.has(n))return l;for(l.set(n,null),a=a.getElementsByTagName(n),d=0;d<a.length;d++){var m=a[d];if(!(m[Ja]||m[Dt]||n==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(o)||"";S=n+S;var R=l.get(S);R?R.push(m):l.set(S,[m])}}return l}function c0(n,o,a){n=n.ownerDocument||n,n.head.insertBefore(a,o==="title"?n.querySelector("head > title"):null)}function DT(n,o,a){if(a===1||o.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(n=o.disabled,typeof o.precedence=="string"&&n==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function l0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function PT(n,o,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=la(l.href),m=o.querySelector(Di(d));if(m){o=m._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(n.count++,n=Il.bind(n),o.then(n,n)),a.state.loading|=4,a.instance=m,Mt(m);return}m=o.ownerDocument||o,l=s0(l),(d=jn.get(d))&&jh(l,d),m=m.createElement("link"),Mt(m);var S=m;S._p=new Promise(function(R,j){S.onload=R,S.onerror=j}),$t(m,"link",l),a.instance=m}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=Il.bind(n),o.addEventListener("load",a),o.addEventListener("error",a))}}var Dh=0;function LT(n,o){return n.stylesheets&&n.count===0&&Ul(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var l=setTimeout(function(){if(n.stylesheets&&Ul(n,n.stylesheets),n.unsuspend){var m=n.unsuspend;n.unsuspend=null,m()}},6e4+o);0<n.imgBytes&&Dh===0&&(Dh=62500*yT());var d=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ul(n,n.stylesheets),n.unsuspend)){var m=n.unsuspend;n.unsuspend=null,m()}},(n.imgBytes>Dh?50:800)+o);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Il(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ul(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var $l=null;function Ul(n,o){n.stylesheets=null,n.unsuspend!==null&&(n.count++,$l=new Map,o.forEach(IT,n),$l=null,Il.call(n))}function IT(n,o){if(!(o.state.loading&4)){var a=$l.get(n);if(a)var l=a.get(null);else{a=new Map,$l.set(n,a);for(var d=n.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var S=d[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}d=o.instance,S=d.getAttribute("data-precedence"),m=a.get(S)||l,m===l&&a.set(null,d),a.set(S,d),this.count++,l=Il.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),m?m.parentNode.insertBefore(d,m.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(d,n.firstChild)),o.state.loading|=4}}var Li={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function $T(n,o,a,l,d,m,S,R,j){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kf(0),this.hiddenUpdates=kf(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function u0(n,o,a,l,d,m,S,R,j,q,G,ee){return n=new $T(n,o,a,S,j,q,G,ee,R),o=1,m===!0&&(o|=24),m=hn(3,null,null,o),n.current=m,m.stateNode=n,o=pd(),o.refCount++,n.pooledCache=o,o.refCount++,m.memoizedState={element:l,isDehydrated:a,cache:o},vd(m),n}function f0(n){return n?(n=Bs,n):Bs}function d0(n,o,a,l,d,m){d=f0(d),l.context===null?l.context=d:l.pendingContext=d,l=eo(o),l.payload={element:a},m=m===void 0?null:m,m!==null&&(l.callback=m),a=to(n,l,o),a!==null&&(nn(a,n,o),mi(a,n,o))}function h0(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<o?a:o}}function Ph(n,o){h0(n,o),(n=n.alternate)&&h0(n,o)}function p0(n){if(n.tag===13||n.tag===31){var o=Vo(n,67108864);o!==null&&nn(o,n,67108864),Ph(n,67108864)}}function m0(n){if(n.tag===13||n.tag===31){var o=vn();o=Mf(o);var a=Vo(n,o);a!==null&&nn(a,n,o),Ph(n,o)}}var Bl=!0;function UT(n,o,a,l){var d=I.T;I.T=null;var m=K.p;try{K.p=2,Lh(n,o,a,l)}finally{K.p=m,I.T=d}}function BT(n,o,a,l){var d=I.T;I.T=null;var m=K.p;try{K.p=8,Lh(n,o,a,l)}finally{K.p=m,I.T=d}}function Lh(n,o,a,l){if(Bl){var d=Ih(l);if(d===null)_h(n,o,l,ql,a),y0(n,l);else if(FT(d,n,o,a,l))l.stopPropagation();else if(y0(n,l),o&4&&-1<qT.indexOf(n)){for(;d!==null;){var m=ks(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=$o(m.pendingLanes);if(S!==0){var R=m;for(R.pendingLanes|=2,R.entangledLanes|=2;S;){var j=1<<31-fn(S);R.entanglements[1]|=j,S&=~j}rr(m),(Ze&6)===0&&(Cl=Ht()+500,Mi(0))}}break;case 31:case 13:R=Vo(m,2),R!==null&&nn(R,m,2),Rl(),Ph(m,2)}if(m=Ih(l),m===null&&_h(n,o,l,ql,a),m===d)break;d=m}d!==null&&l.stopPropagation()}else _h(n,o,l,null,a)}}function Ih(n){return n=Uf(n),$h(n)}var ql=null;function $h(n){if(ql=null,n=Os(n),n!==null){var o=c(n);if(o===null)n=null;else{var a=o.tag;if(a===13){if(n=u(o),n!==null)return n;n=null}else if(a===31){if(n=f(o),n!==null)return n;n=null}else if(a===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}return ql=n,null}function g0(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Of()){case nt:return 2;case zt:return 8;case Bt:case Mc:return 32;case Rg:return 268435456;default:return 32}default:return 32}}var Uh=!1,ho=null,po=null,mo=null,Ii=new Map,$i=new Map,go=[],qT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function y0(n,o){switch(n){case"focusin":case"focusout":ho=null;break;case"dragenter":case"dragleave":po=null;break;case"mouseover":case"mouseout":mo=null;break;case"pointerover":case"pointerout":Ii.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(o.pointerId)}}function Ui(n,o,a,l,d,m){return n===null||n.nativeEvent!==m?(n={blockedOn:o,domEventName:a,eventSystemFlags:l,nativeEvent:m,targetContainers:[d]},o!==null&&(o=ks(o),o!==null&&p0(o)),n):(n.eventSystemFlags|=l,o=n.targetContainers,d!==null&&o.indexOf(d)===-1&&o.push(d),n)}function FT(n,o,a,l,d){switch(o){case"focusin":return ho=Ui(ho,n,o,a,l,d),!0;case"dragenter":return po=Ui(po,n,o,a,l,d),!0;case"mouseover":return mo=Ui(mo,n,o,a,l,d),!0;case"pointerover":var m=d.pointerId;return Ii.set(m,Ui(Ii.get(m)||null,n,o,a,l,d)),!0;case"gotpointercapture":return m=d.pointerId,$i.set(m,Ui($i.get(m)||null,n,o,a,l,d)),!0}return!1}function v0(n){var o=Os(n.target);if(o!==null){var a=c(o);if(a!==null){if(o=a.tag,o===13){if(o=u(a),o!==null){n.blockedOn=o,Ng(n.priority,function(){m0(a)});return}}else if(o===31){if(o=f(a),o!==null){n.blockedOn=o,Ng(n.priority,function(){m0(a)});return}}else if(o===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Fl(n){if(n.blockedOn!==null)return!1;for(var o=n.targetContainers;0<o.length;){var a=Ih(n.nativeEvent);if(a===null){a=n.nativeEvent;var l=new a.constructor(a.type,a);$f=l,a.target.dispatchEvent(l),$f=null}else return o=ks(a),o!==null&&p0(o),n.blockedOn=a,!1;o.shift()}return!0}function b0(n,o,a){Fl(n)&&a.delete(o)}function VT(){Uh=!1,ho!==null&&Fl(ho)&&(ho=null),po!==null&&Fl(po)&&(po=null),mo!==null&&Fl(mo)&&(mo=null),Ii.forEach(b0),$i.forEach(b0)}function Vl(n,o){n.blockedOn===o&&(n.blockedOn=null,Uh||(Uh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VT)))}var Hl=null;function w0(n){Hl!==n&&(Hl=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Hl===n&&(Hl=null);for(var o=0;o<n.length;o+=3){var a=n[o],l=n[o+1],d=n[o+2];if(typeof l!="function"){if($h(l||a)===null)continue;break}var m=ks(a);m!==null&&(n.splice(o,3),o-=3,Id(m,{pending:!0,data:d,method:a.method,action:l},l,d))}}))}function fa(n){function o(j){return Vl(j,n)}ho!==null&&Vl(ho,n),po!==null&&Vl(po,n),mo!==null&&Vl(mo,n),Ii.forEach(o),$i.forEach(o);for(var a=0;a<go.length;a++){var l=go[a];l.blockedOn===n&&(l.blockedOn=null)}for(;0<go.length&&(a=go[0],a.blockedOn===null);)v0(a),a.blockedOn===null&&go.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var d=a[l],m=a[l+1],S=d[Kt]||null;if(typeof m=="function")S||w0(a);else if(S){var R=null;if(m&&m.hasAttribute("formAction")){if(d=m,S=m[Kt]||null)R=S.formAction;else if($h(d)!==null)continue}else R=S.action;typeof R=="function"?a[l+1]=R:(a.splice(l,3),l-=3),w0(a)}}}function S0(){function n(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function o(){d!==null&&(d(),d=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),d!==null&&(d(),d=null)}}}function Bh(n){this._internalRoot=n}Zl.prototype.render=Bh.prototype.render=function(n){var o=this._internalRoot;if(o===null)throw Error(s(409));var a=o.current,l=vn();d0(a,l,n,o,null,null)},Zl.prototype.unmount=Bh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var o=n.containerInfo;d0(n.current,2,null,n,null,null),Rl(),o[As]=null}};function Zl(n){this._internalRoot=n}Zl.prototype.unstable_scheduleHydration=function(n){if(n){var o=Mg();n={blockedOn:null,target:n,priority:o};for(var a=0;a<go.length&&o!==0&&o<go[a].priority;a++);go.splice(a,0,n),a===0&&v0(n)}};var x0=t.version;if(x0!=="19.2.4")throw Error(s(527,x0,"19.2.4"));K.findDOMNode=function(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=p(o),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var HT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ql=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ql.isDisabled&&Ql.supportsFiber)try{Ya=Ql.inject(HT),un=Ql}catch{}}return qi.createRoot=function(n,o){if(!i(n))throw Error(s(299));var a=!1,l="",d=Ov,m=kv,S=Mv;return o!=null&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(l=o.identifierPrefix),o.onUncaughtError!==void 0&&(d=o.onUncaughtError),o.onCaughtError!==void 0&&(m=o.onCaughtError),o.onRecoverableError!==void 0&&(S=o.onRecoverableError)),o=u0(n,1,!1,null,null,a,l,null,d,m,S,S0),n[As]=o.current,xh(n),new Bh(o)},qi.hydrateRoot=function(n,o,a){if(!i(n))throw Error(s(299));var l=!1,d="",m=Ov,S=kv,R=Mv,j=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(j=a.formState)),o=u0(n,1,!0,o,a??null,l,d,j,m,S,R,S0),o.context=f0(null),a=o.current,l=vn(),l=Mf(l),d=eo(l),d.callback=null,to(a,d,l),a=l,o.current.lanes=a,Xa(o,a),rr(o),n[As]=o.current,xh(n),new Zl(o)},qi.version="19.2.4",qi}var N0;function tA(){if(N0)return Vh.exports;N0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vh.exports=eA(),Vh.exports}var nA=tA();const Ip=new WeakMap,rA=new WeakMap,wu={current:[]};let Gh=!1,tc=0;const Ki=new Set,Gl=new Map;function tx(e){for(const t of e){if(wu.current.includes(t))continue;wu.current.push(t),t.recompute();const r=rA.get(t);if(r)for(const s of r){const i=Ip.get(s);i?.length&&tx(i)}}}function oA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const r of e.listeners)r(t)}function sA(e){const t={prevVal:e.prevState,currentVal:e.state};for(const r of e.listeners)r(t)}function nx(e){if(tc>0&&!Gl.has(e)&&Gl.set(e,e.prevState),Ki.add(e),!(tc>0)&&!Gh)try{for(Gh=!0;Ki.size>0;){const t=Array.from(Ki);Ki.clear();for(const r of t){const s=Gl.get(r)??r.prevState;r.prevState=s,oA(r)}for(const r of t){const s=Ip.get(r);s&&(wu.current.push(r),tx(s))}for(const r of t){const s=Ip.get(r);if(s)for(const i of s)sA(i)}}}finally{Gh=!1,wu.current=[],Gl.clear()}}function aA(e){tc++;try{e()}finally{if(tc--,tc===0){const t=Ki.values().next().value;t&&nx(t)}}}function iA(e){return typeof e=="function"}class cA{constructor(t,r){this.listeners=new Set,this.subscribe=s=>{var i,c;this.listeners.add(s);const u=(c=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:c.call(i,s,this);return()=>{this.listeners.delete(s),u?.()}},this.prevState=t,this.state=t,this.options=r}setState(t){var r,s,i;this.prevState=this.state,(r=this.options)!=null&&r.updateFn?this.state=this.options.updateFn(this.prevState)(t):iA(t)?this.state=t(this.prevState):this.state=t,(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),nx(this)}}const Co="__TSR_index",j0="popstate",z0="beforeunload";function lA(e){let t=e.getLocation();const r=new Set,s=u=>{t=e.getLocation(),r.forEach(f=>f({location:t,action:u}))},i=u=>{e.notifyOnIndexChange??!0?s(u):t=e.getLocation()},c=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const y=e.getBlockers?.()??[],v=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&y.length&&v)for(const b of y){const _=Su(h.path,h.state);if(await b.blockerFn({currentLocation:t,nextLocation:_,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:u=>(r.add(u),()=>{r.delete(u)}),push:(u,f,h)=>{const p=t.state[Co];f=D0(p+1,f),c({task:()=>{e.pushState(u,f),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const p=t.state[Co];f=D0(p,f),c({task:()=>{e.replaceState(u,f),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{c({task:()=>{e.go(u),i({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{c({task:()=>{e.back(u?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{c({task:()=>{e.forward(u?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Co]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(p=>p!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function D0(e,t){t||(t={});const r=dm();return{...t,key:r,__TSR_key:r,[Co]:e}}function uA(e){const t=typeof document<"u"?window:void 0,r=t.history.pushState,s=t.history.replaceState;let i=[];const c=()=>i,u=z=>i=z,f=(z=>z),h=(()=>Su(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=dm();t.history.replaceState({[Co]:0,key:z,__TSR_key:z},"")}let p=h(),y,v=!1,b=!1,_=!1,E=!1;const x=()=>p;let C,O;const M=()=>{C&&(L._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),L._ignoreSubscribers=!1,C=void 0,O=void 0,y=void 0)},k=(z,Y,ie)=>{const ae=f(Y);O||(y=p),p=Su(Y,ie),C={href:ae,state:ie,isPush:C?.isPush||z==="push"},O||(O=Promise.resolve().then(()=>M()))},N=z=>{p=h(),L.notify({type:z})},U=async()=>{if(b){b=!1;return}const z=h(),Y=z.state[Co]-p.state[Co],ie=Y===1,ae=Y===-1,oe=!ie&&!ae||v;v=!1;const le=oe?"GO":ae?"BACK":"FORWARD",ce=oe?{type:"GO",index:Y}:{type:ae?"BACK":"FORWARD"};if(_)_=!1;else{const me=c();if(typeof document<"u"&&me.length){for(const I of me)if(await I.blockerFn({currentLocation:p,nextLocation:z,action:le})){b=!0,t.history.go(1),L.notify(ce);return}}}p=h(),L.notify(ce)},H=z=>{if(E){E=!1;return}let Y=!1;const ie=c();if(typeof document<"u"&&ie.length)for(const ae of ie){const oe=ae.enableBeforeUnload??!0;if(oe===!0){Y=!0;break}if(typeof oe=="function"&&oe()===!0){Y=!0;break}}if(Y)return z.preventDefault(),z.returnValue=""},L=lA({getLocation:x,getLength:()=>t.history.length,pushState:(z,Y)=>k("push",z,Y),replaceState:(z,Y)=>k("replace",z,Y),back:z=>(z&&(_=!0),E=!0,t.history.back()),forward:z=>{z&&(_=!0),E=!0,t.history.forward()},go:z=>{v=!0,t.history.go(z)},createHref:z=>f(z),flush:M,destroy:()=>{t.history.pushState=r,t.history.replaceState=s,t.removeEventListener(z0,H,{capture:!0}),t.removeEventListener(j0,U)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:c,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(z0,H,{capture:!0}),t.addEventListener(j0,U),t.history.pushState=function(...z){const Y=r.apply(t.history,z);return L._ignoreSubscribers||N("PUSH"),Y},t.history.replaceState=function(...z){const Y=s.apply(t.history,z);return L._ignoreSubscribers||N("REPLACE"),Y},L}function fA(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Su(e,t){const r=fA(e),s=r.indexOf("#"),i=r.indexOf("?"),c=dm();return{href:r,pathname:r.substring(0,s>0?i>0?Math.min(s,i):s:i>0?i:r.length),hash:s>-1?r.substring(s):"",search:i>-1?r.slice(i,s===-1?void 0:s):"",state:t||{[Co]:0,key:c,__TSR_key:c}}}function dm(){return(Math.random()+1).toString(36).substring(7)}const dA=!1;function Ca(e){let t;return aA(()=>{t=e()}),t}function cc(e){return e[e.length-1]}function hA(e){return typeof e=="function"}function xo(e,t){return hA(e)?e(t):e}const pA=Object.prototype.hasOwnProperty,P0=Object.prototype.propertyIsEnumerable;function rn(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=t,i=$0(e)&&$0(s);if(!i&&!(xu(e)&&xu(s)))return s;const c=i?e:L0(e);if(!c)return s;const u=i?s:L0(s);if(!u)return s;const f=c.length,h=u.length,p=i?new Array(h):{};let y=0;for(let v=0;v<h;v++){const b=i?v:u[v],_=e[b],E=s[b];if(_===E){p[b]=_,(i?v<f:pA.call(e,b))&&y++;continue}if(_===null||E===null||typeof _!="object"||typeof E!="object"){p[b]=E;continue}const x=rn(_,E,r+1);p[b]=x,x===_&&y++}return f===h&&y===f?e:p}function L0(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!P0.call(e,i))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const s=t;for(const i of r){if(!P0.call(e,i))return!1;s.push(i)}return s}function xu(e){if(!I0(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!I0(r)||!r.hasOwnProperty("isPrototypeOf"))}function I0(e){return Object.prototype.toString.call(e)==="[object Object]"}function $0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function us(e,t,r){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,i=e.length;s<i;s++)if(!us(e[s],t[s],r))return!1;return!0}if(xu(e)&&xu(t)){const s=r?.ignoreUndefined??!0;if(r?.partial){for(const u in t)if((!s||t[u]!==void 0)&&!us(e[u],t[u],r))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&i++;let c=0;for(const u in t)if((!s||t[u]!==void 0)&&(c++,c>i||!us(e[u],t[u],r)))return!1;return i===c}return!1}function hs(e){let t,r;const s=new Promise((i,c)=>{t=i,r=c});return s.status="pending",s.resolve=i=>{s.status="resolved",s.value=i,t(i),e?.(i)},s.reject=i=>{s.status="rejected",r(i)},s}function mA(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Ea(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function gA(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function U0(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return gA(t)}const rx=["http:","https:","mailto:","tel:"];function _u(e){if(!e)return!1;try{const t=new URL(e);return!rx.includes(t.protocol)}catch{return!1}}const yA={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},vA=/[&><\u2028\u2029]/g;function bA(e){return e.replace(vA,t=>yA[t])}function Fi(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const r=/%25|%5C/gi;let s=0,i="",c;for(;(c=r.exec(e))!==null;)i+=U0(e.slice(s,c.index))+c[0],s=r.lastIndex;return i=i+U0(s?e.slice(s):e),i.startsWith("//")&&(i="/"+i.replace(/^\/+/,"")),i}function wA(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var SA="Invariant failed";function an(e,t){if(!e)throw new Error(SA)}function Cu(e){const t=new Map;let r,s;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,s&&(s.next=c,c.prev=s)):(c.next.prev=void 0,r=c.next,c.next=void 0,s&&(c.prev=s,s.next=c)),s=c)};return{get(c){const u=t.get(c);if(u)return i(u),u.value},set(c,u){if(t.size>=e&&r){const h=r;t.delete(h.key),h.next&&(r=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const f=t.get(c);if(f)f.value=u,i(f);else{const h={key:c,value:u,prev:s};s&&(s.next=h),s=h,r||(r=h),t.set(c,h)}},clear(){t.clear(),r=void 0,s=void 0}}}const za=0,ps=1,ms=2,lc=3,as=4,ox=5;function xA(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function hm(e,t,r=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,c=e.substring(t,i);if(!c||!c.includes("$"))return r[0]=za,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r;if(c==="$"){const f=e.length;return r[0]=ms,r[1]=t,r[2]=t,r[3]=f,r[4]=f,r[5]=f,r}if(c.charCodeAt(0)===36)return r[0]=ps,r[1]=t,r[2]=t+1,r[3]=i,r[4]=i,r[5]=i,r;const u=xA(c);if(u){const[f,h]=u,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const y=f+3,v=h;if(y<v)return r[0]=lc,r[1]=t+f,r[2]=t+y,r[3]=t+v,r[4]=t+h+1,r[5]=i,r}}else if(p===36){const y=f+1,v=f+2;return v===h?(r[0]=ms,r[1]=t+f,r[2]=t+y,r[3]=t+v,r[4]=t+h+1,r[5]=e.length,r):(r[0]=ps,r[1]=t+f,r[2]=t+v,r[3]=t+h,r[4]=t+h+1,r[5]=i,r)}}return r[0]=za,r[1]=t,r[2]=t,r[3]=i,r[4]=i,r[5]=i,r}function Ku(e,t,r,s,i,c,u){u?.(r);let f=s;{const h=r.fullPath??r.from,p=h.length,y=r.options?.caseSensitive??e,v=!!(r.options?.params?.parse&&r.options?.skipRouteOnParseError?.params);for(;f<p;){const _=hm(h,f,t);let E;const x=f,C=_[5];switch(f=C+1,c++,_[0]){case za:{const M=h.substring(_[2],_[3]);if(y){const k=i.static?.get(M);if(k)E=k;else{i.static??=new Map;const N=is(r.fullPath??r.from);N.parent=i,N.depth=c,E=N,i.static.set(M,N)}}else{const k=M.toLowerCase(),N=i.staticInsensitive?.get(k);if(N)E=N;else{i.staticInsensitive??=new Map;const U=is(r.fullPath??r.from);U.parent=i,U.depth=c,E=U,i.staticInsensitive.set(k,U)}}break}case ps:{const M=h.substring(x,_[1]),k=h.substring(_[4],C),N=y&&!!(M||k),U=M?N?M:M.toLowerCase():void 0,H=k?N?k:k.toLowerCase():void 0,L=!v&&i.dynamic?.find(z=>!z.skipOnParamError&&z.caseSensitive===N&&z.prefix===U&&z.suffix===H);if(L)E=L;else{const z=Kh(ps,r.fullPath??r.from,N,U,H);E=z,z.depth=c,z.parent=i,i.dynamic??=[],i.dynamic.push(z)}break}case lc:{const M=h.substring(x,_[1]),k=h.substring(_[4],C),N=y&&!!(M||k),U=M?N?M:M.toLowerCase():void 0,H=k?N?k:k.toLowerCase():void 0,L=!v&&i.optional?.find(z=>!z.skipOnParamError&&z.caseSensitive===N&&z.prefix===U&&z.suffix===H);if(L)E=L;else{const z=Kh(lc,r.fullPath??r.from,N,U,H);E=z,z.parent=i,z.depth=c,i.optional??=[],i.optional.push(z)}break}case ms:{const M=h.substring(x,_[1]),k=h.substring(_[4],C),N=y&&!!(M||k),U=M?N?M:M.toLowerCase():void 0,H=k?N?k:k.toLowerCase():void 0,L=Kh(ms,r.fullPath??r.from,N,U,H);E=L,L.parent=i,L.depth=c,i.wildcard??=[],i.wildcard.push(L)}}i=E}if(v&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const _=is(r.fullPath??r.from);_.kind=ox,_.parent=i,c++,_.depth=c,i.pathless??=[],i.pathless.push(_),i=_}const b=(r.path||!r.children)&&!r.isRoot;if(b&&h.endsWith("/")){const _=is(r.fullPath??r.from);_.kind=as,_.parent=i,c++,_.depth=c,i.index=_,i=_}i.parse=r.options?.params?.parse??null,i.skipOnParamError=v,i.parsingPriority=r.options?.skipRouteOnParseError?.priority??0,b&&!i.route&&(i.route=r,i.fullPath=r.fullPath??r.from)}if(r.children)for(const h of r.children)Ku(e,t,h,f,i,c,u)}function Yh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function wo(e){if(e.pathless)for(const t of e.pathless)wo(t);if(e.static)for(const t of e.static.values())wo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())wo(t);if(e.dynamic?.length){e.dynamic.sort(Yh);for(const t of e.dynamic)wo(t)}if(e.optional?.length){e.optional.sort(Yh);for(const t of e.optional)wo(t)}if(e.wildcard?.length){e.wildcard.sort(Yh);for(const t of e.wildcard)wo(t)}}function is(e){return{kind:za,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Kh(e,t,r,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:r,prefix:s,suffix:i}}function _A(e,t){const r=is("/"),s=new Uint16Array(6);for(const i of e)Ku(!1,s,i,1,r,0);wo(r),t.masksTree=r,t.flatCache=Cu(1e3)}function CA(e,t){e||="/";const r=t.flatCache.get(e);if(r)return r;const s=pm(e,t.masksTree);return t.flatCache.set(e,s),s}function EA(e,t,r,s,i){e||="/",s||="/";const c=t?`case\0${e}`:e;let u=i.singleCache.get(c);if(!u){u=is("/");const f=new Uint16Array(6);Ku(t,f,{from:e},1,u,0),i.singleCache.set(c,u)}return pm(s,u,r)}function RA(e,t,r=!1){const s=r?e:`nofuzz\0${e}`,i=t.matchCache.get(s);if(i!==void 0)return i;e||="/";let c;try{c=pm(e,t.segmentTree,r)}catch(u){if(u instanceof URIError)c=null;else throw u}return c&&(c.branch=OA(c.route)),t.matchCache.set(s,c),c}function TA(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function AA(e,t=!1,r){const s=is(e.fullPath),i=new Uint16Array(6),c={},u={};let f=0;return Ku(t,i,e,1,s,0,p=>{if(r?.(p,f),an(!(p.id in c),`Duplicate routes found with id: ${String(p.id)}`),c[p.id]=p,f!==0&&p.path){const y=TA(p.fullPath);(!u[y]||p.fullPath.endsWith("/"))&&(u[y]=p)}f++}),wo(s),{processedTree:{segmentTree:s,singleCache:Cu(1e3),matchCache:Cu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:u}}function pm(e,t,r=!1){const s=e.split("/"),i=MA(e,s,t,r);if(!i)return null;const[c]=sx(e,s,i);return{route:i.node.route,rawParams:c,parsedParams:i.parsedParams}}function sx(e,t,r){const s=kA(r.node);let i=null;const c={};let u=r.extract?.part??0,f=r.extract?.node??0,h=r.extract?.path??0,p=r.extract?.segment??0;for(;f<s.length;u++,f++,h++,p++){const y=s[f];if(y.kind===as)break;if(y.kind===ox){p--,u--,h--;continue}const v=t[u],b=h;if(v&&(h+=v.length),y.kind===ps){i??=r.node.fullPath.split("/");const _=i[p],E=y.prefix?.length??0;if(_.charCodeAt(E)===123){const C=y.suffix?.length??0,O=_.substring(E+2,_.length-C-1),M=v.substring(E,v.length-C);c[O]=decodeURIComponent(M)}else{const C=_.substring(1);c[C]=decodeURIComponent(v)}}else if(y.kind===lc){if(r.skipped&1<<f){u--,h=b-1;continue}i??=r.node.fullPath.split("/");const _=i[p],E=y.prefix?.length??0,x=y.suffix?.length??0,C=_.substring(E+3,_.length-x-1),O=y.suffix||y.prefix?v.substring(E,v.length-x):v;O&&(c[C]=decodeURIComponent(O))}else if(y.kind===ms){const _=y,E=e.substring(b+(_.prefix?.length??0),e.length-(_.suffix?.length??0)),x=decodeURIComponent(E);c["*"]=x,c._splat=x;break}}return r.rawParams&&Object.assign(c,r.rawParams),[c,{part:u,node:f,path:h,segment:p}]}function OA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function kA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function MA(e,t,r,s){if(e==="/"&&r.index)return{node:r.index,skipped:0};const i=!cc(t),c=i&&e!=="/",u=t.length-(i?1:0),f=[{node:r,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,p=null,y=null;for(;f.length;){const v=f.pop(),{node:b,index:_,skipped:E,depth:x,statics:C,dynamics:O,optionals:M}=v;let{extract:k,rawParams:N,parsedParams:U}=v;if(b.skipOnParamError){if(!Xh(e,t,v))continue;N=v.rawParams,k=v.extract,U=v.parsedParams}s&&b.route&&b.kind!==as&&Vi(p,v)&&(p=v);const H=_===u;if(H&&(b.route&&!c&&Vi(y,v)&&(y=v),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const L=H?void 0:t[_];let z;if(H&&b.index){const Y={node:b.index,index:_,skipped:E,depth:x+1,statics:C,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U};let ie=!0;if(b.index.skipOnParamError&&(Xh(e,t,Y)||(ie=!1)),ie){if(C===u&&!O&&!M&&!E)return Y;Vi(y,Y)&&(y=Y)}}if(b.wildcard&&Vi(h,v))for(const Y of b.wildcard){const{prefix:ie,suffix:ae}=Y;if(ie&&(H||!(Y.caseSensitive?L:z??=L.toLowerCase()).startsWith(ie)))continue;if(ae){if(H)continue;const le=t.slice(_).join("/").slice(-ae.length);if((Y.caseSensitive?le:le.toLowerCase())!==ae)continue}const oe={node:Y,index:u,skipped:E,depth:x,statics:C,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U};if(!(Y.skipOnParamError&&!Xh(e,t,oe))){h=oe;break}}if(b.optional){const Y=E|1<<x,ie=x+1;for(let ae=b.optional.length-1;ae>=0;ae--){const oe=b.optional[ae];f.push({node:oe,index:_,skipped:Y,depth:ie,statics:C,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U})}if(!H)for(let ae=b.optional.length-1;ae>=0;ae--){const oe=b.optional[ae],{prefix:le,suffix:ce}=oe;if(le||ce){const me=oe.caseSensitive?L:z??=L.toLowerCase();if(le&&!me.startsWith(le)||ce&&!me.endsWith(ce))continue}f.push({node:oe,index:_+1,skipped:E,depth:ie,statics:C,dynamics:O,optionals:M+1,extract:k,rawParams:N,parsedParams:U})}}if(!H&&b.dynamic&&L)for(let Y=b.dynamic.length-1;Y>=0;Y--){const ie=b.dynamic[Y],{prefix:ae,suffix:oe}=ie;if(ae||oe){const le=ie.caseSensitive?L:z??=L.toLowerCase();if(ae&&!le.startsWith(ae)||oe&&!le.endsWith(oe))continue}f.push({node:ie,index:_+1,skipped:E,depth:x+1,statics:C,dynamics:O+1,optionals:M,extract:k,rawParams:N,parsedParams:U})}if(!H&&b.staticInsensitive){const Y=b.staticInsensitive.get(z??=L.toLowerCase());Y&&f.push({node:Y,index:_+1,skipped:E,depth:x+1,statics:C+1,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U})}if(!H&&b.static){const Y=b.static.get(L);Y&&f.push({node:Y,index:_+1,skipped:E,depth:x+1,statics:C+1,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U})}if(b.pathless){const Y=x+1;for(let ie=b.pathless.length-1;ie>=0;ie--){const ae=b.pathless[ie];f.push({node:ae,index:_,skipped:E,depth:Y,statics:C,dynamics:O,optionals:M,extract:k,rawParams:N,parsedParams:U})}}}if(y&&h)return Vi(h,y)?y:h;if(y)return y;if(h)return h;if(s&&p){let v=p.index;for(let _=0;_<p.index;_++)v+=t[_].length;const b=v===e.length?"/":e.slice(v);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function Xh(e,t,r){try{const[s,i]=sx(e,t,r);r.rawParams=s,r.extract=i;const c=r.node.parse(s);return r.parsedParams=Object.assign({},r.parsedParams,c),!0}catch{return null}}function Vi(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===as)>(e.node.kind===as)||t.node.kind===as==(e.node.kind===as)&&t.depth>e.depth))):!0}function fu(e){return mm(e.filter(t=>t!==void 0).join("/"))}function mm(e){return e.replace(/\/{2,}/g,"/")}function ax(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function $r(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function ix(e){return $r(ax(e))}function Eu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function NA(e,t,r){return Eu(e,r)===Eu(t,r)}function jA({base:e,to:t,trailingSlash:r="never",cache:s}){const i=t.startsWith("/"),c=!i&&t===".";let u;if(s){u=i?t:c?e:e+"\0"+t;const v=s.get(u);if(v)return v}let f;if(c)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&cc(f)==="";)f.pop();const v=t.split("/");for(let b=0,_=v.length;b<_;b++){const E=v[b];E===""?b?b===_-1&&f.push(E):f=[E]:E===".."?f.pop():E==="."||f.push(E)}}f.length>1&&(cc(f)===""?r==="never"&&f.pop():r==="always"&&f.push(""));let h,p="";for(let v=0;v<f.length;v++){v>0&&(p+="/");const b=f[v];if(!b)continue;h=hm(b,0,h);const _=h[0];if(_===za){p+=b;continue}const E=h[5],x=b.substring(0,h[1]),C=b.substring(h[4],E),O=b.substring(h[2],h[3]);_===ps?p+=x||C?`${x}{$${O}}${C}`:`$${O}`:_===ms?p+=x||C?`${x}{$}${C}`:"$":p+=`${x}{-$${O}}${C}`}p=mm(p);const y=p||"/";return u&&s&&s.set(u,y),y}function zA(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),r=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(r,"g");return i=>i.replace(s,c=>t.get(c)??c)}function Jh(e,t,r){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(i=>B0(i,r)).join("/"):B0(s,r)}function Wh({path:e,params:t,decoder:r,server:s}){let i=!1;const c={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const u=e.length;let f=0,h,p="";for(;f<u;){const v=f;h=hm(e,v,h);const b=h[5];if(f=b+1,v===b)continue;const _=h[0];if(_===za){p+="/"+e.substring(v,b);continue}if(_===ms){const E=t._splat;c._splat=E,c["*"]=E;const x=e.substring(v,h[1]),C=e.substring(h[4],b);if(!E){i=!0,(x||C)&&(p+="/"+x+C);continue}const O=Jh("_splat",t,r);p+="/"+x+O+C;continue}if(_===ps){const E=e.substring(h[2],h[3]);!i&&!(E in t)&&(i=!0),c[E]=t[E];const x=e.substring(v,h[1]),C=e.substring(h[4],b),O=Jh(E,t,r)??"undefined";p+="/"+x+O+C;continue}if(_===lc){const E=e.substring(h[2],h[3]),x=t[E];if(x==null)continue;c[E]=x;const C=e.substring(v,h[1]),O=e.substring(h[4],b),M=Jh(E,t,r)??"";p+="/"+C+M+O;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:i}}function B0(e,t){const r=encodeURIComponent(e);return t?.(r)??r}function Gt(e){return!!e?.isNotFound}function DA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const $p="tsr-scroll-restoration-v1_3",PA=(e,t)=>{let r;return(...s)=>{r||(r=setTimeout(()=>{e(...s),r=null},t))}};function LA(){const e=DA();if(!e)return null;const t=e.getItem($p);let r=t?JSON.parse(t):{};return{state:r,set:s=>{r=xo(s,r)||r;try{e.setItem($p,JSON.stringify(r))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Yl=LA(),IA=e=>e.state.__TSR_key||e.href;function $A(e){const t=[];let r;for(;r=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(r.children,e)+1})`),e=r;return`${t.reverse().join(" > ")}`.toLowerCase()}let Ru=!1;function UA({storageKey:e,key:t,behavior:r,shouldScrollRestoration:s,scrollToTopSelectors:i,location:c}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,h=u[f];Ru=!0;e:{if(s&&h&&Object.keys(h).length>0){for(const v in h){const b=h[v];if(v==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:r});else if(v){const _=document.querySelector(v);_&&(_.scrollLeft=b.scrollX,_.scrollTop=b.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const b=document.getElementById(p);b&&b.scrollIntoView(v)}break e}const y={top:0,left:0,behavior:r};if(window.scrollTo(y),i)for(const v of i){if(v==="window")continue;const b=typeof v=="function"?v():document.querySelector(v);b&&b.scrollTo(y)}}Ru=!1}function BA(e,t){if(!Yl||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Yl))return;e.isScrollRestorationSetup=!0,Ru=!1;const s=e.options.getScrollRestorationKey||IA;window.history.scrollRestoration="manual";const i=c=>{if(Ru||!e.isScrollRestoring)return;let u="";if(c.target===document||c.target===window)u="window";else{const h=c.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=$A(c.target)}const f=s(e.state.location);Yl.set(h=>{const p=h[f]||={},y=p[u]||={};if(u==="window")y.scrollX=window.scrollX||0,y.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(y.scrollX=v.scrollLeft||0,y.scrollY=v.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",PA(i,100),!0),e.subscribe("onRendered",c=>{const u=s(c.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(UA({storageKey:$p,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Yl.set(f=>(f[u]||={},f)))})}function qA(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const r=document.getElementById(e.state.location.hash);r&&r.scrollIntoView(t)}}}function cx(e,t=String){const r=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&r.set(s,t(i))}return r.toString()}function ep(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function FA(e){const t=new URLSearchParams(e),r={};for(const[s,i]of t.entries()){const c=r[s];c==null?r[s]=ep(i):Array.isArray(c)?c.push(ep(i)):r[s]=[c,ep(i)]}return r}const VA=ZA(JSON.parse),HA=QA(JSON.stringify,JSON.parse);function ZA(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=FA(t);for(const s in r){const i=r[s];if(typeof i=="string")try{r[s]=e(i)}catch{}}return r}}function QA(e,t){const r=typeof t=="function";function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(r&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=cx(i,s);return c?`?${c}`:""}}const Ln="__root__";function lx(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&_u(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${rx.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function wn(e){return e instanceof Response&&!!e.options}function ux(e){if(e!==null&&typeof e=="object"&&e.isSerializedRedirect)return lx(e)}const du=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Xu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(r=>r.id===t)),Ra=(e,t,r=!0)=>{const s={...e.router.options.context??{}},i=r?t:t-1;for(let c=0;c<=i;c++){const u=e.matches[c];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},fx=(e,t)=>{const r=e.router.routesById[t.routeId??""]??e.router.routeTree;!r.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(r.options.notFoundComponent=e.router.options.defaultNotFoundComponent),an(r.options.notFoundComponent);const s=e.matches.find(i=>i.routeId===r.id);an(s,"Could not find match for route: "+r.id),e.updateMatch(s.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&r.parentRoute&&(t.routeId=r.parentRoute.id,fx(e,t))},_o=(e,t,r)=>{if(!(!wn(r)&&!Gt(r))){if(wn(r)&&r.redirectHandled&&!r.options.reloadDocument)throw r;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=wn(r)?"redirected":"notFound";t._nonReactive.error=r,e.updateMatch(t.id,i=>({...i,status:s,context:Ra(e,t.index),isFetching:!1,error:r})),Gt(r)&&!r.routeId&&(r.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw wn(r)?(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r),r):(fx(e,r),r)}},dx=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Hi=(e,t,r,s)=>{const{id:i,routeId:c}=e.matches[t],u=e.router.looseRoutesById[c];if(r instanceof Promise)throw r;r.routerCode=s,e.firstBadMatchIndex??=t,_o(e,e.router.getMatch(i),r);try{u.options.onError?.(r)}catch(f){r=f,_o(e,e.router.getMatch(i),r)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},hx=(e,t,r,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=r.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Xu(e,t)&&(r.options.loader||r.options.beforeLoad||gx(r))&&typeof i=="number"&&i!==1/0&&(r.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{du(e)},i);s._nonReactive.pendingTimeout=u}},GA=(e,t,r)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;hx(e,t,r,s);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&_o(e,c,c.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},YA=(e,t,r,s)=>{const i=e.router.getMatch(t),c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=hs(()=>{c?.resolve()});const{paramsError:u,searchError:f}=i;u&&Hi(e,r,u,"PARSE_PARAMS"),f&&Hi(e,r,f,"VALIDATE_SEARCH"),hx(e,t,s,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,N=>({...N,isFetching:"beforeLoad",fetchCount:N.fetchCount+1,abortController:h})))},v=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,N=>({...N,isFetching:!1}))};if(!s.options.beforeLoad){Ca(()=>{y(),v()});return}i._nonReactive.beforeLoadPromise=hs();const b={...Ra(e,r,!1),...i.__routeContext},{search:_,params:E,cause:x}=i,C=Xu(e,t),O={search:_,abortController:h,params:E,preload:C,context:b,location:e.location,navigate:N=>e.router.navigate({...N,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":x,matches:e.matches,...e.router.options.additionalContext},M=N=>{if(N===void 0){Ca(()=>{y(),v()});return}(wn(N)||Gt(N))&&(y(),Hi(e,r,N,"BEFORE_LOAD")),Ca(()=>{y(),e.updateMatch(t,U=>({...U,__beforeLoadContext:N})),v()})};let k;try{if(k=s.options.beforeLoad(O),Ea(k))return y(),k.catch(N=>{Hi(e,r,N,"BEFORE_LOAD")}).then(M)}catch(N){y(),Hi(e,r,N,"BEFORE_LOAD")}M(k)},KA=(e,t)=>{const{id:r,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],c=()=>f(),u=()=>YA(e,r,t,i),f=()=>{if(dx(e,r))return;const h=GA(e,r,i);return Ea(h)?h.then(u):u()};return c()},XA=(e,t,r)=>{const s=e.router.getMatch(t);if(!s||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([r.options.head?.(i),r.options.scripts?.(i),r.options.headers?.(i)]).then(([c,u,f])=>{const h=c?.meta,p=c?.links,y=c?.scripts,v=c?.styles;return{meta:h,links:p,headScripts:y,headers:f,scripts:u,styles:v}})},px=(e,t,r,s)=>{const i=e.matchPromises[r-1],{params:c,loaderDeps:u,abortController:f,cause:h}=e.router.getMatch(t),p=Ra(e,r),y=Xu(e,t);return{params:c,deps:u,preload:!!y,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:y?"preload":h,route:s,...e.router.options.additionalContext}},q0=async(e,t,r,s)=>{try{const i=e.router.getMatch(t);try{(!(dA??e.router.isServer)||i.ssr===!0)&&mx(s);const c=s.options.loader?.(px(e,t,r,s)),u=s.options.loader&&Ea(c);if((u||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),s.options.loader){const p=u?await c:c;_o(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,y=>({...y,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const h=i._nonReactive.minPendingPromise;h&&await h,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:Ra(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let u=c;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Ra(e,r)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,Gt(c)&&await s.options.notFoundComponent?.preload?.(),_o(e,e.router.getMatch(t),c);try{s.options.onError?.(c)}catch(h){u=h,_o(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:Ra(e,r),status:"error",isFetching:!1}))}}catch(i){const c=e.router.getMatch(t);c&&(c._nonReactive.loaderPromise=void 0),_o(e,c,i)}},JA=async(e,t)=>{const{id:r,routeId:s}=e.matches[t];let i=!1,c=!1;const u=e.router.looseRoutesById[s];if(!dx(e,r)){const p=e.router.getMatch(r);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const y=e.router.getMatch(r),v=y._nonReactive.error||y.error;v&&_o(e,y,v)}else{const y=Date.now()-p.updatedAt,v=Xu(e,r),b=v?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,_=u.options.shouldReload,E=typeof _=="function"?_(px(e,r,t,u)):_,x=!!v&&!e.router.state.matches.some(k=>k.id===r),C=e.router.getMatch(r);C._nonReactive.loaderPromise=hs(),x!==C.preload&&e.updateMatch(r,k=>({...k,preload:x}));const{status:O,invalid:M}=C;i=O==="success"&&(M||(E??y>b)),v&&u.options.preload===!1||(i&&!e.sync?(c=!0,(async()=>{try{await q0(e,r,t,u);const k=e.router.getMatch(r);k._nonReactive.loaderPromise?.resolve(),k._nonReactive.loadPromise?.resolve(),k._nonReactive.loaderPromise=void 0}catch(k){wn(k)&&await e.router.navigate(k.options)}})()):(O!=="success"||i&&e.sync)&&await q0(e,r,t,u))}}const f=e.router.getMatch(r);c||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve()),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,c||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=c?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(r,p=>({...p,isFetching:h,invalid:!1})),e.router.getMatch(r)):f};async function F0(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(r=>r._forcePending)&&du(t);try{for(let f=0;f<t.matches.length;f++){const h=KA(t,f);Ea(h)&&await h}const r=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<r;f++)t.matchPromises.push(JA(t,f));const i=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let c;for(const f of i){if(wn(f))throw f;!c&&Gt(f)&&(c=f)}for(const f of t.matches){const{id:h,routeId:p}=f,y=t.router.looseRoutesById[p];try{const v=XA(t,h,y);if(v){const b=await v;t.updateMatch(h,_=>({..._,...b}))}}catch(v){console.error(`Error executing head for route ${p}:`,v)}}if(c)throw c;const u=du(t);Ea(u)&&await u}catch(r){if(Gt(r)&&!t.preload){const s=du(t);throw Ea(s)&&await s,r}if(wn(r))throw r}return t.matches}async function mx(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:r,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const r=[];for(const s of yx){const i=e.options[s]?.preload;i&&r.push(i())}if(r.length)return Promise.all(r).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function gx(e){for(const t of yx)if(e.options[t]?.preload)return!0;return!1}const yx=["component","errorComponent","pendingComponent","notFoundComponent"];function WA(e){return{input:({url:t})=>{for(const r of e)t=Up(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=vx(e[r],t);return t}}}function eO(e){const t=ix(e.basepath),r=`/${t}`,s=`${r}/`,i=e.caseSensitive?r:r.toLowerCase(),c=e.caseSensitive?s:s.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===i?u.pathname="/":f.startsWith(c)&&(u.pathname=u.pathname.slice(r.length)),u},output:({url:u})=>(u.pathname=fu(["/",t,u.pathname]),u)}}function Up(e,t){const r=e?.input?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function vx(e,t){const r=e?.output?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function tO(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function fs(e){const t=e.resolvedLocation,r=e.location,s=t?.pathname!==r.pathname,i=t?.href!==r.href,c=t?.hash!==r.hash;return{fromLocation:t,toLocation:r,pathChanged:s,hrefChanged:i,hashChanged:c}}class nO{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=r=>r(),this.update=r=>{r.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,i=this.basepath??s?.basepath??"/",c=this.basepath===void 0,u=s?.rewrite;if(this.options={...s,...r},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=zA(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=uA()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let b;this.resolvePathCache=Cu(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=new cA(oO(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(b=>!["redirected"].includes(b.status))}}}),BA(this));let f=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==h||u!==p){this.basepath=h;const b=[],_=ix(h);_&&_!=="/"&&b.push(eO({basepath:h})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:WA(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=AA(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&_A(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,s)=>{const i={eventType:r,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=r=>{this.subscribers.forEach(s=>{s.eventType===r.type&&s.fn(r)})},this.parseLocation=(r,s)=>{const i=({pathname:h,search:p,hash:y,href:v,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const M=this.options.parseSearch(p),k=this.options.stringifySearch(M);return{href:h+k+y,publicHref:v,pathname:Fi(h),external:!1,searchStr:k,search:rn(s?.search,M),hash:Fi(y.slice(1)),state:rn(s?.state,b)}}const _=new URL(v,this.origin),E=Up(this.rewrite,_),x=this.options.parseSearch(E.search),C=this.options.stringifySearch(x);return E.search=C,{href:E.href.replace(E.origin,""),publicHref:v,pathname:Fi(E.pathname),external:!!this.rewrite&&E.origin!==this.origin,searchStr:C,search:rn(s?.search,x),hash:Fi(E.hash.slice(1)),state:rn(s?.state,b)}},c=i(r),{__tempLocation:u,__tempKey:f}=c.state;if(u&&(!f||f===this.tempLocationKey)){const h=i(u);return h.state.key=c.state.key,h.state.__TSR_key=c.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:c}}return c},this.resolvePathWithBase=(r,s)=>jA({base:r,to:mm(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,s,i)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:s},i):this.matchRoutesInternal(r,s),this.getMatchedRoutes=r=>sO({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const s=this.getMatch(r);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const r=this.state.matches.filter(c=>c.status==="pending"),s=this.state.matches.filter(c=>c.isFetching==="loader");new Set([...this.state.pendingMatches??[],...r,...s]).forEach(c=>{this.cancelMatch(c.id)})},this.buildLocation=r=>{const s=(c={})=>{const u=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);c.from;const h=c.unsafeRelative==="path"?u.pathname:c.from??f.fullPath,p=this.resolvePathWithBase(h,"."),y=f.search,v={...f.params},b=c.to?this.resolvePathWithBase(p,`${c.to}`):this.resolvePathWithBase(p,"."),_=c.params===!1||c.params===null?{}:(c.params??!0)===!0?v:Object.assign(v,xo(c.params,v)),E=Wh({path:b,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,x=this.getMatchedRoutes(E);let C=x.matchedRoutes;(x.foundRoute?x.foundRoute.path!=="/"&&x.routeParams["**"]:$r(E))&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]);let M=!1;if(Object.keys(_).length>0)for(const le of C){const ce=le.options.params?.stringify??le.options.stringifyParams;ce&&(M=!0,Object.assign(_,ce(_)))}const k=r.leaveParams?b:Fi(M?Wh({path:b,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:E);let N=y;if(r._includeValidateSearch&&this.options.search?.strict){const le={};C.forEach(ce=>{if(ce.options.validateSearch)try{Object.assign(le,hu(ce.options.validateSearch,{...le,...N}))}catch{}}),N=le}N=aO({search:N,dest:c,destRoutes:C,_includeValidateSearch:r._includeValidateSearch}),N=rn(y,N);const U=this.options.stringifySearch(N),H=c.hash===!0?u.hash:c.hash?xo(c.hash,u.hash):void 0,L=H?`#${H}`:"";let z=c.state===!0?u.state:c.state?xo(c.state,u.state):{};z=rn(u.state,z);const Y=`${k}${U}${L}`;let ie,ae,oe=!1;if(this.rewrite){const le=new URL(Y,this.origin),ce=vx(this.rewrite,le);ie=le.href.replace(le.origin,""),ce.origin!==this.origin?(ae=ce.href,oe=!0):ae=ce.pathname+ce.search+ce.hash}else ie=wA(Y),ae=ie;return{publicHref:ae,href:ie,pathname:k,search:N,searchStr:U,state:z,hash:H??"",external:oe,unmaskOnReload:c.unmaskOnReload}},i=(c={},u)=>{const f=s(c);let h=u?s(u):void 0;if(!h){const p={};if(this.options.routeMasks){const y=CA(f.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:v,params:b,..._}=y.route,E=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,xo(b,p));u={from:r.from,..._,params:E},h=s(u)}}}return h&&(f.maskedLocation=h),f};return r.mask?i(r,{from:r.from,...r.mask}):i(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:s,...i})=>{const c=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(y=>{i.state[y]=this.latestLocation.state[y]});const p=us(i.state,this.latestLocation.state);return h.forEach(y=>{delete i.state[y]}),p},u=$r(this.latestLocation.href)===$r(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=hs(()=>{f?.resolve()}),u&&c())this.load();else{let{maskedLocation:h,hashScrollIntoView:p,...y}=i;h&&(y={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,this.history[i.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:s})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:s,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:u,href:f,...h}={})=>{if(f){const v=this.history.location.state.__TSR_index,b=Su(f,{__TSR_index:r?v:v+1}),_=new URL(b.pathname,this.origin),E=Up(this.rewrite,_);h.to=E.pathname,h.search=this.options.parseSearch(b.search),h.hash=b.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:c,replace:r,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:r,reloadDocument:s,href:i,publicHref:c,...u})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!s&&(s=!0),s){if(r!==void 0||!i){const p=this.buildLocation({to:r,...u});i=i??p.publicHref,c=c??p.publicHref}const h=!f&&c?c:i;if(_u(h))return Promise.resolve();if(!u.ignoreBlocker){const y=this.history.getBlockers?.()??[];for(const v of y)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:i,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:r,cachedMatches:s.cachedMatches.filter(i=>!r.some(c=>c.id===i.id))}))},this.load=async r=>{let s,i,c;for(c=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...fs({resolvedLocation:p,location:h})}),this.emit({type:"onBeforeLoad",...fs({resolvedLocation:p,location:h})}),await F0({router:this,sync:r?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=[],v=[],b=[];Ca(()=>{this.__store.setState(_=>{const E=_.matches,x=_.pendingMatches||_.matches;return y=E.filter(C=>!x.some(O=>O.id===C.id)),v=x.filter(C=>!E.some(O=>O.id===C.id)),b=x.filter(C=>E.some(O=>O.id===C.id)),{..._,isLoading:!1,loadedAt:Date.now(),matches:x,pendingMatches:void 0,cachedMatches:[..._.cachedMatches,...y.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[v,"onEnter"],[b,"onStay"]].forEach(([_,E])=>{_.forEach(x=>{this.looseRoutesById[x.routeId].options[E]?.(x)})})})})}})}catch(h){wn(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):Gt(h)&&(i=h),this.__store.setState(p=>({...p,statusCode:s?s.status:i?404:p.matches.some(y=>y.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===c&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=c,await c;this.latestLoadPromise&&c!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(f=>f.status==="error")&&(u=500),u!==void 0&&this.__store.setState(f=>({...f,statusCode:u}))},this.startViewTransition=r=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,u=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(fs({resolvedLocation:u,location:c})):s.types;if(f===!1){r();return}i={update:r,types:f}}else i=r;document.startViewTransition(i)}else r()},this.updateMatch=(r,s)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(c=>c.id===r)?"pendingMatches":this.state.matches.some(c=>c.id===r)?"matches":this.state.cachedMatches.some(c=>c.id===r)?"cachedMatches":"";i&&this.__store.setState(c=>({...c,[i]:c[i]?.map(u=>u.id===r?s(u):u)}))})},this.getMatch=r=>{const s=i=>i.id===r;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=r=>{const s=i=>r?.filter?.(i)??!0?{...i,invalid:!0,...r?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(s),cachedMatches:i.cachedMatches.map(s),pendingMatches:i.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const s=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const i=r.options._builtLocation??this.buildLocation(r.options),c=this.getParsedLocationHref(i);r.options.href=c,r.headers.set("Location",c)}else if(s)try{const i=new URL(s);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;r.options.href=c,r.headers.set("Location",c)}}catch{}return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const s=r?.filter;s!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(c=>!s(c))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const r=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const c=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=c};this.clearCache({filter:r})},this.loadRouteChunk=mx,this.preloadRoute=async r=>{const s=this.buildLocation(r);let i=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:r});const c=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),u=new Set([...c,...this.state.cachedMatches.map(f=>f.id)]);Ca(()=>{i.forEach(f=>{u.has(f.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,f]}))})});try{return i=await F0({router:this,matches:i,location:s,preload:!0,updateMatch:(f,h)=>{c.has(f)?i=i.map(p=>p.id===f?h(p):p):this.updateMatch(f,h)}}),i}catch(f){if(wn(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});Gt(f)||console.error(f);return}},this.matchRoute=(r,s)=>{const i={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},c=this.buildLocation(i);if(s?.pending&&this.state.status!=="pending")return!1;const f=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=EA(c.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!h||r.params&&!us(h.rawParams,r.params,{partial:!0})?!1:s?.includeSearch??!0?us(f.search,c.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(r=>r.status==="notFound"||r.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??HA,parseSearch:t.parseSearch??VA}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:r,processedTree:s}){this.routesById=t,this.routesByPath=r,this.processedTree=s;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,r){const s=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:c,parsedParams:u}=s;let{matchedRoutes:f}=s,h=!1;(i?i.path!=="/"&&c["**"]:$r(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:h=!0);const p=h?cO(this.options.notFoundMode,f):void 0,y=[],v=b=>b?.id?b.context??this.options.context??void 0:this.options.context??void 0;return f.forEach((b,_)=>{const E=y[_-1],[x,C,O]=(()=>{const ce=E?.search??t.search,me=E?._strictSearch??void 0;try{const I=hu(b.options.validateSearch,{...ce})??void 0;return[{...ce,...I},{...me,...I},void 0]}catch(I){let K=I;if(I instanceof Tu||(K=new Tu(I.message,{cause:I})),r?.throwOnError)throw K;return[ce,{},K]}})(),M=b.options.loaderDeps?.({search:x})??"",k=M?JSON.stringify(M):"",{interpolatedPath:N,usedParams:U}=Wh({path:b.fullPath,params:c,decoder:this.pathParamsDecoder,server:this.isServer}),H=b.id+N+k,L=this.getMatch(H),z=this.state.matches.find(ce=>ce.routeId===b.id),Y=L?._strictParams??U;let ie;if(!L)try{V0(b,U,u,Y)}catch(ce){if(Gt(ce)||wn(ce)?ie=ce:ie=new rO(ce.message,{cause:ce}),r?.throwOnError)throw ie}Object.assign(c,Y);const ae=z?"stay":"enter";let oe;if(L)oe={...L,cause:ae,params:z?rn(z.params,c):c,_strictParams:Y,search:rn(z?z.search:L.search,x),_strictSearch:C};else{const ce=b.options.loader||b.options.beforeLoad||b.lazyFn||gx(b)?"pending":"success";oe={id:H,ssr:b.options.ssr,index:_,routeId:b.id,params:z?rn(z.params,c):c,_strictParams:Y,pathname:N,updatedAt:Date.now(),search:z?rn(z.search,x):x,_strictSearch:C,searchError:void 0,status:ce,isFetching:!1,error:void 0,paramsError:ie,__routeContext:void 0,_nonReactive:{loadPromise:hs()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ae,loaderDeps:z?rn(z.loaderDeps,M):M,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}r?.preload||(oe.globalNotFound=p===b.id),oe.searchError=O;const le=v(E);oe.context={...le,...oe.__routeContext,...oe.__beforeLoadContext},y.push(oe)}),y.forEach((b,_)=>{const E=this.looseRoutesById[b.routeId];if(!this.getMatch(b.id)){const C=y[_-1],O=v(C);if(E.options.context){const M={deps:b.loaderDeps,params:b.params,context:O??{},location:t,navigate:k=>this.navigate({...k,_fromLocation:t}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:y};b.__routeContext=E.options.context(M)??void 0}b.context={...O,...b.__routeContext,...b.__beforeLoadContext}}}),y}matchRoutesLightweight(t){const{matchedRoutes:r,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),c=cc(r),u={...t.search};for(const y of r)try{Object.assign(u,hu(y.options.validateSearch,u))}catch{}const f=cc(this.state.matches),h=f&&f.routeId===c.id&&t.pathname===this.state.location.pathname;let p;if(h)p=f.params;else{const y={...s};for(const v of r)try{V0(v,s,i??{},y)}catch{}p=y}return{matchedRoutes:r,fullPath:c.fullPath,search:u,params:p}}}class Tu extends Error{}class rO extends Error{}function oO(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function hu(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Tu("Async validation not supported");if(r.issues)throw new Tu(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function sO({pathname:e,routesById:t,processedTree:r}){const s={},i=$r(e);let c,u;const f=RA(i,r,!0);return f&&(c=f.route,Object.assign(s,f.rawParams),u=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[Ln]],routeParams:s,foundRoute:c,parsedParams:u}}function aO({search:e,dest:t,destRoutes:r,_includeValidateSearch:s}){return iO(r)(e,t,s??!1)}function iO(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const c=({search:u,next:f})=>{let h=u;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(h=i.options.preSearchFilters.reduce((y,v)=>v(y),u));const p=f(h);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((y,v)=>v(y),p):p};t.middlewares.push(c)}if(i.options.validateSearch){const c=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...hu(i.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(c)}}const r=({search:i})=>{const c=t.dest;return c.search?c.search===!0?i:xo(c.search,i):{}};t.middlewares.push(r);const s=(i,c,u)=>{if(i>=u.length)return c;const f=u[i];return f({search:c,next:p=>s(i+1,p,u)})};return function(c,u,f){return t.dest=u,t._includeValidateSearch=f,s(0,c,t.middlewares)}}function cO(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const s=t[r];if(s.children)return s.id}return Ln}function V0(e,t,r,s){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const c in t)c in r&&(s[c]=r[c]);else{const c=i(s);Object.assign(s,c)}}const sr=Symbol.for("TSR_DEFERRED_PROMISE");function lO(e,t){const r=e;return r[sr]||(r[sr]={status:"pending"},r.then(s=>{r[sr].status="success",r[sr].data=s}).catch(s=>{r[sr].status="error",r[sr].error={data:tO(s),__isServerError:!0}})),r}const uO="Error preloading route! ☝️";class bx{constructor(t){if(this.init=r=>{this.originalIndex=r.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=Ln:this.parentRoute||an(!1);let c=i?Ln:s?.path;c&&c!=="/"&&(c=ax(c));const u=s?.id||c;let f=i?Ln:fu([this.parentRoute.id===Ln?"":this.parentRoute.id,u]);c===Ln&&(c="/"),f!==Ln&&(f=fu(["/",f]));const h=f===Ln?"/":fu([this.parentRoute.fullPath,c]);this._path=c,this._id=f,this._fullPath=h,this._to=$r(h)},this.addChildren=r=>this._addFileChildren(r),this._addFileChildren=r=>(Array.isArray(r)&&(this.children=r),typeof r=="object"&&r!==null&&(this.children=Object.values(r)),this),this._addFileTypes=()=>this,this.updateLoader=r=>(Object.assign(this.options,r),this),this.update=r=>(Object.assign(this.options,r),this),this.lazy=r=>(this.lazyFn=r,this),this.redirect=r=>lx({from:this.fullPath,...r}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class fO extends bx{constructor(t){super(t)}}var dO=(e=>(e[e.AggregateError=1]="AggregateError",e[e.ArrowFunction=2]="ArrowFunction",e[e.ErrorPrototypeStack=4]="ErrorPrototypeStack",e[e.ObjectAssign=8]="ObjectAssign",e[e.BigIntTypedArray=16]="BigIntTypedArray",e[e.RegExp=32]="RegExp",e))(dO||{}),Br=Symbol.asyncIterator,wx=Symbol.hasInstance,Ta=Symbol.isConcatSpreadable,qr=Symbol.iterator,Sx=Symbol.match,xx=Symbol.matchAll,_x=Symbol.replace,Cx=Symbol.search,Ex=Symbol.species,Rx=Symbol.split,Tx=Symbol.toPrimitive,Aa=Symbol.toStringTag,Ax=Symbol.unscopables,Ox={[Br]:0,[wx]:1,[Ta]:2,[qr]:3,[Sx]:4,[xx]:5,[_x]:6,[Cx]:7,[Ex]:8,[Rx]:9,[Tx]:10,[Aa]:11,[Ax]:12},hO={0:Br,1:wx,2:Ta,3:qr,4:Sx,5:xx,6:_x,7:Cx,8:Ex,9:Rx,10:Tx,11:Aa,12:Ax},A=void 0,pO={2:!0,3:!1,1:A,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},mO={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},gO={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function He(e,t,r,s,i,c,u,f,h,p,y,v){return{t:e,i:t,s:r,c:s,m:i,p:c,e:u,a:f,f:h,b:p,o:y,l:v}}function Mo(e){return He(2,A,e,A,A,A,A,A,A,A,A,A)}var kx=Mo(2),Mx=Mo(3),yO=Mo(1),vO=Mo(0),bO=Mo(4),wO=Mo(5),SO=Mo(6),xO=Mo(7);function _O(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case`
11
+ `:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case" ":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return A}}function No(e){let t="",r=0,s;for(let i=0,c=e.length;i<c;i++)s=_O(e[i]),s&&(t+=e.slice(r,i)+s,r=i+1);return r===0?t=e:t+=e.slice(r),t}function CO(e){switch(e){case"\\\\":return"\\";case'\\"':return'"';case"\\n":return`
12
+ `;case"\\r":return"\r";case"\\b":return"\b";case"\\t":return" ";case"\\f":return"\f";case"\\x3C":return"<";case"\\u2028":return"\u2028";case"\\u2029":return"\u2029";default:return e}}function xs(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,CO)}var Kl="__SEROVAL_REFS__",Nx=new Map,wa=new Map;function jx(e){return Nx.has(e)}function EO(e){return wa.has(e)}function RO(e){if(jx(e))return Nx.get(e);throw new rk(e)}function TO(e){if(EO(e))return wa.get(e);throw new ok(e)}typeof globalThis<"u"?Object.defineProperty(globalThis,Kl,{value:wa,configurable:!0,writable:!1,enumerable:!1}):typeof window<"u"?Object.defineProperty(window,Kl,{value:wa,configurable:!0,writable:!1,enumerable:!1}):typeof self<"u"?Object.defineProperty(self,Kl,{value:wa,configurable:!0,writable:!1,enumerable:!1}):typeof global<"u"&&Object.defineProperty(global,Kl,{value:wa,configurable:!0,writable:!1,enumerable:!1});function gm(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function AO(e){let t=mO[gm(e)];return e.name!==t?{name:e.name}:e.constructor.name!==t?{name:e.constructor.name}:{}}function zx(e,t){let r=AO(e),s=Object.getOwnPropertyNames(e);for(let i=0,c=s.length,u;i<c;i++)u=s[i],u!=="name"&&u!=="message"&&(u==="stack"?t&4&&(r=r||{},r[u]=e[u]):(r=r||{},r[u]=e[u]));return r}function Dx(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}function OO(e){switch(e){case Number.POSITIVE_INFINITY:return wO;case Number.NEGATIVE_INFINITY:return SO}return e!==e?xO:Object.is(e,-0)?bO:He(0,A,e,A,A,A,A,A,A,A,A,A)}function Px(e){return He(1,A,No(e),A,A,A,A,A,A,A,A,A)}function kO(e){return He(3,A,""+e,A,A,A,A,A,A,A,A,A)}function MO(e){return He(4,e,A,A,A,A,A,A,A,A,A,A)}function NO(e,t){let r=t.valueOf();return He(5,e,r!==r?"":t.toISOString(),A,A,A,A,A,A,A,A,A)}function jO(e,t){return He(6,e,A,No(t.source),t.flags,A,A,A,A,A,A,A)}function zO(e,t){return He(17,e,Ox[t],A,A,A,A,A,A,A,A,A)}function DO(e,t){return He(18,e,No(RO(t)),A,A,A,A,A,A,A,A,A)}function PO(e,t,r){return He(25,e,r,No(t),A,A,A,A,A,A,A,A)}function LO(e,t,r){return He(9,e,A,A,A,A,A,r,A,A,Dx(t),A)}function IO(e,t){return He(21,e,A,A,A,A,A,A,t,A,A,A)}function $O(e,t,r){return He(15,e,A,t.constructor.name,A,A,A,A,r,t.byteOffset,A,t.length)}function UO(e,t,r){return He(16,e,A,t.constructor.name,A,A,A,A,r,t.byteOffset,A,t.byteLength)}function BO(e,t,r){return He(20,e,A,A,A,A,A,A,r,t.byteOffset,A,t.byteLength)}function qO(e,t,r){return He(13,e,gm(t),A,No(t.message),r,A,A,A,A,A,A)}function FO(e,t,r){return He(14,e,gm(t),A,No(t.message),r,A,A,A,A,A,A)}function VO(e,t){return He(7,e,A,A,A,A,A,t,A,A,A,A)}function HO(e,t){return He(28,A,A,A,A,A,A,[e,t],A,A,A,A)}function ZO(e,t){return He(30,A,A,A,A,A,A,[e,t],A,A,A,A)}function QO(e,t,r){return He(31,e,A,A,A,A,A,r,t,A,A,A)}function GO(e,t){return He(32,e,A,A,A,A,A,A,t,A,A,A)}function YO(e,t){return He(33,e,A,A,A,A,A,A,t,A,A,A)}function KO(e,t){return He(34,e,A,A,A,A,A,A,t,A,A,A)}function XO(e,t,r,s){return He(35,e,r,A,A,A,A,t,A,A,A,s)}var JO={parsing:1,serialization:2,deserialization:3};function WO(e){return`Seroval Error (step: ${JO[e]})`}var ek=(e,t)=>WO(e),Lx=class extends Error{constructor(e,t){super(ek(e)),this.cause=t}},H0=class extends Lx{constructor(e){super("parsing",e)}},tk=class extends Lx{constructor(e){super("deserialization",e)}};function Hr(e){return`Seroval Error (specific: ${e})`}var Ju=class extends Error{constructor(t){super(Hr(1)),this.value=t}},Ix=class extends Error{constructor(t){super(Hr(2))}},nk=class extends Error{constructor(e){super(Hr(3))}},wc=class extends Error{constructor(e){super(Hr(4))}},rk=class extends Error{constructor(e){super(Hr(5)),this.value=e}},ok=class extends Error{constructor(e){super(Hr(6))}},sk=class extends Error{constructor(e){super(Hr(7))}},jo=class extends Error{constructor(e){super(Hr(8))}},ak=class extends Error{constructor(t){super(Hr(9))}},ik=class{constructor(e,t){this.value=e,this.replacement=t}},Wu=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,r)=>{e.s=t,e.f=r}),e},ck=(e,t)=>{e.s(t),e.p.s=1,e.p.v=t},lk=(e,t)=>{e.f(t),e.p.s=2,e.p.v=t};Wu.toString();ck.toString();lk.toString();var uk=()=>{let e=[],t=[],r=!0,s=!1,i=0,c=(h,p,y)=>{for(y=0;y<i;y++)t[y]&&t[y][p](h)},u=(h,p,y,v)=>{for(p=0,y=e.length;p<y;p++)v=e[p],!r&&p===y-1?h[s?"return":"throw"](v):h.next(v)},f=(h,p)=>(r&&(p=i++,t[p]=h),u(h),()=>{r&&(t[p]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:h=>f(h),next:h=>{r&&(e.push(h),c(h,"next"))},throw:h=>{r&&(e.push(h),c(h,"throw"),r=!1,s=!1,t.length=0)},return:h=>{r&&(e.push(h),c(h,"return"),r=!1,s=!0,t.length=0)}}},fk=e=>t=>()=>{let r=0,s={[e]:()=>s,next:()=>{if(r>t.d)return{done:!0,value:void 0};let i=r++,c=t.v[i];if(i===t.t)throw c;return{done:i===t.d,value:c}}};return s},dk=(e,t)=>r=>()=>{let s=0,i=-1,c=!1,u=[],f=[],h=(y=0,v=f.length)=>{for(;y<v;y++)f[y].s({done:!0,value:void 0})};r.on({next:y=>{let v=f.shift();v&&v.s({done:!1,value:y}),u.push(y)},throw:y=>{let v=f.shift();v&&v.f(y),h(),i=u.length,c=!0,u.push(y)},return:y=>{let v=f.shift();v&&v.s({done:!0,value:y}),h(),i=u.length,u.push(y)}});let p={[e]:()=>p,next:()=>{if(i===-1){let b=s++;if(b>=u.length){let _=t();return f.push(_),_.p}return{done:!1,value:u[b]}}if(s>i)return{done:!0,value:void 0};let y=s++,v=u[y];if(y!==i)return{done:!1,value:v};if(c)throw v;return{done:!0,value:v}}};return p},$x=e=>{let t=atob(e),r=t.length,s=new Uint8Array(r);for(let i=0;i<r;i++)s[i]=t.charCodeAt(i);return s.buffer};$x.toString();function hk(e){return"__SEROVAL_SEQUENCE__"in e}function Ux(e,t,r){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:r}}function pk(e){let t=[],r=-1,s=-1,i=e[qr]();for(;;)try{let c=i.next();if(t.push(c.value),c.done){s=t.length-1;break}}catch(c){r=t.length,t.push(c)}return Ux(t,r,s)}var mk=fk(qr);function gk(e){return mk(e)}var yk={},vk={},bk={0:{},1:{},2:{},3:{},4:{},5:{}};function ef(e){return"__SEROVAL_STREAM__"in e}function _s(){return uk()}function wk(e){let t=_s(),r=e[Br]();async function s(){try{let i=await r.next();i.done?t.return(i.value):(t.next(i.value),await s())}catch(i){t.throw(i)}}return s().catch(()=>{}),t}var Sk=dk(Br,Wu);function xk(e){return Sk(e)}async function _k(e){try{return[1,await e]}catch(t){return[0,t]}}function Ck(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function pu(e,t){e.marked.add(t)}function Ek(e,t){let r=e.refs.size;return e.refs.set(t,r),r}function tf(e,t){let r=e.refs.get(t);return r!=null?(pu(e,r),{type:1,value:MO(r)}):{type:0,value:Ek(e,t)}}function ym(e,t){let r=tf(e,t);return r.type===1?r:jx(t)?{type:2,value:DO(r.value,t)}:r}function cs(e,t){let r=ym(e,t);if(r.type!==0)return r.value;if(t in Ox)return zO(r.value,t);throw new Ju(t)}function nf(e,t){let r=tf(e,bk[t]);return r.type===1?r.value:He(26,r.value,t,A,A,A,A,A,A,A,A,A)}function Rk(e){let t=tf(e,yk);return t.type===1?t.value:He(27,t.value,A,A,A,A,A,A,cs(e,qr),A,A,A)}function Tk(e){let t=tf(e,vk);return t.type===1?t.value:He(29,t.value,A,A,A,A,A,[nf(e,1),cs(e,Br)],A,A,A,A)}function Ak(e,t,r,s){return He(r?11:10,e,A,A,A,s,A,A,A,A,Dx(t),A)}function Ok(e,t,r,s){return He(8,t,A,A,A,A,{k:r,v:s},A,nf(e,0),A,A,A)}function kk(e,t,r){let s=new Uint8Array(r),i="";for(let c=0,u=s.length;c<u;c++)i+=String.fromCharCode(s[c]);return He(19,t,No(btoa(i)),A,A,A,A,A,nf(e,5),A,A,A)}function Mk(e,t){return{base:Ck(e,t),child:void 0}}var Nk=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Ot(this._p,this.depth,e)}};async function jk(e,t,r){let s=[];for(let i=0,c=r.length;i<c;i++)i in r?s[i]=await Ot(e,t,r[i]):s[i]=0;return s}async function zk(e,t,r,s){return LO(r,s,await jk(e,t,s))}async function vm(e,t,r){let s=Object.entries(r),i=[],c=[];for(let u=0,f=s.length;u<f;u++)i.push(No(s[u][0])),c.push(await Ot(e,t,s[u][1]));return qr in r&&(i.push(cs(e.base,qr)),c.push(HO(Rk(e.base),await Ot(e,t,pk(r))))),Br in r&&(i.push(cs(e.base,Br)),c.push(ZO(Tk(e.base),await Ot(e,t,wk(r))))),Aa in r&&(i.push(cs(e.base,Aa)),c.push(Px(r[Aa]))),Ta in r&&(i.push(cs(e.base,Ta)),c.push(r[Ta]?kx:Mx)),{k:i,v:c}}async function tp(e,t,r,s,i){return Ak(r,s,i,await vm(e,t,s))}async function Dk(e,t,r,s){return IO(r,await Ot(e,t,s.valueOf()))}async function Pk(e,t,r,s){return $O(r,s,await Ot(e,t,s.buffer))}async function Lk(e,t,r,s){return UO(r,s,await Ot(e,t,s.buffer))}async function Ik(e,t,r,s){return BO(r,s,await Ot(e,t,s.buffer))}async function Z0(e,t,r,s){let i=zx(s,e.base.features);return qO(r,s,i?await vm(e,t,i):A)}async function $k(e,t,r,s){let i=zx(s,e.base.features);return FO(r,s,i?await vm(e,t,i):A)}async function Uk(e,t,r,s){let i=[],c=[];for(let[u,f]of s.entries())i.push(await Ot(e,t,u)),c.push(await Ot(e,t,f));return Ok(e.base,r,i,c)}async function Bk(e,t,r,s){let i=[];for(let c of s.keys())i.push(await Ot(e,t,c));return VO(r,i)}async function Bx(e,t,r,s){let i=e.base.plugins;if(i)for(let c=0,u=i.length;c<u;c++){let f=i[c];if(f.parse.async&&f.test(s))return PO(r,f.tag,await f.parse.async(s,new Nk(e,t),{id:r}))}return A}async function qk(e,t,r,s){let[i,c]=await _k(s);return He(12,r,i,A,A,A,A,A,await Ot(e,t,c),A,A,A)}function Fk(e,t,r,s,i){let c=[],u=r.on({next:f=>{pu(this.base,t),Ot(this,e,f).then(h=>{c.push(GO(t,h))},h=>{i(h),u()})},throw:f=>{pu(this.base,t),Ot(this,e,f).then(h=>{c.push(YO(t,h)),s(c),u()},h=>{i(h),u()})},return:f=>{pu(this.base,t),Ot(this,e,f).then(h=>{c.push(KO(t,h)),s(c),u()},h=>{i(h),u()})}})}async function Vk(e,t,r,s){return QO(r,nf(e.base,4),await new Promise(Fk.bind(e,t,r,s)))}async function Hk(e,t,r,s){let i=[];for(let c=0,u=s.v.length;c<u;c++)i[c]=await Ot(e,t,s.v[c]);return XO(r,i,s.t,s.d)}async function Zk(e,t,r,s){if(Array.isArray(s))return zk(e,t,r,s);if(ef(s))return Vk(e,t,r,s);if(hk(s))return Hk(e,t,r,s);let i=s.constructor;if(i===ik)return Ot(e,t,s.replacement);let c=await Bx(e,t,r,s);if(c)return c;switch(i){case Object:return tp(e,t,r,s,!1);case A:return tp(e,t,r,s,!0);case Date:return NO(r,s);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return Z0(e,t,r,s);case Number:case Boolean:case String:case BigInt:return Dk(e,t,r,s);case ArrayBuffer:return kk(e.base,r,s);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return Pk(e,t,r,s);case DataView:return Ik(e,t,r,s);case Map:return Uk(e,t,r,s);case Set:return Bk(e,t,r,s)}if(i===Promise||s instanceof Promise)return qk(e,t,r,s);let u=e.base.features;if(u&32&&i===RegExp)return jO(r,s);if(u&16)switch(i){case BigInt64Array:case BigUint64Array:return Lk(e,t,r,s)}if(u&1&&typeof AggregateError<"u"&&(i===AggregateError||s instanceof AggregateError))return $k(e,t,r,s);if(s instanceof Error)return Z0(e,t,r,s);if(qr in s||Br in s)return tp(e,t,r,s,!!i);throw new Ju(s)}async function Qk(e,t,r){let s=ym(e.base,r);if(s.type!==0)return s.value;let i=await Bx(e,t,s.value,r);if(i)return i;throw new Ju(r)}async function Ot(e,t,r){switch(typeof r){case"boolean":return r?kx:Mx;case"undefined":return yO;case"string":return Px(r);case"number":return OO(r);case"bigint":return kO(r);case"object":{if(r){let s=ym(e.base,r);return s.type===0?await Zk(e,t+1,s.value,r):s.value}return vO}case"symbol":return cs(e.base,r);case"function":return Qk(e,t,r);default:throw new Ju(r)}}async function Gk(e,t){try{return await Ot(e,0,t)}catch(r){throw r instanceof H0?r:new H0(r)}}var Yk=(e=>(e[e.Vanilla=1]="Vanilla",e[e.Cross=2]="Cross",e))(Yk||{});function qx(e,t){for(let r=0,s=t.length;r<s;r++){let i=t[r];e.has(i)||(e.add(i),i.extends&&qx(e,i.extends))}}function Fx(e){if(e){let t=new Set;return qx(t,e),[...t]}}function Kk(e){switch(e){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new sk(e)}}var Xk=1e6,Jk=1e4,Wk=2e4;function Vx(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var eM=1e3;function tM(e,t){var r;return{mode:e,plugins:t.plugins,refs:t.refs||new Map,features:(r=t.features)!=null?r:63^(t.disabledFeatures||0),depthLimit:t.depthLimit||eM}}function nM(e){return{mode:2,base:tM(2,e),child:A}}var rM=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return tt(this._p,this.depth,e)}};function Hx(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new jo({t:4,i:t});if(e.refs.has(t))throw new Error("Conflicted ref id: "+t)}function oM(e,t,r){return Hx(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,r),r}function sM(e,t,r){return Hx(e.base,t),e.base.refs.set(t,r),r}function kt(e,t,r){return e.mode===1?oM(e,t,r):sM(e,t,r)}function Bp(e,t,r){if(Object.hasOwn(t,r))return t[r];throw new jo(e)}function aM(e,t){return kt(e,t.i,TO(xs(t.s)))}function iM(e,t,r){let s=r.a,i=s.length,c=kt(e,r.i,new Array(i));for(let u=0,f;u<i;u++)f=s[u],f&&(c[u]=tt(e,t,f));return Vx(c,r.o),c}function cM(e){switch(e){case"constructor":case"__proto__":case"prototype":case"__defineGetter__":case"__defineSetter__":case"__lookupGetter__":case"__lookupSetter__":return!1;default:return!0}}function lM(e){switch(e){case Br:case Ta:case Aa:case qr:return!0;default:return!1}}function Q0(e,t,r){cM(t)?e[t]=r:Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0})}function uM(e,t,r,s,i){if(typeof s=="string")Q0(r,s,tt(e,t,i));else{let c=tt(e,t,s);switch(typeof c){case"string":Q0(r,c,tt(e,t,i));break;case"symbol":lM(c)&&(r[c]=tt(e,t,i));break;default:throw new jo(s)}}}function Zx(e,t,r,s){let i=r.k;if(i.length>0)for(let c=0,u=r.v,f=i.length;c<f;c++)uM(e,t,s,i[c],u[c]);return s}function fM(e,t,r){let s=kt(e,r.i,r.t===10?{}:Object.create(null));return Zx(e,t,r.p,s),Vx(s,r.o),s}function dM(e,t){return kt(e,t.i,new Date(t.s))}function hM(e,t){if(e.base.features&32){let r=xs(t.c);if(r.length>Wk)throw new jo(t);return kt(e,t.i,new RegExp(r,t.m))}throw new Ix(t)}function pM(e,t,r){let s=kt(e,r.i,new Set);for(let i=0,c=r.a,u=c.length;i<u;i++)s.add(tt(e,t,c[i]));return s}function mM(e,t,r){let s=kt(e,r.i,new Map);for(let i=0,c=r.e.k,u=r.e.v,f=c.length;i<f;i++)s.set(tt(e,t,c[i]),tt(e,t,u[i]));return s}function gM(e,t){if(t.s.length>Xk)throw new jo(t);return kt(e,t.i,$x(xs(t.s)))}function yM(e,t,r){var s;let i=Kk(r.c),c=tt(e,t,r.f),u=(s=r.b)!=null?s:0;if(u<0||u>c.byteLength)throw new jo(r);return kt(e,r.i,new i(c,u,r.l))}function vM(e,t,r){var s;let i=tt(e,t,r.f),c=(s=r.b)!=null?s:0;if(c<0||c>i.byteLength)throw new jo(r);return kt(e,r.i,new DataView(i,c,r.l))}function Qx(e,t,r,s){if(r.p){let i=Zx(e,t,r.p,{});Object.defineProperties(s,Object.getOwnPropertyDescriptors(i))}return s}function bM(e,t,r){let s=kt(e,r.i,new AggregateError([],xs(r.m)));return Qx(e,t,r,s)}function wM(e,t,r){let s=Bp(r,gO,r.s),i=kt(e,r.i,new s(xs(r.m)));return Qx(e,t,r,i)}function SM(e,t,r){let s=Wu(),i=kt(e,r.i,s.p),c=tt(e,t,r.f);return r.s?s.s(c):s.f(c),i}function xM(e,t,r){return kt(e,r.i,Object(tt(e,t,r.f)))}function _M(e,t,r){let s=e.base.plugins;if(s){let i=xs(r.c);for(let c=0,u=s.length;c<u;c++){let f=s[c];if(f.tag===i)return kt(e,r.i,f.deserialize(r.s,new rM(e,t),{id:r.i}))}}throw new nk(r.c)}function CM(e,t){return kt(e,t.i,kt(e,t.s,Wu()).p)}function EM(e,t,r){let s=e.base.refs.get(r.i);if(s)return s.s(tt(e,t,r.a[1])),A;throw new wc("Promise")}function RM(e,t,r){let s=e.base.refs.get(r.i);if(s)return s.f(tt(e,t,r.a[1])),A;throw new wc("Promise")}function TM(e,t,r){tt(e,t,r.a[0]);let s=tt(e,t,r.a[1]);return gk(s)}function AM(e,t,r){tt(e,t,r.a[0]);let s=tt(e,t,r.a[1]);return xk(s)}function OM(e,t,r){let s=kt(e,r.i,_s()),i=r.a,c=i.length;if(c)for(let u=0;u<c;u++)tt(e,t,i[u]);return s}function kM(e,t,r){let s=e.base.refs.get(r.i);if(s&&ef(s))return s.next(tt(e,t,r.f)),A;throw new wc("Stream")}function MM(e,t,r){let s=e.base.refs.get(r.i);if(s&&ef(s))return s.throw(tt(e,t,r.f)),A;throw new wc("Stream")}function NM(e,t,r){let s=e.base.refs.get(r.i);if(s&&ef(s))return s.return(tt(e,t,r.f)),A;throw new wc("Stream")}function jM(e,t,r){return tt(e,t,r.f),A}function zM(e,t,r){return tt(e,t,r.a[1]),A}function DM(e,t,r){let s=kt(e,r.i,Ux([],r.s,r.l));for(let i=0,c=r.a.length;i<c;i++)s.v[i]=tt(e,t,r.a[i]);return s}function tt(e,t,r){if(t>e.base.depthLimit)throw new ak(e.base.depthLimit);switch(t+=1,r.t){case 2:return Bp(r,pO,r.s);case 0:return Number(r.s);case 1:return xs(String(r.s));case 3:if(String(r.s).length>Jk)throw new jo(r);return BigInt(r.s);case 4:return e.base.refs.get(r.i);case 18:return aM(e,r);case 9:return iM(e,t,r);case 10:case 11:return fM(e,t,r);case 5:return dM(e,r);case 6:return hM(e,r);case 7:return pM(e,t,r);case 8:return mM(e,t,r);case 19:return gM(e,r);case 16:case 15:return yM(e,t,r);case 20:return vM(e,t,r);case 14:return bM(e,t,r);case 13:return wM(e,t,r);case 12:return SM(e,t,r);case 17:return Bp(r,hO,r.s);case 21:return xM(e,t,r);case 25:return _M(e,t,r);case 22:return CM(e,r);case 23:return EM(e,t,r);case 24:return RM(e,t,r);case 28:return TM(e,t,r);case 30:return AM(e,t,r);case 31:return OM(e,t,r);case 32:return kM(e,t,r);case 33:return MM(e,t,r);case 34:return NM(e,t,r);case 27:return jM(e,t,r);case 29:return zM(e,t,r);case 35:return DM(e,t,r);default:throw new Ix(r)}}function PM(e,t){try{return tt(e,0,t)}catch(r){throw new tk(r)}}var LM=()=>T;LM.toString();function np(e,t){let r=Fx(t.plugins),s=nM({plugins:r,refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures});return PM(s,e)}async function IM(e,t={}){let r=Fx(t.plugins),s=Mk(1,{plugins:r,disabledFeatures:t.disabledFeatures});return{t:await Gk(s,e),f:s.base.features,m:Array.from(s.base.marked)}}function $M(e){return{tag:"$TSR/t/"+e.key,test:e.test,parse:{sync(t,r){return r.parse(e.toSerializable(t))},async async(t,r){return await r.parse(e.toSerializable(t))},stream(t,r){return r.parse(e.toSerializable(t))}},serialize:void 0,deserialize(t,r){return e.fromSerializable(r.deserialize(t))}}}var So={},Gx=e=>new ReadableStream({start:t=>{e.on({next:r=>{try{t.enqueue(r)}catch{}},throw:r=>{t.error(r)},return:()=>{try{t.close()}catch{}}})}}),UM={tag:"seroval-plugins/web/ReadableStreamFactory",test(e){return e===So},parse:{sync(){return So},async async(){return await Promise.resolve(So)},stream(){return So}},serialize(){return Gx.toString()},deserialize(){return So}};function G0(e){let t=_s(),r=e.getReader();async function s(){try{let i=await r.read();i.done?t.return(i.value):(t.next(i.value),await s())}catch(i){t.throw(i)}}return s().catch(()=>{}),t}var BM={tag:"seroval/plugins/web/ReadableStream",extends:[UM],test(e){return typeof ReadableStream>"u"?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(So),stream:t.parse(_s())}},async async(e,t){return{factory:await t.parse(So),stream:await t.parse(G0(e))}},stream(e,t){return{factory:t.parse(So),stream:t.parse(G0(e))}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){let r=t.deserialize(e.stream);return Gx(r)}},qM=BM;const FM={tag:"$TSR/Error",test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return"new Error("+t.serialize(e.message)+")"},deserialize(e,t){return new Error(t.deserialize(e.message))}};class VM{constructor(t,r){this.stream=t,this.hint=r?.hint??"binary"}}const Au=globalThis.Buffer,Yx=!!Au&&typeof Au.from=="function";function Kx(e){if(e.length===0)return"";if(Yx)return Au.from(e).toString("base64");const t=32768,r=[];for(let s=0;s<e.length;s+=t){const i=e.subarray(s,s+t);r.push(String.fromCharCode.apply(null,i))}return btoa(r.join(""))}function Xx(e){if(e.length===0)return new Uint8Array(0);if(Yx){const s=Au.from(e,"base64");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r}const nc=Object.create(null),rc=Object.create(null),HM=e=>new ReadableStream({start(t){e.on({next(r){try{t.enqueue(Xx(r))}catch{}},throw(r){t.error(r)},return(){try{t.close()}catch{}}})}}),ZM=new TextEncoder,QM=e=>new ReadableStream({start(t){e.on({next(r){try{typeof r=="string"?t.enqueue(ZM.encode(r)):t.enqueue(Xx(r.$b64))}catch{}},throw(r){t.error(r)},return(){try{t.close()}catch{}}})}}),GM="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))",YM="(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})";function Y0(e){const t=_s(),r=e.getReader();return(async()=>{try{for(;;){const{done:s,value:i}=await r.read();if(s){t.return(void 0);break}t.next(Kx(i))}}catch(s){t.throw(s)}finally{r.releaseLock()}})(),t}function K0(e){const t=_s(),r=e.getReader(),s=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:i,value:c}=await r.read();if(i){try{const u=s.decode();u.length>0&&t.next(u)}catch{}t.return(void 0);break}try{const u=s.decode(c,{stream:!0});u.length>0&&t.next(u)}catch{t.next({$b64:Kx(c)})}}}catch(i){t.throw(i)}finally{r.releaseLock()}})(),t}const KM={tag:"tss/RawStreamFactory",test(e){return e===nc},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return GM},deserialize(){return nc}},XM={tag:"tss/RawStreamFactoryText",test(e){return e===rc},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return YM},deserialize(){return rc}},JM={tag:"tss/RawStream",extends:[KM,XM],test(e){return e instanceof VM},parse:{sync(e,t){const r=e.hint==="text"?rc:nc;return{hint:e.hint,factory:t.parse(r),stream:t.parse(_s())}},async async(e,t){const r=e.hint==="text"?rc:nc,s=e.hint==="text"?K0(e.stream):Y0(e.stream);return{hint:e.hint,factory:await t.parse(r),stream:await t.parse(s)}},stream(e,t){const r=e.hint==="text"?rc:nc,s=e.hint==="text"?K0(e.stream):Y0(e.stream);return{hint:e.hint,factory:t.parse(r),stream:t.parse(s)}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){const r=t.deserialize(e.stream);return e.hint==="text"?QM(r):HM(r)}};function WM(e){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(t){return e(t.streamId)}}}const eN=[FM,JM,qM],tN="use",Ou=Yu[tN],Xl=typeof window<"u"?w.useLayoutEffect:w.useEffect;function rp(e){const t=w.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function nN(e,t,r={},s={}){w.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},r);return i.observe(e.current),()=>{i.disconnect()}},[t,r,s.disabled,e])}function rN(e){const t=w.useRef(null);return w.useImperativeHandle(e,()=>t.current,[]),t}function oN({promise:e}){if(Ou)return Ou(e);const t=lO(e);if(t[sr].status==="pending")throw t;if(t[sr].status==="error")throw t[sr].error;return t[sr].data}function sN(e){const t=g.jsx(aN,{...e});return e.fallback?g.jsx(w.Suspense,{fallback:e.fallback,children:t}):t}function aN(e){const t=oN(e);return e.children(t)}function bm(e){const t=e.errorComponent??wm;return g.jsx(iN,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:s})=>r?w.createElement(t,{error:r,reset:s}):e.children})}class iN extends w.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,r){r.error&&r.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,r){this.props.onCatch&&this.props.onCatch(t,r)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function wm({error:e}){const[t,r]=w.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(s=>!s),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?g.jsx("code",{children:e.message}):null})}):null]})}function cN({children:e,fallback:t=null}){return Jx()?g.jsx(Ft.Fragment,{children:e}):g.jsx(Ft.Fragment,{children:t})}function Jx(){return Ft.useSyncExternalStore(lN,()=>!0,()=>!1)}function lN(){return()=>{}}var op={exports:{}},sp={},ap={exports:{}},ip={};var X0;function uN(){if(X0)return ip;X0=1;var e=bc();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(v,b){var _=b(),E=s({inst:{value:_,getSnapshot:b}}),x=E[0].inst,C=E[1];return c(function(){x.value=_,x.getSnapshot=b,h(x)&&C({inst:x})},[v,_,b]),i(function(){return h(x)&&C({inst:x}),v(function(){h(x)&&C({inst:x})})},[v]),u(_),_}function h(v){var b=v.getSnapshot;v=v.value;try{var _=b();return!r(v,_)}catch{return!0}}function p(v,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return ip.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,ip}var J0;function Wx(){return J0||(J0=1,ap.exports=uN()),ap.exports}var W0;function fN(){if(W0)return sp;W0=1;var e=bc(),t=Wx();function r(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var s=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return sp.useSyncExternalStoreWithSelector=function(p,y,v,b,_){var E=c(null);if(E.current===null){var x={hasValue:!1,value:null};E.current=x}else x=E.current;E=f(function(){function O(H){if(!M){if(M=!0,k=H,H=b(H),_!==void 0&&x.hasValue){var L=x.value;if(_(L,H))return N=L}return N=H}if(L=N,s(k,H))return L;var z=b(H);return _!==void 0&&_(L,z)?(k=H,L):(k=H,N=z)}var M=!1,k,N,U=v===void 0?null:v;return[function(){return O(y())},U===null?void 0:function(){return O(U())}]},[y,v,b,_]);var C=i(p,E[0],E[1]);return u(function(){x.hasValue=!0,x.value=C},[C]),h(C),C},sp}var ew;function dN(){return ew||(ew=1,op.exports=fN()),op.exports}var hN=dN();function pN(e,t=s=>s,r={}){const s=r.equal??mN;return hN.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function mN(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!t.has(s)||!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const r=tw(e);if(r.length!==tw(t).length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!Object.is(e[r[s]],t[r[s]]))return!1;return!0}function tw(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const cp=w.createContext(null);function e1(){return typeof document>"u"?cp:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=cp,cp)}function Vt(e){const t=w.useContext(e1());return e?.warn,t}function gt(e){const t=Vt({warn:e?.router===void 0}),r=e?.router||t,s=w.useRef(void 0);return pN(r.__store,i=>{if(e?.select){if(e.structuralSharing??r.options.defaultStructuralSharing){const c=rn(s.current,e.select(i));return s.current=c,c}return e.select(i)}return i})}const rf=w.createContext(void 0),gN=w.createContext(void 0);function fr(e){const t=w.useContext(e.from?gN:rf);return gt({select:s=>{const i=s.matches.find(c=>e.from?e.from===c.routeId:c.id===t);if(an(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Sm(e){return fr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xm(e){const{select:t,...r}=e;return fr({...r,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function _m(e){return fr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function Cm(e){return fr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function of(e){const t=Vt();return w.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}var Ua=ex();const yN=WS(Ua);function vN(e,t){const r=Vt(),s=rN(t),{activeProps:i,inactiveProps:c,activeOptions:u,to:f,preload:h,preloadDelay:p,hashScrollIntoView:y,replace:v,startTransition:b,resetScroll:_,viewTransition:E,children:x,target:C,disabled:O,style:M,className:k,onClick:N,onFocus:U,onMouseEnter:H,onMouseLeave:L,onTouchStart:z,ignoreBlocker:Y,params:ie,search:ae,hash:oe,state:le,mask:ce,reloadDocument:me,unsafeRelative:I,from:K,_fromLocation:V,...te}=e,ve=Jx(),D=gt({select:nt=>nt.location.search,structuralSharing:!0}),Q=e.from,ne=w.useMemo(()=>({...e,from:Q}),[r,D,Q,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),re=w.useMemo(()=>r.buildLocation({...ne}),[r,ne]),ue=re.maskedLocation?re.maskedLocation.publicHref:re.publicHref,ye=re.maskedLocation?re.maskedLocation.external:re.external,X=w.useMemo(()=>CN(ue,ye,r.history,O),[O,ye,ue,r.history]),xe=w.useMemo(()=>{if(X?.external)return _u(X.href)?void 0:X.href;if(!EN(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),_u(f)?void 0:f}catch{}},[f,X]),Ce=gt({select:nt=>{if(xe)return!1;if(u?.exact){if(!NA(nt.location.pathname,re.pathname,r.basepath))return!1}else{const zt=Eu(nt.location.pathname,r.basepath),Bt=Eu(re.pathname,r.basepath);if(!(zt.startsWith(Bt)&&(zt.length===Bt.length||zt[Bt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!us(nt.location.search,re.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?ve&&nt.location.hash===re.hash:!0}}),Ee=Ce?xo(i,{})??bN:lp,Oe=Ce?lp:xo(c,{})??lp,ze=[k,Ee.className,Oe.className].filter(Boolean).join(" "),lt=(M||Ee.style||Oe.style)&&{...M,...Ee.style,...Oe.style},[Rt,ln]=w.useState(!1),_n=w.useRef(!1),Ut=e.reloadDocument||xe?!1:h??r.options.defaultPreload,yt=p??r.options.defaultPreloadDelay??0,se=w.useCallback(()=>{r.preloadRoute({...ne}).catch(nt=>{console.warn(nt),console.warn(uO)})},[r,ne]),ke=w.useCallback(nt=>{nt?.isIntersecting&&se()},[se]);nN(s,ke,_N,{disabled:!!O||Ut!=="viewport"}),w.useEffect(()=>{_n.current||!O&&Ut==="render"&&(se(),_n.current=!0)},[O,se,Ut]);const Ue=nt=>{const zt=nt.currentTarget.getAttribute("target"),Bt=C!==void 0?C:zt;if(!O&&!RN(nt)&&!nt.defaultPrevented&&(!Bt||Bt==="_self")&&nt.button===0){nt.preventDefault(),Ua.flushSync(()=>{ln(!0)});const Mc=r.subscribe("onResolved",()=>{Mc(),ln(!1)});r.navigate({...ne,replace:v,resetScroll:_,hashScrollIntoView:y,startTransition:b,viewTransition:E,ignoreBlocker:Y})}};if(xe)return{...te,ref:s,href:xe,...x&&{children:x},...C&&{target:C},...O&&{disabled:O},...M&&{style:M},...k&&{className:k},...N&&{onClick:N},...U&&{onFocus:U},...H&&{onMouseEnter:H},...L&&{onMouseLeave:L},...z&&{onTouchStart:z}};const De=nt=>{O||Ut&&se()},jt=De,Ht=nt=>{if(!(O||!Ut))if(!yt)se();else{const zt=nt.target;if(Zi.has(zt))return;const Bt=setTimeout(()=>{Zi.delete(zt),se()},yt);Zi.set(zt,Bt)}},Of=nt=>{if(O||!Ut||!yt)return;const zt=nt.target,Bt=Zi.get(zt);Bt&&(clearTimeout(Bt),Zi.delete(zt))};return{...te,...Ee,...Oe,href:X?.href,ref:s,onClick:Qi([N,Ue]),onFocus:Qi([U,De]),onMouseEnter:Qi([H,Ht]),onMouseLeave:Qi([L,Of]),onTouchStart:Qi([z,jt]),disabled:!!O,target:C,...lt&&{style:lt},...ze&&{className:ze},...O&&wN,...Ce&&SN,...ve&&Rt&&xN}}const lp={},bN={className:"active"},wN={role:"link","aria-disabled":!0},SN={"data-status":"active","aria-current":"page"},xN={"data-transitioning":"transitioning"},Zi=new WeakMap,_N={rootMargin:"100px"},Qi=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function CN(e,t,r,s){if(!s)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function EN(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const ls=w.forwardRef((e,t)=>{const{_asChild:r,...s}=e,{type:i,...c}=vN(s,t),u=typeof s.children=="function"?s.children({isActive:c["data-status"]==="active"}):s.children;if(!r){const{disabled:f,...h}=c;return w.createElement("a",h,u)}return w.createElement(r,c,u)});function RN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let TN=class extends bx{constructor(t){super(t),this.useMatch=r=>fr({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>fr({...r,from:this.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>Cm({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>_m({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>xm({...r,from:this.id}),this.useLoaderData=r=>Sm({...r,from:this.id}),this.useNavigate=()=>of({from:this.fullPath}),this.Link=Ft.forwardRef((r,s)=>g.jsx(ls,{ref:s,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}};function AN(e){return new TN(e)}class ON extends fO{constructor(t){super(t),this.useMatch=r=>fr({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>fr({...r,from:this.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>Cm({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>_m({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>xm({...r,from:this.id}),this.useLoaderData=r=>Sm({...r,from:this.id}),this.useNavigate=()=>of({from:this.fullPath}),this.Link=Ft.forwardRef((r,s)=>g.jsx(ls,{ref:s,from:this.fullPath,...r})),this.$$typeof=Symbol.for("react.memo")}}function kN(e){return new ON(e)}function $n(e){return typeof e=="object"?new nw(e,{silent:!0}).createRoute(e):new nw(e,{silent:!0}).createRoute}class nw{constructor(t,r){this.path=t,this.createRoute=s=>{this.silent;const i=AN(s);return i.isRoot=!1,i},this.silent=r?.silent}}class rw{constructor(t){this.useMatch=r=>fr({select:r?.select,from:this.options.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>fr({from:this.options.id,select:s=>r?.select?r.select(s.context):s.context}),this.useSearch=r=>Cm({select:r?.select,structuralSharing:r?.structuralSharing,from:this.options.id}),this.useParams=r=>_m({select:r?.select,structuralSharing:r?.structuralSharing,from:this.options.id}),this.useLoaderDeps=r=>xm({...r,from:this.options.id}),this.useLoaderData=r=>Sm({...r,from:this.options.id}),this.useNavigate=()=>{const r=Vt();return of({from:r.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function ow(e){return typeof e=="object"?new rw(e):t=>new rw({id:e,...t})}function hr(e,t){let r,s,i,c;const u=()=>(r||(r=e().then(h=>{r=void 0,s=h[t]}).catch(h=>{if(i=h,mA(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const p=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(p)||(sessionStorage.setItem(p,"1"),c=!0)}})),r),f=function(p){if(c)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!s)if(Ou)Ou(u());else throw u();return w.createElement(s,p)};return f.preload=u,f}function MN(){const e=Vt(),t=w.useRef({router:e,mounted:!1}),[r,s]=w.useState(!1),{hasPendingMatches:i,isLoading:c}=gt({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),u=rp(c),f=c||r||i,h=rp(f),p=c||i,y=rp(p);return e.startTransition=v=>{s(!0),w.startTransition(()=>{v(),s(!1)})},w.useEffect(()=>{const v=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return $r(e.latestLocation.publicHref)!==$r(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{v()}},[e,e.history]),Xl(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Xl(()=>{u&&!c&&e.emit({type:"onLoad",...fs(e.state)})},[u,e,c]),Xl(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...fs(e.state)})},[p,y,e]),Xl(()=>{if(h&&!f){const v=fs(e.state);e.emit({type:"onResolved",...v}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),v.hrefChanged&&qA(e)}},[f,h,e]),null}function NN(e){const t=gt({select:r=>`not-found-${r.location.pathname}-${r.status}`});return g.jsx(bm,{getResetKey:()=>t,onCatch:(r,s)=>{if(Gt(r))e.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(Gt(r))return e.fallback?.(r);throw r},children:e.children})}function jN(){return g.jsx("p",{children:"Not Found"})}function va(e){return g.jsx(g.Fragment,{children:e.children})}function t1(e,t,r){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...r}):g.jsx(jN,{})}function zN(){return Vt().isScrollRestoring,null}const n1=w.memo(function({matchId:t}){const r=Vt(),s=gt({select:x=>{const C=x.matches.findIndex(M=>M.id===t),O=x.matches[C];return an(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending,resetKey:x.loadedAt,parentRouteId:x.matches[C-1]?.routeId}},structuralSharing:!0}),i=r.routesById[s.routeId],c=i.options.pendingComponent??r.options.defaultPendingComponent,u=c?g.jsx(c,{}):null,f=i.options.errorComponent??r.options.defaultErrorComponent,h=i.options.onCatch??r.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??r.options.notFoundRoute?.options.component:i.options.notFoundComponent,y=s.ssr===!1||s.ssr==="data-only",v=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??c??(i.options.errorComponent?.preload||y))?w.Suspense:va,b=f?bm:va,_=p?NN:va,E=i.isRoot?i.options.shellComponent??va:va;return g.jsxs(E,{children:[g.jsx(rf.Provider,{value:t,children:g.jsx(v,{fallback:u,children:g.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||wm,onCatch:(x,C)=>{if(Gt(x))throw x;h?.(x,C)},children:g.jsx(_,{fallback:x=>{if(!p||x.routeId&&x.routeId!==s.routeId||!x.routeId&&!i.isRoot)throw x;return w.createElement(p,x)},children:y||s._displayPending?g.jsx(cN,{fallback:u,children:g.jsx(sw,{matchId:t})}):g.jsx(sw,{matchId:t})})})})}),s.parentRouteId===Ln&&r.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(DN,{}),g.jsx(zN,{})]}):null]})});function DN(){const e=Vt(),t=w.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:r=>{r&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...fs(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const sw=w.memo(function({matchId:t}){const r=Vt(),{match:s,key:i,routeId:c}=gt({select:h=>{const p=h.matches.find(E=>E.id===t),y=p.routeId,b=(r.routesById[y].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:y,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:y,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),u=r.routesById[c],f=w.useMemo(()=>{const h=u.options.component??r.options.defaultComponent;return h?g.jsx(h,{},i):g.jsx(r1,{})},[i,u.options.component,r.options.defaultComponent]);if(s._displayPending)throw r.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw r.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const h=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(h){const p=r.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const y=hs();p._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),p._nonReactive.minPendingPromise=void 0},h)}}throw r.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return an(Gt(s.error)),t1(r,u,s.error);if(s.status==="redirected")throw an(wn(s.error)),r.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),r1=w.memo(function(){const t=Vt(),r=w.useContext(rf),s=gt({select:p=>p.matches.find(y=>y.id===r)?.routeId}),i=t.routesById[s],c=gt({select:p=>{const v=p.matches.find(b=>b.id===r);return an(v),v.globalNotFound}}),u=gt({select:p=>{const y=p.matches,v=y.findIndex(b=>b.id===r);return y[v+1]?.id}}),f=t.options.defaultPendingComponent?g.jsx(t.options.defaultPendingComponent,{}):null;if(c)return t1(t,i,void 0);if(!u)return null;const h=g.jsx(n1,{matchId:u});return s===Ln?g.jsx(w.Suspense,{fallback:f,children:h}):h});function PN(){const e=Vt(),r=e.routesById[Ln].options.pendingComponent??e.options.defaultPendingComponent,s=r?g.jsx(r,{}):null,i=typeof document<"u"&&e.ssr?va:w.Suspense,c=g.jsxs(i,{fallback:s,children:[g.jsx(MN,{}),g.jsx(LN,{})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:c}):c}function LN(){const e=Vt(),t=gt({select:i=>i.matches[0]?.id}),r=gt({select:i=>i.loadedAt}),s=t?g.jsx(n1,{matchId:t}):null;return g.jsx(rf.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:g.jsx(bm,{getResetKey:()=>r,errorComponent:wm,onCatch:i=>{i.message||i.toString()},children:s})})}const IN=e=>new $N(e);class $N extends nO{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=$n,globalThis.createLazyFileRoute=ow):typeof window<"u"&&(window.createFileRoute=$n,window.createLazyFileRoute=ow);function UN({router:e,children:t,...r}){Object.keys(r).length>0&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const s=e1(),i=g.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:i}):i}function BN({router:e,...t}){return g.jsx(UN,{router:e,...t,children:g.jsx(PN,{})})}function o1({tag:e,attrs:t,children:r,nonce:s}){switch(e){case"title":return g.jsx("title",{...t,suppressHydrationWarning:!0,children:r});case"meta":return g.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return g.jsx("link",{...t,nonce:s,suppressHydrationWarning:!0});case"style":return g.jsx("style",{...t,dangerouslySetInnerHTML:{__html:r},nonce:s});case"script":return g.jsx(qN,{attrs:t,children:r});default:return null}}function qN({attrs:e,children:t}){Vt(),w.useEffect(()=>{if(e?.src){const r=(()=>{try{const c=document.baseURI||window.location.href;return new URL(e.src,c).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(c=>c.src===r))return;const i=document.createElement("script");for(const[c,u]of Object.entries(e))c!=="suppressHydrationWarning"&&u!==void 0&&u!==!1&&i.setAttribute(c,typeof u=="boolean"?"":String(u));return document.head.appendChild(i),()=>{i.parentNode&&i.parentNode.removeChild(i)}}if(typeof t=="string"){const r=typeof e?.type=="string"?e.type:"text/javascript",s=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(u=>{if(!(u instanceof HTMLScriptElement))return!1;const f=u.getAttribute("type")??"text/javascript",h=u.getAttribute("nonce")??void 0;return u.textContent===t&&f===r&&h===s}))return;const c=document.createElement("script");if(c.textContent=t,e)for(const[u,f]of Object.entries(e))u!=="suppressHydrationWarning"&&f!==void 0&&f!==!1&&c.setAttribute(u,typeof f=="boolean"?"":String(f));return document.head.appendChild(c),()=>{c.parentNode&&c.parentNode.removeChild(c)}}},[e,t]);{const{src:r,...s}=e||{};return g.jsx("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:""},...s})}}const FN=()=>{const e=Vt(),t=e.options.ssr?.nonce,r=gt({select:h=>h.matches.map(p=>p.meta).filter(Boolean)}),s=w.useMemo(()=>{const h=[],p={};let y;for(let v=r.length-1;v>=0;v--){const b=r[v];for(let _=b.length-1;_>=0;_--){const E=b[_];if(E)if(E.title)y||(y={tag:"title",children:E.title});else if("script:ld+json"in E)try{const x=JSON.stringify(E["script:ld+json"]);h.push({tag:"script",attrs:{type:"application/ld+json"},children:bA(x)})}catch{}else{const x=E.name??E.property;if(x){if(p[x])continue;p[x]=!0}h.push({tag:"meta",attrs:{...E,nonce:t}})}}}return y&&h.push(y),t&&h.push({tag:"meta",attrs:{property:"csp-nonce",content:t}}),h.reverse(),h},[r,t]),i=gt({select:h=>{const p=h.matches.map(b=>b.links).filter(Boolean).flat(1).map(b=>({tag:"link",attrs:{...b,nonce:t}})),y=e.ssr?.manifest,v=h.matches.map(b=>y?.routes[b.routeId]?.assets??[]).filter(Boolean).flat(1).filter(b=>b.tag==="link").map(b=>({tag:"link",attrs:{...b.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...p,...v]},structuralSharing:!0}),c=gt({select:h=>{const p=[];return h.matches.map(y=>e.looseRoutesById[y.routeId]).forEach(y=>e.ssr?.manifest?.routes[y.id]?.preloads?.filter(Boolean).forEach(v=>{p.push({tag:"link",attrs:{rel:"modulepreload",href:v,nonce:t}})})),p},structuralSharing:!0}),u=gt({select:h=>h.matches.map(p=>p.styles).flat(1).filter(Boolean).map(({children:p,...y})=>({tag:"style",attrs:{...y,nonce:t},children:p})),structuralSharing:!0}),f=gt({select:h=>h.matches.map(p=>p.headScripts).flat(1).filter(Boolean).map(({children:p,...y})=>({tag:"script",attrs:{...y,nonce:t},children:p})),structuralSharing:!0});return VN([...s,...c,...i,...u,...f],h=>JSON.stringify(h))};function VN(e,t){const r=new Set;return e.filter(s=>{const i=t(s);return r.has(i)?!1:(r.add(i),!0)})}function HN(){const e=FN(),r=Vt().options.ssr?.nonce;return g.jsx(g.Fragment,{children:e.map(s=>w.createElement(o1,{...s,key:`tsr-meta-${JSON.stringify(s)}`,nonce:r}))})}const ZN=()=>{const e=Vt(),t=e.options.ssr?.nonce,r=gt({select:u=>{const f=[],h=e.ssr?.manifest;return h?(u.matches.map(p=>e.looseRoutesById[p.routeId]).forEach(p=>h.routes[p.id]?.assets?.filter(y=>y.tag==="script").forEach(y=>{f.push({tag:"script",attrs:{...y.attrs,nonce:t},children:y.children})})),f):[]},structuralSharing:!0}),{scripts:s}=gt({select:u=>({scripts:u.matches.map(f=>f.scripts).flat(1).filter(Boolean).map(({children:f,...h})=>({tag:"script",attrs:{...h,suppressHydrationWarning:!0,nonce:t},children:f}))}),structuralSharing:!0});let i;e.serverSsr&&(i=e.serverSsr.takeBufferedScripts());const c=[...s,...r];return i&&c.unshift(i),g.jsx(g.Fragment,{children:c.map((u,f)=>w.createElement(o1,{...u,key:`tsr-scripts-${u.tag}-${f}`}))})};function s1(e){if(Array.isArray(e))return e.flatMap(y=>s1(y));if(typeof e!="string")return[];const t=[];let r=0,s,i,c,u,f;const h=()=>{for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length},p=()=>(i=e.charAt(r),i!=="="&&i!==";"&&i!==",");for(;r<e.length;){for(s=r,f=!1;h();)if(i=e.charAt(r),i===","){for(c=r,r+=1,h(),u=r;r<e.length&&p();)r+=1;r<e.length&&e.charAt(r)==="="?(f=!0,r=u,t.push(e.slice(s,c)),s=r):r=c+1}else r+=1;(!f||r>=e.length)&&t.push(e.slice(s))}return t}function QN(e){return e instanceof Headers?e:Array.isArray(e)?new Headers(e):typeof e=="object"?new Headers(e):null}function GN(...e){return e.reduce((t,r)=>{const s=QN(r);if(!s)return t;for(const[i,c]of s.entries())i==="set-cookie"?s1(c).forEach(f=>t.append("set-cookie",f)):t.set(i,c);return t},new Headers)}function YN(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e}async function KN(e){an(window.$_TSR);const t=e.options.serializationAdapters;if(t?.length){const x=new Map;t.forEach(C=>{x.set(C.key,C.fromSerializable)}),window.$_TSR.t=x,window.$_TSR.buffer.forEach(C=>C())}window.$_TSR.initialized=!0,an(window.$_TSR.router);const{manifest:r,dehydratedData:s,lastMatchId:i}=window.$_TSR.router;e.ssr={manifest:r};const u=document.querySelector('meta[property="csp-nonce"]')?.content;e.options.ssr={nonce:u};const f=e.matchRoutes(e.state.location),h=Promise.all(f.map(x=>{const C=e.looseRoutesById[x.routeId];return e.loadRouteChunk(C)}));function p(x){const O=e.looseRoutesById[x.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(O){const M=hs();x._nonReactive.minPendingPromise=M,x._forcePending=!0,setTimeout(()=>{M.resolve(),e.updateMatch(x.id,k=>(k._nonReactive.minPendingPromise=void 0,{...k,_forcePending:void 0}))},O)}}function y(x){const C=e.looseRoutesById[x.routeId];C&&(C.options.ssr=x.ssr)}let v;f.forEach(x=>{const C=window.$_TSR.router.matches.find(O=>O.i===x.id);if(!C){x._nonReactive.dehydrated=!1,x.ssr=!1,y(x);return}YN(x,C),y(x),x._nonReactive.dehydrated=x.ssr!==!1,(x.ssr==="data-only"||x.ssr===!1)&&v===void 0&&(v=x.index,p(x))}),e.__store.setState(x=>({...x,matches:f})),await e.options.hydrate?.(s),await Promise.all(e.state.matches.map(async x=>{try{const C=e.looseRoutesById[x.routeId],M=e.state.matches[x.index-1]?.context??e.options.context;if(C.options.context){const H={deps:x.loaderDeps,params:x.params,context:M??{},location:e.state.location,navigate:L=>e.navigate({...L,_fromLocation:e.state.location}),buildLocation:e.buildLocation,cause:x.cause,abortController:x.abortController,preload:!1,matches:f};x.__routeContext=C.options.context(H)??void 0}x.context={...M,...x.__routeContext,...x.__beforeLoadContext};const k={ssr:e.options.ssr,matches:e.state.matches,match:x,params:x.params,loaderData:x.loaderData},N=await C.options.head?.(k),U=await C.options.scripts?.(k);x.meta=N?.meta,x.links=N?.links,x.headScripts=N?.scripts,x.styles=N?.styles,x.scripts=U}catch(C){if(Gt(C))x.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${x.routeId}`,C);else throw x.error=C,console.error(`Error during hydration for route ${x.routeId}:`,C),C}}));const b=f[f.length-1].id!==i;if(!f.some(x=>x.ssr===!1)&&!b)return f.forEach(x=>{x._nonReactive.dehydrated=void 0}),h;const E=Promise.resolve().then(()=>e.load()).catch(x=>{console.error("Error during router hydration:",x)});if(b){const x=f[1];an(x),p(x),x._displayPending=!0,x._nonReactive.displayPendingPromise=E,E.then(()=>{Ca(()=>{e.__store.state.status==="pending"&&e.__store.setState(C=>({...C,status:"idle",resolvedLocation:C.location})),e.updateMatch(x.id,C=>({...C,_displayPending:void 0,displayPendingPromise:void 0}))})})}return h}const XN="__TSS_CONTEXT",qp=Symbol.for("TSS_SERVER_FUNCTION"),aw=Symbol.for("TSS_SERVER_FUNCTION_FACTORY"),JN="x-tss-serialized",WN="x-tss-raw",a1="application/x-tss-framed",Dr={JSON:0,CHUNK:1,END:2,ERROR:3},da=9,iw=1,ej=/;\s*v=(\d+)/;function tj(e){const t=e.match(ej);return t?parseInt(t[1],10):void 0}function nj(e){const t=tj(e);if(t!==void 0&&t!==iw)throw new Error(`Incompatible framed protocol version: server=${t}, client=${iw}. Please ensure client and server are using compatible versions.`)}const Em=()=>window.__TSS_START_OPTIONS__;function rj(){return[...Em()?.serializationAdapters?.map($M)??[],...eN]}const cw=new TextDecoder,oj=new Uint8Array(0),lw=16*1024*1024,uw=32*1024*1024,fw=1024,dw=1e5;function sj(e){const t=new Map,r=new Map,s=new Set;let i=!1,c=null,u=0,f;const h=new ReadableStream({start(v){f=v},cancel(){i=!0;try{c?.cancel()}catch{}t.forEach(v=>{try{v.error(new Error("Framed response cancelled"))}catch{}}),t.clear(),r.clear(),s.clear()}});function p(v){const b=r.get(v);if(b)return b;if(s.has(v))return new ReadableStream({start(E){E.close()}});if(r.size>=fw)throw new Error(`Too many raw streams in framed response (max ${fw})`);const _=new ReadableStream({start(E){t.set(v,E)},cancel(){s.add(v),t.delete(v),r.delete(v)}});return r.set(v,_),_}function y(v){return p(v),t.get(v)}return(async()=>{const v=e.getReader();c=v;const b=[];let _=0;function E(){if(_<da)return null;const C=b[0];if(C.length>=da){const L=C[0],z=(C[1]<<24|C[2]<<16|C[3]<<8|C[4])>>>0,Y=(C[5]<<24|C[6]<<16|C[7]<<8|C[8])>>>0;return{type:L,streamId:z,length:Y}}const O=new Uint8Array(da);let M=0,k=da;for(let L=0;L<b.length&&k>0;L++){const z=b[L],Y=Math.min(z.length,k);O.set(z.subarray(0,Y),M),M+=Y,k-=Y}const N=O[0],U=(O[1]<<24|O[2]<<16|O[3]<<8|O[4])>>>0,H=(O[5]<<24|O[6]<<16|O[7]<<8|O[8])>>>0;return{type:N,streamId:U,length:H}}function x(C){if(C===0)return oj;const O=new Uint8Array(C);let M=0,k=C;for(;k>0&&b.length>0;){const N=b[0];if(!N)break;const U=Math.min(N.length,k);O.set(N.subarray(0,U),M),M+=U,k-=U,U===N.length?b.shift():b[0]=N.subarray(U)}return _-=C,O}try{for(;;){const{done:C,value:O}=await v.read();if(i||C)break;if(O){if(_+O.length>uw)throw new Error(`Framed response buffer exceeded ${uw} bytes`);for(b.push(O),_+=O.length;;){const M=E();if(!M)break;const{type:k,streamId:N,length:U}=M;if(k!==Dr.JSON&&k!==Dr.CHUNK&&k!==Dr.END&&k!==Dr.ERROR)throw new Error(`Unknown frame type: ${k}`);if(k===Dr.JSON){if(N!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(N===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if(U>lw)throw new Error(`Frame payload too large: ${U} bytes (max ${lw})`);const H=da+U;if(_<H)break;if(++u>dw)throw new Error(`Too many frames in framed response (max ${dw})`);x(da);const L=x(U);switch(k){case Dr.JSON:{try{f.enqueue(cw.decode(L))}catch{}break}case Dr.CHUNK:{const z=y(N);z&&z.enqueue(L);break}case Dr.END:{const z=y(N);if(s.add(N),z){try{z.close()}catch{}t.delete(N)}break}case Dr.ERROR:{const z=y(N);if(s.add(N),z){const Y=cw.decode(L);z.error(new Error(Y)),t.delete(N)}break}}}}}if(_!==0)throw new Error("Incomplete frame at end of framed response");try{f.close()}catch{}t.forEach(C=>{try{C.close()}catch{}}),t.clear()}catch(C){try{f.error(C)}catch{}t.forEach(O=>{try{O.error(C)}catch{}}),t.clear()}finally{try{v.releaseLock()}catch{}c=null}})(),{getOrCreateStream:p,jsonChunks:h}}let Oa=null;const aj=Object.prototype.hasOwnProperty;function i1(e){for(const t in e)if(aj.call(e,t))return!0;return!1}async function ij(e,t,r){Oa||(Oa=rj());const i=t[0],c=i.fetch??r,u=i.data instanceof FormData?"formData":"payload",f=i.headers?new Headers(i.headers):new Headers;if(f.set("x-tsr-serverFn","true"),u==="payload"&&f.set("accept",`${a1}, application/x-ndjson, application/json`),i.method==="GET"){if(u==="formData")throw new Error("FormData is not supported with GET requests");const p=await c1(i);if(p!==void 0){const y=cx({payload:p});e.includes("?")?e+=`&${y}`:e+=`?${y}`}}let h;if(i.method==="POST"){const p=await cj(i);p?.contentType&&f.set("content-type",p.contentType),h=p?.body}return await lj(async()=>c(e,{method:i.method,headers:f,signal:i.signal,body:h}))}async function c1(e){let t=!1;const r={};if(e.data!==void 0&&(t=!0,r.data=e.data),e.context&&i1(e.context)&&(t=!0,r.context=e.context),t)return l1(r)}async function l1(e){return JSON.stringify(await Promise.resolve(IM(e,{plugins:Oa})))}async function cj(e){if(e.data instanceof FormData){let r;return e.context&&i1(e.context)&&(r=await l1(e.context)),r!==void 0&&e.data.set(XN,r),{body:e.data}}const t=await c1(e);if(t)return{body:t,contentType:"application/json"}}async function lj(e){let t;try{t=await e()}catch(i){if(i instanceof Response)t=i;else throw console.log(i),i}if(t.headers.get(WN)==="true")return t;const r=t.headers.get("content-type");if(an(r),!!t.headers.get(JN)){let i;if(r.includes(a1)){if(nj(r),!t.body)throw new Error("No response body for framed response");const{getOrCreateStream:c,jsonChunks:u}=sj(t.body),h=[WM(c),...Oa||[]],p=new Map;i=await fj({jsonStream:u,onMessage:y=>np(y,{refs:p,plugins:h}),onError(y,v){console.error(y,v)}})}else if(r.includes("application/x-ndjson")){const c=new Map;i=await uj({response:t,onMessage:u=>np(u,{refs:c,plugins:Oa}),onError(u,f){console.error(u,f)}})}else if(r.includes("application/json")){const c=await t.json();i=np(c,{plugins:Oa})}if(an(i),i instanceof Error)throw i;return i}if(r.includes("application/json")){const i=await t.json(),c=ux(i);if(c)throw c;if(Gt(i))throw i;return i}if(!t.ok)throw new Error(await t.text());return t}async function uj({response:e,onMessage:t,onError:r}){if(!e.body)throw new Error("No response body");const s=e.body.pipeThrough(new TextDecoderStream).getReader();let i="",c=!1,u;for(;!c;){const{value:f,done:h}=await s.read();if(f&&(i+=f),i.length===0&&h)throw new Error("Stream ended before first object");if(i.endsWith(`
13
+ `)){const p=i.split(`
14
+ `).filter(Boolean),y=p[0];if(!y)throw new Error("No JSON line in the first chunk");u=JSON.parse(y),c=!0,i=p.slice(1).join(`
15
+ `)}else{const p=i.indexOf(`
16
+ `);if(p>=0){const y=i.slice(0,p).trim();i=i.slice(p+1),y.length>0&&(u=JSON.parse(y),c=!0)}}}return(async()=>{try{for(;;){const{value:f,done:h}=await s.read();f&&(i+=f);const p=i.lastIndexOf(`
17
+ `);if(p>=0){const y=i.slice(0,p);i=i.slice(p+1);const v=y.split(`
18
+ `).filter(Boolean);for(const b of v)try{t(JSON.parse(b))}catch(_){r?.(`Invalid JSON line: ${b}`,_)}}if(h)break}}catch(f){r?.("Stream processing error:",f)}})(),t(u)}async function fj({jsonStream:e,onMessage:t,onError:r}){const s=e.getReader(),{value:i,done:c}=await s.read();if(c||!i)throw new Error("Stream ended before first object");const u=JSON.parse(i);return(async()=>{try{for(;;){const{value:f,done:h}=await s.read();if(h)break;if(f)try{t(JSON.parse(f))}catch(p){r?.(`Invalid JSON: ${f}`,p)}}}catch(f){r?.("Stream processing error:",f)}})(),t(u)}function u1(e){const t="/_serverFn/"+e;return Object.assign((...i)=>{const c=Em()?.serverFns?.fetch;return ij(t,i,c??fetch)},{url:t,serverFnMeta:{id:e},[qp]:!0})}const dj={key:"$TSS/serverfn",test:e=>typeof e!="function"||!(qp in e)?!1:!!e[qp],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>u1(e)};var ar=[],Pn=[],hj=Uint8Array,up="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var ha=0,pj=up.length;ha<pj;++ha)ar[ha]=up[ha],Pn[up.charCodeAt(ha)]=ha;Pn[45]=62;Pn[95]=63;function mj(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var s=r===t?0:4-r%4;return[r,s]}function gj(e,t,r){return(t+r)*3/4-r}function uc(e){var t,r=mj(e),s=r[0],i=r[1],c=new hj(gj(e,s,i)),u=0,f=i>0?s-4:s,h;for(h=0;h<f;h+=4)t=Pn[e.charCodeAt(h)]<<18|Pn[e.charCodeAt(h+1)]<<12|Pn[e.charCodeAt(h+2)]<<6|Pn[e.charCodeAt(h+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return i===2&&(t=Pn[e.charCodeAt(h)]<<2|Pn[e.charCodeAt(h+1)]>>4,c[u++]=t&255),i===1&&(t=Pn[e.charCodeAt(h)]<<10|Pn[e.charCodeAt(h+1)]<<4|Pn[e.charCodeAt(h+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function yj(e){return ar[e>>18&63]+ar[e>>12&63]+ar[e>>6&63]+ar[e&63]}function vj(e,t,r){for(var s,i=[],c=t;c<r;c+=3)s=(e[c]<<16&16711680)+(e[c+1]<<8&65280)+(e[c+2]&255),i.push(yj(s));return i.join("")}function fc(e){for(var t,r=e.length,s=r%3,i=[],c=16383,u=0,f=r-s;u<f;u+=c)i.push(vj(e,u,u+c>f?f:u+c));return s===1?(t=e[r-1],i.push(ar[t>>2]+ar[t<<4&63]+"==")):s===2&&(t=(e[r-2]<<8)+e[r-1],i.push(ar[t>>10]+ar[t>>4&63]+ar[t<<2&63]+"=")),i.join("")}function Ir(e){if(e===void 0)return{};if(!f1(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function bj(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function f1(e){const t=typeof e=="object",r=Object.getPrototypeOf(e),s=r===null||r===Object.prototype||r?.constructor?.name==="Object";return t&&s}const d1=!0,Da=BigInt("-9223372036854775808"),Rm=BigInt("9223372036854775807"),Fp=BigInt("0"),wj=BigInt("8"),Sj=BigInt("256");function h1(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function xj(e){e<Fp&&(e-=Da+Da);let t=e.toString(16);t.length%2===1&&(t="0"+t);const r=new Uint8Array(new ArrayBuffer(8));let s=0;for(const i of t.match(/.{2}/g).reverse())r.set([parseInt(i,16)],s++),e>>=wj;return fc(r)}function _j(e){const t=uc(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let r=Fp,s=Fp;for(const i of t)r+=BigInt(i)*Sj**s,s++;return r>Rm&&(r+=Da+Da),r}function Cj(e){if(e<Da||Rm<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),fc(new Uint8Array(t))}function Ej(e){const t=uc(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const Rj=DataView.prototype.setBigInt64?Cj:xj,Tj=DataView.prototype.getBigInt64?Ej:_j,hw=1024;function p1(e){if(e.length>hw)throw new Error(`Field name ${e} exceeds maximum field name length ${hw}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const r=e.charCodeAt(t);if(r<32||r>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function Pa(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(s=>Pa(s));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);const t=Object.entries(e);if(t.length===1){const s=t[0][0];if(s==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return uc(e.$bytes).buffer}if(s==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return Tj(e.$integer)}if(s==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);const i=uc(e.$float);if(i.byteLength!==8)throw new Error(`Received ${i.byteLength} bytes, expected 8 for $float`);const u=new DataView(i.buffer).getFloat64(0,d1);if(!h1(u))throw new Error(`Float ${u} should be encoded as a number`);return u}if(s==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(s==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const r={};for(const[s,i]of Object.entries(e))p1(s),r[s]=Pa(i);return r}const pw=16384;function oc(e){const t=JSON.stringify(e,(r,s)=>s===void 0?"undefined":typeof s=="bigint"?`${s.toString()}n`:s);if(t.length>pw){const r="[...truncated]";let s=pw-r.length;const i=t.codePointAt(s-1);return i!==void 0&&i>65535&&(s-=1),t.substring(0,s)+r}return t}function Vp(e,t,r,s){if(e===void 0){const u=r&&` (present at path ${r} in original object ${oc(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<Da||Rm<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:Rj(e)}}if(typeof e=="number")if(h1(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,d1),{$float:fc(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:fc(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,f)=>Vp(u,t,r+`[${f}]`));if(e instanceof Set)throw new Error(fp(r,"Set",[...e],t));if(e instanceof Map)throw new Error(fp(r,"Map",[...e],t));if(!f1(e)){const u=e?.constructor?.name,f=u?`${u} `:"";throw new Error(fp(r,f,e,t))}const i={},c=Object.entries(e);c.sort(([u,f],[h,p])=>u===h?0:u<h?-1:1);for(const[u,f]of c)f!==void 0&&(p1(u),i[u]=Vp(f,t,r+`.${u}`));return i}function fp(e,t,r,s){return e?`${t}${oc(r)} is not a supported Convex type (present at path ${e} in original object ${oc(s)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${oc(r)} is not a supported Convex type.`}function Yn(e){return Vp(e,e,"")}var Aj=Object.defineProperty,Oj=(e,t,r)=>t in e?Aj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,at=(e,t,r)=>Oj(e,typeof t!="symbol"?t+"":t,r);const kj="https://docs.convex.dev/error#undefined-validator";function dc(e,t){const r=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${r} in ${e}. This is often caused by circular imports. See ${kj} for details.`)}class xn{constructor({isOptional:t}){at(this,"type"),at(this,"fieldPaths"),at(this,"isOptional"),at(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}}class Tm extends xn{constructor({isOptional:t,tableName:r}){if(super({isOptional:t}),at(this,"tableName"),at(this,"kind","id"),typeof r!="string")throw new Error("v.id(tableName) requires a string");this.tableName=r}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new Tm({isOptional:"optional",tableName:this.tableName})}}class ku extends xn{constructor(){super(...arguments),at(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new ku({isOptional:"optional"})}}class Mu extends xn{constructor(){super(...arguments),at(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new Mu({isOptional:"optional"})}}class Am extends xn{constructor(){super(...arguments),at(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new Am({isOptional:"optional"})}}class Om extends xn{constructor(){super(...arguments),at(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new Om({isOptional:"optional"})}}class km extends xn{constructor(){super(...arguments),at(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new km({isOptional:"optional"})}}class Mm extends xn{constructor(){super(...arguments),at(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new Mm({isOptional:"optional"})}}class Nm extends xn{constructor(){super(...arguments),at(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new Nm({isOptional:"optional"})}}class os extends xn{constructor({isOptional:t,fields:r}){super({isOptional:t}),at(this,"fields"),at(this,"kind","object"),globalThis.Object.entries(r).forEach(([s,i])=>{if(i===void 0&&dc("v.object()",s),!i.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=r}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,r])=>[t,{fieldType:r.json,optional:r.isOptional==="optional"}]))}}asOptional(){return new os({isOptional:"optional",fields:this.fields})}omit(...t){const r={...this.fields};for(const s of t)delete r[s];return new os({isOptional:this.isOptional,fields:r})}pick(...t){const r={};for(const s of t)r[s]=this.fields[s];return new os({isOptional:this.isOptional,fields:r})}partial(){const t={};for(const[r,s]of globalThis.Object.entries(this.fields))t[r]=s.asOptional();return new os({isOptional:this.isOptional,fields:t})}extend(t){return new os({isOptional:this.isOptional,fields:{...this.fields,...t}})}}class jm extends xn{constructor({isOptional:t,value:r}){if(super({isOptional:t}),at(this,"value"),at(this,"kind","literal"),typeof r!="string"&&typeof r!="boolean"&&typeof r!="number"&&typeof r!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=r}get json(){return{type:this.kind,value:Yn(this.value)}}asOptional(){return new jm({isOptional:"optional",value:this.value})}}class zm extends xn{constructor({isOptional:t,element:r}){super({isOptional:t}),at(this,"element"),at(this,"kind","array"),r===void 0&&dc("v.array()"),this.element=r}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new zm({isOptional:"optional",element:this.element})}}class Dm extends xn{constructor({isOptional:t,key:r,value:s}){if(super({isOptional:t}),at(this,"key"),at(this,"value"),at(this,"kind","record"),r===void 0&&dc("v.record()","key"),s===void 0&&dc("v.record()","value"),r.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(s.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!r.isConvexValidator||!s.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=r,this.value=s}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new Dm({isOptional:"optional",key:this.key,value:this.value})}}class Pm extends xn{constructor({isOptional:t,members:r}){super({isOptional:t}),at(this,"members"),at(this,"kind","union"),r.forEach((s,i)=>{if(s===void 0&&dc("v.union()",`member at index ${i}`),!s.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=r}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new Pm({isOptional:"optional",members:this.members})}}const et={id:e=>new Tm({isOptional:"required",tableName:e}),null:()=>new Mm({isOptional:"required"}),number:()=>new ku({isOptional:"required"}),float64:()=>new ku({isOptional:"required"}),bigint:()=>new Mu({isOptional:"required"}),int64:()=>new Mu({isOptional:"required"}),boolean:()=>new Am({isOptional:"required"}),string:()=>new km({isOptional:"required"}),bytes:()=>new Om({isOptional:"required"}),literal:e=>new jm({isOptional:"required",value:e}),array:e=>new zm({isOptional:"required",element:e}),object:e=>new os({isOptional:"required",fields:e}),record:(e,t)=>new Dm({isOptional:"required",key:e,value:t}),union:(...e)=>new Pm({isOptional:"required",members:e}),any:()=>new Nm({isOptional:"required"}),optional:e=>e.asOptional(),nullable:e=>et.union(e,et.null())};var Mj=Object.defineProperty,Nj=(e,t,r)=>t in e?Mj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dp=(e,t,r)=>Nj(e,typeof t!="symbol"?t+"":t,r),mw,gw;const jj=Symbol.for("ConvexError");class Hp extends(gw=Error,mw=jj,gw){constructor(t){super(typeof t=="string"?t:oc(t)),dp(this,"name","ConvexError"),dp(this,"data"),dp(this,mw,!0),this.data=t}}const m1=()=>Array.from({length:4},()=>0);m1();m1();const yw="1.31.6";var zj=Object.defineProperty,Dj=(e,t,r)=>t in e?zj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vw=(e,t,r)=>Dj(e,typeof t!="symbol"?t+"":t,r);const Pj="color:rgb(0, 145, 255)";function g1(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class y1{constructor(t){vw(this,"_onLogLineFuncs"),vw(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let r=Math.random().toString(36).substring(2,15);for(let s=0;s<10&&this._onLogLineFuncs[r]!==void 0;s++)r=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[r]=t,()=>{delete this._onLogLineFuncs[r]}}logVerbose(...t){if(this._verbose)for(const r of Object.values(this._onLogLineFuncs))r("debug",`${new Date().toISOString()}`,...t)}log(...t){for(const r of Object.values(this._onLogLineFuncs))r("info",...t)}warn(...t){for(const r of Object.values(this._onLogLineFuncs))r("warn",...t)}error(...t){for(const r of Object.values(this._onLogLineFuncs))r("error",...t)}}function v1(e){const t=new y1(e);return t.addLogLineListener((r,...s)=>{switch(r){case"debug":console.debug(...s);break;case"info":console.log(...s);break;case"warn":console.warn(...s);break;case"error":console.error(...s);break;default:console.log(...s)}}),t}function b1(e){return new y1(e)}function Nu(e,t,r,s,i){const c=g1(r);if(typeof i=="object"&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t==="info"){const u=i.match(/^\[.*?\] /);if(u===null){e.error(`[CONVEX ${c}(${s})] Could not parse console.log`);return}const f=i.slice(1,u[0].length-2),h=i.slice(u[0].length);e.log(`%c[CONVEX ${c}(${s})] [${f}]`,Pj,h)}else e.error(`[CONVEX ${c}(${s})] ${i}`)}function Lj(e,t){const r=`[CONVEX FATAL ERROR] ${t}`;return e.error(r),new Error(r)}function Sa(e,t,r){return`[CONVEX ${g1(e)}(${t})] ${r.errorMessage}
19
+ Called by client`}function Zp(e,t){return t.data=e.errorData,t}function gs(e){const t=e.split(":");let r,s;return t.length===1?(r=t[0],s="default"):(r=t.slice(0,t.length-1).join(":"),s=t[t.length-1]),r.endsWith(".js")&&(r=r.slice(0,-3)),`${r}:${s}`}function ds(e,t){return JSON.stringify({udfPath:gs(e),args:Yn(t)})}function bw(e,t,r){const{initialNumItems:s,id:i}=r;return JSON.stringify({type:"paginated",udfPath:gs(e),args:Yn(t),options:Yn({initialNumItems:s,id:i})})}var Ij=Object.defineProperty,$j=(e,t,r)=>t in e?Ij(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,or=(e,t,r)=>$j(e,typeof t!="symbol"?t+"":t,r);class Uj{constructor(){or(this,"nextQueryId"),or(this,"querySetVersion"),or(this,"querySet"),or(this,"queryIdToToken"),or(this,"identityVersion"),or(this,"auth"),or(this,"outstandingQueriesOlderThanRestart"),or(this,"outstandingAuthOlderThanRestart"),or(this,"paused"),or(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,r,s,i){const c=gs(t),u=ds(c,r),f=this.querySet.get(u);if(f!==void 0)return f.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,p={id:h,canonicalizedUdfPath:c,args:r,numSubscribers:1,journal:s,componentPath:i};this.querySet.set(u,p),this.queryIdToToken.set(h,u);const y=this.querySetVersion,v=this.querySetVersion+1,b={type:"Add",queryId:h,udfPath:c,args:[Yn(r)],journal:s,componentPath:i};return this.paused?this.pendingQuerySetModifications.set(h,b):this.querySetVersion=v,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:y,newVersion:v,modifications:[b]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const r of t.modifications)switch(r.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(r.queryId);const s=r.journal;if(s!==void 0){const i=this.queryIdToToken.get(r.queryId);i!==void 0&&(this.querySet.get(i).journal=s)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}}queryId(t,r){const s=gs(t),i=ds(s,r),c=this.querySet.get(i);return c!==void 0?c.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const r=this.identityVersion;return this.paused||(this.identityVersion=r+1),{type:"Authenticate",baseVersion:r,...this.auth}}setAdminAuth(t,r){const s={tokenType:"Admin",value:t,impersonating:r};this.auth=s;const i=this.identityVersion;return this.paused||(this.identityVersion=i+1),{type:"Authenticate",baseVersion:i,...s}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const r=this.queryIdToToken.get(t);return r?this.querySet.get(r).canonicalizedUdfPath:null}queryArgs(t){const r=this.queryIdToToken.get(t);return r?this.querySet.get(r).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const r=[];for(const c of this.querySet.values()){const u={type:"Add",queryId:c.id,udfPath:c.canonicalizedUdfPath,args:[Yn(c.args)],journal:c.journal,componentPath:c.componentPath};r.push(u),t.has(c.id)||this.outstandingQueriesOlderThanRestart.add(c.id)}this.querySetVersion=1;const s={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:r};if(!this.auth)return this.identityVersion=0,[s,void 0];this.outstandingAuthOlderThanRestart=!0;const i={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[s,i]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,r=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,r]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const r=this.querySet.get(t);if(r.numSubscribers>1)return r.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(r.id),this.outstandingQueriesOlderThanRestart.delete(r.id);const s=this.querySetVersion,i=this.querySetVersion+1,c={type:"Remove",queryId:r.id};return this.paused?this.pendingQuerySetModifications.has(r.id)?this.pendingQuerySetModifications.delete(r.id):this.pendingQuerySetModifications.set(r.id,c):this.querySetVersion=i,{type:"ModifyQuerySet",baseVersion:s,newVersion:i,modifications:[c]}}}}var Bj=Object.defineProperty,qj=(e,t,r)=>t in e?Bj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Jl=(e,t,r)=>qj(e,typeof t!="symbol"?t+"":t,r);class Fj{constructor(t,r){this.logger=t,this.markConnectionStateDirty=r,Jl(this,"inflightRequests"),Jl(this,"requestsOlderThanRestart"),Jl(this,"inflightMutationsCount",0),Jl(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,r){const s=new Promise(i=>{const c=r?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:c,requestedAt:new Date,onResult:i}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),s}onResponse(t){const r=this.inflightRequests.get(t.requestId);if(r===void 0||r.status.status==="Completed")return null;const s=r.message.type==="Mutation"?"mutation":"action",i=r.message.udfPath;for(const h of t.logLines)Nu(this.logger,"info",s,i,h);const c=r.status;let u,f;if(t.success)u={success:!0,logLines:t.logLines,value:Pa(t.result)},f=()=>c.onResult(u);else{const h=t.result,{errorData:p}=t;Nu(this.logger,"error",s,i,h),u={success:!1,errorMessage:h,errorData:p!==void 0?Pa(p):void 0,logLines:t.logLines},f=()=>c.onResult(u)}return t.type==="ActionResponse"||!t.success?(f(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),r.message.type==="Action"?this.inflightActionsCount--:r.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(r.status={status:"Completed",result:u,ts:t.ts,onResolve:f},null)}removeCompleted(t){const r=new Map;for(const[s,i]of this.inflightRequests.entries()){const c=i.status;c.status==="Completed"&&c.ts.lessThanOrEqual(t)&&(c.onResolve(),r.set(s,c.result),i.message.type==="Mutation"?this.inflightMutationsCount--:i.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s))}return r.size>0&&this.markConnectionStateDirty(),r}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[r,s]of this.inflightRequests){if(s.status.status==="NotSent"){s.status.status="Requested",t.push(s.message);continue}if(s.message.type==="Mutation")t.push(s.message);else if(s.message.type==="Action"){if(this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r),this.inflightActionsCount--,s.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");s.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,r]of this.inflightRequests)if(r.status.status==="NotSent"){r.status.status="Requested",t.push(r.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const r of this.inflightRequests.values())r.status.status!=="Completed"&&r.status.requestedAt.getTime()<t&&(t=r.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const hc=Symbol.for("functionName"),w1=Symbol.for("toReferencePath");function Vj(e){return e[w1]??null}function Hj(e){return e.startsWith("function://")}function Zj(e){let t;if(typeof e=="string")Hj(e)?t={functionHandle:e}:t={name:e};else if(e[hc])t={name:e[hc]};else{const r=Vj(e);if(!r)throw new Error(`${e} is not a functionReference`);t={reference:r}}return t}function sn(e){const t=Zj(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const r=e[hc];if(!r)throw new Error(`${e} is not a functionReference`);return r}function S1(e){return{[hc]:e}}function x1(e=[]){const t={get(r,s){if(typeof s=="string"){const i=[...e,s];return x1(i)}else if(s===hc){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const i=e.slice(0,-1).join("/"),c=e[e.length-1];return c==="default"?i:i+":"+c}else return s===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}const Qj=x1();var Gj=Object.defineProperty,Yj=(e,t,r)=>t in e?Gj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ju=(e,t,r)=>Yj(e,typeof t!="symbol"?t+"":t,r);class pc{constructor(t){ju(this,"queryResults"),ju(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...r){const s=Ir(r[0]),i=sn(t),c=this.queryResults.get(ds(i,s));if(c!==void 0)return pc.queryValue(c.result)}getAllQueries(t){const r=[],s=sn(t);for(const i of this.queryResults.values())i.udfPath===gs(s)&&r.push({args:i.args,value:pc.queryValue(i.result)});return r}setQuery(t,r,s){const i=Ir(r),c=sn(t),u=ds(c,i);let f;s===void 0?f=void 0:f={success:!0,value:s,logLines:[]};const h={udfPath:c,args:i,result:f};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class Kj{constructor(){ju(this,"queryResults"),ju(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,r){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!r.has(u.mutationId));const s=this.queryResults;this.queryResults=new Map(t);const i=new pc(this.queryResults);for(const u of this.optimisticUpdates)u.update(i);const c=[];for(const[u,f]of this.queryResults){const h=s.get(u);(h===void 0||h.result!==f.result)&&c.push(u)}return c}applyOptimisticUpdate(t,r){this.optimisticUpdates.push({update:t,mutationId:r});const s=new pc(this.queryResults);return t(s),s.modifiedQueries}rawQueryResult(t){const r=this.queryResults.get(t);if(r!==void 0)return r.result}queryResult(t){const r=this.queryResults.get(t);if(r===void 0)return;const s=r.result;if(s!==void 0){if(s.success)return s.value;throw s.errorData!==void 0?Zp(s,new Hp(Sa("query",r.udfPath,s))):new Error(Sa("query",r.udfPath,s))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var Xj=Object.defineProperty,Jj=(e,t,r)=>t in e?Xj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hp=(e,t,r)=>Jj(e,typeof t!="symbol"?t+"":t,r);class on{constructor(t,r){hp(this,"low"),hp(this,"high"),hp(this,"__isUnsignedLong__"),this.low=t|0,this.high=r|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new on(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?ww:t>=Wj?ez:new on(t%sc|0,t/sc|0)}toString(){return(BigInt(this.high)*BigInt(sc)+BigInt(this.low)).toString()}equals(t){return on.isLong(t)||(t=on.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return on.isLong(t)||(t=on.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?on.fromNumber(t):new on(t.low,t.high)}}const ww=new on(0,0),Sw=65536,sc=Sw*Sw,Wj=sc*sc,ez=new on(-1,-1);var tz=Object.defineProperty,nz=(e,t,r)=>t in e?tz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wl=(e,t,r)=>nz(e,typeof t!="symbol"?t+"":t,r);class xw{constructor(t,r){Wl(this,"version"),Wl(this,"remoteQuerySet"),Wl(this,"queryPath"),Wl(this,"logger"),this.version={querySet:0,ts:on.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=r}transition(t){const r=t.startVersion;if(this.version.querySet!==r.querySet||this.version.ts.notEquals(r.ts)||this.version.identity!==r.identity)throw new Error(`Invalid start version: ${r.ts.toString()}:${r.querySet}:${r.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const s of t.modifications)switch(s.type){case"QueryUpdated":{const i=this.queryPath(s.queryId);if(i)for(const u of s.logLines)Nu(this.logger,"info","query",i,u);const c=Pa(s.value??null);this.remoteQuerySet.set(s.queryId,{success:!0,value:c,logLines:s.logLines});break}case"QueryFailed":{const i=this.queryPath(s.queryId);if(i)for(const u of s.logLines)Nu(this.logger,"info","query",i,u);const{errorData:c}=s;this.remoteQuerySet.set(s.queryId,{success:!1,errorMessage:s.errorMessage,errorData:c!==void 0?Pa(c):void 0,logLines:s.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(s.queryId);break}default:throw new Error(`Invalid modification ${s.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function pp(e){const t=uc(e);return on.fromBytesLE(Array.from(t))}function rz(e){const t=new Uint8Array(e.toBytesLE());return fc(t)}function _w(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:pp(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:pp(e.startVersion.ts)},endVersion:{...e.endVersion,ts:pp(e.endVersion.ts)}}}}function oz(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:rz(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var sz=Object.defineProperty,az=(e,t,r)=>t in e?sz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xt=(e,t,r)=>az(e,typeof t!="symbol"?t+"":t,r);const iz=1e3,cz=1001,lz=1005,uz=4040;let mu;function ba(){return mu===void 0&&(mu=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(mu+performance.now())}function Cw(){return`t=${Math.round((ba()-mu)/100)/10}s`}const _1={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function fz(e){if(e===void 0)return"Unknown";for(const t of Object.keys(_1))if(e.startsWith(t))return t;return"Unknown"}class dz{constructor(t,r,s,i,c,u){this.markConnectionStateDirty=c,this.debug=u,xt(this,"socket"),xt(this,"connectionCount"),xt(this,"_hasEverConnected",!1),xt(this,"lastCloseReason"),xt(this,"transitionChunkBuffer",null),xt(this,"defaultInitialBackoff"),xt(this,"maxBackoff"),xt(this,"retries"),xt(this,"serverInactivityThreshold"),xt(this,"reconnectDueToServerInactivityTimeout"),xt(this,"scheduledReconnect",null),xt(this,"networkOnlineHandler",null),xt(this,"pendingNetworkRecoveryInfo",null),xt(this,"uri"),xt(this,"onOpen"),xt(this,"onResume"),xt(this,"onMessage"),xt(this,"webSocketConstructor"),xt(this,"logger"),xt(this,"onServerDisconnectError"),this.webSocketConstructor=s,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=r.onOpen,this.onResume=r.onResume,this.onMessage=r.onMessage,this.onServerDisconnectError=r.onServerDisconnectError,this.logger=i,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const r=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${r}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const r=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const s=_w(JSON.parse(r));if(s.type!=="Transition")throw new Error(`Expected Transition, got ${s.type} after assembling chunks`);return s}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ba()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",Cw(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",Cw())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:r}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:r}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(r/1e3)}s of waiting`)}},t.onerror=r=>{this.transitionChunkBuffer=null;const s=r.message;s&&this.logger.log(`WebSocket error message: ${s}`)},t.onmessage=r=>{this.resetServerInactivityTimeout();const s=r.data.length;let i=_w(JSON.parse(r.data));if(this._logVerbose(`received ws message with type ${i.type}`),i.type==="Ping")return;if(i.type==="TransitionChunk"){const u=this.assembleTransition(i);if(!u)return;i=u,this._logVerbose(`assembled full ws message of type ${i.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${i.type} while buffering TransitionChunks`)),i.type==="Transition"&&this.reportLargeTransition({messageLength:s,transition:i}),this.onMessage(i).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=r=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=r.reason||`closed with code ${r.code}`),r.code!==iz&&r.code!==cz&&r.code!==lz&&r.code!==uz){let i=`WebSocket closed with code ${r.code}`;r.reason&&(i+=`: ${r.reason}`),this.logger.log(i),this.onServerDisconnectError&&r.reason&&this.onServerDisconnectError(i)}const s=fz(r.reason);this.scheduleReconnect(s)}}socketState(){return this.socket.state}sendMessage(t){const r={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const s=oz(t),i=JSON.stringify(s);let c=!1;try{this.socket.ws.send(i),c=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${c?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(r)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(r)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const r=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(r)}ms`);const s=ba(),i=setTimeout(()=>{this.scheduledReconnect?.timeout===i&&(this.scheduledReconnect=null,this.connect())},r);this.scheduledReconnect={timeout:i,scheduledAt:s,backoffMs:r}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=r=>{this._logVerbose("Ignoring message received after close")},new Promise(r=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),r()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=s=>{this._logVerbose("Ignoring message received after close")};const r=new Promise(s=>{t.onclose=()=>{s()}});return t.close(),r}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const r=ba()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-r),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(r)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:ba()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const s=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:_1[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const i=Math.min(s,this.maxBackoff),c=i*(Math.random()-.5);return i+c}reportLargeTransition({transition:t,messageLength:r}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const s=ba()-t.clientClockSkew-t.serverTs/1e6,i=`${Math.round(s)}ms`,c=`${Math.round(r/1e4)/100}MB`,u=r/(s/1e3),f=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${c} transition in ${i} at ${f}`),r>2e7?this.logger.log(`received query results totaling more that 20MB (${c}) which will take a long time to download on slower connections`):s>2e4&&this.logger.log(`received query results totaling ${c} which took more than 20s to arrive (${i})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:s,messageLength:r}})}}function hz(){return pz()}function pz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}class Xi extends Error{}Xi.prototype.name="InvalidTokenError";function mz(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let s=r.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function gz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return mz(t)}catch{return atob(t)}}function C1(e,t){if(typeof e!="string")throw new Xi("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,s=e.split(".")[r];if(typeof s!="string")throw new Xi(`Invalid token specified: missing part #${r+1}`);let i;try{i=gz(s)}catch(c){throw new Xi(`Invalid token specified: invalid base64 for part #${r+1} (${c.message})`)}try{return JSON.parse(i)}catch(c){throw new Xi(`Invalid token specified: invalid json for part #${r+1} (${c.message})`)}}var yz=Object.defineProperty,vz=(e,t,r)=>t in e?yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zn=(e,t,r)=>vz(e,typeof t!="symbol"?t+"":t,r);const bz=480*60*60*1e3,Ew=2;class wz{constructor(t,r,s){zn(this,"authState",{state:"noAuth"}),zn(this,"configVersion",0),zn(this,"syncState"),zn(this,"authenticate"),zn(this,"stopSocket"),zn(this,"tryRestartSocket"),zn(this,"pauseSocket"),zn(this,"resumeSocket"),zn(this,"clearAuth"),zn(this,"logger"),zn(this,"refreshTokenLeewaySeconds"),zn(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=r.authenticate,this.stopSocket=r.stopSocket,this.tryRestartSocket=r.tryRestartSocket,this.pauseSocket=r.pauseSocket,this.resumeSocket=r.resumeSocket,this.clearAuth=r.clearAuth,this.logger=s.logger,this.refreshTokenLeewaySeconds=s.refreshTokenLeewaySeconds}async setConfig(t,r){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const s=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});s.isFromOutdatedConfig||(s.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:r},hasRetried:!1}),this.authenticate(s.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:r}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:r}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(r+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=Ew){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Ew-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const r=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});r.isFromOutdatedConfig||(r.value&&this.syncState.isNewAuth(r.value)?(this.authenticate(r.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:r.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const r=this.decodeToken(t);if(!r){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:s,exp:i}=r;if(!s||!i){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const c=i-s;if(c<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(bz,(c-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${c}s`),u=0);const f=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:f,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,r){const s=++this.configVersion;this._logVerbose(`fetching token with config version ${s}`);const i=await t(r);return this.configVersion!==s?(this._logVerbose(`stale config version, expected ${s}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:i}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const r=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(r)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return C1(t)}catch(r){return this._logVerbose(`Error decoding token: ${r instanceof Error?r.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const Sz=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function xz(e,t){const r={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:r})}function _z(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function Cz(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const r of Sz){const s=performance.getEntriesByName(r).filter(i=>i.entryType==="mark").filter(i=>i.detail.sessionId===e);t.push(...s)}return t.map(_z)}var Ez=Object.defineProperty,Rz=(e,t,r)=>t in e?Ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_t=(e,t,r)=>Rz(e,typeof t!="symbol"?t+"":t,r);class Tz{constructor(t,r,s){if(_t(this,"address"),_t(this,"state"),_t(this,"requestManager"),_t(this,"webSocketManager"),_t(this,"authenticationManager"),_t(this,"remoteQuerySet"),_t(this,"optimisticQueryResults"),_t(this,"_transitionHandlerCounter",0),_t(this,"_nextRequestId"),_t(this,"_onTransitionFns",new Map),_t(this,"_sessionId"),_t(this,"firstMessageReceived",!1),_t(this,"debug"),_t(this,"logger"),_t(this,"maxObservedTimestamp"),_t(this,"connectionStateSubscribers",new Map),_t(this,"nextConnectionStateSubscriberId",0),_t(this,"_lastPublishedConnectionState"),_t(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const _=this.connectionState();if(JSON.stringify(_)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=_;for(const E of this.connectionStateSubscribers.values())E(_)}})}),_t(this,"mark",_=>{this.debug&&xz(_,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");s?.skipConvexDeploymentUrlCheck!==!0&&bj(t),s={...s};const i=s.authRefreshTokenLeewaySeconds??2;let c=s.webSocketConstructor;if(!c&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");c=c||WebSocket,this.debug=s.reportDebugInfoToConvex??!1,this.address=t,this.logger=s.logger===!1?b1({verbose:s.verbose??!1}):s.logger!==!0&&s.logger?s.logger:v1({verbose:s.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const f=t.substring(u+3),h=t.substring(0,u);let p;if(h==="http")p="ws";else if(h==="https")p="wss";else throw new Error(`Unknown parent protocol ${h}`);const y=`${p}://${f}/api/${yw}/sync`;this.state=new Uj,this.remoteQuerySet=new xw(_=>this.state.queryPath(_),this.logger),this.requestManager=new Fj(this.logger,this.markConnectionStateDirty);const v=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new wz(this.state,{authenticate:_=>{const E=this.state.setAuth(_);return this.webSocketManager.sendMessage(E),E.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:v,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:i}),this.optimisticQueryResults=new Kj,this.addOnTransitionHandler(_=>{r(_.queries.map(E=>E.token))}),this._nextRequestId=0,this._sessionId=hz();const{unsavedChangesWarning:b}=s;if(typeof window>"u"||typeof window.addEventListener>"u"){if(b===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else b!==!1&&window.addEventListener("beforeunload",_=>{if(this.requestManager.hasIncompleteRequests()){_.preventDefault();const E="Are you sure you want to leave? Your changes may not be saved.";return(_||window.event).returnValue=E,E}});this.webSocketManager=new dz(y,{onOpen:_=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({..._,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const E=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new xw(O=>this.state.queryPath(O),this.logger);const[x,C]=this.state.restart(E);C&&this.webSocketManager.sendMessage(C),this.webSocketManager.sendMessage(x);for(const O of this.requestManager.restart())this.webSocketManager.sendMessage(O)},onResume:()=>{const[_,E]=this.state.resume();E&&this.webSocketManager.sendMessage(E),_&&this.webSocketManager.sendMessage(_);for(const x of this.requestManager.resume())this.webSocketManager.sendMessage(x)},onMessage:_=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),_.type){case"Transition":{this.observedTimestamp(_.endVersion.ts),this.authenticationManager.onTransition(_),this.remoteQuerySet.transition(_),this.state.transition(_);const E=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(E);break}case"MutationResponse":{_.success&&this.observedTimestamp(_.ts);const E=this.requestManager.onResponse(_);E!==null&&this.notifyOnQueryResultChanges(new Map([[E.requestId,E.result]]));break}case"ActionResponse":{this.requestManager.onResponse(_);break}case"AuthError":{this.authenticationManager.onAuthError(_);break}case"FatalError":{const E=Lj(this.logger,_.error);throw this.webSocketManager.terminate(),E}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:s.onServerDisconnectError},c,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),s.expectAuth&&v()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const r=this.remoteQuerySet.remoteQueryResults(),s=new Map;for(const[c,u]of r){const f=this.state.queryToken(c);if(f!==null){const h={result:u,udfPath:this.state.queryPath(c),args:this.state.queryArgs(c)};s.set(f,h)}}const i=this.optimisticQueryResults.ingestQueryResultsFromServer(s,new Set(t.keys()));this.handleTransition({queries:i.map(c=>{const u=this.optimisticQueryResults.rawQueryResult(c);return{token:c,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([c,u])=>({requestId:c,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const r of this._onTransitionFns.values())r(t)}addOnTransitionHandler(t){const r=this._transitionHandlerCounter++;return this._onTransitionFns.set(r,t),()=>this._onTransitionFns.delete(r)}getCurrentAuthClaims(){const t=this.state.getAuth();let r={};if(t&&t.tokenType==="User")try{r=t?C1(t.value):{}}catch{r={}}else return;return{token:t.value,decoded:r}}setAuth(t,r){this.authenticationManager.setConfig(t,r)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,r){const s=this.state.setAdminAuth(t,r);this.webSocketManager.sendMessage(s)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,r,s){const i=Ir(r),{modification:c,queryToken:u,unsubscribe:f}=this.state.subscribe(t,i,s?.journal,s?.componentPath);return c!==null&&this.webSocketManager.sendMessage(c),{queryToken:u,unsubscribe:()=>{const h=f();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,r){const s=Ir(r),i=ds(t,s);return this.optimisticQueryResults.queryResult(i)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,r){const s=Ir(r),i=ds(t,s);return this.optimisticQueryResults.queryLogs(i)}queryJournal(t,r){const s=Ir(r),i=ds(t,s);return this.state.queryJournal(i)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const r=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(r,t),()=>{this.connectionStateSubscribers.delete(r)}}async mutation(t,r,s){const i=await this.mutationInternal(t,r,s);if(!i.success)throw i.errorData!==void 0?Zp(i,new Hp(Sa("mutation",t,i))):new Error(Sa("mutation",t,i));return i.value}async mutationInternal(t,r,s,i){const{mutationPromise:c}=this.enqueueMutation(t,r,s,i);return c}enqueueMutation(t,r,s,i){const c=Ir(r);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,s!==void 0){const y=s.optimisticUpdate;if(y!==void 0){const v=E=>{y(E,c)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},_=this.optimisticQueryResults.applyOptimisticUpdate(v,u).map(E=>{const x=this.localQueryResultByToken(E);return{token:E,modification:{kind:"Updated",result:x===void 0?void 0:{success:!0,value:x,logLines:[]}}}});this.handleTransition({queries:_,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const f={type:"Mutation",requestId:u,udfPath:t,componentPath:i,args:[Yn(c)]},h=this.webSocketManager.sendMessage(f),p=this.requestManager.request(f,h);return{requestId:u,mutationPromise:p}}async action(t,r){const s=await this.actionInternal(t,r);if(!s.success)throw s.errorData!==void 0?Zp(s,new Hp(Sa("action",t,s))):new Error(Sa("action",t,s));return s.value}async actionInternal(t,r,s){const i=Ir(r),c=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:c,udfPath:t,componentPath:s,args:[Yn(i)]},f=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,f)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=Cz(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const r=`${this.address}/api/debug_event`;fetch(r,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${yw}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(s=>{s.ok||this.logger.warn("Analytics request failed with response:",s.body)}).catch(s=>{this.logger.warn("Analytics response failed with error:",s)})}}function mp(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var Az=Object.defineProperty,Oz=(e,t,r)=>t in e?Az(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rw=(e,t,r)=>Oz(e,typeof t!="symbol"?t+"":t,r);class kz{constructor(t,r){this.client=t,this.onTransition=r,Rw(this,"paginatedQuerySet",new Map),Rw(this,"lastTransitionTs"),this.lastTransitionTs=on.fromNumber(0),this.client.addOnTransitionHandler(s=>this.onBaseTransition(s))}subscribe(t,r,s){const i=gs(t),c=bw(i,r,s),u=()=>this.removePaginatedQuerySubscriber(c),f=this.paginatedQuerySet.get(c);return f?(f.numSubscribers+=1,{paginatedQueryToken:c,unsubscribe:u}):(this.paginatedQuerySet.set(c,{token:c,canonicalizedUdfPath:i,args:r,numSubscribers:1,options:{initialNumItems:s.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:s.id}),this.addPageToPaginatedQuery(c,null,s.initialNumItems),{paginatedQueryToken:c,unsubscribe:u})}localQueryResult(t,r,s){const i=gs(t),c=bw(i,r,s);return this.localQueryResultByToken(c)}localQueryResultByToken(t){const r=this.paginatedQuerySet.get(t);if(!r)return;const s=this.activePageQueryTokens(r);if(s.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let i=[],c=!1,u=!1;for(const h of s){const p=this.client.localQueryResultByToken(h);if(p===void 0){c=!0,u=!1;continue}const y=mp(p);i=i.concat(y.page),u=!!y.isDone}let f;return c?f=i.length===0?"LoadingFirstPage":"LoadingMore":u?f="Exhausted":f="CanLoadMore",{results:i,status:f,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const r=t.queries.map(u=>u.token),s=this.queriesContainingTokens(r);let i=[];s.length>0&&(this.processPaginatedQuerySplits(s,u=>this.client.localQueryResultByToken(u)),i=s.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const c={...t,paginatedQueries:i};this.onTransition(c)}loadMoreOfPaginatedQuery(t,r){this.mustGetPaginatedQuery(t);const s=this.queryTokenForLastPageOfPaginatedQuery(t),i=this.client.localQueryResultByToken(s);if(!i)return!1;const c=mp(i);if(c.isDone)return!1;this.addPageToPaginatedQuery(t,c.continueCursor,r);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const r=[],s=new Set(t);for(const[i,c]of this.paginatedQuerySet)for(const u of this.allQueryTokens(c))if(s.has(u)){r.push(i);break}return r}processPaginatedQuerySplits(t,r){for(const s of t){const i=this.mustGetPaginatedQuery(s),{ongoingSplits:c,pageKeyToQuery:u,pageKeys:f}=i;for(const[h,[p,y]]of c)r(u.get(p).queryToken)!==void 0&&r(u.get(y).queryToken)!==void 0&&this.completePaginatedQuerySplit(i,h,p,y);for(const h of f){if(c.has(h))continue;const p=u.get(h).queryToken,y=r(p);if(!y)continue;const v=mp(y);v.splitCursor&&(v.pageStatus==="SplitRecommended"||v.pageStatus==="SplitRequired"||v.page.length>i.options.initialNumItems*2)&&this.splitPaginatedQueryPage(i,h,v.splitCursor,v.continueCursor)}}}splitPaginatedQueryPage(t,r,s,i){const c=t.nextPageKey++,u=t.nextPageKey++,f={cursor:i,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...f,cursor:null,endCursor:s}});t.pageKeyToQuery.set(c,h);const p=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...f,cursor:s,endCursor:i}});t.pageKeyToQuery.set(u,p),t.ongoingSplits.set(r,[c,u])}addPageToPaginatedQuery(t,r,s){const i=this.mustGetPaginatedQuery(t),c=i.nextPageKey++,u={cursor:r,numItems:s,id:i.id},f={...i.args,paginationOpts:u},h=this.client.subscribe(i.canonicalizedUdfPath,f);return i.pageKeys.push(c),i.pageKeyToQuery.set(c,h),h}removePaginatedQuerySubscriber(t){const r=this.paginatedQuerySet.get(t);if(r&&(r.numSubscribers-=1,!(r.numSubscribers>0))){for(const s of r.pageKeyToQuery.values())s.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,r,s,i){const c=t.pageKeyToQuery.get(r);t.pageKeyToQuery.delete(r);const u=t.pageKeys.indexOf(r);t.pageKeys.splice(u,1,s,i),t.ongoingSplits.delete(r),c.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(r=>t.pageKeyToQuery.get(r).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(r=>r.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const r=this.mustGetPaginatedQuery(t),s=r.pageKeys[r.pageKeys.length-1];if(s===void 0)throw new Error(`No pages for paginated query ${t}`);return r.pageKeyToQuery.get(s).queryToken}mustGetPaginatedQuery(t){const r=this.paginatedQuerySet.get(t);if(!r)throw new Error("paginated query no longer exists for token "+t);return r}}function Mz({getCurrentValue:e,subscribe:t}){const[r,s]=w.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let i=r.value;return(r.getCurrentValue!==e||r.subscribe!==t)&&(i=e(),s({getCurrentValue:e,subscribe:t,value:i})),w.useEffect(()=>{let c=!1;const u=()=>{c||s(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const p=e();return h.value===p?h:{...h,value:p}})},f=t(u);return u(),()=>{c=!0,f()}},[e,t]),i}var Nz=Object.defineProperty,jz=(e,t,r)=>t in e?Nz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pr=(e,t,r)=>jz(e,typeof t!="symbol"?t+"":t,r);const zz=5e3;if(typeof Ft>"u")throw new Error("Required dependency 'react' not found");function E1(e,t,r){function s(i){return Iz(i),t.mutation(e,i,{optimisticUpdate:r})}return s.withOptimisticUpdate=function(c){if(r!==void 0)throw new Error(`Already specified optimistic update for mutation ${sn(e)}`);return E1(e,t,c)},s}class Dz{constructor(t,r){if(Pr(this,"address"),Pr(this,"cachedSync"),Pr(this,"cachedPaginatedQueryClient"),Pr(this,"listeners"),Pr(this,"options"),Pr(this,"closed",!1),Pr(this,"_logger"),Pr(this,"adminAuth"),Pr(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=r?.logger===!1?b1({verbose:r?.verbose??!1}):r?.logger!==!0&&r?.logger?r.logger:v1({verbose:r?.verbose??!1}),this.options={...r,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new Tz(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new kz(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,r){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,r??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,r){if(this.adminAuth=t,this.fakeUserIdentity=r,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,r)}watchQuery(t,...r){const[s,i]=r,c=sn(t);return{onUpdate:u=>{const{queryToken:f,unsubscribe:h}=this.sync.subscribe(c,s,i),p=this.listeners.get(f);return p!==void 0?p.add(u):this.listeners.set(f,new Set([u])),()=>{if(this.closed)return;const y=this.listeners.get(f);y.delete(u),y.size===0&&this.listeners.delete(f),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(c,s)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(c,s)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(c,s)}}}prewarmQuery(t){const r=t.extendSubscriptionFor??zz,i=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(i,r)}watchPaginatedQuery(t,r,s){const i=sn(t);return{onUpdate:c=>{const{paginatedQueryToken:u,unsubscribe:f}=this.paginatedQueryClient.subscribe(i,r||{},s),h=this.listeners.get(u);return h!==void 0?h.add(c):this.listeners.set(u,new Set([c])),()=>{if(this.closed)return;const p=this.listeners.get(u);p.delete(c),p.size===0&&this.listeners.delete(u),f()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(i,r,s)}}mutation(t,...r){const[s,i]=r,c=sn(t);return this.sync.mutation(c,s,i)}action(t,...r){const s=sn(t);return this.sync.action(s,...r)}query(t,...r){const s=this.watchQuery(t,...r),i=s.localQueryResult();return i!==void 0?Promise.resolve(i):new Promise((c,u)=>{const f=s.onUpdate(()=>{f();try{c(s.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const r=t.queries.map(i=>i.token),s=t.paginatedQueries.map(i=>i.token);this.transition([...r,...s])}transition(t){for(const r of t){const s=this.listeners.get(r);if(s)for(const i of s)i()}}}const Lm=Ft.createContext(void 0);function Pz(){return w.useContext(Lm)}const Lz=({client:e,children:t})=>Ft.createElement(Lm.Provider,{value:e},t);function R1(e,...t){const r=t[0]==="skip",s=t[0]==="skip"?{}:Ir(t[0]),i=typeof e=="string"?S1(e):e,c=sn(i),u=w.useMemo(()=>r?{}:{query:{query:i,args:s}},[JSON.stringify(Yn(s)),c,r]),h=qz(u).query;if(h instanceof Error)throw h;return h}function Tw(e){const t=typeof e=="string"?S1(e):e,r=w.useContext(Lm);if(r===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return w.useMemo(()=>E1(t,r),[r,sn(t)])}function Iz(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var $z=Object.defineProperty,Uz=(e,t,r)=>t in e?$z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gp=(e,t,r)=>Uz(e,typeof t!="symbol"?t+"":t,r);class Bz{constructor(t){gp(this,"createWatch"),gp(this,"queries"),gp(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const r of Object.keys(t)){const{query:s,args:i,paginationOptions:c}=t[r];if(sn(s),this.queries[r]===void 0)this.addQuery(r,s,i,c?{paginationOptions:c}:{});else{const u=this.queries[r];(sn(s)!==sn(u.query)||JSON.stringify(Yn(i))!==JSON.stringify(Yn(u.args))||JSON.stringify(c)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(r),this.addQuery(r,s,i,c?{paginationOptions:c}:{}))}}for(const r of Object.keys(this.queries))t[r]===void 0&&this.removeQuery(r)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const r={};for(const s of Object.keys(t)){const{query:i,args:c}=t[s],u=t[s].paginationOptions;sn(i);const f=this.createWatch(i,c,u?{paginationOptions:u}:{});let h;try{h=f.localQueryResult()}catch(p){if(p instanceof Error)h=p;else throw p}r[s]=h}return r}setCreateWatch(t){this.createWatch=t;for(const r of Object.keys(this.queries)){const{query:s,args:i,watch:c,paginationOptions:u}=this.queries[r],f="journal"in c?c.journal():void 0;this.removeQuery(r),this.addQuery(r,s,i,{...f?{journal:f}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,r,s,{paginationOptions:i,journal:c}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(r,s,{...c?{journal:c}:[],...i?{paginationOptions:i}:{}}),f=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:r,args:s,watch:u,unsubscribe:f,...i?{paginationOptions:i}:{}}}removeQuery(t){const r=this.queries[t];if(r===void 0)throw new Error(`No query found with identifier ${t}.`);r.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function qz(e){const t=Pz();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const r=w.useMemo(()=>(s,i,{journal:c,paginationOptions:u})=>u?t.watchPaginatedQuery(s,i,u):t.watchQuery(s,i,c?{journal:c}:{}),[t]);return Fz(e,r)}function Fz(e,t){const[r]=w.useState(()=>new Bz(t));r.createWatch!==t&&r.setCreateWatch(t),w.useEffect(()=>()=>r.destroy(),[r]);const s=w.useMemo(()=>({getCurrentValue:()=>r.getLocalResults(e),subscribe:i=>(r.setQueries(e),r.subscribe(i))}),[r,e]);return Mz(s)}const Vz="/assets/globals-CoCRjt0K.css";const T1=(...e)=>e.filter((t,r,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===r).join(" ").trim();const Hz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Zz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,s)=>s?s.toUpperCase():r.toLowerCase());const Aw=e=>{const t=Zz(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Qz={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Gz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Yz=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:i="",children:c,iconNode:u,...f},h)=>w.createElement("svg",{ref:h,...Qz,width:t,height:t,stroke:e,strokeWidth:s?Number(r)*24/Number(t):r,className:T1("lucide",i),...!c&&!Gz(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,y])=>w.createElement(p,y)),...Array.isArray(c)?c:[c]]));const Se=(e,t)=>{const r=w.forwardRef(({className:s,...i},c)=>w.createElement(Yz,{ref:c,iconNode:t,className:T1(`lucide-${Hz(Aw(e))}`,`lucide-${e}`,s),...i}));return r.displayName=Aw(e),r};const Kz=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Xz=Se("archive",Kz);const Jz=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Qp=Se("bell",Jz);const Wz=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],eD=Se("book",Wz);const tD=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],nD=Se("bookmark",tD);const rD=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],A1=Se("braces",rD);const oD=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Gp=Se("calendar",oD);const sD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],O1=Se("check",sD);const aD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Cs=Se("chevron-down",aD);const iD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cD=Se("chevron-right",iD);const lD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],k1=Se("chevron-up",lD);const uD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],fD=Se("circle-alert",uD);const dD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],M1=Se("circle-question-mark",dD);const hD=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pD=Se("clock",hD);const mD=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],gD=Se("code-xml",mD);const yD=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],vD=Se("code",yD);const bD=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],wD=Se("dollar-sign",bD);const SD=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],xD=Se("external-link",SD);const _D=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],CD=Se("eye",_D);const ED=[["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"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],RD=Se("file-code",ED);const TD=[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],AD=Se("file-text",TD);const OD=[["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"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],kD=Se("file-type",OD);const MD=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],ND=Se("flag",MD);const jD=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],zD=Se("folder-open",jD);const DD=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],PD=Se("folder",DD);const LD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ID=Se("globe",LD);const $D=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],N1=Se("hash",$D);const UD=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],BD=Se("heart",UD);const qD=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],j1=Se("house",qD);const FD=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],z1=Se("image",FD);const VD=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],D1=Se("layers",VD);const HD=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ZD=Se("layout-dashboard",HD);const QD=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],GD=Se("link-2",QD);const YD=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],KD=Se("link",YD);const XD=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],JD=Se("list",XD);const WD=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],e3=Se("loader-circle",WD);const t3=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],n3=Se("lock",t3);const r3=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],o3=Se("log-out",r3);const s3=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],a3=Se("mail",s3);const i3=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],c3=Se("map-pin",i3);const l3=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],u3=Se("message-square",l3);const f3=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],d3=Se("package",f3);const h3=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],p3=Se("phone",h3);const m3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],P1=Se("plus",m3);const g3=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],y3=Se("settings",g3);const v3=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],b3=Se("square-check-big",v3);const w3=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],S3=Se("square-pen",w3);const x3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],_3=Se("star",x3);const C3=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],E3=Se("tag",C3);const R3=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],T3=Se("tags",R3);const A3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],O3=Se("text-align-start",A3);const k3=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],L1=Se("toggle-left",k3);const M3=[["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"}]],N3=Se("trash-2",M3);const j3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z3=Se("triangle-alert",j3);const D3=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],I1=Se("user",D3);const P3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zu=Se("x",P3);function $1(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=$1(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function U1(){for(var e,t,r=0,s="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=$1(e))&&(s&&(s+=" "),s+=t);return s}const L3=(e,t)=>{const r=new Array(e.length+t.length);for(let s=0;s<e.length;s++)r[s]=e[s];for(let s=0;s<t.length;s++)r[e.length+s]=t[s];return r},I3=(e,t)=>({classGroupId:e,validator:t}),B1=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Du="-",Ow=[],$3="arbitrary..",U3=e=>{const t=q3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return B3(u);const f=u.split(Du),h=f[0]===""&&f.length>1?1:0;return q1(f,h,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=s[u],p=r[u];return h?p?L3(p,h):h:p||Ow}return r[u]||Ow}}},q1=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],c=r.nextPart.get(i);if(c){const p=q1(e,t+1,c);if(p)return p}const u=r.validators;if(u===null)return;const f=t===0?e.join(Du):e.slice(t).join(Du),h=u.length;for(let p=0;p<h;p++){const y=u[p];if(y.validator(f))return y.classGroupId}},B3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),s=t.slice(0,r);return s?$3+s:void 0})(),q3=e=>{const{theme:t,classGroups:r}=e;return F3(r,t)},F3=(e,t)=>{const r=B1();for(const s in e){const i=e[s];Im(i,r,s,t)}return r},Im=(e,t,r,s)=>{const i=e.length;for(let c=0;c<i;c++){const u=e[c];V3(u,t,r,s)}},V3=(e,t,r,s)=>{if(typeof e=="string"){H3(e,t,r);return}if(typeof e=="function"){Z3(e,t,r,s);return}Q3(e,t,r,s)},H3=(e,t,r)=>{const s=e===""?t:F1(t,e);s.classGroupId=r},Z3=(e,t,r,s)=>{if(G3(e)){Im(e(s),t,r,s);return}t.validators===null&&(t.validators=[]),t.validators.push(I3(r,e))},Q3=(e,t,r,s)=>{const i=Object.entries(e),c=i.length;for(let u=0;u<c;u++){const[f,h]=i[u];Im(h,F1(t,f),r,s)}},F1=(e,t)=>{let r=e;const s=t.split(Du),i=s.length;for(let c=0;c<i;c++){const u=s[c];let f=r.nextPart.get(u);f||(f=B1(),r.nextPart.set(u,f)),r=f}return r},G3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Y3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),s=Object.create(null);const i=(c,u)=>{r[c]=u,t++,t>e&&(t=0,s=r,r=Object.create(null))};return{get(c){let u=r[c];if(u!==void 0)return u;if((u=s[c])!==void 0)return i(c,u),u},set(c,u){c in r?r[c]=u:i(c,u)}}},Yp="!",kw=":",K3=[],Mw=(e,t,r,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:s,isExternal:i}),X3=e=>{const{prefix:t,experimentalParseClassName:r}=e;let s=i=>{const c=[];let u=0,f=0,h=0,p;const y=i.length;for(let x=0;x<y;x++){const C=i[x];if(u===0&&f===0){if(C===kw){c.push(i.slice(h,x)),h=x+1;continue}if(C==="/"){p=x;continue}}C==="["?u++:C==="]"?u--:C==="("?f++:C===")"&&f--}const v=c.length===0?i:i.slice(h);let b=v,_=!1;v.endsWith(Yp)?(b=v.slice(0,-1),_=!0):v.startsWith(Yp)&&(b=v.slice(1),_=!0);const E=p&&p>h?p-h:void 0;return Mw(c,_,b,E)};if(t){const i=t+kw,c=s;s=u=>u.startsWith(i)?c(u.slice(i.length)):Mw(K3,!1,u,void 0,!0)}if(r){const i=s;s=c=>r({className:c,parseClassName:i})}return s},J3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,s)=>{t.set(r,1e6+s)}),r=>{const s=[];let i=[];for(let c=0;c<r.length;c++){const u=r[c],f=u[0]==="[",h=t.has(u);f||h?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(u)):i.push(u)}return i.length>0&&(i.sort(),s.push(...i)),s}},W3=e=>({cache:Y3(e.cacheSize),parseClassName:X3(e),sortModifiers:J3(e),...U3(e)}),e4=/\s+/,t4=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:c}=t,u=[],f=e.trim().split(e4);let h="";for(let p=f.length-1;p>=0;p-=1){const y=f[p],{isExternal:v,modifiers:b,hasImportantModifier:_,baseClassName:E,maybePostfixModifierPosition:x}=r(y);if(v){h=y+(h.length>0?" "+h:h);continue}let C=!!x,O=s(C?E.substring(0,x):E);if(!O){if(!C){h=y+(h.length>0?" "+h:h);continue}if(O=s(E),!O){h=y+(h.length>0?" "+h:h);continue}C=!1}const M=b.length===0?"":b.length===1?b[0]:c(b).join(":"),k=_?M+Yp:M,N=k+O;if(u.indexOf(N)>-1)continue;u.push(N);const U=i(O,C);for(let H=0;H<U.length;++H){const L=U[H];u.push(k+L)}h=y+(h.length>0?" "+h:h)}return h},n4=(...e)=>{let t=0,r,s,i="";for(;t<e.length;)(r=e[t++])&&(s=V1(r))&&(i&&(i+=" "),i+=s);return i},V1=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=V1(e[s]))&&(r&&(r+=" "),r+=t);return r},r4=(e,...t)=>{let r,s,i,c;const u=h=>{const p=t.reduce((y,v)=>v(y),e());return r=W3(p),s=r.cache.get,i=r.cache.set,c=f,f(h)},f=h=>{const p=s(h);if(p)return p;const y=t4(h,r);return i(h,y),y};return c=u,(...h)=>c(n4(...h))},o4=[],At=e=>{const t=r=>r[e]||o4;return t.isThemeGetter=!0,t},H1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s4=/^\d+\/\d+$/,a4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,c4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pa=e=>s4.test(e),Ne=e=>!!e&&!Number.isNaN(Number(e)),vo=e=>!!e&&Number.isInteger(Number(e)),yp=e=>e.endsWith("%")&&Ne(e.slice(0,-1)),Lr=e=>a4.test(e),f4=()=>!0,d4=e=>i4.test(e)&&!c4.test(e),Q1=()=>!1,h4=e=>l4.test(e),p4=e=>u4.test(e),m4=e=>!de(e)&&!he(e),g4=e=>Ba(e,K1,Q1),de=e=>H1.test(e),rs=e=>Ba(e,X1,d4),vp=e=>Ba(e,S4,Ne),Nw=e=>Ba(e,G1,Q1),y4=e=>Ba(e,Y1,p4),eu=e=>Ba(e,J1,h4),he=e=>Z1.test(e),Gi=e=>qa(e,X1),v4=e=>qa(e,x4),jw=e=>qa(e,G1),b4=e=>qa(e,K1),w4=e=>qa(e,Y1),tu=e=>qa(e,J1,!0),Ba=(e,t,r)=>{const s=H1.exec(e);return s?s[1]?t(s[1]):r(s[2]):!1},qa=(e,t,r=!1)=>{const s=Z1.exec(e);return s?s[1]?t(s[1]):r:!1},G1=e=>e==="position"||e==="percentage",Y1=e=>e==="image"||e==="url",K1=e=>e==="length"||e==="size"||e==="bg-size",X1=e=>e==="length",S4=e=>e==="number",x4=e=>e==="family-name",J1=e=>e==="shadow",_4=()=>{const e=At("color"),t=At("font"),r=At("text"),s=At("font-weight"),i=At("tracking"),c=At("leading"),u=At("breakpoint"),f=At("container"),h=At("spacing"),p=At("radius"),y=At("shadow"),v=At("inset-shadow"),b=At("text-shadow"),_=At("drop-shadow"),E=At("blur"),x=At("perspective"),C=At("aspect"),O=At("ease"),M=At("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...N(),he,de],H=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],z=()=>[he,de,h],Y=()=>[pa,"full","auto",...z()],ie=()=>[vo,"none","subgrid",he,de],ae=()=>["auto",{span:["full",vo,he,de]},vo,he,de],oe=()=>[vo,"auto",he,de],le=()=>["auto","min","max","fr",he,de],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...z()],K=()=>[pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],V=()=>[e,he,de],te=()=>[...N(),jw,Nw,{position:[he,de]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",b4,g4,{size:[he,de]}],Q=()=>[yp,Gi,rs],ne=()=>["","none","full",p,he,de],re=()=>["",Ne,Gi,rs],ue=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Ne,yp,jw,Nw],xe=()=>["","none",E,he,de],Ce=()=>["none",Ne,he,de],Ee=()=>["none",Ne,he,de],Oe=()=>[Ne,he,de],ze=()=>[pa,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Lr],breakpoint:[Lr],color:[f4],container:[Lr],"drop-shadow":[Lr],ease:["in","out","in-out"],font:[m4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Lr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Lr],shadow:[Lr],spacing:["px",Ne],text:[Lr],"text-shadow":[Lr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pa,de,he,C]}],container:["container"],columns:[{columns:[Ne,de,he,f]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[vo,"auto",he,de]}],basis:[{basis:[pa,"full","auto",f,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,pa,"auto","initial","none",de]}],grow:[{grow:["",Ne,he,de]}],shrink:[{shrink:["",Ne,he,de]}],order:[{order:[vo,"first","last","none",he,de]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[f,"screen",...K()]}],"min-w":[{"min-w":[f,"screen","none",...K()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,Gi,rs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,he,vp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yp,de]}],"font-family":[{font:[v4,de,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,he,de]}],"line-clamp":[{"line-clamp":[Ne,"none",he,vp]}],leading:[{leading:[c,...z()]}],"list-image":[{"list-image":["none",he,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",he,rs]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Ne,"auto",he,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vo,he,de],radial:["",he,de],conic:[vo,he,de]},w4,y4]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,he,de]}],"outline-w":[{outline:["",Ne,Gi,rs]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",y,tu,eu]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",v,tu,eu]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Ne,rs]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",b,tu,eu]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Ne,he,de]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[he,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,de]}],filter:[{filter:["","none",he,de]}],blur:[{blur:xe()}],brightness:[{brightness:[Ne,he,de]}],contrast:[{contrast:[Ne,he,de]}],"drop-shadow":[{"drop-shadow":["","none",_,tu,eu]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Ne,he,de]}],"hue-rotate":[{"hue-rotate":[Ne,he,de]}],invert:[{invert:["",Ne,he,de]}],saturate:[{saturate:[Ne,he,de]}],sepia:[{sepia:["",Ne,he,de]}],"backdrop-filter":[{"backdrop-filter":["","none",he,de]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,he,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,he,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,he,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,he,de]}],"backdrop-invert":[{"backdrop-invert":["",Ne,he,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,he,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,he,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,he,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",he,de]}],ease:[{ease:["linear","initial",O,he,de]}],delay:[{delay:[Ne,he,de]}],animate:[{animate:["none",M,he,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,he,de]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[he,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,de]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Ne,Gi,rs,vp]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},C4=r4(_4);function je(...e){return C4(U1(e))}et.union(et.literal("admin"),et.literal("editor"),et.literal("author"),et.literal("viewer"));const E4=et.union(et.literal("contentTypes"),et.literal("contentEntries"),et.literal("mediaItems"),et.literal("settings")),R4=et.union(et.literal("create"),et.literal("read"),et.literal("update"),et.literal("delete"),et.literal("publish"),et.literal("unpublish"),et.literal("restore"),et.literal("manage"),et.literal("move"));et.object({resource:E4,action:R4,scope:et.optional(et.union(et.literal("all"),et.literal("own")))});function ac(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function ka(e,t="all"){return[{resource:e,action:"read",scope:t}]}function W1(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const T4={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...ac("contentTypes"),...ac("contentEntries"),...W1(),{resource:"contentEntries",action:"restore"},...ac("mediaItems"),{resource:"settings",action:"manage"},...ka("settings")]},A4={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...ka("contentTypes"),...ac("contentEntries"),...W1(),{resource:"contentEntries",action:"restore"},...ac("mediaItems")]},O4={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...ka("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},k4={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...ka("contentTypes"),...ka("contentEntries"),...ka("mediaItems")]},$m={admin:T4,editor:A4,author:O4,viewer:k4};function M4(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const r=e.scope??"all",s=t.scope??"all";return r==="all"?!0:s==="own"}function N4(e,t,r){const s=$m[e]??r?.[e];return s?s.permissions.some(i=>M4(i,t)):!1}function j4(e,t){return($m[e]??t?.[e])?.permissions??[]}function z4(e,t){return $m[e]??t?.[e]}function D4(e,t,r){return j4(e,r).filter(s=>s.resource===t)}function R7(e,t,r){return D4(e,t,r).length>0}const e_=w.createContext(null);function P4({children:e,getUser:t,getUserRole:r,onLogout:s,autoRedirectToLogin:i=!1,loginUrl:c="/login"}){const[u,f]=w.useState(null),[h,p]=w.useState(null),[y,v]=w.useState("loading"),[b,_]=w.useState(null),E=w.useCallback(async()=>{v("loading"),_(null);try{const k=await t();if(!k){f(null),p(null),v("unauthenticated"),i&&typeof window<"u"&&(window.location.href=c);return}const N=await r({userId:k.id});f(k),p(N),v("authenticated")}catch(k){console.error("Authentication error:",k),f(null),p(null),_(k instanceof Error?k.message:"Authentication failed"),v("error")}},[t,r,i,c]);w.useEffect(()=>{E()},[E]);const x=w.useCallback(k=>h?N4(h,k):!1,[h]),C=w.useCallback(async()=>{try{s&&await s(),f(null),p(null),v("unauthenticated"),i&&typeof window<"u"&&(window.location.href=c)}catch(k){console.error("Logout error:",k),_(k instanceof Error?k.message:"Logout failed")}},[s,i,c]),O=w.useCallback(async()=>{await E()},[E]),M={user:u,role:h,authState:y,isLoading:y==="loading",isAuthenticated:y==="authenticated",error:b,checkPermission:x,logout:C,refresh:O};return g.jsx(e_.Provider,{value:M,children:e})}function t_(){const e=w.useContext(e_);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const n_=w.createContext(null),r_="convex-cms-theme";function zw(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Dw(){if(typeof window>"u")return"system";const e=localStorage.getItem(r_);return e==="light"||e==="dark"||e==="system"?e:"system"}function L4({children:e}){const[t,r]=w.useState(()=>Dw()),[s,i]=w.useState(()=>{const f=Dw();return f==="system"?zw():f}),c=w.useCallback(f=>{const h=f==="system"?zw():f;i(h);const p=document.documentElement;p.classList.remove("light","dark"),p.classList.add(h)},[]),u=w.useCallback(f=>{r(f),localStorage.setItem(r_,f),c(f)},[c]);return w.useEffect(()=>{c(t)},[t,c]),w.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="system"&&c("system")};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[t,c]),g.jsx(n_.Provider,{value:{theme:t,resolvedTheme:s,setTheme:u},children:e})}function T7(){const e=w.useContext(n_);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function W(e,t,r){function s(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const p=u.prototype,y=Object.keys(p);for(let v=0;v<y.length;v++){const b=y[v];b in f||(f[b]=p[b].bind(f))}}const i=r?.Parent??Object;class c extends i{}Object.defineProperty(c,"name",{value:e});function u(f){var h;const p=r?.Parent?new c:this;s(p,f),(h=p._zod).deferred??(h.deferred=[]);for(const y of p._zod.deferred)y();return p}return Object.defineProperty(u,"init",{value:s}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>r?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class Ma extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class o_ extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const s_={};function Ro(e){return s_}function a_(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function Kp(e,t){return typeof t=="bigint"?t.toString():t}function Um(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bm(e){return e==null}function qm(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function I4(e,t){const r=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const h=s.match(/\d?e-(\d?)/);h?.[1]&&(i=Number.parseInt(h[1]))}const c=r>i?r:i,u=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return u%f/10**c}const Pw=Symbol("evaluating");function Ye(e,t,r){let s;Object.defineProperty(e,t,{get(){if(s!==Pw)return s===void 0&&(s=Pw,s=r()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Es(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function zo(...e){const t={};for(const r of e){const s=Object.getOwnPropertyDescriptors(r);Object.assign(t,s)}return Object.defineProperties({},t)}function Lw(e){return JSON.stringify(e)}function $4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const i_="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const U4=Um(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function La(e){if(Pu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Pu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function c_(e){return La(e)?{...e}:Array.isArray(e)?[...e]:e}const B4=new Set(["string","number","symbol"]);function sf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Do(e,t,r){const s=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(s._zod.parent=e),s}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function q4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const F4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function V4(e,t){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=zo(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=r.shape[f])}return Es(this,"shape",u),u},checks:[]});return Do(e,c)}function H4(e,t){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=zo(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Es(this,"shape",u),u},checks:[]});return Do(e,c)}function Z4(e,t){if(!La(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const c=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(c,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=zo(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Es(this,"shape",c),c}});return Do(e,i)}function Q4(e,t){if(!La(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=zo(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Es(this,"shape",s),s}});return Do(e,r)}function G4(e,t){const r=zo(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Es(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return Do(e,r)}function Y4(e,t,r){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=zo(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(r)for(const p in r){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(h[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)h[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return Es(this,"shape",h),h},checks:[]});return Do(t,u)}function K4(e,t,r){const s=zo(t._zod.def,{get shape(){const i=t._zod.def.shape,c={...i};if(r)for(const u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=new e({type:"nonoptional",innerType:i[u]}))}else for(const u in i)c[u]=new e({type:"nonoptional",innerType:i[u]});return Es(this,"shape",c),c}});return Do(t,s)}function xa(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _a(e,t){return t.map(r=>{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function nu(e){return typeof e=="string"?e:e?.message}function To(e,t,r){const s={...e,path:e.path??[]};if(!e.message){const i=nu(e.inst?._zod.def?.error?.(e))??nu(t?.error?.(e))??nu(r.customError?.(e))??nu(r.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Fm(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mc(...e){const[t,r,s]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:s}:{...t}}const l_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Kp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},u_=W("$ZodError",l_),f_=W("$ZodError",l_,{Parent:Error});function X4(e,t=r=>r.message){const r={},s=[];for(const i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:r}}function J4(e,t=r=>r.message){const r={_errors:[]},s=i=>{for(const c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>s({issues:u}));else if(c.code==="invalid_key")s({issues:c.issues});else if(c.code==="invalid_element")s({issues:c.issues});else if(c.path.length===0)r._errors.push(t(c));else{let u=r,f=0;for(;f<c.path.length;){const h=c.path[f];f===c.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(c))):u[h]=u[h]||{_errors:[]},u=u[h],f++}}};return s(e),r}const Vm=e=>(t,r,s,i)=>{const c=s?Object.assign(s,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},c);if(u instanceof Promise)throw new Ma;if(u.issues.length){const f=new(i?.Err??e)(u.issues.map(h=>To(h,c,Ro())));throw i_(f,i?.callee),f}return u.value},Hm=e=>async(t,r,s,i)=>{const c=s?Object.assign(s,{async:!0}):{async:!0};let u=t._zod.run({value:r,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new(i?.Err??e)(u.issues.map(h=>To(h,c,Ro())));throw i_(f,i?.callee),f}return u.value},af=e=>(t,r,s)=>{const i=s?{...s,async:!1}:{async:!1},c=t._zod.run({value:r,issues:[]},i);if(c instanceof Promise)throw new Ma;return c.issues.length?{success:!1,error:new(e??u_)(c.issues.map(u=>To(u,i,Ro())))}:{success:!0,data:c.value}},W4=af(f_),cf=e=>async(t,r,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let c=t._zod.run({value:r,issues:[]},i);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(u=>To(u,i,Ro())))}:{success:!0,data:c.value}},eP=cf(f_),tP=e=>(t,r,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Vm(e)(t,r,i)},nP=e=>(t,r,s)=>Vm(e)(t,r,s),rP=e=>async(t,r,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Hm(e)(t,r,i)},oP=e=>async(t,r,s)=>Hm(e)(t,r,s),sP=e=>(t,r,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return af(e)(t,r,i)},aP=e=>(t,r,s)=>af(e)(t,r,s),iP=e=>async(t,r,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cf(e)(t,r,i)},cP=e=>async(t,r,s)=>cf(e)(t,r,s),lP=/^[cC][^\s-]{8,}$/,uP=/^[0-9a-z]+$/,fP=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dP=/^[0-9a-vA-V]{20}$/,hP=/^[A-Za-z0-9]{27}$/,pP=/^[a-zA-Z0-9_-]{21}$/,mP=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gP=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Iw=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,yP=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bP(){return new RegExp(vP,"u")}const wP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,SP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xP=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_P=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,CP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d_=/^[A-Za-z0-9_-]*$/,EP=/^\+[1-9]\d{6,14}$/,h_="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",RP=new RegExp(`^${h_}$`);function p_(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function TP(e){return new RegExp(`^${p_(e)}$`)}function AP(e){const t=p_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${r.join("|")})`;return new RegExp(`^${h_}T(?:${s})$`)}const OP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kP=/^-?\d+$/,m_=/^-?\d+(?:\.\d+)?$/,MP=/^(?:true|false)$/i,NP=/^[^A-Z]*$/,jP=/^[^a-z]*$/,cn=W("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),g_={number:"number",bigint:"bigint",object:"date"},y_=W("$ZodCheckLessThan",(e,t)=>{cn.init(e,t);const r=g_[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,c=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),v_=W("$ZodCheckGreaterThan",(e,t)=>{cn.init(e,t);const r=g_[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,c=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zP=W("$ZodCheckMultipleOf",(e,t)=>{cn.init(e,t),e._zod.onattach.push(r=>{var s;(s=r._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):I4(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),DP=W("$ZodCheckNumberFormat",(e,t)=>{cn.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),s=r?"int":"number",[i,c]=F4[t.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=t.format,f.minimum=i,f.maximum=c,r&&(f.pattern=kP)}),e._zod.check=u=>{const f=u.value;if(r){if(!Number.isInteger(f)){u.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?u.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):u.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}f<i&&u.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>c&&u.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),PP=W("$ZodCheckMaxLength",(e,t)=>{var r;cn.init(e,t),(r=e._zod.def).when??(r.when=s=>{const i=s.value;return!Bm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const u=Fm(i);s.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),LP=W("$ZodCheckMinLength",(e,t)=>{var r;cn.init(e,t),(r=e._zod.def).when??(r.when=s=>{const i=s.value;return!Bm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const u=Fm(i);s.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),IP=W("$ZodCheckLengthEquals",(e,t)=>{var r;cn.init(e,t),(r=e._zod.def).when??(r.when=s=>{const i=s.value;return!Bm(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,c=i.length;if(c===t.length)return;const u=Fm(i),f=c>t.length;s.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),lf=W("$ZodCheckStringFormat",(e,t)=>{var r,s;cn.init(e,t),e._zod.onattach.push(i=>{const c=i._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),$P=W("$ZodCheckRegex",(e,t)=>{lf.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),UP=W("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=NP),lf.init(e,t)}),BP=W("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jP),lf.init(e,t)}),qP=W("$ZodCheckIncludes",(e,t)=>{cn.init(e,t);const r=sf(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=s,e._zod.onattach.push(i=>{const c=i._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),FP=W("$ZodCheckStartsWith",(e,t)=>{cn.init(e,t);const r=new RegExp(`^${sf(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),VP=W("$ZodCheckEndsWith",(e,t)=>{cn.init(e,t);const r=new RegExp(`.*${sf(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),HP=W("$ZodCheckOverwrite",(e,t)=>{cn.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class ZP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
20
+ `).filter(u=>u),i=Math.min(...s.map(u=>u.length-u.trimStart().length)),c=s.map(u=>u.slice(i)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const t=Function,r=this?.args,i=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...r,i.join(`
21
+ `))}}const QP={major:4,minor:3,patch:6},dt=W("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=QP;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const i of s)for(const c of i._zod.onattach)c(e);if(s.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(u,f,h)=>{let p=xa(u),y;for(const v of f){if(v._zod.def.when){if(!v._zod.def.when(u))continue}else if(p)continue;const b=u.issues.length,_=v._zod.check(u);if(_ instanceof Promise&&h?.async===!1)throw new Ma;if(y||_ instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await _,u.issues.length!==b&&(p||(p=xa(u,b)))});else{if(u.issues.length===b)continue;p||(p=xa(u,b))}}return y?y.then(()=>u):u},c=(u,f,h)=>{if(xa(u))return u.aborted=!0,u;const p=i(f,s,h);if(p instanceof Promise){if(h.async===!1)throw new Ma;return p.then(y=>e._zod.parse(y,h))}return e._zod.parse(p,h)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(y=>c(y,u,f)):c(p,u,f)}const h=e._zod.parse(u,f);if(h instanceof Promise){if(f.async===!1)throw new Ma;return h.then(p=>i(p,s,f))}return i(h,s,f)}}Ye(e,"~standard",()=>({validate:i=>{try{const c=W4(e,i);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return eP(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Zm=W("$ZodString",(e,t)=>{dt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??OP(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),it=W("$ZodStringFormat",(e,t)=>{lf.init(e,t),Zm.init(e,t)}),GP=W("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gP),it.init(e,t)}),YP=W("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Iw(s))}else t.pattern??(t.pattern=Iw());it.init(e,t)}),KP=W("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yP),it.init(e,t)}),XP=W("$ZodURL",(e,t)=>{it.init(e,t),e._zod.check=r=>{try{const s=r.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),JP=W("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bP()),it.init(e,t)}),WP=W("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=pP),it.init(e,t)}),eL=W("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lP),it.init(e,t)}),tL=W("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uP),it.init(e,t)}),nL=W("$ZodULID",(e,t)=>{t.pattern??(t.pattern=fP),it.init(e,t)}),rL=W("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dP),it.init(e,t)}),oL=W("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=hP),it.init(e,t)}),sL=W("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=AP(t)),it.init(e,t)}),aL=W("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=RP),it.init(e,t)}),iL=W("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=TP(t)),it.init(e,t)}),cL=W("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mP),it.init(e,t)}),lL=W("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wP),it.init(e,t),e._zod.bag.format="ipv4"}),uL=W("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=SP),it.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),fL=W("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xP),it.init(e,t)}),dL=W("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_P),it.init(e,t),e._zod.check=r=>{const s=r.value.split("/");try{if(s.length!==2)throw new Error;const[i,c]=s;if(!c)throw new Error;const u=Number(c);if(`${u}`!==c)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function b_(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const hL=W("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=CP),it.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{b_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function pL(e){if(!d_.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return b_(r)}const mL=W("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=d_),it.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{pL(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),gL=W("$ZodE164",(e,t)=>{t.pattern??(t.pattern=EP),it.init(e,t)});function yL(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const vL=W("$ZodJWT",(e,t)=>{it.init(e,t),e._zod.check=r=>{yL(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),w_=W("$ZodNumber",(e,t)=>{dt.init(e,t),e._zod.pattern=e._zod.bag.pattern??m_,e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const c=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...c?{received:c}:{}}),r}}),bL=W("$ZodNumberFormat",(e,t)=>{DP.init(e,t),w_.init(e,t)}),wL=W("$ZodBoolean",(e,t)=>{dt.init(e,t),e._zod.pattern=MP,e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=!!r.value}catch{}const i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),SL=W("$ZodUnknown",(e,t)=>{dt.init(e,t),e._zod.parse=r=>r}),xL=W("$ZodNever",(e,t)=>{dt.init(e,t),e._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function $w(e,t,r){e.issues.length&&t.issues.push(..._a(r,e.issues)),t.value[r]=e.value}const _L=W("$ZodArray",(e,t)=>{dt.init(e,t),e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);const c=[];for(let u=0;u<i.length;u++){const f=i[u],h=t.element._zod.run({value:f,issues:[]},s);h instanceof Promise?c.push(h.then(p=>$w(p,r,u))):$w(h,r,u)}return c.length?Promise.all(c).then(()=>r):r}});function Lu(e,t,r,s,i){if(e.issues.length){if(i&&!(r in s))return;t.issues.push(..._a(r,e.issues))}e.value===void 0?r in s&&(t.value[r]=void 0):t.value[r]=e.value}function S_(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=q4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function x_(e,t,r,s,i,c){const u=[],f=i.keySet,h=i.catchall._zod,p=h.def.type,y=h.optout==="optional";for(const v in t){if(f.has(v))continue;if(p==="never"){u.push(v);continue}const b=h.run({value:t[v],issues:[]},s);b instanceof Promise?e.push(b.then(_=>Lu(_,r,v,t,y))):Lu(b,r,v,t,y)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:c}),e.length?Promise.all(e).then(()=>r):r}const CL=W("$ZodObject",(e,t)=>{if(dt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const s=Um(()=>S_(t));Ye(e._zod,"propValues",()=>{const f=t.shape,h={};for(const p in f){const y=f[p]._zod;if(y.values){h[p]??(h[p]=new Set);for(const v of y.values)h[p].add(v)}}return h});const i=Pu,c=t.catchall;let u;e._zod.parse=(f,h)=>{u??(u=s.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const y=[],v=u.shape;for(const b of u.keys){const _=v[b],E=_._zod.optout==="optional",x=_._zod.run({value:p[b],issues:[]},h);x instanceof Promise?y.push(x.then(C=>Lu(C,f,b,p,E))):Lu(x,f,b,p,E)}return c?x_(y,p,f,h,s.value,e):y.length?Promise.all(y).then(()=>f):f}}),EL=W("$ZodObjectJIT",(e,t)=>{CL.init(e,t);const r=e._zod.parse,s=Um(()=>S_(t)),i=b=>{const _=new ZP(["shape","payload","ctx"]),E=s.value,x=k=>{const N=Lw(k);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};_.write("const input = payload.value;");const C=Object.create(null);let O=0;for(const k of E.keys)C[k]=`key_${O++}`;_.write("const newResult = {};");for(const k of E.keys){const N=C[k],U=Lw(k),L=b[k]?._zod?.optout==="optional";_.write(`const ${N} = ${x(k)};`),L?_.write(`
22
+ if (${N}.issues.length) {
23
+ if (${U} in input) {
24
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
25
+ ...iss,
26
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
27
+ })));
28
+ }
29
+ }
30
+
31
+ if (${N}.value === undefined) {
32
+ if (${U} in input) {
33
+ newResult[${U}] = undefined;
34
+ }
35
+ } else {
36
+ newResult[${U}] = ${N}.value;
37
+ }
38
+
39
+ `):_.write(`
40
+ if (${N}.issues.length) {
41
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
42
+ ...iss,
43
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
44
+ })));
45
+ }
46
+
47
+ if (${N}.value === undefined) {
48
+ if (${U} in input) {
49
+ newResult[${U}] = undefined;
50
+ }
51
+ } else {
52
+ newResult[${U}] = ${N}.value;
53
+ }
54
+
55
+ `)}_.write("payload.value = newResult;"),_.write("return payload;");const M=_.compile();return(k,N)=>M(b,k,N)};let c;const u=Pu,f=!s_.jitless,p=f&&U4.value,y=t.catchall;let v;e._zod.parse=(b,_)=>{v??(v=s.value);const E=b.value;return u(E)?f&&p&&_?.async===!1&&_.jitless!==!0?(c||(c=i(t.shape)),b=c(b,_),y?x_([],E,b,_,v,e):b):r(b,_):(b.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),b)}});function Uw(e,t,r,s){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const i=e.filter(c=>!xa(c));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(c=>c.issues.map(u=>To(u,s,Ro())))}),t)}const RL=W("$ZodUnion",(e,t)=>{dt.init(e,t),Ye(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ye(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ye(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ye(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${i.map(c=>qm(c.source)).join("|")})$`)}});const r=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,c)=>{if(r)return s(i,c);let u=!1;const f=[];for(const h of t.options){const p=h._zod.run({value:i.value,issues:[]},c);if(p instanceof Promise)f.push(p),u=!0;else{if(p.issues.length===0)return p;f.push(p)}}return u?Promise.all(f).then(h=>Uw(h,i,e,c)):Uw(f,i,e,c)}}),TL=W("$ZodIntersection",(e,t)=>{dt.init(e,t),e._zod.parse=(r,s)=>{const i=r.value,c=t.left._zod.run({value:i,issues:[]},s),u=t.right._zod.run({value:i,issues:[]},s);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([h,p])=>Bw(r,h,p)):Bw(r,c,u)}});function Xp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(La(e)&&La(t)){const r=Object.keys(t),s=Object.keys(e).filter(c=>r.indexOf(c)!==-1),i={...e,...t};for(const c of s){const u=Xp(e[c],t[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};i[c]=u.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;s<e.length;s++){const i=e[s],c=t[s],u=Xp(i,c);if(!u.valid)return{valid:!1,mergeErrorPath:[s,...u.mergeErrorPath]};r.push(u.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Bw(e,t,r){const s=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const h of f.keys)s.has(h)||s.set(h,{}),s.get(h).l=!0}else e.issues.push(f);for(const f of r.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)s.has(h)||s.set(h,{}),s.get(h).r=!0;else e.issues.push(f);const c=[...s].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&i&&e.issues.push({...i,keys:c}),xa(e))return e;const u=Xp(t.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const AL=W("$ZodRecord",(e,t)=>{dt.init(e,t),e._zod.parse=(r,s)=>{const i=r.value;if(!La(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const c=[],u=t.keyType._zod.values;if(u){r.value={};const f=new Set;for(const p of u)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const y=t.valueType._zod.run({value:i[p],issues:[]},s);y instanceof Promise?c.push(y.then(v=>{v.issues.length&&r.issues.push(..._a(p,v.issues)),r.value[p]=v.value})):(y.issues.length&&r.issues.push(..._a(p,y.issues)),r.value[p]=y.value)}let h;for(const p in i)f.has(p)||(h=h??[],h.push(p));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:h})}else{r.value={};for(const f of Reflect.ownKeys(i)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&m_.test(f)&&h.issues.length){const v=t.keyType._zod.run({value:Number(f),issues:[]},s);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(h=v)}if(h.issues.length){t.mode==="loose"?r.value[f]=i[f]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(v=>To(v,s,Ro())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:i[f],issues:[]},s);y instanceof Promise?c.push(y.then(v=>{v.issues.length&&r.issues.push(..._a(f,v.issues)),r.value[h.value]=v.value})):(y.issues.length&&r.issues.push(..._a(f,y.issues)),r.value[h.value]=y.value)}}return c.length?Promise.all(c).then(()=>r):r}}),OL=W("$ZodEnum",(e,t)=>{dt.init(e,t);const r=a_(t.entries),s=new Set(r);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.filter(i=>B4.has(typeof i)).map(i=>typeof i=="string"?sf(i):i.toString()).join("|")})$`),e._zod.parse=(i,c)=>{const u=i.value;return s.has(u)||i.issues.push({code:"invalid_value",values:r,input:u,inst:e}),i}}),kL=W("$ZodTransform",(e,t)=>{dt.init(e,t),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new o_(e.constructor.name);const i=t.transform(r.value,r);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(r.value=u,r));if(i instanceof Promise)throw new Ma;return r.value=i,r}});function qw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const __=W("$ZodOptional",(e,t)=>{dt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ye(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${qm(r.source)})?$`):void 0}),e._zod.parse=(r,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(r,s);return i instanceof Promise?i.then(c=>qw(c,r.value)):qw(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,s)}}),ML=W("$ZodExactOptional",(e,t)=>{__.init(e,t),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,s)=>t.innerType._zod.run(r,s)}),NL=W("$ZodNullable",(e,t)=>{dt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${qm(r.source)}|null)$`):void 0}),Ye(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,s)=>r.value===null?r:t.innerType._zod.run(r,s)}),jL=W("$ZodDefault",(e,t)=>{dt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return t.innerType._zod.run(r,s);if(r.value===void 0)return r.value=t.defaultValue,r;const i=t.innerType._zod.run(r,s);return i instanceof Promise?i.then(c=>Fw(c,t)):Fw(i,t)}});function Fw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zL=W("$ZodPrefault",(e,t)=>{dt.init(e,t),e._zod.optin="optional",Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,s)=>(s.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,s))}),DL=W("$ZodNonOptional",(e,t)=>{dt.init(e,t),Ye(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(r,s)=>{const i=t.innerType._zod.run(r,s);return i instanceof Promise?i.then(c=>Vw(c,e)):Vw(i,e)}});function Vw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const PL=W("$ZodCatch",(e,t)=>{dt.init(e,t),Ye(e._zod,"optin",()=>t.innerType._zod.optin),Ye(e._zod,"optout",()=>t.innerType._zod.optout),Ye(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return t.innerType._zod.run(r,s);const i=t.innerType._zod.run(r,s);return i instanceof Promise?i.then(c=>(r.value=c.value,c.issues.length&&(r.value=t.catchValue({...r,error:{issues:c.issues.map(u=>To(u,s,Ro()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(c=>To(c,s,Ro()))},input:r.value}),r.issues=[]),r)}}),LL=W("$ZodPipe",(e,t)=>{dt.init(e,t),Ye(e._zod,"values",()=>t.in._zod.values),Ye(e._zod,"optin",()=>t.in._zod.optin),Ye(e._zod,"optout",()=>t.out._zod.optout),Ye(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,s)=>{if(s.direction==="backward"){const c=t.out._zod.run(r,s);return c instanceof Promise?c.then(u=>ru(u,t.in,s)):ru(c,t.in,s)}const i=t.in._zod.run(r,s);return i instanceof Promise?i.then(c=>ru(c,t.out,s)):ru(i,t.out,s)}});function ru(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const IL=W("$ZodReadonly",(e,t)=>{dt.init(e,t),Ye(e._zod,"propValues",()=>t.innerType._zod.propValues),Ye(e._zod,"values",()=>t.innerType._zod.values),Ye(e._zod,"optin",()=>t.innerType?._zod?.optin),Ye(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,s)=>{if(s.direction==="backward")return t.innerType._zod.run(r,s);const i=t.innerType._zod.run(r,s);return i instanceof Promise?i.then(Hw):Hw(i)}});function Hw(e){return e.value=Object.freeze(e.value),e}const $L=W("$ZodCustom",(e,t)=>{cn.init(e,t),dt.init(e,t),e._zod.parse=(r,s)=>r,e._zod.check=r=>{const s=r.value,i=t.fn(s);if(i instanceof Promise)return i.then(c=>Zw(c,r,s,e));Zw(i,r,s,e)}});function Zw(e,t,r,s){if(!e){const i={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(mc(i))}}var Qw;class UL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const s=r[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const s={...this.get(r)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function BL(){return new UL}(Qw=globalThis).__zod_globalRegistry??(Qw.__zod_globalRegistry=BL());const Ji=globalThis.__zod_globalRegistry;function qL(e,t){return new e({type:"string",...we(t)})}function FL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function Gw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function VL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function HL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function ZL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function QL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function GL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function YL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function KL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function XL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function JL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function WL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function e5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function t5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function n5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function r5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function o5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function s5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function a5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function i5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function c5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function l5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function u5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function f5(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function d5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function h5(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function p5(e,t){return new e({type:"number",checks:[],...we(t)})}function m5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function g5(e,t){return new e({type:"boolean",...we(t)})}function y5(e){return new e({type:"unknown"})}function v5(e,t){return new e({type:"never",...we(t)})}function Yw(e,t){return new y_({check:"less_than",...we(t),value:e,inclusive:!1})}function bp(e,t){return new y_({check:"less_than",...we(t),value:e,inclusive:!0})}function Kw(e,t){return new v_({check:"greater_than",...we(t),value:e,inclusive:!1})}function wp(e,t){return new v_({check:"greater_than",...we(t),value:e,inclusive:!0})}function Xw(e,t){return new zP({check:"multiple_of",...we(t),value:e})}function C_(e,t){return new PP({check:"max_length",...we(t),maximum:e})}function Iu(e,t){return new LP({check:"min_length",...we(t),minimum:e})}function E_(e,t){return new IP({check:"length_equals",...we(t),length:e})}function b5(e,t){return new $P({check:"string_format",format:"regex",...we(t),pattern:e})}function w5(e){return new UP({check:"string_format",format:"lowercase",...we(e)})}function S5(e){return new BP({check:"string_format",format:"uppercase",...we(e)})}function x5(e,t){return new qP({check:"string_format",format:"includes",...we(t),includes:e})}function _5(e,t){return new FP({check:"string_format",format:"starts_with",...we(t),prefix:e})}function C5(e,t){return new VP({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Fa(e){return new HP({check:"overwrite",tx:e})}function E5(e){return Fa(t=>t.normalize(e))}function R5(){return Fa(e=>e.trim())}function T5(){return Fa(e=>e.toLowerCase())}function A5(){return Fa(e=>e.toUpperCase())}function O5(){return Fa(e=>$4(e))}function k5(e,t,r){return new e({type:"array",element:t,...we(r)})}function M5(e,t,r){return new e({type:"custom",check:"custom",fn:t,...we(r)})}function N5(e){const t=j5(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(mc(s,r.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),r.issues.push(mc(i))}},e(r.value,r)));return t}function j5(e,t){const r=new cn({check:"custom",...we(t)});return r._zod.check=e,r}function R_(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ji,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ct(e,t,r={path:[],schemaPath:[]}){var s;const i=e._zod.def,c=t.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const y={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,y);else{const b=u.schema,_=t.processors[i.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);_(e,t,b,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),Ct(v,t,y),t.seen.get(v).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(u.schema,h),t.io==="input"&&Qt(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((s=u.schema).default??(s.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function T_(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const u of e.seen.entries()){const f=e.metadataRegistry.get(u[0])?.id;if(f){const h=s.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(f,u[0])}}const i=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,b=e.external.uri??(E=>E);if(v)return{ref:b(v)};const _=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=_,{defId:_,ref:`${b("__shared")}#/${f}/${_}`}}if(u[1]===r)return{ref:"#"};const p=`#/${f}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+y}},c=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:p}=i(u);f.def={...f.schema},p&&(f.defId=p);const y=f.schema;for(const v in y)delete y[v];y.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
56
+
57
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){c(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(f.cycle){c(u);continue}if(f.count>1&&e.reused==="ref"){c(u);continue}}}function A_(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=u=>{const f=e.seen.get(u);if(f.ref===null)return;const h=f.def??f.schema,p={...h},y=f.ref;if(f.ref=null,y){s(y);const b=e.seen.get(y),_=b.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(_)):Object.assign(h,_),Object.assign(h,p),u._zod.parent===y)for(const x in h)x==="$ref"||x==="allOf"||x in p||delete h[x];if(_.$ref&&b.def)for(const x in h)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(h[x])===JSON.stringify(b.def[x])&&delete h[x]}const v=u._zod.parent;if(v&&v!==y){s(v);const b=e.seen.get(v);if(b?.schema.$ref&&(h.$ref=b.schema.$ref,b.def))for(const _ in h)_==="$ref"||_==="allOf"||_ in b.def&&JSON.stringify(h[_])===JSON.stringify(b.def[_])&&delete h[_]}e.override({zodSchema:u,jsonSchema:h,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())s(u[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(u)}Object.assign(i,r.def??r.schema);const c=e.external?.defs??{};for(const u of e.seen.entries()){const f=u[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?i.$defs=c:i.definitions=c);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:$u(t,"input",e.processors),output:$u(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Qt(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Qt(s.element,r);if(s.type==="set")return Qt(s.valueType,r);if(s.type==="lazy")return Qt(s.getter(),r);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Qt(s.innerType,r);if(s.type==="intersection")return Qt(s.left,r)||Qt(s.right,r);if(s.type==="record"||s.type==="map")return Qt(s.keyType,r)||Qt(s.valueType,r);if(s.type==="pipe")return Qt(s.in,r)||Qt(s.out,r);if(s.type==="object"){for(const i in s.shape)if(Qt(s.shape[i],r))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(Qt(i,r))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(Qt(i,r))return!0;return!!(s.rest&&Qt(s.rest,r))}return!1}const z5=(e,t={})=>r=>{const s=R_({...r,processors:t});return Ct(e,s),T_(s,e),A_(s,e)},$u=(e,t,r={})=>s=>{const{libraryOptions:i,target:c}=s??{},u=R_({...i??{},target:c,io:t,processors:r});return Ct(e,u),T_(u,e),A_(u,e)},D5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},P5=(e,t,r,s)=>{const i=r;i.type="string";const{minimum:c,maximum:u,format:f,patterns:h,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(i.minLength=c),typeof u=="number"&&(i.maxLength=u),f&&(i.format=D5[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),h&&h.size>0){const y=[...h];y.length===1?i.pattern=y[0].source:y.length>1&&(i.allOf=[...y.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},L5=(e,t,r,s)=>{const i=r,{minimum:c,maximum:u,format:f,multipleOf:h,exclusiveMaximum:p,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=y,i.exclusiveMinimum=!0):i.exclusiveMinimum=y),typeof c=="number"&&(i.minimum=c,typeof y=="number"&&t.target!=="draft-04"&&(y>=c?delete i.minimum:delete i.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof u=="number"&&(i.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete i.maximum:delete i.exclusiveMaximum)),typeof h=="number"&&(i.multipleOf=h)},I5=(e,t,r,s)=>{r.type="boolean"},$5=(e,t,r,s)=>{r.not={}},U5=(e,t,r,s)=>{},B5=(e,t,r,s)=>{const i=e._zod.def,c=a_(i.entries);c.every(u=>typeof u=="number")&&(r.type="number"),c.every(u=>typeof u=="string")&&(r.type="string"),r.enum=c},q5=(e,t,r,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},F5=(e,t,r,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},V5=(e,t,r,s)=>{const i=r,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(i.minItems=u),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=Ct(c.element,t,{...s,path:[...s.path,"items"]})},H5=(e,t,r,s)=>{const i=r,c=e._zod.def;i.type="object",i.properties={};const u=c.shape;for(const p in u)i.properties[p]=Ct(u[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(u)),h=new Set([...f].filter(p=>{const y=c.shape[p]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));h.size>0&&(i.required=Array.from(h)),c.catchall?._zod.def.type==="never"?i.additionalProperties=!1:c.catchall?c.catchall&&(i.additionalProperties=Ct(c.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Z5=(e,t,r,s)=>{const i=e._zod.def,c=i.inclusive===!1,u=i.options.map((f,h)=>Ct(f,t,{...s,path:[...s.path,c?"oneOf":"anyOf",h]}));c?r.oneOf=u:r.anyOf=u},Q5=(e,t,r,s)=>{const i=e._zod.def,c=Ct(i.left,t,{...s,path:[...s.path,"allOf",0]}),u=Ct(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,h=[...f(c)?c.allOf:[c],...f(u)?u.allOf:[u]];r.allOf=h},G5=(e,t,r,s)=>{const i=r,c=e._zod.def;i.type="object";const u=c.keyType,h=u._zod.bag?.patterns;if(c.mode==="loose"&&h&&h.size>0){const y=Ct(c.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const v of h)i.patternProperties[v.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Ct(c.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=Ct(c.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=u._zod.values;if(p){const y=[...p].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(i.required=y)}},Y5=(e,t,r,s)=>{const i=e._zod.def,c=Ct(i.innerType,t,s),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=i.innerType,r.nullable=!0):r.anyOf=[c,{type:"null"}]},K5=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType},X5=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},J5=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},W5=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType;let u;try{u=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},e6=(e,t,r,s)=>{const i=e._zod.def,c=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ct(c,t,s);const u=t.seen.get(e);u.ref=c},t6=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType,r.readOnly=!0},O_=(e,t,r,s)=>{const i=e._zod.def;Ct(i.innerType,t,s);const c=t.seen.get(e);c.ref=i.innerType},n6=W("ZodISODateTime",(e,t)=>{sL.init(e,t),ct.init(e,t)});function r6(e){return u5(n6,e)}const o6=W("ZodISODate",(e,t)=>{aL.init(e,t),ct.init(e,t)});function s6(e){return f5(o6,e)}const a6=W("ZodISOTime",(e,t)=>{iL.init(e,t),ct.init(e,t)});function i6(e){return d5(a6,e)}const c6=W("ZodISODuration",(e,t)=>{cL.init(e,t),ct.init(e,t)});function l6(e){return h5(c6,e)}const u6=(e,t)=>{u_.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>J4(e,r)},flatten:{value:r=>X4(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Kp,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Kp,2)}},isEmpty:{get(){return e.issues.length===0}}})},Un=W("ZodError",u6,{Parent:Error}),f6=Vm(Un),d6=Hm(Un),h6=af(Un),p6=cf(Un),m6=tP(Un),g6=nP(Un),y6=rP(Un),v6=oP(Un),b6=sP(Un),w6=aP(Un),S6=iP(Un),x6=cP(Un),ht=W("ZodType",(e,t)=>(dt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:$u(e,"input"),output:$u(e,"output")}}),e.toJSONSchema=z5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(zo(t,{checks:[...t.checks??[],...r.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(r,s)=>Do(e,r,s),e.brand=()=>e,e.register=((r,s)=>(r.add(e,s),e)),e.parse=(r,s)=>f6(e,r,s,{callee:e.parse}),e.safeParse=(r,s)=>h6(e,r,s),e.parseAsync=async(r,s)=>d6(e,r,s,{callee:e.parseAsync}),e.safeParseAsync=async(r,s)=>p6(e,r,s),e.spa=e.safeParseAsync,e.encode=(r,s)=>m6(e,r,s),e.decode=(r,s)=>g6(e,r,s),e.encodeAsync=async(r,s)=>y6(e,r,s),e.decodeAsync=async(r,s)=>v6(e,r,s),e.safeEncode=(r,s)=>b6(e,r,s),e.safeDecode=(r,s)=>w6(e,r,s),e.safeEncodeAsync=async(r,s)=>S6(e,r,s),e.safeDecodeAsync=async(r,s)=>x6(e,r,s),e.refine=(r,s)=>e.check(yI(r,s)),e.superRefine=r=>e.check(vI(r)),e.overwrite=r=>e.check(Fa(r)),e.optional=()=>tS(e),e.exactOptional=()=>oI(e),e.nullable=()=>nS(e),e.nullish=()=>tS(nS(e)),e.nonoptional=r=>uI(e,r),e.array=()=>N_(e),e.or=r=>K6([e,r]),e.and=r=>J6(e,r),e.transform=r=>rS(e,nI(r)),e.default=r=>iI(e,r),e.prefault=r=>lI(e,r),e.catch=r=>dI(e,r),e.pipe=r=>rS(e,r),e.readonly=()=>mI(e),e.describe=r=>{const s=e.clone();return Ji.add(s,{description:r}),s},Object.defineProperty(e,"description",{get(){return Ji.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ji.get(e);const s=e.clone();return Ji.add(s,r[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),k_=W("_ZodString",(e,t)=>{Zm.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(s,i,c)=>P5(e,s,i);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...s)=>e.check(b5(...s)),e.includes=(...s)=>e.check(x5(...s)),e.startsWith=(...s)=>e.check(_5(...s)),e.endsWith=(...s)=>e.check(C5(...s)),e.min=(...s)=>e.check(Iu(...s)),e.max=(...s)=>e.check(C_(...s)),e.length=(...s)=>e.check(E_(...s)),e.nonempty=(...s)=>e.check(Iu(1,...s)),e.lowercase=s=>e.check(w5(s)),e.uppercase=s=>e.check(S5(s)),e.trim=()=>e.check(R5()),e.normalize=(...s)=>e.check(E5(...s)),e.toLowerCase=()=>e.check(T5()),e.toUpperCase=()=>e.check(A5()),e.slugify=()=>e.check(O5())}),_6=W("ZodString",(e,t)=>{Zm.init(e,t),k_.init(e,t),e.email=r=>e.check(FL(C6,r)),e.url=r=>e.check(GL(E6,r)),e.jwt=r=>e.check(l5(U6,r)),e.emoji=r=>e.check(YL(R6,r)),e.guid=r=>e.check(Gw(Jw,r)),e.uuid=r=>e.check(VL(ou,r)),e.uuidv4=r=>e.check(HL(ou,r)),e.uuidv6=r=>e.check(ZL(ou,r)),e.uuidv7=r=>e.check(QL(ou,r)),e.nanoid=r=>e.check(KL(T6,r)),e.guid=r=>e.check(Gw(Jw,r)),e.cuid=r=>e.check(XL(A6,r)),e.cuid2=r=>e.check(JL(O6,r)),e.ulid=r=>e.check(WL(k6,r)),e.base64=r=>e.check(a5(L6,r)),e.base64url=r=>e.check(i5(I6,r)),e.xid=r=>e.check(e5(M6,r)),e.ksuid=r=>e.check(t5(N6,r)),e.ipv4=r=>e.check(n5(j6,r)),e.ipv6=r=>e.check(r5(z6,r)),e.cidrv4=r=>e.check(o5(D6,r)),e.cidrv6=r=>e.check(s5(P6,r)),e.e164=r=>e.check(c5($6,r)),e.datetime=r=>e.check(r6(r)),e.date=r=>e.check(s6(r)),e.time=r=>e.check(i6(r)),e.duration=r=>e.check(l6(r))});function ir(e){return qL(_6,e)}const ct=W("ZodStringFormat",(e,t)=>{it.init(e,t),k_.init(e,t)}),C6=W("ZodEmail",(e,t)=>{KP.init(e,t),ct.init(e,t)}),Jw=W("ZodGUID",(e,t)=>{GP.init(e,t),ct.init(e,t)}),ou=W("ZodUUID",(e,t)=>{YP.init(e,t),ct.init(e,t)}),E6=W("ZodURL",(e,t)=>{XP.init(e,t),ct.init(e,t)}),R6=W("ZodEmoji",(e,t)=>{JP.init(e,t),ct.init(e,t)}),T6=W("ZodNanoID",(e,t)=>{WP.init(e,t),ct.init(e,t)}),A6=W("ZodCUID",(e,t)=>{eL.init(e,t),ct.init(e,t)}),O6=W("ZodCUID2",(e,t)=>{tL.init(e,t),ct.init(e,t)}),k6=W("ZodULID",(e,t)=>{nL.init(e,t),ct.init(e,t)}),M6=W("ZodXID",(e,t)=>{rL.init(e,t),ct.init(e,t)}),N6=W("ZodKSUID",(e,t)=>{oL.init(e,t),ct.init(e,t)}),j6=W("ZodIPv4",(e,t)=>{lL.init(e,t),ct.init(e,t)}),z6=W("ZodIPv6",(e,t)=>{uL.init(e,t),ct.init(e,t)}),D6=W("ZodCIDRv4",(e,t)=>{fL.init(e,t),ct.init(e,t)}),P6=W("ZodCIDRv6",(e,t)=>{dL.init(e,t),ct.init(e,t)}),L6=W("ZodBase64",(e,t)=>{hL.init(e,t),ct.init(e,t)}),I6=W("ZodBase64URL",(e,t)=>{mL.init(e,t),ct.init(e,t)}),$6=W("ZodE164",(e,t)=>{gL.init(e,t),ct.init(e,t)}),U6=W("ZodJWT",(e,t)=>{vL.init(e,t),ct.init(e,t)}),M_=W("ZodNumber",(e,t)=>{w_.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(s,i,c)=>L5(e,s,i),e.gt=(s,i)=>e.check(Kw(s,i)),e.gte=(s,i)=>e.check(wp(s,i)),e.min=(s,i)=>e.check(wp(s,i)),e.lt=(s,i)=>e.check(Yw(s,i)),e.lte=(s,i)=>e.check(bp(s,i)),e.max=(s,i)=>e.check(bp(s,i)),e.int=s=>e.check(Ww(s)),e.safe=s=>e.check(Ww(s)),e.positive=s=>e.check(Kw(0,s)),e.nonnegative=s=>e.check(wp(0,s)),e.negative=s=>e.check(Yw(0,s)),e.nonpositive=s=>e.check(bp(0,s)),e.multipleOf=(s,i)=>e.check(Xw(s,i)),e.step=(s,i)=>e.check(Xw(s,i)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function B6(e){return p5(M_,e)}const q6=W("ZodNumberFormat",(e,t)=>{bL.init(e,t),M_.init(e,t)});function Ww(e){return m5(q6,e)}const F6=W("ZodBoolean",(e,t)=>{wL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>I5(e,r,s)});function Qn(e){return g5(F6,e)}const V6=W("ZodUnknown",(e,t)=>{SL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>U5()});function eS(){return y5(V6)}const H6=W("ZodNever",(e,t)=>{xL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>$5(e,r,s)});function Z6(e){return v5(H6,e)}const Q6=W("ZodArray",(e,t)=>{_L.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>V5(e,r,s,i),e.element=t.element,e.min=(r,s)=>e.check(Iu(r,s)),e.nonempty=r=>e.check(Iu(1,r)),e.max=(r,s)=>e.check(C_(r,s)),e.length=(r,s)=>e.check(E_(r,s)),e.unwrap=()=>e.element});function N_(e,t){return k5(Q6,e,t)}const G6=W("ZodObject",(e,t)=>{EL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>H5(e,r,s,i),Ye(e,"shape",()=>t.shape),e.keyof=()=>Qm(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:eS()}),e.loose=()=>e.clone({...e._zod.def,catchall:eS()}),e.strict=()=>e.clone({...e._zod.def,catchall:Z6()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Z4(e,r),e.safeExtend=r=>Q4(e,r),e.merge=r=>G4(e,r),e.pick=r=>V4(e,r),e.omit=r=>H4(e,r),e.partial=(...r)=>Y4(j_,e,r[0]),e.required=(...r)=>K4(z_,e,r[0])});function Va(e,t){const r={type:"object",shape:e??{},...we(t)};return new G6(r)}const Y6=W("ZodUnion",(e,t)=>{RL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Z5(e,r,s,i),e.options=t.options});function K6(e,t){return new Y6({type:"union",options:e,...we(t)})}const X6=W("ZodIntersection",(e,t)=>{TL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Q5(e,r,s,i)});function J6(e,t){return new X6({type:"intersection",left:e,right:t})}const W6=W("ZodRecord",(e,t)=>{AL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>G5(e,r,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function eI(e,t,r){return new W6({type:"record",keyType:e,valueType:t,...we(r)})}const Jp=W("ZodEnum",(e,t)=>{OL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(s,i,c)=>B5(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const c={};for(const u of s)if(r.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Jp({...t,checks:[],...we(i),entries:c})},e.exclude=(s,i)=>{const c={...t.entries};for(const u of s)if(r.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new Jp({...t,checks:[],...we(i),entries:c})}});function Qm(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new Jp({type:"enum",entries:r,...we(t)})}const tI=W("ZodTransform",(e,t)=>{kL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>F5(e,r),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new o_(e.constructor.name);r.addIssue=c=>{if(typeof c=="string")r.issues.push(mc(c,r.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(mc(u))}};const i=t.transform(r.value,r);return i instanceof Promise?i.then(c=>(r.value=c,r)):(r.value=i,r)}});function nI(e){return new tI({type:"transform",transform:e})}const j_=W("ZodOptional",(e,t)=>{__.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>O_(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function tS(e){return new j_({type:"optional",innerType:e})}const rI=W("ZodExactOptional",(e,t)=>{ML.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>O_(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function oI(e){return new rI({type:"optional",innerType:e})}const sI=W("ZodNullable",(e,t)=>{NL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Y5(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function nS(e){return new sI({type:"nullable",innerType:e})}const aI=W("ZodDefault",(e,t)=>{jL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>X5(e,r,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function iI(e,t){return new aI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():c_(t)}})}const cI=W("ZodPrefault",(e,t)=>{zL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>J5(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function lI(e,t){return new cI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():c_(t)}})}const z_=W("ZodNonOptional",(e,t)=>{DL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>K5(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function uI(e,t){return new z_({type:"nonoptional",innerType:e,...we(t)})}const fI=W("ZodCatch",(e,t)=>{PL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>W5(e,r,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dI(e,t){return new fI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hI=W("ZodPipe",(e,t)=>{LL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>e6(e,r,s,i),e.in=t.in,e.out=t.out});function rS(e,t){return new hI({type:"pipe",in:e,out:t})}const pI=W("ZodReadonly",(e,t)=>{IL.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>t6(e,r,s,i),e.unwrap=()=>e._zod.def.innerType});function mI(e){return new pI({type:"readonly",innerType:e})}const gI=W("ZodCustom",(e,t)=>{$L.init(e,t),ht.init(e,t),e._zod.processJSONSchema=(r,s,i)=>q5(e,r)});function yI(e,t={}){return M5(gI,e,t)}function vI(e){return N5(e)}const bI=Va({id:ir(),path:ir(),label:ir(),icon:ir(),visible:Qn().default(!0),section:Qm(["main","config"]).default("main"),badge:ir().optional(),exact:Qn().optional()}),oS=Va({appName:ir().default("Convex CMS"),logo:ir().optional(),favicon:ir().optional()}),sS=Va({sidebarWidth:B6().min(200).max(400).default(256),sidebarCollapsible:Qn().default(!1)}),aS=Va({showDashboard:Qn().default(!0),showContent:Qn().default(!0),showMedia:Qn().default(!0),showTaxonomies:Qn().default(!0),showContentTypes:Qn().default(!0),showTrash:Qn().default(!0),showSettings:Qn().default(!0),customItems:N_(bI).default([])}),iS=Va({mode:Qm(["light","dark","system"]).default("system"),allowModeSwitch:Qn().default(!0),tokens:eI(ir(),ir()).optional()}),wI=Va({branding:oS.default(()=>oS.parse({})),layout:sS.default(()=>sS.parse({})),navigation:aS.default(()=>aS.parse({})),theme:iS.default(()=>iS.parse({}))}),SI=[{id:"dashboard",path:"/",label:"Dashboard",icon:"LayoutDashboard",section:"main",exact:!0},{id:"content",path:"/content",label:"Content",icon:"FileText",section:"main"},{id:"media",path:"/media",label:"Media",icon:"Image",section:"main"},{id:"taxonomies",path:"/taxonomies",label:"Taxonomies",icon:"Tags",section:"main"},{id:"content-types",path:"/content-types",label:"Content Types",icon:"Layers",section:"config"},{id:"trash",path:"/trash",label:"Trash",icon:"Trash2",section:"config"},{id:"settings",path:"/settings",label:"Settings",icon:"Settings",section:"config"}];function xI(e){return wI.parse(e??{})}function _I(e){const t={dashboard:e.navigation.showDashboard,content:e.navigation.showContent,media:e.navigation.showMedia,taxonomies:e.navigation.showTaxonomies,"content-types":e.navigation.showContentTypes,trash:e.navigation.showTrash,settings:e.navigation.showSettings},s=[...SI.filter(i=>t[i.id]!==!1),...e.navigation.customItems.filter(i=>i.visible!==!1)];return{main:s.filter(i=>i.section==="main"),config:s.filter(i=>i.section==="config")}}const D_=w.createContext(null);function CI({config:e,children:t}){const r=_I(e),s={...e,navItems:r};return g.jsx(D_.Provider,{value:s,children:t})}function Gm(){const e=w.useContext(D_);if(!e)throw new Error("useAdminConfig must be used within AdminConfigProvider");return e}const P_=w.createContext(null);function EI({baseConfig:e,children:t,api:r}){const s=R1(r?.getSettings??"skip"),i=w.useMemo(()=>s?{...e,navigation:{...e.navigation,showMedia:e.navigation.showMedia&&s.features.mediaManagement}}:e,[e,s]),c=w.useMemo(()=>({baseConfig:e,settings:s}),[e,s]);return g.jsx(P_.Provider,{value:c,children:g.jsx(CI,{config:i,children:t})})}function A7(){const e=w.useContext(P_);if(!e)throw new Error("useSettingsConfig must be used within SettingsConfigProvider");return e}const L_=w.createContext(null);function RI({children:e}){const[t,r]=w.useState(new Map),s=w.useCallback((u,f)=>{r(h=>{const p=new Map(h);return p.set(u,f),p})},[]),i=w.useCallback(u=>{r(f=>{const h=new Map(f);return h.delete(u),h})},[]),c=w.useMemo(()=>({overrides:t,setOverride:s,clearOverride:i}),[t,s,i]);return g.jsx(L_.Provider,{value:c,children:e})}function TI(){const e=w.useContext(L_);if(!e)throw new Error("useBreadcrumbContext must be used within a BreadcrumbProvider");return e}const AI={LayoutDashboard:ZD,FileText:AD,Image:z1,Layers:D1,Tags:T3,FileCode:RD,Settings:y3,Trash2:N3,HelpCircle:M1,Home:j1,User:I1,Bell:Qp,Lock:n3,Globe:ID,Calendar:Gp,Clock:pD,Link:KD,Hash:N1,ToggleLeft:L1,ChevronDown:Cs,CheckSquare:b3,Braces:A1,Folder:PD,MapPin:c3,DollarSign:wD,Mail:a3,Phone:p3,Package:d3,Star:_3,Heart:BD,Flag:ND,Bookmark:nD,Archive:Xz,Edit:S3,Eye:CD,AlertCircle:fD};function cS({name:e,className:t="size-5"}){const r=AI[e];return r?g.jsx(r,{className:t}):null}const I_=w.createContext(null);function OI({api:e,children:t}){return g.jsx(I_.Provider,{value:e,children:t})}function $_(){const e=w.useContext(I_);if(!e)throw new Error("useApi must be used within ApiProvider");return e}function pe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}function kI(e,t){const r=w.createContext(t),s=c=>{const{children:u,...f}=c,h=w.useMemo(()=>f,Object.values(f));return g.jsx(r.Provider,{value:h,children:u})};s.displayName=e+"Provider";function i(c){const u=w.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,i]}function pr(e,t=[]){let r=[];function s(c,u){const f=w.createContext(u),h=r.length;r=[...r,u];const p=v=>{const{scope:b,children:_,...E}=v,x=b?.[e]?.[h]||f,C=w.useMemo(()=>E,Object.values(E));return g.jsx(x.Provider,{value:C,children:_})};p.displayName=c+"Provider";function y(v,b){const _=b?.[e]?.[h]||f,E=w.useContext(_);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[p,y]}const i=()=>{const c=r.map(u=>w.createContext(u));return function(f){const h=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return i.scopeName=e,[s,MI(i,...t)]}function MI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(c){const u=s.reduce((f,{useScope:h,scopeName:p})=>{const v=h(c)[`__scope${p}`];return{...f,...v}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var Et=globalThis?.document?w.useLayoutEffect:()=>{},NI=Yu[" useInsertionEffect ".trim().toString()]||Et;function Ao({prop:e,defaultProp:t,onChange:r=()=>{},caller:s}){const[i,c,u]=jI({defaultProp:t,onChange:r}),f=e!==void 0,h=f?e:i;{const y=w.useRef(e!==void 0);w.useEffect(()=>{const v=y.current;v!==f&&console.warn(`${s} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,s])}const p=w.useCallback(y=>{if(f){const v=zI(y)?y(e):y;v!==e&&u.current?.(v)}else c(y)},[f,e,c,u]);return[h,p]}function jI({defaultProp:e,onChange:t}){const[r,s]=w.useState(e),i=w.useRef(r),c=w.useRef(t);return NI(()=>{c.current=t},[t]),w.useEffect(()=>{i.current!==r&&(c.current?.(r),i.current=r)},[r,i]),[r,s,c]}function zI(e){return typeof e=="function"}function lS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sc(...e){return t=>{let r=!1;const s=e.map(i=>{const c=lS(i,t);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():lS(e[i],null)}}}}function Ve(...e){return w.useCallback(Sc(...e),e)}function ys(e){const t=DI(e),r=w.forwardRef((s,i)=>{const{children:c,...u}=s,f=w.Children.toArray(c),h=f.find(LI);if(h){const p=h.props.children,y=f.map(v=>v===h?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:v);return g.jsx(t,{...u,ref:i,children:w.isValidElement(p)?w.cloneElement(p,void 0,y):null})}return g.jsx(t,{...u,ref:i,children:c})});return r.displayName=`${e}.Slot`,r}function DI(e){const t=w.forwardRef((r,s)=>{const{children:i,...c}=r;if(w.isValidElement(i)){const u=$I(i),f=II(c,i.props);return i.type!==w.Fragment&&(f.ref=s?Sc(s,u):u),w.cloneElement(i,f)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PI=Symbol("radix.slottable");function LI(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PI}function II(e,t){const r={...t};for(const s in t){const i=e[s],c=t[s];/^on[A-Z]/.test(s)?i&&c?r[s]=(...f)=>{const h=c(...f);return i(...f),h}:i&&(r[s]=i):s==="style"?r[s]={...i,...c}:s==="className"&&(r[s]=[i,c].filter(Boolean).join(" "))}return{...e,...r}}function $I(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var UI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=UI.reduce((e,t)=>{const r=ys(`Primitive.${t}`),s=w.forwardRef((i,c)=>{const{asChild:u,...f}=i,h=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...f,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function U_(e,t){e&&Ua.flushSync(()=>e.dispatchEvent(t))}function BI(e,t){return w.useReducer((r,s)=>t[r][s]??r,e)}var Bn=e=>{const{present:t,children:r}=e,s=qI(t),i=typeof r=="function"?r({present:s.isPresent}):w.Children.only(r),c=Ve(s.ref,FI(i));return typeof r=="function"||s.isPresent?w.cloneElement(i,{ref:c}):null};Bn.displayName="Presence";function qI(e){const[t,r]=w.useState(),s=w.useRef(null),i=w.useRef(e),c=w.useRef("none"),u=e?"mounted":"unmounted",[f,h]=BI(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=su(s.current);c.current=f==="mounted"?p:"none"},[f]),Et(()=>{const p=s.current,y=i.current;if(y!==e){const b=c.current,_=su(p);e?h("MOUNT"):_==="none"||p?.display==="none"?h("UNMOUNT"):h(y&&b!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,h]),Et(()=>{if(t){let p;const y=t.ownerDocument.defaultView??window,v=_=>{const x=su(s.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(h("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=_=>{_.target===t&&(c.current=su(s.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{y.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(p=>{s.current=p?getComputedStyle(p):null,r(p)},[])}}function su(e){return e?.animationName||"none"}function FI(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var VI=Yu[" useId ".trim().toString()]||(()=>{}),HI=0;function Gn(e){const[t,r]=w.useState(VI());return Et(()=>{r(s=>s??String(HI++))},[e]),e||(t?`radix-${t}`:"")}var uf="Collapsible",[ZI]=pr(uf),[QI,Ym]=ZI(uf),B_=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:c,onOpenChange:u,...f}=e,[h,p]=Ao({prop:s,defaultProp:i??!1,onChange:u,caller:uf});return g.jsx(QI,{scope:r,disabled:c,contentId:Gn(),open:h,onOpenToggle:w.useCallback(()=>p(y=>!y),[p]),children:g.jsx(Ae.div,{"data-state":Xm(h),"data-disabled":c?"":void 0,...f,ref:t})})});B_.displayName=uf;var q_="CollapsibleTrigger",F_=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,...s}=e,i=Ym(q_,r);return g.jsx(Ae.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Xm(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:t,onClick:pe(e.onClick,i.onOpenToggle)})});F_.displayName=q_;var Km="CollapsibleContent",V_=w.forwardRef((e,t)=>{const{forceMount:r,...s}=e,i=Ym(Km,e.__scopeCollapsible);return g.jsx(Bn,{present:r||i.open,children:({present:c})=>g.jsx(GI,{...s,ref:t,present:c})})});V_.displayName=Km;var GI=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:s,children:i,...c}=e,u=Ym(Km,r),[f,h]=w.useState(s),p=w.useRef(null),y=Ve(t,p),v=w.useRef(0),b=v.current,_=w.useRef(0),E=_.current,x=u.open||f,C=w.useRef(x),O=w.useRef(void 0);return w.useEffect(()=>{const M=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(M)},[]),Et(()=>{const M=p.current;if(M){O.current=O.current||{transitionDuration:M.style.transitionDuration,animationName:M.style.animationName},M.style.transitionDuration="0s",M.style.animationName="none";const k=M.getBoundingClientRect();v.current=k.height,_.current=k.width,C.current||(M.style.transitionDuration=O.current.transitionDuration,M.style.animationName=O.current.animationName),h(s)}},[u.open,s]),g.jsx(Ae.div,{"data-state":Xm(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...c,ref:y,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:x&&i})});function Xm(e){return e?"open":"closed"}var YI=B_;const KI=YI,XI=F_,JI=V_;function Kn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current?.(...r),[])}function WI(e,t=globalThis?.document){const r=Kn(e);w.useEffect(()=>{const s=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[r,t])}var e$="DismissableLayer",Wp="dismissableLayer.update",t$="dismissableLayer.pointerDownOutside",n$="dismissableLayer.focusOutside",uS,H_=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...h}=e,p=w.useContext(H_),[y,v]=w.useState(null),b=y?.ownerDocument??globalThis?.document,[,_]=w.useState({}),E=Ve(t,L=>v(L)),x=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),O=x.indexOf(C),M=y?x.indexOf(y):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,N=M>=O,U=s$(L=>{const z=L.target,Y=[...p.branches].some(ie=>ie.contains(z));!N||Y||(i?.(L),u?.(L),L.defaultPrevented||f?.())},b),H=a$(L=>{const z=L.target;[...p.branches].some(ie=>ie.contains(z))||(c?.(L),u?.(L),L.defaultPrevented||f?.())},b);return WI(L=>{M===p.layers.size-1&&(s?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},b),w.useEffect(()=>{if(y)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(uS=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),fS(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=uS)}},[y,b,r,p]),w.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),fS())},[y,p]),w.useEffect(()=>{const L=()=>_({});return document.addEventListener(Wp,L),()=>document.removeEventListener(Wp,L)},[]),g.jsx(Ae.div,{...h,ref:E,style:{pointerEvents:k?N?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,H.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,U.onPointerDownCapture)})});xc.displayName=e$;var r$="DismissableLayerBranch",o$=w.forwardRef((e,t)=>{const r=w.useContext(H_),s=w.useRef(null),i=Ve(t,s);return w.useEffect(()=>{const c=s.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),g.jsx(Ae.div,{...e,ref:i})});o$.displayName=r$;function s$(e,t=globalThis?.document){const r=Kn(e),s=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const c=f=>{if(f.target&&!s.current){let h=function(){Z_(t$,r,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=h,t.addEventListener("click",i.current,{once:!0})):h()}else t.removeEventListener("click",i.current);s.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}function a$(e,t=globalThis?.document){const r=Kn(e),s=w.useRef(!1);return w.useEffect(()=>{const i=c=>{c.target&&!s.current&&Z_(n$,r,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function fS(){const e=new CustomEvent(Wp);document.dispatchEvent(e)}function Z_(e,t,r,{discrete:s}){const i=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),s?U_(i,c):i.dispatchEvent(c)}var Sp="focusScope.autoFocusOnMount",xp="focusScope.autoFocusOnUnmount",dS={bubbles:!1,cancelable:!0},i$="FocusScope",_c=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:c,...u}=e,[f,h]=w.useState(null),p=Kn(i),y=Kn(c),v=w.useRef(null),b=Ve(t,x=>h(x)),_=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(s){let x=function(k){if(_.paused||!f)return;const N=k.target;f.contains(N)?v.current=N:bo(v.current,{select:!0})},C=function(k){if(_.paused||!f)return;const N=k.relatedTarget;N!==null&&(f.contains(N)||bo(v.current,{select:!0}))},O=function(k){if(document.activeElement===document.body)for(const U of k)U.removedNodes.length>0&&bo(f)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const M=new MutationObserver(O);return f&&M.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),M.disconnect()}}},[s,f,_.paused]),w.useEffect(()=>{if(f){pS.add(_);const x=document.activeElement;if(!f.contains(x)){const O=new CustomEvent(Sp,dS);f.addEventListener(Sp,p),f.dispatchEvent(O),O.defaultPrevented||(c$(h$(Q_(f)),{select:!0}),document.activeElement===x&&bo(f))}return()=>{f.removeEventListener(Sp,p),setTimeout(()=>{const O=new CustomEvent(xp,dS);f.addEventListener(xp,y),f.dispatchEvent(O),O.defaultPrevented||bo(x??document.body,{select:!0}),f.removeEventListener(xp,y),pS.remove(_)},0)}}},[f,p,y,_]);const E=w.useCallback(x=>{if(!r&&!s||_.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,O=document.activeElement;if(C&&O){const M=x.currentTarget,[k,N]=l$(M);k&&N?!x.shiftKey&&O===N?(x.preventDefault(),r&&bo(k,{select:!0})):x.shiftKey&&O===k&&(x.preventDefault(),r&&bo(N,{select:!0})):O===M&&x.preventDefault()}},[r,s,_.paused]);return g.jsx(Ae.div,{tabIndex:-1,...u,ref:b,onKeyDown:E})});_c.displayName=i$;function c$(e,{select:t=!1}={}){const r=document.activeElement;for(const s of e)if(bo(s,{select:t}),document.activeElement!==r)return}function l$(e){const t=Q_(e),r=hS(t,e),s=hS(t.reverse(),e);return[r,s]}function Q_(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function hS(e,t){for(const r of e)if(!u$(r,{upTo:t}))return r}function u$(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function f$(e){return e instanceof HTMLInputElement&&"select"in e}function bo(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&f$(e)&&t&&e.select()}}var pS=d$();function d$(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=mS(e,t),e.unshift(t)},remove(t){e=mS(e,t),e[0]?.resume()}}}function mS(e,t){const r=[...e],s=r.indexOf(t);return s!==-1&&r.splice(s,1),r}function h$(e){return e.filter(t=>t.tagName!=="A")}var p$="Portal",Cc=w.forwardRef((e,t)=>{const{container:r,...s}=e,[i,c]=w.useState(!1);Et(()=>c(!0),[]);const u=r||i&&globalThis?.document?.body;return u?yN.createPortal(g.jsx(Ae.div,{...s,ref:t}),u):null});Cc.displayName=p$;var _p=0;function ff(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gS()),document.body.insertAdjacentElement("beforeend",e[1]??gS()),_p++,()=>{_p===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_p--}},[])}function gS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var cr=function(){return cr=Object.assign||function(t){for(var r,s=1,i=arguments.length;s<i;s++){r=arguments[s];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])}return t},cr.apply(this,arguments)};function G_(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]]);return r}function m$(e,t,r){if(r||arguments.length===2)for(var s=0,i=t.length,c;s<i;s++)(c||!(s in t))&&(c||(c=Array.prototype.slice.call(t,0,s)),c[s]=t[s]);return e.concat(c||Array.prototype.slice.call(t))}var gu="right-scroll-bar-position",yu="width-before-scroll-bar",g$="with-scroll-bars-hidden",y$="--removed-body-scroll-bar-size";function Cp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function v$(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(s){var i=r.value;i!==s&&(r.value=s,r.callback(s,i))}}}})[0];return r.callback=t,r.facade}var b$=typeof window<"u"?w.useLayoutEffect:w.useEffect,yS=new WeakMap;function w$(e,t){var r=v$(null,function(s){return e.forEach(function(i){return Cp(i,s)})});return b$(function(){var s=yS.get(r);if(s){var i=new Set(s),c=new Set(e),u=r.current;i.forEach(function(f){c.has(f)||Cp(f,null)}),c.forEach(function(f){i.has(f)||Cp(f,u)})}yS.set(r,e)},[e]),r}function S$(e){return e}function x$(e,t){t===void 0&&(t=S$);var r=[],s=!1,i={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var u=t(c,s);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(s=!0;r.length;){var u=r;r=[],u.forEach(c)}r={push:function(f){return c(f)},filter:function(){return r}}},assignMedium:function(c){s=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(c),u=r}var h=function(){var y=u;u=[],y.forEach(c)},p=function(){return Promise.resolve().then(h)};p(),r={push:function(y){u.push(y),p()},filter:function(y){return u=u.filter(y),r}}}};return i}function _$(e){e===void 0&&(e={});var t=x$(null);return t.options=cr({async:!0,ssr:!1},e),t}var Y_=function(e){var t=e.sideCar,r=G_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return w.createElement(s,cr({},r))};Y_.isSideCarExport=!0;function C$(e,t){return e.useMedium(t),Y_}var K_=_$(),Ep=function(){},df=w.forwardRef(function(e,t){var r=w.useRef(null),s=w.useState({onScrollCapture:Ep,onWheelCapture:Ep,onTouchMoveCapture:Ep}),i=s[0],c=s[1],u=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,y=e.enabled,v=e.shards,b=e.sideCar,_=e.noRelative,E=e.noIsolation,x=e.inert,C=e.allowPinchZoom,O=e.as,M=O===void 0?"div":O,k=e.gapMode,N=G_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=b,H=w$([r,t]),L=cr(cr({},N),i);return w.createElement(w.Fragment,null,y&&w.createElement(U,{sideCar:K_,removeScrollBar:p,shards:v,noRelative:_,noIsolation:E,inert:x,setCallbacks:c,allowPinchZoom:!!C,lockRef:r,gapMode:k}),u?w.cloneElement(w.Children.only(f),cr(cr({},L),{ref:H})):w.createElement(M,cr({},L,{className:h,ref:H}),f))});df.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};df.classNames={fullWidth:yu,zeroRight:gu};var E$=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function R$(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=E$();return t&&e.setAttribute("nonce",t),e}function T$(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function A$(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var O$=function(){var e=0,t=null;return{add:function(r){e==0&&(t=R$())&&(T$(t,r),A$(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},k$=function(){var e=O$();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},X_=function(){var e=k$(),t=function(r){var s=r.styles,i=r.dynamic;return e(s,i),null};return t},M$={left:0,top:0,right:0,gap:0},Rp=function(e){return parseInt(e||"",10)||0},N$=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Rp(r),Rp(s),Rp(i)]},j$=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return M$;var t=N$(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-r+t[2]-t[0])}},z$=X_(),Na="data-scroll-locked",D$=function(e,t,r,s){var i=e.left,c=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
58
+ .`.concat(g$,` {
59
+ overflow: hidden `).concat(s,`;
60
+ padding-right: `).concat(f,"px ").concat(s,`;
61
+ }
62
+ body[`).concat(Na,`] {
63
+ overflow: hidden `).concat(s,`;
64
+ overscroll-behavior: contain;
65
+ `).concat([t&&"position: relative ".concat(s,";"),r==="margin"&&`
66
+ padding-left: `.concat(i,`px;
67
+ padding-top: `).concat(c,`px;
68
+ padding-right: `).concat(u,`px;
69
+ margin-left:0;
70
+ margin-top:0;
71
+ margin-right: `).concat(f,"px ").concat(s,`;
72
+ `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(s,";")].filter(Boolean).join(""),`
73
+ }
74
+
75
+ .`).concat(gu,` {
76
+ right: `).concat(f,"px ").concat(s,`;
77
+ }
78
+
79
+ .`).concat(yu,` {
80
+ margin-right: `).concat(f,"px ").concat(s,`;
81
+ }
82
+
83
+ .`).concat(gu," .").concat(gu,` {
84
+ right: 0 `).concat(s,`;
85
+ }
86
+
87
+ .`).concat(yu," .").concat(yu,` {
88
+ margin-right: 0 `).concat(s,`;
89
+ }
90
+
91
+ body[`).concat(Na,`] {
92
+ `).concat(y$,": ").concat(f,`px;
93
+ }
94
+ `)},vS=function(){var e=parseInt(document.body.getAttribute(Na)||"0",10);return isFinite(e)?e:0},P$=function(){w.useEffect(function(){return document.body.setAttribute(Na,(vS()+1).toString()),function(){var e=vS()-1;e<=0?document.body.removeAttribute(Na):document.body.setAttribute(Na,e.toString())}},[])},L$=function(e){var t=e.noRelative,r=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;P$();var c=w.useMemo(function(){return j$(i)},[i]);return w.createElement(z$,{styles:D$(c,!t,i,r?"":"!important")})},em=!1;if(typeof window<"u")try{var au=Object.defineProperty({},"passive",{get:function(){return em=!0,!0}});window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{em=!1}var ma=em?{passive:!1}:!1,I$=function(e){return e.tagName==="TEXTAREA"},J_=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!I$(e)&&r[t]==="visible")},$$=function(e){return J_(e,"overflowY")},U$=function(e){return J_(e,"overflowX")},bS=function(e,t){var r=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=W_(e,s);if(i){var c=eC(e,s),u=c[1],f=c[2];if(u>f)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},B$=function(e){var t=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[t,r,s]},q$=function(e){var t=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[t,r,s]},W_=function(e,t){return e==="v"?$$(t):U$(t)},eC=function(e,t){return e==="v"?B$(t):q$(t)},F$=function(e,t){return e==="h"&&t==="rtl"?-1:1},V$=function(e,t,r,s,i){var c=F$(e,window.getComputedStyle(t).direction),u=c*s,f=r.target,h=t.contains(f),p=!1,y=u>0,v=0,b=0;do{if(!f)break;var _=eC(e,f),E=_[0],x=_[1],C=_[2],O=x-C-c*E;(E||O)&&W_(e,f)&&(v+=O,b+=E);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},iu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wS=function(e){return[e.deltaX,e.deltaY]},SS=function(e){return e&&"current"in e?e.current:e},H$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Z$=function(e){return`
95
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
96
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
97
+ `)},Q$=0,ga=[];function G$(e){var t=w.useRef([]),r=w.useRef([0,0]),s=w.useRef(),i=w.useState(Q$++)[0],c=w.useState(X_)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=m$([e.lockRef.current],(e.shards||[]).map(SS),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!u.current.allowPinchZoom;var O=iu(x),M=r.current,k="deltaX"in x?x.deltaX:M[0]-O[0],N="deltaY"in x?x.deltaY:M[1]-O[1],U,H=x.target,L=Math.abs(k)>Math.abs(N)?"h":"v";if("touches"in x&&L==="h"&&H.type==="range")return!1;var z=window.getSelection(),Y=z&&z.anchorNode,ie=Y?Y===H||Y.contains(H):!1;if(ie)return!1;var ae=bS(L,H);if(!ae)return!0;if(ae?U=L:(U=L==="v"?"h":"v",ae=bS(L,H)),!ae)return!1;if(!s.current&&"changedTouches"in x&&(k||N)&&(s.current=U),!U)return!0;var oe=s.current||U;return V$(oe,C,x,oe==="h"?k:N)},[]),h=w.useCallback(function(x){var C=x;if(!(!ga.length||ga[ga.length-1]!==c)){var O="deltaY"in C?wS(C):iu(C),M=t.current.filter(function(U){return U.name===C.type&&(U.target===C.target||C.target===U.shadowParent)&&H$(U.delta,O)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var k=(u.current.shards||[]).map(SS).filter(Boolean).filter(function(U){return U.contains(C.target)}),N=k.length>0?f(C,k[0]):!u.current.noIsolation;N&&C.cancelable&&C.preventDefault()}}},[]),p=w.useCallback(function(x,C,O,M){var k={name:x,delta:C,target:O,should:M,shadowParent:Y$(O)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(N){return N!==k})},1)},[]),y=w.useCallback(function(x){r.current=iu(x),s.current=void 0},[]),v=w.useCallback(function(x){p(x.type,wS(x),x.target,f(x,e.lockRef.current))},[]),b=w.useCallback(function(x){p(x.type,iu(x),x.target,f(x,e.lockRef.current))},[]);w.useEffect(function(){return ga.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",h,ma),document.addEventListener("touchmove",h,ma),document.addEventListener("touchstart",y,ma),function(){ga=ga.filter(function(x){return x!==c}),document.removeEventListener("wheel",h,ma),document.removeEventListener("touchmove",h,ma),document.removeEventListener("touchstart",y,ma)}},[]);var _=e.removeScrollBar,E=e.inert;return w.createElement(w.Fragment,null,E?w.createElement(c,{styles:Z$(i)}):null,_?w.createElement(L$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Y$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const K$=C$(K_,G$);var Ec=w.forwardRef(function(e,t){return w.createElement(df,cr({},e,{ref:t,sideCar:K$}))});Ec.classNames=df.classNames;var X$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ya=new WeakMap,cu=new WeakMap,lu={},Tp=0,tC=function(e){return e&&(e.host||tC(e.parentNode))},J$=function(e,t){return t.map(function(r){if(e.contains(r))return r;var s=tC(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},W$=function(e,t,r,s){var i=J$(t,Array.isArray(e)?e:[e]);lu[r]||(lu[r]=new WeakMap);var c=lu[r],u=[],f=new Set,h=new Set(i),p=function(v){!v||f.has(v)||(f.add(v),p(v.parentNode))};i.forEach(p);var y=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(b){if(f.has(b))y(b);else try{var _=b.getAttribute(s),E=_!==null&&_!=="false",x=(ya.get(b)||0)+1,C=(c.get(b)||0)+1;ya.set(b,x),c.set(b,C),u.push(b),x===1&&E&&cu.set(b,!0),C===1&&b.setAttribute(r,"true"),E||b.setAttribute(s,"true")}catch(O){console.error("aria-hidden: cannot operate on ",b,O)}})};return y(t),f.clear(),Tp++,function(){u.forEach(function(v){var b=ya.get(v)-1,_=c.get(v)-1;ya.set(v,b),c.set(v,_),b||(cu.has(v)||v.removeAttribute(s),cu.delete(v)),_||v.removeAttribute(r)}),Tp--,Tp||(ya=new WeakMap,ya=new WeakMap,cu=new WeakMap,lu={})}},hf=function(e,t,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=X$(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),W$(s,i,r,"aria-hidden")):function(){return null}},pf="Dialog",[nC]=pr(pf),[e8,Wn]=nC(pf),rC=e=>{const{__scopeDialog:t,children:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=w.useRef(null),h=w.useRef(null),[p,y]=Ao({prop:s,defaultProp:i??!1,onChange:c,caller:pf});return g.jsx(e8,{scope:t,triggerRef:f,contentRef:h,contentId:Gn(),titleId:Gn(),descriptionId:Gn(),open:p,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};rC.displayName=pf;var oC="DialogTrigger",t8=w.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,i=Wn(oC,r),c=Ve(t,i.triggerRef);return g.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":eg(i.open),...s,ref:c,onClick:pe(e.onClick,i.onOpenToggle)})});t8.displayName=oC;var Jm="DialogPortal",[n8,sC]=nC(Jm,{forceMount:void 0}),aC=e=>{const{__scopeDialog:t,forceMount:r,children:s,container:i}=e,c=Wn(Jm,t);return g.jsx(n8,{scope:t,forceMount:r,children:w.Children.map(s,u=>g.jsx(Bn,{present:r||c.open,children:g.jsx(Cc,{asChild:!0,container:i,children:u})}))})};aC.displayName=Jm;var Uu="DialogOverlay",iC=w.forwardRef((e,t)=>{const r=sC(Uu,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,c=Wn(Uu,e.__scopeDialog);return c.modal?g.jsx(Bn,{present:s||c.open,children:g.jsx(o8,{...i,ref:t})}):null});iC.displayName=Uu;var r8=ys("DialogOverlay.RemoveScroll"),o8=w.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,i=Wn(Uu,r);return g.jsx(Ec,{as:r8,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(Ae.div,{"data-state":eg(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),vs="DialogContent",cC=w.forwardRef((e,t)=>{const r=sC(vs,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,c=Wn(vs,e.__scopeDialog);return g.jsx(Bn,{present:s||c.open,children:c.modal?g.jsx(s8,{...i,ref:t}):g.jsx(a8,{...i,ref:t})})});cC.displayName=vs;var s8=w.forwardRef((e,t)=>{const r=Wn(vs,e.__scopeDialog),s=w.useRef(null),i=Ve(t,r.contentRef,s);return w.useEffect(()=>{const c=s.current;if(c)return hf(c)},[]),g.jsx(lC,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,c=>{c.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:pe(e.onFocusOutside,c=>c.preventDefault())})}),a8=w.forwardRef((e,t)=>{const r=Wn(vs,e.__scopeDialog),s=w.useRef(!1),i=w.useRef(!1);return g.jsx(lC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(s.current||r.triggerRef.current?.focus(),c.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=c.target;r.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.current&&c.preventDefault()}})}),lC=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,...u}=e,f=Wn(vs,r),h=w.useRef(null),p=Ve(t,h);return ff(),g.jsxs(g.Fragment,{children:[g.jsx(_c,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:c,children:g.jsx(xc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":eg(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(i8,{titleId:f.titleId}),g.jsx(l8,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Wm="DialogTitle",uC=w.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,i=Wn(Wm,r);return g.jsx(Ae.h2,{id:i.titleId,...s,ref:t})});uC.displayName=Wm;var fC="DialogDescription",dC=w.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,i=Wn(fC,r);return g.jsx(Ae.p,{id:i.descriptionId,...s,ref:t})});dC.displayName=fC;var hC="DialogClose",pC=w.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,i=Wn(hC,r);return g.jsx(Ae.button,{type:"button",...s,ref:t,onClick:pe(e.onClick,()=>i.onOpenChange(!1))})});pC.displayName=hC;function eg(e){return e?"open":"closed"}var mC="DialogTitleWarning",[O7,gC]=kI(mC,{contentName:vs,titleName:Wm,docsSlug:"dialog"}),i8=({titleId:e})=>{const t=gC(mC),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
98
+
99
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
100
+
101
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},c8="DialogDescriptionWarning",l8=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gC(c8).contentName}}.`;return w.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},u8=rC,f8=aC,d8=iC,h8=cC,p8=uC,m8=dC,g8=pC;function y8({...e}){return g.jsx(u8,{"data-slot":"dialog",...e})}function v8({...e}){return g.jsx(f8,{"data-slot":"dialog-portal",...e})}function b8({className:e,...t}){return g.jsx(d8,{"data-slot":"dialog-overlay",className:je("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 w8({className:e,children:t,showCloseButton:r=!0,...s}){return g.jsxs(v8,{"data-slot":"dialog-portal",children:[g.jsx(b8,{}),g.jsxs(h8,{"data-slot":"dialog-content",className:je("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 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 outline-none sm:max-w-lg",e),...s,children:[t,r&&g.jsxs(g8,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(zu,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function S8({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:je("flex flex-col gap-2 text-center sm:text-left",e),...t})}function x8({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-footer",className:je("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function _8({className:e,...t}){return g.jsx(p8,{"data-slot":"dialog-title",className:je("text-lg leading-none font-semibold",e),...t})}function C8({className:e,...t}){return g.jsx(m8,{"data-slot":"dialog-description",className:je("text-muted-foreground text-sm",e),...t})}var E8=Symbol.for("react.lazy"),Bu=Yu[" use ".trim().toString()];function R8(e){return typeof e=="object"&&e!==null&&"then"in e}function yC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===E8&&"_payload"in e&&R8(e._payload)}function vC(e){const t=T8(e),r=w.forwardRef((s,i)=>{let{children:c,...u}=s;yC(c)&&typeof Bu=="function"&&(c=Bu(c._payload));const f=w.Children.toArray(c),h=f.find(O8);if(h){const p=h.props.children,y=f.map(v=>v===h?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:v);return g.jsx(t,{...u,ref:i,children:w.isValidElement(p)?w.cloneElement(p,void 0,y):null})}return g.jsx(t,{...u,ref:i,children:c})});return r.displayName=`${e}.Slot`,r}var bC=vC("Slot");function T8(e){const t=w.forwardRef((r,s)=>{let{children:i,...c}=r;if(yC(i)&&typeof Bu=="function"&&(i=Bu(i._payload)),w.isValidElement(i)){const u=M8(i),f=k8(c,i.props);return i.type!==w.Fragment&&(f.ref=s?Sc(s,u):u),w.cloneElement(i,f)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var A8=Symbol("radix.slottable");function O8(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A8}function k8(e,t){const r={...t};for(const s in t){const i=e[s],c=t[s];/^on[A-Z]/.test(s)?i&&c?r[s]=(...f)=>{const h=c(...f);return i(...f),h}:i&&(r[s]=i):s==="style"?r[s]={...i,...c}:s==="className"&&(r[s]=[i,c].filter(Boolean).join(" "))}return{...e,...r}}function M8(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const xS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_S=U1,N8=(e,t)=>r=>{var s;if(t?.variants==null)return _S(e,r?.class,r?.className);const{variants:i,defaultVariants:c}=t,u=Object.keys(i).map(p=>{const y=r?.[p],v=c?.[p];if(y===null)return null;const b=xS(y)||xS(v);return i[p][b]}),f=r&&Object.entries(r).reduce((p,y)=>{let[v,b]=y;return b===void 0||(p[v]=b),p},{}),h=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,y)=>{let{class:v,className:b,..._}=y;return Object.entries(_).every(E=>{let[x,C]=E;return Array.isArray(C)?C.includes({...c,...f}[x]):{...c,...f}[x]===C})?[...p,v,b]:p},[]);return _S(e,u,h,r?.class,r?.className)},j8=N8("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ic({className:e,variant:t="default",size:r="default",asChild:s=!1,...i}){const c=s?bC:"button";return g.jsx(c,{"data-slot":"button","data-variant":t,"data-size":r,className:je(j8({variant:t,size:r,className:e})),...i})}const CS={fast:"duration-100 ease-out"},z8={primary:"default",secondary:"secondary",danger:"destructive",ghost:"ghost",outline:"outline",link:"link",success:"default",warning:"default"},D8={success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success",warning:"bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning"},P8=()=>g.jsxs("svg",{className:"size-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[g.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),g.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});function Ur({variant:e="primary",loading:t,disabled:r,children:s,className:i,asChild:c,...u}){const f=z8[e],h=D8[e];return c?g.jsx(ic,{variant:f,disabled:r||t,className:je(CS.fast,h,i),asChild:!0,...u,children:s}):g.jsxs(ic,{variant:f,disabled:r||t,className:je(CS.fast,h,i),...u,children:[t&&g.jsx(P8,{}),s]})}const L8={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function tg({open:e,onOpenChange:t,title:r,description:s,children:i,footer:c,size:u="md",className:f}){return g.jsx(y8,{open:e,onOpenChange:t,children:g.jsxs(w8,{className:je("flex max-h-[85vh] flex-col overflow-hidden",L8[u],f),children:[g.jsxs(S8,{className:"shrink-0",children:[g.jsx(_8,{children:r}),s&&g.jsx(C8,{children:s})]}),g.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-4 [&::-webkit-scrollbar]:hidden",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:i}),c&&g.jsx(x8,{className:"shrink-0 border-t pt-4",children:c})]})})}function k7({open:e,onOpenChange:t,title:r,description:s,confirmLabel:i="Confirm",cancelLabel:c="Cancel",onConfirm:u,onCancel:f,variant:h="default",loading:p,isLoading:y,error:v}){const b=p??y??!1,_=()=>{f?.(),t(!1)},E=()=>{u()},x=()=>h==="danger"?"danger":h==="warning"?"warning":"primary";return g.jsx(tg,{open:e,onOpenChange:t,title:r,size:"sm",footer:g.jsxs(g.Fragment,{children:[g.jsx(Ur,{variant:"outline",onClick:_,disabled:b,children:c}),g.jsx(Ur,{variant:x(),onClick:E,loading:b,children:i})]}),children:g.jsxs("div",{className:"space-y-3",children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:s}),v&&g.jsx("p",{className:"text-sm text-destructive",children:v})]})})}function ss({className:e,type:t,...r}){return g.jsx("input",{type:t,"data-slot":"input",className:je("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var I8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mf=I8.reduce((e,t)=>{const r=vC(`Primitive.${t}`),s=w.forwardRef((i,c)=>{const{asChild:u,...f}=i,h=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...f,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),$8="Label",wC=w.forwardRef((e,t)=>g.jsx(mf.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));wC.displayName=$8;var U8=wC;function Dn({className:e,...t}){return g.jsx(U8,{"data-slot":"label",className:je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function B8({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:je("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),...t})}function SC(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function xC(e){const[t,r]=w.useState(void 0);return Et(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const c=i[0];let u,f;if("borderBoxSize"in c){const h=c.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,f=p.blockSize}else u=e.offsetWidth,f=e.offsetHeight;r({width:u,height:f})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var gf="Checkbox",[q8]=pr(gf),[F8,ng]=q8(gf);function V8(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:i,disabled:c,form:u,name:f,onCheckedChange:h,required:p,value:y="on",internal_do_not_use_render:v}=e,[b,_]=Ao({prop:r,defaultProp:i??!1,onChange:h,caller:gf}),[E,x]=w.useState(null),[C,O]=w.useState(null),M=w.useRef(!1),k=E?!!u||!!E.closest("form"):!0,N={checked:b,disabled:c,setChecked:_,control:E,setControl:x,name:f,form:u,value:y,hasConsumerStoppedPropagationRef:M,required:p,defaultChecked:Eo(i)?!1:i,isFormControl:k,bubbleInput:C,setBubbleInput:O};return g.jsx(F8,{scope:t,...N,children:H8(v)?v(N):s})}var _C="CheckboxTrigger",CC=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},i)=>{const{control:c,value:u,disabled:f,checked:h,required:p,setControl:y,setChecked:v,hasConsumerStoppedPropagationRef:b,isFormControl:_,bubbleInput:E}=ng(_C,e),x=Ve(i,y),C=w.useRef(h);return w.useEffect(()=>{const O=c?.form;if(O){const M=()=>v(C.current);return O.addEventListener("reset",M),()=>O.removeEventListener("reset",M)}},[c,v]),g.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":Eo(h)?"mixed":h,"aria-required":p,"data-state":kC(h),"data-disabled":f?"":void 0,disabled:f,value:u,...s,ref:x,onKeyDown:pe(t,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:pe(r,O=>{v(M=>Eo(M)?!0:!M),E&&_&&(b.current=O.isPropagationStopped(),b.current||O.stopPropagation())})})});CC.displayName=_C;var EC=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:i,defaultChecked:c,required:u,disabled:f,value:h,onCheckedChange:p,form:y,...v}=e;return g.jsx(V8,{__scopeCheckbox:r,checked:i,defaultChecked:c,disabled:f,required:u,onCheckedChange:p,name:s,form:y,value:h,internal_do_not_use_render:({isFormControl:b})=>g.jsxs(g.Fragment,{children:[g.jsx(CC,{...v,ref:t,__scopeCheckbox:r}),b&&g.jsx(OC,{__scopeCheckbox:r})]})})});EC.displayName=gf;var RC="CheckboxIndicator",TC=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...i}=e,c=ng(RC,r);return g.jsx(Bn,{present:s||Eo(c.checked)||c.checked===!0,children:g.jsx(Ae.span,{"data-state":kC(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});TC.displayName=RC;var AC="CheckboxBubbleInput",OC=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:i,checked:c,defaultChecked:u,required:f,disabled:h,name:p,value:y,form:v,bubbleInput:b,setBubbleInput:_}=ng(AC,e),E=Ve(r,_),x=SC(c),C=xC(s);w.useEffect(()=>{const M=b;if(!M)return;const k=window.HTMLInputElement.prototype,U=Object.getOwnPropertyDescriptor(k,"checked").set,H=!i.current;if(x!==c&&U){const L=new Event("click",{bubbles:H});M.indeterminate=Eo(c),U.call(M,Eo(c)?!1:c),M.dispatchEvent(L)}},[b,x,c,i]);const O=w.useRef(Eo(c)?!1:c);return g.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??O.current,required:f,disabled:h,name:p,value:y,form:v,...t,tabIndex:-1,ref:E,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});OC.displayName=AC;function H8(e){return typeof e=="function"}function Eo(e){return e==="indeterminate"}function kC(e){return Eo(e)?"indeterminate":e?"checked":"unchecked"}function ES({className:e,...t}){return g.jsx(EC,{"data-slot":"checkbox",className:je("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:g.jsx(TC,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:g.jsx(O1,{className:"size-3.5"})})})}function RS(e,[t,r]){return Math.min(r,Math.max(t,e))}function rg(e){const t=e+"CollectionProvider",[r,s]=pr(t),[i,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=x=>{const{scope:C,children:O}=x,M=Ft.useRef(null),k=Ft.useRef(new Map).current;return g.jsx(i,{scope:C,itemMap:k,collectionRef:M,children:O})};u.displayName=t;const f=e+"CollectionSlot",h=ys(f),p=Ft.forwardRef((x,C)=>{const{scope:O,children:M}=x,k=c(f,O),N=Ve(C,k.collectionRef);return g.jsx(h,{ref:N,children:M})});p.displayName=f;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=ys(y),_=Ft.forwardRef((x,C)=>{const{scope:O,children:M,...k}=x,N=Ft.useRef(null),U=Ve(C,N),H=c(y,O);return Ft.useEffect(()=>(H.itemMap.set(N,{ref:N,...k}),()=>{H.itemMap.delete(N)})),g.jsx(b,{[v]:"",ref:U,children:M})});_.displayName=y;function E(x){const C=c(e+"CollectionConsumer",x);return Ft.useCallback(()=>{const M=C.collectionRef.current;if(!M)return[];const k=Array.from(M.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((H,L)=>k.indexOf(H.ref.current)-k.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:u,Slot:p,ItemSlot:_},E,s]}var Z8=w.createContext(void 0);function og(e){const t=w.useContext(Z8);return e||t||"ltr"}const Q8=["top","right","bottom","left"],Oo=Math.min,bn=Math.max,qu=Math.round,uu=Math.floor,ur=e=>({x:e,y:e}),G8={left:"right",right:"left",bottom:"top",top:"bottom"},Y8={start:"end",end:"start"};function tm(e,t,r){return bn(e,Oo(t,r))}function Fr(e,t){return typeof e=="function"?e(t):e}function Vr(e){return e.split("-")[0]}function Ha(e){return e.split("-")[1]}function sg(e){return e==="x"?"y":"x"}function ag(e){return e==="y"?"height":"width"}const K8=new Set(["top","bottom"]);function lr(e){return K8.has(Vr(e))?"y":"x"}function ig(e){return sg(lr(e))}function X8(e,t,r){r===void 0&&(r=!1);const s=Ha(e),i=ig(e),c=ag(i);let u=i==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=Fu(u)),[u,Fu(u)]}function J8(e){const t=Fu(e);return[nm(e),t,nm(t)]}function nm(e){return e.replace(/start|end/g,t=>Y8[t])}const TS=["left","right"],AS=["right","left"],W8=["top","bottom"],eU=["bottom","top"];function tU(e,t,r){switch(e){case"top":case"bottom":return r?t?AS:TS:t?TS:AS;case"left":case"right":return t?W8:eU;default:return[]}}function nU(e,t,r,s){const i=Ha(e);let c=tU(Vr(e),r==="start",s);return i&&(c=c.map(u=>u+"-"+i),t&&(c=c.concat(c.map(nm)))),c}function Fu(e){return e.replace(/left|right|bottom|top/g,t=>G8[t])}function rU(e){return{top:0,right:0,bottom:0,left:0,...e}}function MC(e){return typeof e!="number"?rU(e):{top:e,right:e,bottom:e,left:e}}function Vu(e){const{x:t,y:r,width:s,height:i}=e;return{width:s,height:i,top:r,left:t,right:t+s,bottom:r+i,x:t,y:r}}function OS(e,t,r){let{reference:s,floating:i}=e;const c=lr(t),u=ig(t),f=ag(u),h=Vr(t),p=c==="y",y=s.x+s.width/2-i.width/2,v=s.y+s.height/2-i.height/2,b=s[f]/2-i[f]/2;let _;switch(h){case"top":_={x:y,y:s.y-i.height};break;case"bottom":_={x:y,y:s.y+s.height};break;case"right":_={x:s.x+s.width,y:v};break;case"left":_={x:s.x-i.width,y:v};break;default:_={x:s.x,y:s.y}}switch(Ha(t)){case"start":_[u]-=b*(r&&p?-1:1);break;case"end":_[u]+=b*(r&&p?-1:1);break}return _}async function oU(e,t){var r;t===void 0&&(t={});const{x:s,y:i,platform:c,rects:u,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:_=0}=Fr(t,e),E=MC(_),C=f[b?v==="floating"?"reference":"floating":v],O=Vu(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(C)))==null||r?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:y,strategy:h})),M=v==="floating"?{x:s,y:i,width:u.floating.width,height:u.floating.height}:u.reference,k=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),N=await(c.isElement==null?void 0:c.isElement(k))?await(c.getScale==null?void 0:c.getScale(k))||{x:1,y:1}:{x:1,y:1},U=Vu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:k,strategy:h}):M);return{top:(O.top-U.top+E.top)/N.y,bottom:(U.bottom-O.bottom+E.bottom)/N.y,left:(O.left-U.left+E.left)/N.x,right:(U.right-O.right+E.right)/N.x}}const sU=async(e,t,r)=>{const{placement:s="bottom",strategy:i="absolute",middleware:c=[],platform:u}=r,f=c.filter(Boolean),h=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:y,y:v}=OS(p,s,h),b=s,_={},E=0;for(let C=0;C<f.length;C++){var x;const{name:O,fn:M}=f[C],{x:k,y:N,data:U,reset:H}=await M({x:y,y:v,initialPlacement:s,placement:b,strategy:i,middlewareData:_,rects:p,platform:{...u,detectOverflow:(x=u.detectOverflow)!=null?x:oU},elements:{reference:e,floating:t}});y=k??y,v=N??v,_={..._,[O]:{..._[O],...U}},H&&E<=50&&(E++,typeof H=="object"&&(H.placement&&(b=H.placement),H.rects&&(p=H.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):H.rects),{x:y,y:v}=OS(p,b,h)),C=-1)}return{x:y,y:v,placement:b,strategy:i,middlewareData:_}},aU=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:i,rects:c,platform:u,elements:f,middlewareData:h}=t,{element:p,padding:y=0}=Fr(e,t)||{};if(p==null)return{};const v=MC(y),b={x:r,y:s},_=ig(i),E=ag(_),x=await u.getDimensions(p),C=_==="y",O=C?"top":"left",M=C?"bottom":"right",k=C?"clientHeight":"clientWidth",N=c.reference[E]+c.reference[_]-b[_]-c.floating[E],U=b[_]-c.reference[_],H=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let L=H?H[k]:0;(!L||!await(u.isElement==null?void 0:u.isElement(H)))&&(L=f.floating[k]||c.floating[E]);const z=N/2-U/2,Y=L/2-x[E]/2-1,ie=Oo(v[O],Y),ae=Oo(v[M],Y),oe=ie,le=L-x[E]-ae,ce=L/2-x[E]/2+z,me=tm(oe,ce,le),I=!h.arrow&&Ha(i)!=null&&ce!==me&&c.reference[E]/2-(ce<oe?ie:ae)-x[E]/2<0,K=I?ce<oe?ce-oe:ce-le:0;return{[_]:b[_]+K,data:{[_]:me,centerOffset:ce-me-K,...I&&{alignmentOffset:K}},reset:I}}}),iU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,s;const{placement:i,middlewareData:c,rects:u,initialPlacement:f,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:x=!0,...C}=Fr(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const O=Vr(i),M=lr(f),k=Vr(f)===f,N=await(h.isRTL==null?void 0:h.isRTL(p.floating)),U=b||(k||!x?[Fu(f)]:J8(f)),H=E!=="none";!b&&H&&U.push(...nU(f,x,E,N));const L=[f,...U],z=await h.detectOverflow(t,C),Y=[];let ie=((s=c.flip)==null?void 0:s.overflows)||[];if(y&&Y.push(z[O]),v){const ce=X8(i,u,N);Y.push(z[ce[0]],z[ce[1]])}if(ie=[...ie,{placement:i,overflows:Y}],!Y.every(ce=>ce<=0)){var ae,oe;const ce=(((ae=c.flip)==null?void 0:ae.index)||0)+1,me=L[ce];if(me&&(!(v==="alignment"?M!==lr(me):!1)||ie.every(V=>lr(V.placement)===M?V.overflows[0]>0:!0)))return{data:{index:ce,overflows:ie},reset:{placement:me}};let I=(oe=ie.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:oe.placement;if(!I)switch(_){case"bestFit":{var le;const K=(le=ie.filter(V=>{if(H){const te=lr(V.placement);return te===M||te==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(te=>te>0).reduce((te,ve)=>te+ve,0)]).sort((V,te)=>V[1]-te[1])[0])==null?void 0:le[0];K&&(I=K);break}case"initialPlacement":I=f;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function kS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MS(e){return Q8.some(t=>e[t]>=0)}const cU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:s}=t,{strategy:i="referenceHidden",...c}=Fr(e,t);switch(i){case"referenceHidden":{const u=await s.detectOverflow(t,{...c,elementContext:"reference"}),f=kS(u,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:MS(f)}}}case"escaped":{const u=await s.detectOverflow(t,{...c,altBoundary:!0}),f=kS(u,r.floating);return{data:{escapedOffsets:f,escaped:MS(f)}}}default:return{}}}}},NC=new Set(["left","top"]);async function lU(e,t){const{placement:r,platform:s,elements:i}=e,c=await(s.isRTL==null?void 0:s.isRTL(i.floating)),u=Vr(r),f=Ha(r),h=lr(r)==="y",p=NC.has(u)?-1:1,y=c&&h?-1:1,v=Fr(t,e);let{mainAxis:b,crossAxis:_,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(_=f==="end"?E*-1:E),h?{x:_*y,y:b*p}:{x:b*p,y:_*y}}const uU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,s;const{x:i,y:c,placement:u,middlewareData:f}=t,h=await lU(t,e);return u===((r=f.offset)==null?void 0:r.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:i+h.x,y:c+h.y,data:{...h,placement:u}}}}},fU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:i,platform:c}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:O=>{let{x:M,y:k}=O;return{x:M,y:k}}},...p}=Fr(e,t),y={x:r,y:s},v=await c.detectOverflow(t,p),b=lr(Vr(i)),_=sg(b);let E=y[_],x=y[b];if(u){const O=_==="y"?"top":"left",M=_==="y"?"bottom":"right",k=E+v[O],N=E-v[M];E=tm(k,E,N)}if(f){const O=b==="y"?"top":"left",M=b==="y"?"bottom":"right",k=x+v[O],N=x-v[M];x=tm(k,x,N)}const C=h.fn({...t,[_]:E,[b]:x});return{...C,data:{x:C.x-r,y:C.y-s,enabled:{[_]:u,[b]:f}}}}}},dU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:i,rects:c,middlewareData:u}=t,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=Fr(e,t),y={x:r,y:s},v=lr(i),b=sg(v);let _=y[b],E=y[v];const x=Fr(f,t),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const k=b==="y"?"height":"width",N=c.reference[b]-c.floating[k]+C.mainAxis,U=c.reference[b]+c.reference[k]-C.mainAxis;_<N?_=N:_>U&&(_=U)}if(p){var O,M;const k=b==="y"?"width":"height",N=NC.has(Vr(i)),U=c.reference[v]-c.floating[k]+(N&&((O=u.offset)==null?void 0:O[v])||0)+(N?0:C.crossAxis),H=c.reference[v]+c.reference[k]+(N?0:((M=u.offset)==null?void 0:M[v])||0)-(N?C.crossAxis:0);E<U?E=U:E>H&&(E=H)}return{[b]:_,[v]:E}}}},hU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,s;const{placement:i,rects:c,platform:u,elements:f}=t,{apply:h=()=>{},...p}=Fr(e,t),y=await u.detectOverflow(t,p),v=Vr(i),b=Ha(i),_=lr(i)==="y",{width:E,height:x}=c.floating;let C,O;v==="top"||v==="bottom"?(C=v,O=b===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(O=v,C=b==="end"?"top":"bottom");const M=x-y.top-y.bottom,k=E-y.left-y.right,N=Oo(x-y[C],M),U=Oo(E-y[O],k),H=!t.middlewareData.shift;let L=N,z=U;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(z=k),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(L=M),H&&!b){const ie=bn(y.left,0),ae=bn(y.right,0),oe=bn(y.top,0),le=bn(y.bottom,0);_?z=E-2*(ie!==0||ae!==0?ie+ae:bn(y.left,y.right)):L=x-2*(oe!==0||le!==0?oe+le:bn(y.top,y.bottom))}await h({...t,availableWidth:z,availableHeight:L});const Y=await u.getDimensions(f.floating);return E!==Y.width||x!==Y.height?{reset:{rects:!0}}:{}}}};function yf(){return typeof window<"u"}function Za(e){return jC(e)?(e.nodeName||"").toLowerCase():"#document"}function Sn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mr(e){var t;return(t=(jC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jC(e){return yf()?e instanceof Node||e instanceof Sn(e).Node:!1}function Xn(e){return yf()?e instanceof Element||e instanceof Sn(e).Element:!1}function dr(e){return yf()?e instanceof HTMLElement||e instanceof Sn(e).HTMLElement:!1}function NS(e){return!yf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sn(e).ShadowRoot}const pU=new Set(["inline","contents"]);function Rc(e){const{overflow:t,overflowX:r,overflowY:s,display:i}=Jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!pU.has(i)}const mU=new Set(["table","td","th"]);function gU(e){return mU.has(Za(e))}const yU=[":popover-open",":modal"];function vf(e){return yU.some(t=>{try{return e.matches(t)}catch{return!1}})}const vU=["transform","translate","scale","rotate","perspective"],bU=["transform","translate","scale","rotate","perspective","filter"],wU=["paint","layout","strict","content"];function cg(e){const t=lg(),r=Xn(e)?Jn(e):e;return vU.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||bU.some(s=>(r.willChange||"").includes(s))||wU.some(s=>(r.contain||"").includes(s))}function SU(e){let t=ko(e);for(;dr(t)&&!Ia(t);){if(cg(t))return t;if(vf(t))return null;t=ko(t)}return null}function lg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xU=new Set(["html","body","#document"]);function Ia(e){return xU.has(Za(e))}function Jn(e){return Sn(e).getComputedStyle(e)}function bf(e){return Xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ko(e){if(Za(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NS(e)&&e.host||mr(e);return NS(t)?t.host:t}function zC(e){const t=ko(e);return Ia(t)?e.ownerDocument?e.ownerDocument.body:e.body:dr(t)&&Rc(t)?t:zC(t)}function gc(e,t,r){var s;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=zC(e),c=i===((s=e.ownerDocument)==null?void 0:s.body),u=Sn(i);if(c){const f=rm(u);return t.concat(u,u.visualViewport||[],Rc(i)?i:[],f&&r?gc(f):[])}return t.concat(i,gc(i,[],r))}function rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function DC(e){const t=Jn(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=dr(e),c=i?e.offsetWidth:r,u=i?e.offsetHeight:s,f=qu(r)!==c||qu(s)!==u;return f&&(r=c,s=u),{width:r,height:s,$:f}}function ug(e){return Xn(e)?e:e.contextElement}function ja(e){const t=ug(e);if(!dr(t))return ur(1);const r=t.getBoundingClientRect(),{width:s,height:i,$:c}=DC(t);let u=(c?qu(r.width):r.width)/s,f=(c?qu(r.height):r.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const _U=ur(0);function PC(e){const t=Sn(e);return!lg()||!t.visualViewport?_U:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function CU(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Sn(e)?!1:t}function bs(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),c=ug(e);let u=ur(1);t&&(s?Xn(s)&&(u=ja(s)):u=ja(e));const f=CU(c,r,s)?PC(c):ur(0);let h=(i.left+f.x)/u.x,p=(i.top+f.y)/u.y,y=i.width/u.x,v=i.height/u.y;if(c){const b=Sn(c),_=s&&Xn(s)?Sn(s):s;let E=b,x=rm(E);for(;x&&s&&_!==E;){const C=ja(x),O=x.getBoundingClientRect(),M=Jn(x),k=O.left+(x.clientLeft+parseFloat(M.paddingLeft))*C.x,N=O.top+(x.clientTop+parseFloat(M.paddingTop))*C.y;h*=C.x,p*=C.y,y*=C.x,v*=C.y,h+=k,p+=N,E=Sn(x),x=rm(E)}}return Vu({width:y,height:v,x:h,y:p})}function wf(e,t){const r=bf(e).scrollLeft;return t?t.left+r:bs(mr(e)).left+r}function LC(e,t){const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-wf(e,r),i=r.top+t.scrollTop;return{x:s,y:i}}function EU(e){let{elements:t,rect:r,offsetParent:s,strategy:i}=e;const c=i==="fixed",u=mr(s),f=t?vf(t.floating):!1;if(s===u||f&&c)return r;let h={scrollLeft:0,scrollTop:0},p=ur(1);const y=ur(0),v=dr(s);if((v||!v&&!c)&&((Za(s)!=="body"||Rc(u))&&(h=bf(s)),dr(s))){const _=bs(s);p=ja(s),y.x=_.x+s.clientLeft,y.y=_.y+s.clientTop}const b=u&&!v&&!c?LC(u,h):ur(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-h.scrollLeft*p.x+y.x+b.x,y:r.y*p.y-h.scrollTop*p.y+y.y+b.y}}function RU(e){return Array.from(e.getClientRects())}function TU(e){const t=mr(e),r=bf(e),s=e.ownerDocument.body,i=bn(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),c=bn(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let u=-r.scrollLeft+wf(e);const f=-r.scrollTop;return Jn(s).direction==="rtl"&&(u+=bn(t.clientWidth,s.clientWidth)-i),{width:i,height:c,x:u,y:f}}const jS=25;function AU(e,t){const r=Sn(e),s=mr(e),i=r.visualViewport;let c=s.clientWidth,u=s.clientHeight,f=0,h=0;if(i){c=i.width,u=i.height;const y=lg();(!y||y&&t==="fixed")&&(f=i.offsetLeft,h=i.offsetTop)}const p=wf(s);if(p<=0){const y=s.ownerDocument,v=y.body,b=getComputedStyle(v),_=y.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(s.clientWidth-v.clientWidth-_);E<=jS&&(c-=E)}else p<=jS&&(c+=p);return{width:c,height:u,x:f,y:h}}const OU=new Set(["absolute","fixed"]);function kU(e,t){const r=bs(e,!0,t==="fixed"),s=r.top+e.clientTop,i=r.left+e.clientLeft,c=dr(e)?ja(e):ur(1),u=e.clientWidth*c.x,f=e.clientHeight*c.y,h=i*c.x,p=s*c.y;return{width:u,height:f,x:h,y:p}}function zS(e,t,r){let s;if(t==="viewport")s=AU(e,r);else if(t==="document")s=TU(mr(e));else if(Xn(t))s=kU(t,r);else{const i=PC(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Vu(s)}function IC(e,t){const r=ko(e);return r===t||!Xn(r)||Ia(r)?!1:Jn(r).position==="fixed"||IC(r,t)}function MU(e,t){const r=t.get(e);if(r)return r;let s=gc(e,[],!1).filter(f=>Xn(f)&&Za(f)!=="body"),i=null;const c=Jn(e).position==="fixed";let u=c?ko(e):e;for(;Xn(u)&&!Ia(u);){const f=Jn(u),h=cg(u);!h&&f.position==="fixed"&&(i=null),(c?!h&&!i:!h&&f.position==="static"&&!!i&&OU.has(i.position)||Rc(u)&&!h&&IC(e,u))?s=s.filter(y=>y!==u):i=f,u=ko(u)}return t.set(e,s),s}function NU(e){let{element:t,boundary:r,rootBoundary:s,strategy:i}=e;const u=[...r==="clippingAncestors"?vf(t)?[]:MU(t,this._c):[].concat(r),s],f=u[0],h=u.reduce((p,y)=>{const v=zS(t,y,i);return p.top=bn(v.top,p.top),p.right=Oo(v.right,p.right),p.bottom=Oo(v.bottom,p.bottom),p.left=bn(v.left,p.left),p},zS(t,f,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function jU(e){const{width:t,height:r}=DC(e);return{width:t,height:r}}function zU(e,t,r){const s=dr(t),i=mr(t),c=r==="fixed",u=bs(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const h=ur(0);function p(){h.x=wf(i)}if(s||!s&&!c)if((Za(t)!=="body"||Rc(i))&&(f=bf(t)),s){const _=bs(t,!0,c,t);h.x=_.x+t.clientLeft,h.y=_.y+t.clientTop}else i&&p();c&&!s&&i&&p();const y=i&&!s&&!c?LC(i,f):ur(0),v=u.left+f.scrollLeft-h.x-y.x,b=u.top+f.scrollTop-h.y-y.y;return{x:v,y:b,width:u.width,height:u.height}}function Ap(e){return Jn(e).position==="static"}function DS(e,t){if(!dr(e)||Jn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return mr(e)===r&&(r=r.ownerDocument.body),r}function $C(e,t){const r=Sn(e);if(vf(e))return r;if(!dr(e)){let i=ko(e);for(;i&&!Ia(i);){if(Xn(i)&&!Ap(i))return i;i=ko(i)}return r}let s=DS(e,t);for(;s&&gU(s)&&Ap(s);)s=DS(s,t);return s&&Ia(s)&&Ap(s)&&!cg(s)?r:s||SU(e)||r}const DU=async function(e){const t=this.getOffsetParent||$C,r=this.getDimensions,s=await r(e.floating);return{reference:zU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function PU(e){return Jn(e).direction==="rtl"}const LU={convertOffsetParentRelativeRectToViewportRelativeRect:EU,getDocumentElement:mr,getClippingRect:NU,getOffsetParent:$C,getElementRects:DU,getClientRects:RU,getDimensions:jU,getScale:ja,isElement:Xn,isRTL:PU};function UC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IU(e,t){let r=null,s;const i=mr(e);function c(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function u(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),c();const p=e.getBoundingClientRect(),{left:y,top:v,width:b,height:_}=p;if(f||t(),!b||!_)return;const E=uu(v),x=uu(i.clientWidth-(y+b)),C=uu(i.clientHeight-(v+_)),O=uu(y),k={rootMargin:-E+"px "+-x+"px "+-C+"px "+-O+"px",threshold:bn(0,Oo(1,h))||1};let N=!0;function U(H){const L=H[0].intersectionRatio;if(L!==h){if(!N)return u();L?u(!1,L):s=setTimeout(()=>{u(!1,1e-7)},1e3)}L===1&&!UC(p,e.getBoundingClientRect())&&u(),N=!1}try{r=new IntersectionObserver(U,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(U,k)}r.observe(e)}return u(!0),c}function $U(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,p=ug(e),y=i||c?[...p?gc(p):[],...gc(t)]:[];y.forEach(O=>{i&&O.addEventListener("scroll",r,{passive:!0}),c&&O.addEventListener("resize",r)});const v=p&&f?IU(p,r):null;let b=-1,_=null;u&&(_=new ResizeObserver(O=>{let[M]=O;M&&M.target===p&&_&&(_.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var k;(k=_)==null||k.observe(t)})),r()}),p&&!h&&_.observe(p),_.observe(t));let E,x=h?bs(e):null;h&&C();function C(){const O=bs(e);x&&!UC(x,O)&&r(),x=O,E=requestAnimationFrame(C)}return r(),()=>{var O;y.forEach(M=>{i&&M.removeEventListener("scroll",r),c&&M.removeEventListener("resize",r)}),v?.(),(O=_)==null||O.disconnect(),_=null,h&&cancelAnimationFrame(E)}}const UU=uU,BU=fU,qU=iU,FU=hU,VU=cU,PS=aU,HU=dU,ZU=(e,t,r)=>{const s=new Map,i={platform:LU,...r},c={...i.platform,_c:s};return sU(e,t,{...i,platform:c})};var QU=typeof document<"u",GU=function(){},vu=QU?w.useLayoutEffect:GU;function Hu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(s=r;s--!==0;)if(!Hu(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){const c=i[s];if(!(c==="_owner"&&e.$$typeof)&&!Hu(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function BC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function LS(e,t){const r=BC(e);return Math.round(t*r)/r}function Op(e){const t=w.useRef(e);return vu(()=>{t.current=e}),t}function YU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:i,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[y,v]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,_]=w.useState(s);Hu(b,s)||_(s);const[E,x]=w.useState(null),[C,O]=w.useState(null),M=w.useCallback(V=>{V!==H.current&&(H.current=V,x(V))},[]),k=w.useCallback(V=>{V!==L.current&&(L.current=V,O(V))},[]),N=c||E,U=u||C,H=w.useRef(null),L=w.useRef(null),z=w.useRef(y),Y=h!=null,ie=Op(h),ae=Op(i),oe=Op(p),le=w.useCallback(()=>{if(!H.current||!L.current)return;const V={placement:t,strategy:r,middleware:b};ae.current&&(V.platform=ae.current),ZU(H.current,L.current,V).then(te=>{const ve={...te,isPositioned:oe.current!==!1};ce.current&&!Hu(z.current,ve)&&(z.current=ve,Ua.flushSync(()=>{v(ve)}))})},[b,t,r,ae,oe]);vu(()=>{p===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,v(V=>({...V,isPositioned:!1})))},[p]);const ce=w.useRef(!1);vu(()=>(ce.current=!0,()=>{ce.current=!1}),[]),vu(()=>{if(N&&(H.current=N),U&&(L.current=U),N&&U){if(ie.current)return ie.current(N,U,le);le()}},[N,U,le,ie,Y]);const me=w.useMemo(()=>({reference:H,floating:L,setReference:M,setFloating:k}),[M,k]),I=w.useMemo(()=>({reference:N,floating:U}),[N,U]),K=w.useMemo(()=>{const V={position:r,left:0,top:0};if(!I.floating)return V;const te=LS(I.floating,y.x),ve=LS(I.floating,y.y);return f?{...V,transform:"translate("+te+"px, "+ve+"px)",...BC(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:te,top:ve}},[r,f,I.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:le,refs:me,elements:I,floatingStyles:K}),[y,le,me,I,K])}const KU=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:i}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?PS({element:s.current,padding:i}).fn(r):{}:s?PS({element:s,padding:i}).fn(r):{}}}},XU=(e,t)=>({...UU(e),options:[e,t]}),JU=(e,t)=>({...BU(e),options:[e,t]}),WU=(e,t)=>({...HU(e),options:[e,t]}),eB=(e,t)=>({...qU(e),options:[e,t]}),tB=(e,t)=>({...FU(e),options:[e,t]}),nB=(e,t)=>({...VU(e),options:[e,t]}),rB=(e,t)=>({...KU(e),options:[e,t]});var oB="Arrow",qC=w.forwardRef((e,t)=>{const{children:r,width:s=10,height:i=5,...c}=e;return g.jsx(Ae.svg,{...c,ref:t,width:s,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});qC.displayName=oB;var sB=qC,fg="Popper",[FC,Qa]=pr(fg),[aB,VC]=FC(fg),HC=e=>{const{__scopePopper:t,children:r}=e,[s,i]=w.useState(null);return g.jsx(aB,{scope:t,anchor:s,onAnchorChange:i,children:r})};HC.displayName=fg;var ZC="PopperAnchor",QC=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...i}=e,c=VC(ZC,r),u=w.useRef(null),f=Ve(t,u),h=w.useRef(null);return w.useEffect(()=>{const p=h.current;h.current=s?.current||u.current,p!==h.current&&c.onAnchorChange(h.current)}),s?null:g.jsx(Ae.div,{...i,ref:f})});QC.displayName=ZC;var dg="PopperContent",[iB,cB]=FC(dg),GC=w.forwardRef((e,t)=>{const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:c="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:_="optimized",onPlaced:E,...x}=e,C=VC(dg,r),[O,M]=w.useState(null),k=Ve(t,X=>M(X)),[N,U]=w.useState(null),H=xC(N),L=H?.width??0,z=H?.height??0,Y=s+(c!=="center"?"-"+c:""),ie=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ae=Array.isArray(p)?p:[p],oe=ae.length>0,le={padding:ie,boundary:ae.filter(uB),altBoundary:oe},{refs:ce,floatingStyles:me,placement:I,isPositioned:K,middlewareData:V}=YU({strategy:"fixed",placement:Y,whileElementsMounted:(...X)=>$U(...X,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[XU({mainAxis:i+z,alignmentAxis:u}),h&&JU({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?WU():void 0,...le}),h&&eB({...le}),tB({...le,apply:({elements:X,rects:xe,availableWidth:Ce,availableHeight:Ee})=>{const{width:Oe,height:ze}=xe.reference,lt=X.floating.style;lt.setProperty("--radix-popper-available-width",`${Ce}px`),lt.setProperty("--radix-popper-available-height",`${Ee}px`),lt.setProperty("--radix-popper-anchor-width",`${Oe}px`),lt.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),N&&rB({element:N,padding:f}),fB({arrowWidth:L,arrowHeight:z}),b&&nB({strategy:"referenceHidden",...le})]}),[te,ve]=XC(I),D=Kn(E);Et(()=>{K&&D?.()},[K,D]);const Q=V.arrow?.x,ne=V.arrow?.y,re=V.arrow?.centerOffset!==0,[ue,ye]=w.useState();return Et(()=>{O&&ye(window.getComputedStyle(O).zIndex)},[O]),g.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...me,transform:K?me.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(iB,{scope:r,placedSide:te,onArrowChange:U,arrowX:Q,arrowY:ne,shouldHideArrow:re,children:g.jsx(Ae.div,{"data-side":te,"data-align":ve,...x,ref:k,style:{...x.style,animation:K?void 0:"none"}})})})});GC.displayName=dg;var YC="PopperArrow",lB={top:"bottom",right:"left",bottom:"top",left:"right"},KC=w.forwardRef(function(t,r){const{__scopePopper:s,...i}=t,c=cB(YC,s),u=lB[c.placedSide];return g.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:g.jsx(sB,{...i,ref:r,style:{...i.style,display:"block"}})})});KC.displayName=YC;function uB(e){return e!==null}var fB=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:s,middlewareData:i}=t,u=i.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[p,y]=XC(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(i.arrow?.x??0)+f/2,_=(i.arrow?.y??0)+h/2;let E="",x="";return p==="bottom"?(E=u?v:`${b}px`,x=`${-h}px`):p==="top"?(E=u?v:`${b}px`,x=`${s.floating.height+h}px`):p==="right"?(E=`${-h}px`,x=u?v:`${_}px`):p==="left"&&(E=`${s.floating.width+h}px`,x=u?v:`${_}px`),{data:{x:E,y:x}}}});function XC(e){const[t,r="center"]=e.split("-");return[t,r]}var hg=HC,Sf=QC,pg=GC,mg=KC,JC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dB="VisuallyHidden",hB=w.forwardRef((e,t)=>g.jsx(Ae.span,{...e,ref:t,style:{...JC,...e.style}}));hB.displayName=dB;var pB=[" ","Enter","ArrowUp","ArrowDown"],mB=[" ","Enter"],ws="Select",[xf,_f,gB]=rg(ws),[Ga]=pr(ws,[gB,Qa]),Cf=Qa(),[yB,Po]=Ga(ws),[vB,bB]=Ga(ws),WC=e=>{const{__scopeSelect:t,children:r,open:s,defaultOpen:i,onOpenChange:c,value:u,defaultValue:f,onValueChange:h,dir:p,name:y,autoComplete:v,disabled:b,required:_,form:E}=e,x=Cf(t),[C,O]=w.useState(null),[M,k]=w.useState(null),[N,U]=w.useState(!1),H=og(p),[L,z]=Ao({prop:s,defaultProp:i??!1,onChange:c,caller:ws}),[Y,ie]=Ao({prop:u,defaultProp:f,onChange:h,caller:ws}),ae=w.useRef(null),oe=C?E||!!C.closest("form"):!0,[le,ce]=w.useState(new Set),me=Array.from(le).map(I=>I.props.value).join(";");return g.jsx(hg,{...x,children:g.jsxs(yB,{required:_,scope:t,trigger:C,onTriggerChange:O,valueNode:M,onValueNodeChange:k,valueNodeHasChildren:N,onValueNodeHasChildrenChange:U,contentId:Gn(),value:Y,onValueChange:ie,open:L,onOpenChange:z,dir:H,triggerPointerDownPosRef:ae,disabled:b,children:[g.jsx(xf.Provider,{scope:t,children:g.jsx(vB,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(I=>{ce(K=>new Set(K).add(I))},[]),onNativeOptionRemove:w.useCallback(I=>{ce(K=>{const V=new Set(K);return V.delete(I),V})},[]),children:r})}),oe?g.jsxs(SE,{"aria-hidden":!0,required:_,tabIndex:-1,name:y,autoComplete:v,value:Y,onChange:I=>ie(I.target.value),disabled:b,form:E,children:[Y===void 0?g.jsx("option",{value:""}):null,Array.from(le)]},me):null]})})};WC.displayName=ws;var eE="SelectTrigger",tE=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:s=!1,...i}=e,c=Cf(r),u=Po(eE,r),f=u.disabled||s,h=Ve(t,u.onTriggerChange),p=_f(r),y=w.useRef("touch"),[v,b,_]=_E(x=>{const C=p().filter(k=>!k.disabled),O=C.find(k=>k.value===u.value),M=CE(C,x,O);M!==void 0&&u.onValueChange(M.value)}),E=x=>{f||(u.onOpenChange(!0),_()),x&&(u.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return g.jsx(Sf,{asChild:!0,...c,children:g.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":xE(u.value)?"":void 0,...i,ref:h,onClick:pe(i.onClick,x=>{x.currentTarget.focus(),y.current!=="mouse"&&E(x)}),onPointerDown:pe(i.onPointerDown,x=>{y.current=x.pointerType;const C=x.target;C.hasPointerCapture(x.pointerId)&&C.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(E(x),x.preventDefault())}),onKeyDown:pe(i.onKeyDown,x=>{const C=v.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&b(x.key),!(C&&x.key===" ")&&pB.includes(x.key)&&(E(),x.preventDefault())})})})});tE.displayName=eE;var nE="SelectValue",rE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:i,children:c,placeholder:u="",...f}=e,h=Po(nE,r),{onValueNodeHasChildrenChange:p}=h,y=c!==void 0,v=Ve(t,h.onValueNodeChange);return Et(()=>{p(y)},[p,y]),g.jsx(Ae.span,{...f,ref:v,style:{pointerEvents:"none"},children:xE(h.value)?g.jsx(g.Fragment,{children:u}):c})});rE.displayName=nE;var wB="SelectIcon",oE=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:s,...i}=e;return g.jsx(Ae.span,{"aria-hidden":!0,...i,ref:t,children:s||"▼"})});oE.displayName=wB;var SB="SelectPortal",sE=e=>g.jsx(Cc,{asChild:!0,...e});sE.displayName=SB;var Ss="SelectContent",aE=w.forwardRef((e,t)=>{const r=Po(Ss,e.__scopeSelect),[s,i]=w.useState();if(Et(()=>{i(new DocumentFragment)},[]),!r.open){const c=s;return c?Ua.createPortal(g.jsx(iE,{scope:e.__scopeSelect,children:g.jsx(xf.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),c):null}return g.jsx(cE,{...e,ref:t})});aE.displayName=Ss;var Zn=10,[iE,Lo]=Ga(Ss),xB="SelectContentImpl",_B=ys("SelectContent.RemoveScroll"),cE=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:c,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:_,sticky:E,hideWhenDetached:x,avoidCollisions:C,...O}=e,M=Po(Ss,r),[k,N]=w.useState(null),[U,H]=w.useState(null),L=Ve(t,X=>N(X)),[z,Y]=w.useState(null),[ie,ae]=w.useState(null),oe=_f(r),[le,ce]=w.useState(!1),me=w.useRef(!1);w.useEffect(()=>{if(k)return hf(k)},[k]),ff();const I=w.useCallback(X=>{const[xe,...Ce]=oe().map(ze=>ze.ref.current),[Ee]=Ce.slice(-1),Oe=document.activeElement;for(const ze of X)if(ze===Oe||(ze?.scrollIntoView({block:"nearest"}),ze===xe&&U&&(U.scrollTop=0),ze===Ee&&U&&(U.scrollTop=U.scrollHeight),ze?.focus(),document.activeElement!==Oe))return},[oe,U]),K=w.useCallback(()=>I([z,k]),[I,z,k]);w.useEffect(()=>{le&&K()},[le,K]);const{onOpenChange:V,triggerPointerDownPosRef:te}=M;w.useEffect(()=>{if(k){let X={x:0,y:0};const xe=Ee=>{X={x:Math.abs(Math.round(Ee.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(Ee.pageY)-(te.current?.y??0))}},Ce=Ee=>{X.x<=10&&X.y<=10?Ee.preventDefault():k.contains(Ee.target)||V(!1),document.removeEventListener("pointermove",xe),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[k,V,te]),w.useEffect(()=>{const X=()=>V(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[V]);const[ve,D]=_E(X=>{const xe=oe().filter(Oe=>!Oe.disabled),Ce=xe.find(Oe=>Oe.ref.current===document.activeElement),Ee=CE(xe,X,Ce);Ee&&setTimeout(()=>Ee.ref.current.focus())}),Q=w.useCallback((X,xe,Ce)=>{const Ee=!me.current&&!Ce;(M.value!==void 0&&M.value===xe||Ee)&&(Y(X),Ee&&(me.current=!0))},[M.value]),ne=w.useCallback(()=>k?.focus(),[k]),re=w.useCallback((X,xe,Ce)=>{const Ee=!me.current&&!Ce;(M.value!==void 0&&M.value===xe||Ee)&&ae(X)},[M.value]),ue=s==="popper"?om:lE,ye=ue===om?{side:f,sideOffset:h,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:_,sticky:E,hideWhenDetached:x,avoidCollisions:C}:{};return g.jsx(iE,{scope:r,content:k,viewport:U,onViewportChange:H,itemRefCallback:Q,selectedItem:z,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:K,selectedItemText:ie,position:s,isPositioned:le,searchRef:ve,children:g.jsx(Ec,{as:_B,allowPinchZoom:!0,children:g.jsx(_c,{asChild:!0,trapped:M.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:pe(i,X=>{M.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:g.jsx(xc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:g.jsx(ue,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:X=>X.preventDefault(),...O,...ye,onPlaced:()=>ce(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...O.style},onKeyDown:pe(O.onKeyDown,X=>{const xe=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!xe&&X.key.length===1&&D(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let Ee=oe().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Oe=X.target,ze=Ee.indexOf(Oe);Ee=Ee.slice(ze+1)}setTimeout(()=>I(Ee)),X.preventDefault()}})})})})})})});cE.displayName=xB;var CB="SelectItemAlignedPosition",lE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:s,...i}=e,c=Po(Ss,r),u=Lo(Ss,r),[f,h]=w.useState(null),[p,y]=w.useState(null),v=Ve(t,L=>y(L)),b=_f(r),_=w.useRef(!1),E=w.useRef(!0),{viewport:x,selectedItem:C,selectedItemText:O,focusSelectedItem:M}=u,k=w.useCallback(()=>{if(c.trigger&&c.valueNode&&f&&p&&x&&C&&O){const L=c.trigger.getBoundingClientRect(),z=p.getBoundingClientRect(),Y=c.valueNode.getBoundingClientRect(),ie=O.getBoundingClientRect();if(c.dir!=="rtl"){const Oe=ie.left-z.left,ze=Y.left-Oe,lt=L.left-ze,Rt=L.width+lt,ln=Math.max(Rt,z.width),_n=window.innerWidth-Zn,Ut=RS(ze,[Zn,Math.max(Zn,_n-ln)]);f.style.minWidth=Rt+"px",f.style.left=Ut+"px"}else{const Oe=z.right-ie.right,ze=window.innerWidth-Y.right-Oe,lt=window.innerWidth-L.right-ze,Rt=L.width+lt,ln=Math.max(Rt,z.width),_n=window.innerWidth-Zn,Ut=RS(ze,[Zn,Math.max(Zn,_n-ln)]);f.style.minWidth=Rt+"px",f.style.right=Ut+"px"}const ae=b(),oe=window.innerHeight-Zn*2,le=x.scrollHeight,ce=window.getComputedStyle(p),me=parseInt(ce.borderTopWidth,10),I=parseInt(ce.paddingTop,10),K=parseInt(ce.borderBottomWidth,10),V=parseInt(ce.paddingBottom,10),te=me+I+le+V+K,ve=Math.min(C.offsetHeight*5,te),D=window.getComputedStyle(x),Q=parseInt(D.paddingTop,10),ne=parseInt(D.paddingBottom,10),re=L.top+L.height/2-Zn,ue=oe-re,ye=C.offsetHeight/2,X=C.offsetTop+ye,xe=me+I+X,Ce=te-xe;if(xe<=re){const Oe=ae.length>0&&C===ae[ae.length-1].ref.current;f.style.bottom="0px";const ze=p.clientHeight-x.offsetTop-x.offsetHeight,lt=Math.max(ue,ye+(Oe?ne:0)+ze+K),Rt=xe+lt;f.style.height=Rt+"px"}else{const Oe=ae.length>0&&C===ae[0].ref.current;f.style.top="0px";const lt=Math.max(re,me+x.offsetTop+(Oe?Q:0)+ye)+Ce;f.style.height=lt+"px",x.scrollTop=xe-re+x.offsetTop}f.style.margin=`${Zn}px 0`,f.style.minHeight=ve+"px",f.style.maxHeight=oe+"px",s?.(),requestAnimationFrame(()=>_.current=!0)}},[b,c.trigger,c.valueNode,f,p,x,C,O,c.dir,s]);Et(()=>k(),[k]);const[N,U]=w.useState();Et(()=>{p&&U(window.getComputedStyle(p).zIndex)},[p]);const H=w.useCallback(L=>{L&&E.current===!0&&(k(),M?.(),E.current=!1)},[k,M]);return g.jsx(RB,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:_,onScrollButtonChange:H,children:g.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:g.jsx(Ae.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});lE.displayName=CB;var EB="SelectPopperPosition",om=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:s="start",collisionPadding:i=Zn,...c}=e,u=Cf(r);return g.jsx(pg,{...u,...c,ref:t,align:s,collisionPadding:i,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});om.displayName=EB;var[RB,gg]=Ga(Ss,{}),sm="SelectViewport",uE=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:s,...i}=e,c=Lo(sm,r),u=gg(sm,r),f=Ve(t,c.onViewportChange),h=w.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),g.jsx(xf.Slot,{scope:r,children:g.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:pe(i.onScroll,p=>{const y=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const _=Math.abs(h.current-y.scrollTop);if(_>0){const E=window.innerHeight-Zn*2,x=parseFloat(v.style.minHeight),C=parseFloat(v.style.height),O=Math.max(x,C);if(O<E){const M=O+_,k=Math.min(E,M),N=M-k;v.style.height=k+"px",v.style.bottom==="0px"&&(y.scrollTop=N>0?N:0,v.style.justifyContent="flex-end")}}}h.current=y.scrollTop})})})]})});uE.displayName=sm;var fE="SelectGroup",[TB,AB]=Ga(fE),OB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,i=Gn();return g.jsx(TB,{scope:r,id:i,children:g.jsx(Ae.div,{role:"group","aria-labelledby":i,...s,ref:t})})});OB.displayName=fE;var dE="SelectLabel",kB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,i=AB(dE,r);return g.jsx(Ae.div,{id:i.id,...s,ref:t})});kB.displayName=dE;var Zu="SelectItem",[MB,hE]=Ga(Zu),pE=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:s,disabled:i=!1,textValue:c,...u}=e,f=Po(Zu,r),h=Lo(Zu,r),p=f.value===s,[y,v]=w.useState(c??""),[b,_]=w.useState(!1),E=Ve(t,M=>h.itemRefCallback?.(M,s,i)),x=Gn(),C=w.useRef("touch"),O=()=>{i||(f.onValueChange(s),f.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(MB,{scope:r,value:s,disabled:i,textId:x,isSelected:p,onItemTextChange:w.useCallback(M=>{v(k=>k||(M?.textContent??"").trim())},[]),children:g.jsx(xf.ItemSlot,{scope:r,value:s,disabled:i,textValue:y,children:g.jsx(Ae.div,{role:"option","aria-labelledby":x,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:E,onFocus:pe(u.onFocus,()=>_(!0)),onBlur:pe(u.onBlur,()=>_(!1)),onClick:pe(u.onClick,()=>{C.current!=="mouse"&&O()}),onPointerUp:pe(u.onPointerUp,()=>{C.current==="mouse"&&O()}),onPointerDown:pe(u.onPointerDown,M=>{C.current=M.pointerType}),onPointerMove:pe(u.onPointerMove,M=>{C.current=M.pointerType,i?h.onItemLeave?.():C.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(u.onPointerLeave,M=>{M.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:pe(u.onKeyDown,M=>{h.searchRef?.current!==""&&M.key===" "||(mB.includes(M.key)&&O(),M.key===" "&&M.preventDefault())})})})})});pE.displayName=Zu;var Wi="SelectItemText",mE=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:i,...c}=e,u=Po(Wi,r),f=Lo(Wi,r),h=hE(Wi,r),p=bB(Wi,r),[y,v]=w.useState(null),b=Ve(t,O=>v(O),h.onItemTextChange,O=>f.itemTextRefCallback?.(O,h.value,h.disabled)),_=y?.textContent,E=w.useMemo(()=>g.jsx("option",{value:h.value,disabled:h.disabled,children:_},h.value),[h.disabled,h.value,_]),{onNativeOptionAdd:x,onNativeOptionRemove:C}=p;return Et(()=>(x(E),()=>C(E)),[x,C,E]),g.jsxs(g.Fragment,{children:[g.jsx(Ae.span,{id:h.textId,...c,ref:b}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Ua.createPortal(c.children,u.valueNode):null]})});mE.displayName=Wi;var gE="SelectItemIndicator",yE=w.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return hE(gE,r).isSelected?g.jsx(Ae.span,{"aria-hidden":!0,...s,ref:t}):null});yE.displayName=gE;var am="SelectScrollUpButton",vE=w.forwardRef((e,t)=>{const r=Lo(am,e.__scopeSelect),s=gg(am,e.__scopeSelect),[i,c]=w.useState(!1),u=Ve(t,s.onScrollButtonChange);return Et(()=>{if(r.viewport&&r.isPositioned){let f=function(){const p=h.scrollTop>0;c(p)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?g.jsx(wE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});vE.displayName=am;var im="SelectScrollDownButton",bE=w.forwardRef((e,t)=>{const r=Lo(im,e.__scopeSelect),s=gg(im,e.__scopeSelect),[i,c]=w.useState(!1),u=Ve(t,s.onScrollButtonChange);return Et(()=>{if(r.viewport&&r.isPositioned){let f=function(){const p=h.scrollHeight-h.clientHeight,y=Math.ceil(h.scrollTop)<p;c(y)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),i?g.jsx(wE,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});bE.displayName=im;var wE=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:s,...i}=e,c=Lo("SelectScrollButton",r),u=w.useRef(null),f=_f(r),h=w.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return w.useEffect(()=>()=>h(),[h]),Et(()=>{f().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),g.jsx(Ae.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:pe(i.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(s,50))}),onPointerMove:pe(i.onPointerMove,()=>{c.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(s,50))}),onPointerLeave:pe(i.onPointerLeave,()=>{h()})})}),NB="SelectSeparator",jB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return g.jsx(Ae.div,{"aria-hidden":!0,...s,ref:t})});jB.displayName=NB;var cm="SelectArrow",zB=w.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,i=Cf(r),c=Po(cm,r),u=Lo(cm,r);return c.open&&u.position==="popper"?g.jsx(mg,{...i,...s,ref:t}):null});zB.displayName=cm;var DB="SelectBubbleInput",SE=w.forwardRef(({__scopeSelect:e,value:t,...r},s)=>{const i=w.useRef(null),c=Ve(s,i),u=SC(t);return w.useEffect(()=>{const f=i.current;if(!f)return;const h=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==t&&y){const v=new Event("change",{bubbles:!0});y.call(f,t),f.dispatchEvent(v)}},[u,t]),g.jsx(Ae.select,{...r,style:{...JC,...r.style},ref:c,defaultValue:t})});SE.displayName=DB;function xE(e){return e===""||e===void 0}function _E(e){const t=Kn(e),r=w.useRef(""),s=w.useRef(0),i=w.useCallback(u=>{const f=r.current+u;t(f),(function h(p){r.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>h(""),1e3))})(f)},[t]),c=w.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,i,c]}function CE(e,t,r){const i=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let u=PB(e,Math.max(c,0));i.length===1&&(u=u.filter(p=>p!==r));const h=u.find(p=>p.textValue.toLowerCase().startsWith(i.toLowerCase()));return h!==r?h:void 0}function PB(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var LB=WC,IB=tE,$B=rE,UB=oE,BB=sE,qB=aE,FB=uE,VB=pE,HB=mE,ZB=yE,QB=vE,GB=bE;function kp({...e}){return g.jsx(LB,{"data-slot":"select",...e})}function Mp({...e}){return g.jsx($B,{"data-slot":"select-value",...e})}function Np({className:e,size:t="default",children:r,...s}){return g.jsxs(IB,{"data-slot":"select-trigger","data-size":t,className:je("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",e),...s,children:[r,g.jsx(UB,{asChild:!0,children:g.jsx(Cs,{className:"size-4 opacity-50"})})]})}function jp({className:e,children:t,position:r="item-aligned",align:s="center",...i}){return g.jsx(BB,{children:g.jsxs(qB,{"data-slot":"select-content",className:je("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",r==="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",e),position:r,align:s,...i,children:[g.jsx(YB,{}),g.jsx(FB,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(KB,{})]})})}function Yi({className:e,children:t,...r}){return g.jsxs(VB,{"data-slot":"select-item",className:je("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",e),...r,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(ZB,{children:g.jsx(O1,{className:"size-4"})})}),g.jsx(HB,{children:t})]})}function YB({className:e,...t}){return g.jsx(QB,{"data-slot":"select-scroll-up-button",className:je("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(k1,{className:"size-4"})})}function KB({className:e,...t}){return g.jsx(GB,{"data-slot":"select-scroll-down-button",className:je("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Cs,{className:"size-4"})})}function XB({isOpen:e,onClose:t,breakingChanges:r,onForceUpdate:s,onCancel:i,isLoading:c}){const u=()=>{i(),t()};return g.jsx(tg,{open:e,onOpenChange:f=>!f&&!c&&u(),title:"Breaking Changes Detected",size:"lg",footer:g.jsxs(g.Fragment,{children:[g.jsx(Ur,{variant:"outline",onClick:u,disabled:c,children:"Cancel"}),g.jsx(Ur,{variant:"danger",onClick:s,loading:c,children:"Force Update"})]}),children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"diff-modified flex items-start gap-3 rounded-lg border p-3",children:[g.jsx(z3,{className:"mt-0.5 size-5 shrink-0 text-diff-modified"}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("p",{className:"text-sm font-medium text-diff-modified",children:"These changes may affect existing content"}),g.jsx("p",{className:"text-sm text-diff-modified-foreground",children:"The following changes could cause data loss or validation errors for existing entries. Review carefully before proceeding."})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("p",{className:"text-sm font-medium text-foreground",children:[r.length," breaking change",r.length!==1?"s":""," detected:"]}),g.jsx("ul",{className:"space-y-2",children:r.map((f,h)=>g.jsxs("li",{className:"flex items-start gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm",children:[g.jsx("span",{className:"mt-0.5 size-1.5 shrink-0 rounded-full bg-warning"}),g.jsx("span",{className:"text-muted-foreground",children:f})]},h))})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Force Update" to apply these changes anyway, or "Cancel" to go back and modify your changes.'})]})})}const zp={text:{label:"Text",icon:g.jsx(O3,{className:"size-4"}),description:"Single line text input"},richText:{label:"Rich Text",icon:g.jsx(kD,{className:"size-4"}),description:"Multi-line formatted text"},number:{label:"Number",icon:g.jsx(N1,{className:"size-4"}),description:"Numeric value"},boolean:{label:"Boolean",icon:g.jsx(L1,{className:"size-4"}),description:"True/false toggle"},date:{label:"Date",icon:g.jsx(Gp,{className:"size-4"}),description:"Date picker"},datetime:{label:"Date & Time",icon:g.jsx(Gp,{className:"size-4"}),description:"Date and time picker"},reference:{label:"Reference",icon:g.jsx(GD,{className:"size-4"}),description:"Link to another content entry"},media:{label:"Media",icon:g.jsx(z1,{className:"size-4"}),description:"Image, video, or file"},json:{label:"JSON",icon:g.jsx(A1,{className:"size-4"}),description:"Custom JSON data"},select:{label:"Select",icon:g.jsx(Cs,{className:"size-4"}),description:"Dropdown selection"},multiSelect:{label:"Multi-Select",icon:g.jsx(JD,{className:"size-4"}),description:"Multiple selections"},tags:{label:"Tags",icon:g.jsx(E3,{className:"size-4"}),description:"Free-form tag list"},category:{label:"Category",icon:g.jsx(zD,{className:"size-4"}),description:"Taxonomy category selection"}};function IS(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^[0-9]/,"_$&").slice(0,64)}function $S(e){return/^[a-z][a-z0-9_]{0,63}$/.test(e)}function JB({isOpen:e,onClose:t,onCreated:r,onUpdated:s,contentType:i}){const c=!!i,u=i?.source==="code",f=u,[h,p]=w.useState(""),[y,v]=w.useState(""),[b,_]=w.useState(!1),[E,x]=w.useState(""),[C,O]=w.useState(!1),[M,k]=w.useState([{name:"title",label:"Title",type:"text",required:!0}]),[N,U]=w.useState("title"),[H,L]=w.useState("title"),[z,Y]=w.useState(!1),[ie,ae]=w.useState(null),[oe,le]=w.useState(null),[ce,me]=w.useState(!1),[I,K]=w.useState([]),[V,te]=w.useState(!1),[ve,D]=w.useState(!1),Q=$_(),ne=Tw(Q.createContentType),re=Tw(Q.updateContentType);w.useEffect(()=>{i&&e&&(p(i.displayName),v(i.name),_(!0),x(i.description||""),O(i.singleton||!1),k(i.fields),U(i.titleField||""),L(i.slugField||""))},[i,e]);const ue=w.useCallback(()=>{p(""),v(""),_(!1),x(""),O(!1),k([{name:"title",label:"Title",type:"text",required:!0}]),U("title"),L("title"),Y(!1),ae(null),le(null),me(!1),K([]),te(!1),D(!1)},[]),ye=w.useCallback(se=>{p(se),b||v(IS(se))},[b]),X=w.useCallback(se=>{_(!0),v(se.toLowerCase().replace(/[^a-z0-9_]/g,""))},[]),xe=w.useCallback(()=>{const se=`field_${M.length+1}`;k(ke=>[...ke,{name:se,label:`Field ${ke.length+1}`,type:"text",required:!1}]),le(M.length),me(!0)},[M.length]),Ce=w.useCallback(se=>{const ke=M[se];if(k(Ue=>Ue.filter((De,jt)=>jt!==se)),N===ke.name){const Ue=M.find((De,jt)=>jt!==se&&De.type==="text");U(Ue?.name||"")}if(H===ke.name){const Ue=M.find((De,jt)=>jt!==se&&De.type==="text");L(Ue?.name||"")}oe===se?(le(null),me(!1)):oe!==null&&oe>se&&le(oe-1)},[M,oe,N,H]),Ee=w.useCallback((se,ke)=>{k(Ue=>Ue.map((De,jt)=>jt===se?{...De,...ke}:De))},[]),Oe=w.useCallback((se,ke)=>{k(Ue=>{const De=[...Ue],[jt]=De.splice(se,1);return De.splice(ke,0,jt),De}),le(ke)},[]),ze=w.useMemo(()=>{const se=[];h.trim()||se.push("Display name is required"),y.trim()?$S(y)||se.push("System Name must start with a letter and contain only lowercase letters, numbers, and underscores"):se.push("System Name is required"),M.length===0&&se.push("At least one field is required");const ke=M.map(De=>De.name),Ue=ke.filter((De,jt)=>ke.indexOf(De)!==jt);Ue.length>0&&se.push(`Duplicate field names: ${[...new Set(Ue)].join(", ")}`);for(const De of M)De.name.trim()?/^[a-z][a-z0-9_]{0,63}$/.test(De.name)||se.push(`Field "${De.name}" has an invalid name format`):se.push(`Field "${De.label}" has an empty name`),De.label.trim()||se.push(`Field with name "${De.name}" has an empty label`),(De.type==="select"||De.type==="multiSelect")&&(!De.options?.options||De.options.options.length===0)&&se.push(`${De.type} field "${De.label}" requires at least one option`);return se},[h,y,M]),lt=w.useMemo(()=>M.filter(se=>se.type==="text"),[M]),Rt=se=>se.split(`
102
+ `).filter(Ue=>Ue.trim().startsWith("-")).map(Ue=>Ue.trim().substring(2)),ln=w.useCallback(async(se,ke=!1)=>{if(se.preventDefault(),ze.length>0){ae(ze.join(". "));return}Y(!0),ae(null);try{if(c&&i){const Ue=await re({id:i._id,displayName:h.trim(),description:E.trim()||void 0,fields:M,singleton:C,titleField:N||void 0,slugField:H||void 0,force:ke});s?.(Ue),ue(),t()}else{const Ue=await ne({name:y,displayName:h.trim(),description:E.trim()||void 0,fields:M,singleton:C,titleField:N||void 0,slugField:H||void 0});r?.(Ue),ue(),t()}}catch(Ue){const De=Ue instanceof Error?Ue.message:c?"Failed to update content type":"Failed to create content type";if(c&&!ke&&De.includes("breaking change")){const jt=Rt(De);K(jt),te(!0)}else ae(De)}finally{Y(!1)}},[ze,c,i,ne,re,y,h,E,M,C,N,H,r,s,ue,t]),_n=w.useCallback(async()=>{D(!0);try{if(i){const se=await re({id:i._id,displayName:h.trim(),description:E.trim()||void 0,fields:M,singleton:C,titleField:N||void 0,slugField:H||void 0,force:!0});s?.(se),ue(),te(!1),t()}}catch(se){const ke=se instanceof Error?se.message:"Failed to update content type";ae(ke),te(!1)}finally{D(!1)}},[i,re,h,E,M,C,N,H,s,ue,t]),Ut=w.useCallback(()=>{z||(ue(),t())},[z,ue,t]);if(!e)return null;const yt=oe!==null?M[oe]:null;return g.jsxs(g.Fragment,{children:[g.jsx(tg,{open:e,onOpenChange:se=>!se&&Ut(),title:u?"View Content Type":c?"Edit Content Type":"Create Content Type",size:"2xl",footer:f?g.jsx(Ur,{variant:"outline",onClick:Ut,children:"Close"}):g.jsxs(g.Fragment,{children:[g.jsx(Ur,{variant:"outline",onClick:Ut,disabled:z,children:"Cancel"}),g.jsx(Ur,{variant:"primary",onClick:ln,disabled:ze.length>0,loading:z,"data-testid":c?"update-content-type-submit":"create-content-type-submit",children:c?"Save Changes":"Create Content Type"})]}),children:g.jsxs("form",{onSubmit:ln,className:"space-y-6",children:[u&&g.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-violet-200 bg-violet-50 p-3",children:[g.jsx(gD,{className:"mt-0.5 size-5 shrink-0 text-violet-600"}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("p",{className:"text-sm font-medium text-violet-900",children:"Managed by Code"}),g.jsx("p",{className:"text-sm text-violet-700",children:"This content type is defined in your codebase and cannot be edited through the admin interface. To make changes, update the definition in your code."})]})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Basic Information"}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{htmlFor:"displayName",children:["Display Name ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ss,{id:"displayName",value:h,onChange:se=>ye(se.target.value),placeholder:"e.g., Blog Post",disabled:z||f,autoFocus:!f,"data-testid":"display-name-input"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{htmlFor:"machineName",children:["System Name ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ss,{id:"machineName",value:y,onChange:se=>X(se.target.value),placeholder:"e.g., blog_post",disabled:z||c||f,className:je(!$S(y)&&y&&"border-destructive"),"data-testid":"machine-name-input"}),g.jsx("p",{className:"text-xs text-muted-foreground",children:c?"System name cannot be changed after creation":"Lowercase letters, numbers, and underscores only. Used in API queries."})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Dn,{htmlFor:"description",children:"Description"}),g.jsx(B8,{id:"description",value:E,onChange:se=>x(se.target.value),placeholder:"Optional description of this content type",disabled:z||f,rows:2})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ES,{id:"singleton",checked:C,onCheckedChange:se=>O(se),disabled:z||f}),g.jsx(Dn,{htmlFor:"singleton",className:"cursor-pointer",children:"Singleton (only one entry allowed)"})]})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Fields"}),!f&&g.jsxs(Ur,{type:"button",variant:"secondary",size:"sm",onClick:xe,disabled:z,"data-testid":"add-field-button",children:[g.jsx(P1,{className:"size-3.5"}),"Add Field"]})]}),g.jsx("div",{className:"space-y-2",children:M.map((se,ke)=>g.jsxs("div",{className:je("flex items-center gap-2 rounded-lg border p-2 transition-colors",!f&&"cursor-pointer hover:bg-muted/50",oe===ke&&"border-primary bg-primary/5"),onClick:()=>{f||(le(ke),me(!0))},"data-testid":`field-item-${ke}`,children:[!f&&g.jsxs("div",{className:"flex flex-col gap-0.5",children:[ke>0&&g.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Oe(ke,ke-1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:g.jsx(k1,{className:"size-3"})}),ke<M.length-1&&g.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Oe(ke,ke+1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:g.jsx(Cs,{className:"size-3"})})]}),g.jsx("div",{className:"flex size-8 items-center justify-center rounded bg-muted text-muted-foreground",children:zp[se.type].icon}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"truncate text-sm font-medium",children:se.label}),g.jsxs("p",{className:"text-xs text-muted-foreground",children:[zp[se.type].label,se.required&&" *"]})]}),!f&&g.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Ce(ke)},disabled:z||M.length===1,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50",children:g.jsx(zu,{className:"size-4"})})]},ke))}),!f&&ce&&yt&&oe!==null&&g.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4","data-testid":"field-editor",children:[g.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[g.jsxs("h5",{className:"font-medium",children:["Edit Field: ",yt.label]}),g.jsx("button",{type:"button",onClick:()=>{me(!1),le(null)},className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:g.jsx(zu,{className:"size-4"})})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{htmlFor:"fieldLabel",children:["Label ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ss,{id:"fieldLabel",value:yt.label,onChange:se=>Ee(oe,{label:se.target.value,name:b?yt.name:IS(se.target.value)||yt.name}),disabled:z,"data-testid":"field-label-input"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{htmlFor:"fieldName",children:["Name ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ss,{id:"fieldName",value:yt.name,onChange:se=>Ee(oe,{name:se.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),disabled:z,"data-testid":"field-name-input"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{htmlFor:"fieldType",children:["Type ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsxs(kp,{value:yt.type,onValueChange:se=>Ee(oe,{type:se,options:void 0}),disabled:z,children:[g.jsx(Np,{"data-testid":"field-type-select",children:g.jsx(Mp,{})}),g.jsx(jp,{children:Object.entries(zp).map(([se,ke])=>g.jsx(Yi,{value:se,children:g.jsxs("div",{className:"flex items-center gap-2",children:[ke.icon,g.jsx("span",{children:ke.label}),g.jsxs("span",{className:"text-muted-foreground",children:["- ",ke.description]})]})},se))})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ES,{id:"fieldRequired",checked:yt.required,onCheckedChange:se=>Ee(oe,{required:se}),disabled:z}),g.jsx(Dn,{htmlFor:"fieldRequired",className:"cursor-pointer",children:"Required"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Dn,{htmlFor:"fieldDescription",children:"Help Text"}),g.jsx(ss,{id:"fieldDescription",value:yt.description||"",onChange:se=>Ee(oe,{description:se.target.value||void 0}),placeholder:"Help text shown below the field",disabled:z})]}),(yt.type==="select"||yt.type==="multiSelect")&&g.jsx(WB,{options:yt.options?.options||[],onChange:se=>Ee(oe,{options:{...yt.options,options:se}}),disabled:z})]})]})]}),lt.length>0&&g.jsxs("div",{className:"space-y-4",children:[g.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Display Settings"}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Dn,{htmlFor:"titleField",children:"Title Field"}),g.jsxs(kp,{value:N||"none",onValueChange:se=>U(se==="none"?"":se),disabled:z,children:[g.jsx(Np,{children:g.jsx(Mp,{placeholder:"None"})}),g.jsxs(jp,{children:[g.jsx(Yi,{value:"none",children:"None"}),lt.map(se=>g.jsx(Yi,{value:se.name,children:se.label},se.name))]})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to display as the entry title in lists"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Dn,{htmlFor:"slugField",children:"Slug Field"}),g.jsxs(kp,{value:H||"none",onValueChange:se=>L(se==="none"?"":se),disabled:z,children:[g.jsx(Np,{children:g.jsx(Mp,{placeholder:"None (auto-generate)"})}),g.jsxs(jp,{children:[g.jsx(Yi,{value:"none",children:"None (auto-generate)"}),lt.map(se=>g.jsx(Yi,{value:se.name,children:se.label},se.name))]})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to use for generating URL-friendly slugs"})]})]}),ie&&g.jsx("div",{className:"diff-removed rounded-lg border px-3 py-2 text-sm",role:"alert","data-testid":"submit-error",children:ie})]})}),g.jsx(XB,{isOpen:V,onClose:()=>te(!1),breakingChanges:I,onForceUpdate:_n,onCancel:()=>{te(!1),K([])},isLoading:ve})]})}function WB({options:e,onChange:t,disabled:r}){const s=()=>{t([...e,{value:`option_${e.length+1}`,label:""}])},i=u=>{t(e.filter((f,h)=>h!==u))},c=(u,f)=>{t(e.map((h,p)=>p===u?{...h,...f}:h))};return g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Dn,{children:["Options ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx("div",{className:"space-y-2",children:e.map((u,f)=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ss,{value:u.label,onChange:h=>{const p=h.target.value,y=p.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/^_+|_+$/g,"");c(f,{label:p,value:y})},placeholder:"Option label",disabled:r,className:"flex-1"}),g.jsx(ss,{value:u.value,onChange:h=>c(f,{value:h.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),placeholder:"value",disabled:r,className:"w-32"}),g.jsx("button",{type:"button",onClick:()=>i(f),disabled:r,className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:g.jsx(zu,{className:"size-4"})})]},f))}),g.jsxs(Ur,{type:"button",variant:"secondary",size:"sm",onClick:s,disabled:r,children:[g.jsx(P1,{className:"size-3.5"}),"Add Option"]})]})}function e9(){const t=gt().location.pathname,r=Gm(),{navItems:s,branding:i,layout:c}=r,u=$_(),[f,h]=w.useState(!1),p=R1(u.listContentTypes,{isActive:!0}),y=p?.page??[],v=(C,O)=>O?t===C:t.startsWith(C),b=t==="/content"||t.startsWith("/entries/type/")||t.startsWith("/entries/new/")||t.startsWith("/entries/"),_=C=>C.id==="content"?E(C):g.jsxs(ls,{to:C.path,className:je("flex items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",v(C.path,C.exact)?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground"),children:[g.jsx(cS,{name:C.icon,className:"size-5"}),g.jsx("span",{className:"flex-1",children:C.label}),C.badge&&g.jsx("span",{className:"rounded-full bg-sidebar-primary px-2 py-0.5 text-xs text-sidebar-primary-foreground",children:C.badge})]},C.id),E=C=>g.jsxs(KI,{defaultOpen:b,children:[g.jsxs(XI,{className:je("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",b?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground","group"),children:[g.jsx(cS,{name:C.icon,className:"size-5"}),g.jsx("span",{className:"flex-1 text-left",children:C.label}),g.jsx(Cs,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180"})]}),g.jsx(JI,{children:g.jsxs("div",{className:"ml-5 mt-1 space-y-1 border-l border-sidebar-border pl-3",children:[g.jsx(ls,{to:"/content",className:je("flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",t==="/content"?"bg-sidebar-accent/60 text-sidebar-accent-foreground":"text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"),children:"All Entries"}),y.map(O=>g.jsx(ls,{to:"/entries/type/$contentTypeId",params:{contentTypeId:O._id},className:je("flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",t===`/entries/type/${O._id}`?"bg-sidebar-accent/60 text-sidebar-accent-foreground":"text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"),children:O.displayName},O._id)),y.length===0&&p!==void 0&&g.jsx("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-sidebar-foreground/60 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground",children:"+ Create content type"})]})})]},C.id),x=c.sidebarWidth;return g.jsxs(g.Fragment,{children:[g.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 flex flex-col border-r border-sidebar-border bg-sidebar",style:{width:x},children:[g.jsx("div",{className:"flex h-14 items-center gap-2 border-b border-sidebar-border px-4",children:g.jsxs(ls,{to:"/",className:"flex items-center gap-2 font-semibold text-sidebar-foreground",children:[i.logo?g.jsx("img",{src:i.logo,alt:i.appName,className:"size-8"}):g.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:g.jsx(D1,{className:"size-4"})}),g.jsx("span",{className:"text-base",children:i.appName})]})}),g.jsxs("nav",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[s.main.length>0&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60",children:"Main"}),g.jsx("div",{className:"space-y-1 pt-2",children:s.main.map(_)})]}),s.config.length>0&&g.jsxs("div",{className:"space-y-1",children:[g.jsx("span",{className:"px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60",children:"Configuration"}),g.jsx("div",{className:"space-y-1 pt-2",children:s.config.map(_)})]})]}),g.jsx("div",{className:"border-t border-sidebar-border p-4",children:g.jsxs("div",{className:"flex items-center justify-between text-xs text-sidebar-foreground/60",children:[g.jsx("span",{children:"Version"}),g.jsx("span",{className:"font-mono",children:"0.1.0"})]})})]}),g.jsx(JB,{isOpen:f,onClose:()=>h(!1)})]})}function t9({...e}){return g.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function n9({className:e,...t}){return g.jsx("ol",{"data-slot":"breadcrumb-list",className:je("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function r9({className:e,...t}){return g.jsx("li",{"data-slot":"breadcrumb-item",className:je("inline-flex items-center gap-1.5",e),...t})}function o9({asChild:e,className:t,...r}){const s=e?bC:"a";return g.jsx(s,{"data-slot":"breadcrumb-link",className:je("hover:text-foreground transition-colors",t),...r})}function s9({className:e,...t}){return g.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:je("text-foreground font-normal",e),...t})}function a9({children:e,className:t,...r}){return g.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:je("[&>svg]:size-3.5",t),...r,children:e??g.jsx(cD,{})})}var Dp="rovingFocusGroup.onEntryFocus",i9={bubbles:!1,cancelable:!0},Tc="RovingFocusGroup",[lm,EE,c9]=rg(Tc),[l9,RE]=pr(Tc,[c9]),[u9,f9]=l9(Tc),TE=w.forwardRef((e,t)=>g.jsx(lm.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(lm.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(d9,{...e,ref:t})})}));TE.displayName=Tc;var d9=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:i=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,b=w.useRef(null),_=Ve(t,b),E=og(c),[x,C]=Ao({prop:u,defaultProp:f??null,onChange:h,caller:Tc}),[O,M]=w.useState(!1),k=Kn(p),N=EE(r),U=w.useRef(!1),[H,L]=w.useState(0);return w.useEffect(()=>{const z=b.current;if(z)return z.addEventListener(Dp,k),()=>z.removeEventListener(Dp,k)},[k]),g.jsx(u9,{scope:r,orientation:s,dir:E,loop:i,currentTabStopId:x,onItemFocus:w.useCallback(z=>C(z),[C]),onItemShiftTab:w.useCallback(()=>M(!0),[]),onFocusableItemAdd:w.useCallback(()=>L(z=>z+1),[]),onFocusableItemRemove:w.useCallback(()=>L(z=>z-1),[]),children:g.jsx(Ae.div,{tabIndex:O||H===0?-1:0,"data-orientation":s,...v,ref:_,style:{outline:"none",...e.style},onMouseDown:pe(e.onMouseDown,()=>{U.current=!0}),onFocus:pe(e.onFocus,z=>{const Y=!U.current;if(z.target===z.currentTarget&&Y&&!O){const ie=new CustomEvent(Dp,i9);if(z.currentTarget.dispatchEvent(ie),!ie.defaultPrevented){const ae=N().filter(I=>I.focusable),oe=ae.find(I=>I.active),le=ae.find(I=>I.id===x),me=[oe,le,...ae].filter(Boolean).map(I=>I.ref.current);kE(me,y)}}U.current=!1}),onBlur:pe(e.onBlur,()=>M(!1))})})}),AE="RovingFocusGroupItem",OE=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:i=!1,tabStopId:c,children:u,...f}=e,h=Gn(),p=c||h,y=f9(AE,r),v=y.currentTabStopId===p,b=EE(r),{onFocusableItemAdd:_,onFocusableItemRemove:E,currentTabStopId:x}=y;return w.useEffect(()=>{if(s)return _(),()=>E()},[s,_,E]),g.jsx(lm.ItemSlot,{scope:r,id:p,focusable:s,active:i,children:g.jsx(Ae.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...f,ref:t,onMouseDown:pe(e.onMouseDown,C=>{s?y.onItemFocus(p):C.preventDefault()}),onFocus:pe(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:pe(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){y.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const O=m9(C,y.orientation,y.dir);if(O!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let k=b().filter(N=>N.focusable).map(N=>N.ref.current);if(O==="last")k.reverse();else if(O==="prev"||O==="next"){O==="prev"&&k.reverse();const N=k.indexOf(C.currentTarget);k=y.loop?g9(k,N+1):k.slice(N+1)}setTimeout(()=>kE(k))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:x!=null}):u})})});OE.displayName=AE;var h9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function p9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function m9(e,t,r){const s=p9(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return h9[s]}function kE(e,t=!1){const r=document.activeElement;for(const s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}function g9(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var y9=TE,v9=OE,um=["Enter"," "],b9=["ArrowDown","PageUp","Home"],ME=["ArrowUp","PageDown","End"],w9=[...b9,...ME],S9={ltr:[...um,"ArrowRight"],rtl:[...um,"ArrowLeft"]},x9={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ac="Menu",[yc,_9,C9]=rg(Ac),[Rs,NE]=pr(Ac,[C9,Qa,RE]),Ef=Qa(),jE=RE(),[E9,Ts]=Rs(Ac),[R9,Oc]=Rs(Ac),zE=e=>{const{__scopeMenu:t,open:r=!1,children:s,dir:i,onOpenChange:c,modal:u=!0}=e,f=Ef(t),[h,p]=w.useState(null),y=w.useRef(!1),v=Kn(c),b=og(i);return w.useEffect(()=>{const _=()=>{y.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>y.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),g.jsx(hg,{...f,children:g.jsx(E9,{scope:t,open:r,onOpenChange:v,content:h,onContentChange:p,children:g.jsx(R9,{scope:t,onClose:w.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:s})})})};zE.displayName=Ac;var T9="MenuAnchor",yg=w.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,i=Ef(r);return g.jsx(Sf,{...i,...s,ref:t})});yg.displayName=T9;var vg="MenuPortal",[A9,DE]=Rs(vg,{forceMount:void 0}),PE=e=>{const{__scopeMenu:t,forceMount:r,children:s,container:i}=e,c=Ts(vg,t);return g.jsx(A9,{scope:t,forceMount:r,children:g.jsx(Bn,{present:r||c.open,children:g.jsx(Cc,{asChild:!0,container:i,children:s})})})};PE.displayName=vg;var In="MenuContent",[O9,bg]=Rs(In),LE=w.forwardRef((e,t)=>{const r=DE(In,e.__scopeMenu),{forceMount:s=r.forceMount,...i}=e,c=Ts(In,e.__scopeMenu),u=Oc(In,e.__scopeMenu);return g.jsx(yc.Provider,{scope:e.__scopeMenu,children:g.jsx(Bn,{present:s||c.open,children:g.jsx(yc.Slot,{scope:e.__scopeMenu,children:u.modal?g.jsx(k9,{...i,ref:t}):g.jsx(M9,{...i,ref:t})})})})}),k9=w.forwardRef((e,t)=>{const r=Ts(In,e.__scopeMenu),s=w.useRef(null),i=Ve(t,s);return w.useEffect(()=>{const c=s.current;if(c)return hf(c)},[]),g.jsx(wg,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:pe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),M9=w.forwardRef((e,t)=>{const r=Ts(In,e.__scopeMenu);return g.jsx(wg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),N9=ys("MenuContent.ScrollLock"),wg=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:s=!1,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:_,disableOutsideScroll:E,...x}=e,C=Ts(In,r),O=Oc(In,r),M=Ef(r),k=jE(r),N=_9(r),[U,H]=w.useState(null),L=w.useRef(null),z=Ve(t,L,C.onContentChange),Y=w.useRef(0),ie=w.useRef(""),ae=w.useRef(0),oe=w.useRef(null),le=w.useRef("right"),ce=w.useRef(0),me=E?Ec:w.Fragment,I=E?{as:N9,allowPinchZoom:!0}:void 0,K=te=>{const ve=ie.current+te,D=N().filter(X=>!X.disabled),Q=document.activeElement,ne=D.find(X=>X.ref.current===Q)?.textValue,re=D.map(X=>X.textValue),ue=V9(re,ve,ne),ye=D.find(X=>X.textValue===ue)?.ref.current;(function X(xe){ie.current=xe,window.clearTimeout(Y.current),xe!==""&&(Y.current=window.setTimeout(()=>X(""),1e3))})(ve),ye&&setTimeout(()=>ye.focus())};w.useEffect(()=>()=>window.clearTimeout(Y.current),[]),ff();const V=w.useCallback(te=>le.current===oe.current?.side&&Z9(te,oe.current?.area),[]);return g.jsx(O9,{scope:r,searchRef:ie,onItemEnter:w.useCallback(te=>{V(te)&&te.preventDefault()},[V]),onItemLeave:w.useCallback(te=>{V(te)||(L.current?.focus(),H(null))},[V]),onTriggerLeave:w.useCallback(te=>{V(te)&&te.preventDefault()},[V]),pointerGraceTimerRef:ae,onPointerGraceIntentChange:w.useCallback(te=>{oe.current=te},[]),children:g.jsx(me,{...I,children:g.jsx(_c,{asChild:!0,trapped:i,onMountAutoFocus:pe(c,te=>{te.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:g.jsx(xc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:_,children:g.jsx(y9,{asChild:!0,...k,dir:O.dir,orientation:"vertical",loop:s,currentTabStopId:U,onCurrentTabStopIdChange:H,onEntryFocus:pe(h,te=>{O.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(pg,{role:"menu","aria-orientation":"vertical","data-state":WE(C.open),"data-radix-menu-content":"",dir:O.dir,...M,...x,ref:z,style:{outline:"none",...x.style},onKeyDown:pe(x.onKeyDown,te=>{const D=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Q=te.ctrlKey||te.altKey||te.metaKey,ne=te.key.length===1;D&&(te.key==="Tab"&&te.preventDefault(),!Q&&ne&&K(te.key));const re=L.current;if(te.target!==re||!w9.includes(te.key))return;te.preventDefault();const ye=N().filter(X=>!X.disabled).map(X=>X.ref.current);ME.includes(te.key)&&ye.reverse(),q9(ye)}),onBlur:pe(e.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(Y.current),ie.current="")}),onPointerMove:pe(e.onPointerMove,vc(te=>{const ve=te.target,D=ce.current!==te.clientX;if(te.currentTarget.contains(ve)&&D){const Q=te.clientX>ce.current?"right":"left";le.current=Q,ce.current=te.clientX}}))})})})})})})});LE.displayName=In;var j9="MenuGroup",Sg=w.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return g.jsx(Ae.div,{role:"group",...s,ref:t})});Sg.displayName=j9;var z9="MenuLabel",IE=w.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return g.jsx(Ae.div,{...s,ref:t})});IE.displayName=z9;var Qu="MenuItem",US="menu.itemSelect",Rf=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:s,...i}=e,c=w.useRef(null),u=Oc(Qu,e.__scopeMenu),f=bg(Qu,e.__scopeMenu),h=Ve(t,c),p=w.useRef(!1),y=()=>{const v=c.current;if(!r&&v){const b=new CustomEvent(US,{bubbles:!0,cancelable:!0});v.addEventListener(US,_=>s?.(_),{once:!0}),U_(v,b),b.defaultPrevented?p.current=!1:u.onClose()}};return g.jsx($E,{...i,ref:h,disabled:r,onClick:pe(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:pe(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:pe(e.onKeyDown,v=>{const b=f.searchRef.current!=="";r||b&&v.key===" "||um.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Rf.displayName=Qu;var $E=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:s=!1,textValue:i,...c}=e,u=bg(Qu,r),f=jE(r),h=w.useRef(null),p=Ve(t,h),[y,v]=w.useState(!1),[b,_]=w.useState("");return w.useEffect(()=>{const E=h.current;E&&_((E.textContent??"").trim())},[c.children]),g.jsx(yc.ItemSlot,{scope:r,disabled:s,textValue:i??b,children:g.jsx(v9,{asChild:!0,...f,focusable:!s,children:g.jsx(Ae.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...c,ref:p,onPointerMove:pe(e.onPointerMove,vc(E=>{s?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(e.onPointerLeave,vc(E=>u.onItemLeave(E))),onFocus:pe(e.onFocus,()=>v(!0)),onBlur:pe(e.onBlur,()=>v(!1))})})})}),D9="MenuCheckboxItem",UE=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:s,...i}=e;return g.jsx(HE,{scope:e.__scopeMenu,checked:r,children:g.jsx(Rf,{role:"menuitemcheckbox","aria-checked":Gu(r)?"mixed":r,...i,ref:t,"data-state":_g(r),onSelect:pe(i.onSelect,()=>s?.(Gu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});UE.displayName=D9;var BE="MenuRadioGroup",[P9,L9]=Rs(BE,{value:void 0,onValueChange:()=>{}}),qE=w.forwardRef((e,t)=>{const{value:r,onValueChange:s,...i}=e,c=Kn(s);return g.jsx(P9,{scope:e.__scopeMenu,value:r,onValueChange:c,children:g.jsx(Sg,{...i,ref:t})})});qE.displayName=BE;var FE="MenuRadioItem",VE=w.forwardRef((e,t)=>{const{value:r,...s}=e,i=L9(FE,e.__scopeMenu),c=r===i.value;return g.jsx(HE,{scope:e.__scopeMenu,checked:c,children:g.jsx(Rf,{role:"menuitemradio","aria-checked":c,...s,ref:t,"data-state":_g(c),onSelect:pe(s.onSelect,()=>i.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});VE.displayName=FE;var xg="MenuItemIndicator",[HE,I9]=Rs(xg,{checked:!1}),ZE=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:s,...i}=e,c=I9(xg,r);return g.jsx(Bn,{present:s||Gu(c.checked)||c.checked===!0,children:g.jsx(Ae.span,{...i,ref:t,"data-state":_g(c.checked)})})});ZE.displayName=xg;var $9="MenuSeparator",QE=w.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return g.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});QE.displayName=$9;var U9="MenuArrow",GE=w.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,i=Ef(r);return g.jsx(mg,{...i,...s,ref:t})});GE.displayName=U9;var B9="MenuSub",[M7,YE]=Rs(B9),ec="MenuSubTrigger",KE=w.forwardRef((e,t)=>{const r=Ts(ec,e.__scopeMenu),s=Oc(ec,e.__scopeMenu),i=YE(ec,e.__scopeMenu),c=bg(ec,e.__scopeMenu),u=w.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=c,p={__scopeMenu:e.__scopeMenu},y=w.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return w.useEffect(()=>y,[y]),w.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),h(null)}},[f,h]),g.jsx(yg,{asChild:!0,...p,children:g.jsx($E,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":WE(r.open),...e,ref:Sc(t,i.onTriggerChange),onClick:v=>{e.onClick?.(v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:pe(e.onPointerMove,vc(v=>{c.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:pe(e.onPointerLeave,vc(v=>{y();const b=r.content?.getBoundingClientRect();if(b){const _=r.content?.dataset.side,E=_==="right",x=E?-5:5,C=b[E?"left":"right"],O=b[E?"right":"left"];c.onPointerGraceIntentChange({area:[{x:v.clientX+x,y:v.clientY},{x:C,y:b.top},{x:O,y:b.top},{x:O,y:b.bottom},{x:C,y:b.bottom}],side:_}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(v),v.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:pe(e.onKeyDown,v=>{const b=c.searchRef.current!=="";e.disabled||b&&v.key===" "||S9[s.dir].includes(v.key)&&(r.onOpenChange(!0),r.content?.focus(),v.preventDefault())})})})});KE.displayName=ec;var XE="MenuSubContent",JE=w.forwardRef((e,t)=>{const r=DE(In,e.__scopeMenu),{forceMount:s=r.forceMount,...i}=e,c=Ts(In,e.__scopeMenu),u=Oc(In,e.__scopeMenu),f=YE(XE,e.__scopeMenu),h=w.useRef(null),p=Ve(t,h);return g.jsx(yc.Provider,{scope:e.__scopeMenu,children:g.jsx(Bn,{present:s||c.open,children:g.jsx(yc.Slot,{scope:e.__scopeMenu,children:g.jsx(wg,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{u.isUsingKeyboardRef.current&&h.current?.focus(),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:pe(e.onFocusOutside,y=>{y.target!==f.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:pe(e.onEscapeKeyDown,y=>{u.onClose(),y.preventDefault()}),onKeyDown:pe(e.onKeyDown,y=>{const v=y.currentTarget.contains(y.target),b=x9[u.dir].includes(y.key);v&&b&&(c.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});JE.displayName=XE;function WE(e){return e?"open":"closed"}function Gu(e){return e==="indeterminate"}function _g(e){return Gu(e)?"indeterminate":e?"checked":"unchecked"}function q9(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function F9(e,t){return e.map((r,s)=>e[(t+s)%e.length])}function V9(e,t,r){const i=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=r?e.indexOf(r):-1;let u=F9(e,Math.max(c,0));i.length===1&&(u=u.filter(p=>p!==r));const h=u.find(p=>p.toLowerCase().startsWith(i.toLowerCase()));return h!==r?h:void 0}function H9(e,t){const{x:r,y:s}=e;let i=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const f=t[c],h=t[u],p=f.x,y=f.y,v=h.x,b=h.y;y>s!=b>s&&r<(v-p)*(s-y)/(b-y)+p&&(i=!i)}return i}function Z9(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return H9(r,t)}function vc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q9=zE,G9=yg,Y9=PE,K9=LE,X9=Sg,J9=IE,W9=Rf,eq=UE,tq=qE,nq=VE,rq=ZE,oq=QE,sq=GE,aq=KE,iq=JE,Tf="DropdownMenu",[cq]=pr(Tf,[NE]),Yt=NE(),[lq,eR]=cq(Tf),tR=e=>{const{__scopeDropdownMenu:t,children:r,dir:s,open:i,defaultOpen:c,onOpenChange:u,modal:f=!0}=e,h=Yt(t),p=w.useRef(null),[y,v]=Ao({prop:i,defaultProp:c??!1,onChange:u,caller:Tf});return g.jsx(lq,{scope:t,triggerId:Gn(),triggerRef:p,contentId:Gn(),open:y,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(b=>!b),[v]),modal:f,children:g.jsx(Q9,{...h,open:y,onOpenChange:v,dir:s,modal:f,children:r})})};tR.displayName=Tf;var nR="DropdownMenuTrigger",rR=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:s=!1,...i}=e,c=eR(nR,r),u=Yt(r);return g.jsx(G9,{asChild:!0,...u,children:g.jsx(Ae.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...i,ref:Sc(t,c.triggerRef),onPointerDown:pe(e.onPointerDown,f=>{!s&&f.button===0&&f.ctrlKey===!1&&(c.onOpenToggle(),c.open||f.preventDefault())}),onKeyDown:pe(e.onKeyDown,f=>{s||(["Enter"," "].includes(f.key)&&c.onOpenToggle(),f.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});rR.displayName=nR;var uq="DropdownMenuPortal",oR=e=>{const{__scopeDropdownMenu:t,...r}=e,s=Yt(t);return g.jsx(Y9,{...s,...r})};oR.displayName=uq;var sR="DropdownMenuContent",aR=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=eR(sR,r),c=Yt(r),u=w.useRef(!1);return g.jsx(K9,{id:i.contentId,"aria-labelledby":i.triggerId,...c,...s,ref:t,onCloseAutoFocus:pe(e.onCloseAutoFocus,f=>{u.current||i.triggerRef.current?.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:pe(e.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,y=h.button===2||p;(!i.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});aR.displayName=sR;var fq="DropdownMenuGroup",dq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(X9,{...i,...s,ref:t})});dq.displayName=fq;var hq="DropdownMenuLabel",iR=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(J9,{...i,...s,ref:t})});iR.displayName=hq;var pq="DropdownMenuItem",cR=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(W9,{...i,...s,ref:t})});cR.displayName=pq;var mq="DropdownMenuCheckboxItem",gq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(eq,{...i,...s,ref:t})});gq.displayName=mq;var yq="DropdownMenuRadioGroup",vq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(tq,{...i,...s,ref:t})});vq.displayName=yq;var bq="DropdownMenuRadioItem",wq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(nq,{...i,...s,ref:t})});wq.displayName=bq;var Sq="DropdownMenuItemIndicator",xq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(rq,{...i,...s,ref:t})});xq.displayName=Sq;var _q="DropdownMenuSeparator",lR=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(oq,{...i,...s,ref:t})});lR.displayName=_q;var Cq="DropdownMenuArrow",Eq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(sq,{...i,...s,ref:t})});Eq.displayName=Cq;var Rq="DropdownMenuSubTrigger",Tq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(aq,{...i,...s,ref:t})});Tq.displayName=Rq;var Aq="DropdownMenuSubContent",Oq=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,i=Yt(r);return g.jsx(iq,{...i,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Oq.displayName=Aq;var kq=tR,Mq=rR,Nq=oR,jq=aR,zq=iR,Dq=cR,Pq=lR;function Lq({...e}){return g.jsx(kq,{"data-slot":"dropdown-menu",...e})}function Iq({...e}){return g.jsx(Mq,{"data-slot":"dropdown-menu-trigger",...e})}function $q({className:e,sideOffset:t=4,...r}){return g.jsx(Nq,{children:g.jsx(jq,{"data-slot":"dropdown-menu-content",sideOffset:t,className:je("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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function BS({className:e,inset:t,variant:r="default",...s}){return g.jsx(Dq,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:je("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s})}function Uq({className:e,inset:t,...r}){return g.jsx(zq,{"data-slot":"dropdown-menu-label","data-inset":t,className:je("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function qS({className:e,...t}){return g.jsx(Pq,{"data-slot":"dropdown-menu-separator",className:je("bg-border -mx-1 my-1 h-px",e),...t})}function Bq(e,t=[]){let r=[];function s(c,u){const f=w.createContext(u);f.displayName=c+"Context";const h=r.length;r=[...r,u];const p=v=>{const{scope:b,children:_,...E}=v,x=b?.[e]?.[h]||f,C=w.useMemo(()=>E,Object.values(E));return g.jsx(x.Provider,{value:C,children:_})};p.displayName=c+"Provider";function y(v,b){const _=b?.[e]?.[h]||f,E=w.useContext(_);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[p,y]}const i=()=>{const c=r.map(u=>w.createContext(u));return function(f){const h=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return i.scopeName=e,[s,qq(i,...t)]}function qq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(c){const u=s.reduce((f,{useScope:h,scopeName:p})=>{const v=h(c)[`__scope${p}`];return{...f,...v}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var Fq=Wx();function Vq(){return Fq.useSyncExternalStore(Hq,()=>!0,()=>!1)}function Hq(){return()=>{}}var Cg="Avatar",[Zq]=Bq(Cg),[Qq,uR]=Zq(Cg),fR=w.forwardRef((e,t)=>{const{__scopeAvatar:r,...s}=e,[i,c]=w.useState("idle");return g.jsx(Qq,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:c,children:g.jsx(mf.span,{...s,ref:t})})});fR.displayName=Cg;var dR="AvatarImage",hR=w.forwardRef((e,t)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:i=()=>{},...c}=e,u=uR(dR,r),f=Gq(s,c),h=Kn(p=>{i(p),u.onImageLoadingStatusChange(p)});return Et(()=>{f!=="idle"&&h(f)},[f,h]),f==="loaded"?g.jsx(mf.img,{...c,ref:t,src:s}):null});hR.displayName=dR;var pR="AvatarFallback",mR=w.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:s,...i}=e,c=uR(pR,r),[u,f]=w.useState(s===void 0);return w.useEffect(()=>{if(s!==void 0){const h=window.setTimeout(()=>f(!0),s);return()=>window.clearTimeout(h)}},[s]),u&&c.imageLoadingStatus!=="loaded"?g.jsx(mf.span,{...i,ref:t}):null});mR.displayName=pR;function FS(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Gq(e,{referrerPolicy:t,crossOrigin:r}){const s=Vq(),i=w.useRef(null),c=s?(i.current||(i.current=new window.Image),i.current):null,[u,f]=w.useState(()=>FS(c,e));return Et(()=>{f(FS(c,e))},[c,e]),Et(()=>{const h=v=>()=>{f(v)};if(!c)return;const p=h("loaded"),y=h("error");return c.addEventListener("load",p),c.addEventListener("error",y),t&&(c.referrerPolicy=t),typeof r=="string"&&(c.crossOrigin=r),()=>{c.removeEventListener("load",p),c.removeEventListener("error",y)}},[c,r,t]),u}var Yq=fR,Kq=hR,Xq=mR;function Jq({className:e,...t}){return g.jsx(Yq,{"data-slot":"avatar",className:je("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Wq({className:e,...t}){return g.jsx(Kq,{"data-slot":"avatar-image",className:je("aspect-square size-full",e),...t})}function eF({className:e,...t}){return g.jsx(Xq,{"data-slot":"avatar-fallback",className:je("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var Af="Popover",[gR]=pr(Af,[Qa]),kc=Qa(),[tF,Io]=gR(Af),yR=e=>{const{__scopePopover:t,children:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!1}=e,f=kc(t),h=w.useRef(null),[p,y]=w.useState(!1),[v,b]=Ao({prop:s,defaultProp:i??!1,onChange:c,caller:Af});return g.jsx(hg,{...f,children:g.jsx(tF,{scope:t,contentId:Gn(),triggerRef:h,open:v,onOpenChange:b,onOpenToggle:w.useCallback(()=>b(_=>!_),[b]),hasCustomAnchor:p,onCustomAnchorAdd:w.useCallback(()=>y(!0),[]),onCustomAnchorRemove:w.useCallback(()=>y(!1),[]),modal:u,children:r})})};yR.displayName=Af;var vR="PopoverAnchor",nF=w.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,i=Io(vR,r),c=kc(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return w.useEffect(()=>(u(),()=>f()),[u,f]),g.jsx(Sf,{...c,...s,ref:t})});nF.displayName=vR;var bR="PopoverTrigger",wR=w.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,i=Io(bR,r),c=kc(r),u=Ve(t,i.triggerRef),f=g.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ER(i.open),...s,ref:u,onClick:pe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:g.jsx(Sf,{asChild:!0,...c,children:f})});wR.displayName=bR;var Eg="PopoverPortal",[rF,oF]=gR(Eg,{forceMount:void 0}),SR=e=>{const{__scopePopover:t,forceMount:r,children:s,container:i}=e,c=Io(Eg,t);return g.jsx(rF,{scope:t,forceMount:r,children:g.jsx(Bn,{present:r||c.open,children:g.jsx(Cc,{asChild:!0,container:i,children:s})})})};SR.displayName=Eg;var $a="PopoverContent",xR=w.forwardRef((e,t)=>{const r=oF($a,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,c=Io($a,e.__scopePopover);return g.jsx(Bn,{present:s||c.open,children:c.modal?g.jsx(aF,{...i,ref:t}):g.jsx(iF,{...i,ref:t})})});xR.displayName=$a;var sF=ys("PopoverContent.RemoveScroll"),aF=w.forwardRef((e,t)=>{const r=Io($a,e.__scopePopover),s=w.useRef(null),i=Ve(t,s),c=w.useRef(!1);return w.useEffect(()=>{const u=s.current;if(u)return hf(u)},[]),g.jsx(Ec,{as:sF,allowPinchZoom:!0,children:g.jsx(_R,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,u=>{u.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;c.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:pe(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),iF=w.forwardRef((e,t)=>{const r=Io($a,e.__scopePopover),s=w.useRef(!1),i=w.useRef(!1);return g.jsx(_R,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(s.current||r.triggerRef.current?.focus(),c.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=c.target;r.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.current&&c.preventDefault()}})}),_R=w.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,...v}=e,b=Io($a,r),_=kc(r);return ff(),g.jsx(_c,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:c,children:g.jsx(xc,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:y,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>b.onOpenChange(!1),children:g.jsx(pg,{"data-state":ER(b.open),role:"dialog",id:b.contentId,..._,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),CR="PopoverClose",cF=w.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,i=Io(CR,r);return g.jsx(Ae.button,{type:"button",...s,ref:t,onClick:pe(e.onClick,()=>i.onOpenChange(!1))})});cF.displayName=CR;var lF="PopoverArrow",uF=w.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,i=kc(r);return g.jsx(mg,{...i,...s,ref:t})});uF.displayName=lF;function ER(e){return e?"open":"closed"}var fF=yR,dF=wR,hF=SR,pF=xR;function VS({...e}){return g.jsx(fF,{"data-slot":"popover",...e})}function HS({...e}){return g.jsx(dF,{"data-slot":"popover-trigger",...e})}function ZS({className:e,align:t="center",sideOffset:r=4,...s}){return g.jsx(hF,{children:g.jsx(pF,{"data-slot":"popover-content",align:t,sideOffset:r,className:je("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}const mF=[{keys:["⌘","S"],description:"Save entry"},{keys:["⌘","⇧","P"],description:"Publish entry"},{keys:["⌘","K"],description:"Quick search"},{keys:["Esc"],description:"Close modal/panel"}],gF=[{label:"Documentation",url:"https://docs.convex.dev",icon:eD},{label:"API Reference",url:"https://docs.convex.dev/api",icon:vD},{label:"Community Discord",url:"https://discord.gg/convex",icon:u3}],yF={"/":"Dashboard","/content":"Content","/media":"Media Library","/content-types":"Content Types","/settings":"Settings","/taxonomies":"Taxonomies","/trash":"Trash","/entries":"Entries","/entries/type":"Content Types","/entries/new":"New Entry"};function vF(e,t,r){const s=[{label:t,to:"/"}],i=decodeURIComponent(e);if(i==="/")return s;const c=i.split("/").filter(Boolean);let u="";return c.forEach((f,h)=>{u+=`/${f}`;const p=h===c.length-1;let y=r.get(u)??yF[u];y||(y=f.charAt(0).toUpperCase()+f.slice(1).replace(/-/g," ")),p?s.push({label:y}):s.push({label:y,to:u})}),s}function bF(){const e=gt(),t=of(),{branding:r}=Gm();let s=new Map;try{s=TI().overrides}catch{}const i=vF(e.location.pathname,r.appName,s);let c=null,u=null,f=async()=>{},h=!1;try{const x=t_();c=x.user,u=x.role,f=x.logout,h=x.isAuthenticated}catch{}const y=(u?z4(u):null)?.displayName??u??"No Role",v=c?.name??c?.email??"User",b=x=>{const C=x.split(" ");return C.length>=2?`${C[0][0]}${C[1][0]}`.toUpperCase():x.slice(0,2).toUpperCase()},_=c?.name?b(c.name):"U",E=async()=>{await f()};return g.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center justify-between border-b border-border bg-background/95 px-6 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[g.jsx(t9,{children:g.jsx(n9,{children:i.map((x,C)=>g.jsxs(w.Fragment,{children:[C>0&&g.jsx(a9,{}),g.jsx(r9,{children:x.to?g.jsx(o9,{asChild:!0,children:g.jsxs(ls,{to:x.to,className:"flex items-center gap-1.5",children:[C===0&&g.jsx(j1,{className:"size-3.5"}),g.jsx("span",{children:x.label})]})}):g.jsx(s9,{children:x.label})})]},C))})}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(VS,{children:[g.jsx(HS,{asChild:!0,children:g.jsxs(ic,{variant:"ghost",size:"icon",className:"size-9",children:[g.jsx(Qp,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Notifications"})]})}),g.jsxs(ZS,{align:"end",className:"w-80",children:[g.jsx("div",{className:"flex items-center justify-between pb-2",children:g.jsx("h4",{className:"font-medium",children:"Notifications"})}),g.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[g.jsx(Qp,{className:"size-8 text-muted-foreground/50"}),g.jsx("p",{className:"mt-2 text-sm font-medium",children:"No notifications yet"}),g.jsx("p",{className:"text-xs text-muted-foreground",children:"You're all caught up!"})]})]})]}),g.jsxs(VS,{children:[g.jsx(HS,{asChild:!0,children:g.jsxs(ic,{variant:"ghost",size:"icon",className:"size-9",children:[g.jsx(M1,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Help"})]})}),g.jsxs(ZS,{align:"end",className:"w-72",children:[g.jsx("div",{className:"pb-2",children:g.jsx("h4",{className:"font-medium",children:"Help & Resources"})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{children:[g.jsx("h5",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Keyboard Shortcuts"}),g.jsx("div",{className:"space-y-1",children:mF.map((x,C)=>g.jsxs("div",{className:"flex items-center justify-between text-sm",children:[g.jsx("span",{className:"text-muted-foreground",children:x.description}),g.jsx("div",{className:"flex gap-0.5",children:x.keys.map((O,M)=>g.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:O},M))})]},C))})]}),g.jsxs("div",{children:[g.jsx("h5",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Resources"}),g.jsx("div",{className:"space-y-1",children:gF.map(x=>g.jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent",children:[g.jsx(x.icon,{className:"size-4 text-muted-foreground"}),g.jsx("span",{className:"flex-1",children:x.label}),g.jsx(xD,{className:"size-3 text-muted-foreground"})]},x.label))})]})]})]})]}),g.jsxs(Lq,{children:[g.jsx(Iq,{asChild:!0,children:g.jsxs(ic,{variant:"ghost",className:"h-9 gap-2 pl-2 pr-3",children:[g.jsxs(Jq,{className:"size-6",children:[g.jsx(Wq,{src:c?.avatarUrl,alt:v}),g.jsx(eF,{className:"text-xs",children:_})]}),g.jsx("span",{className:"text-sm font-medium",children:v}),g.jsx(Cs,{className:"size-3.5 text-muted-foreground"})]})}),g.jsxs($q,{align:"end",className:"w-56",children:[g.jsx(Uq,{className:"font-normal",children:g.jsxs("div",{className:"flex flex-col space-y-1",children:[g.jsx("p",{className:"text-sm font-medium",children:v}),c?.email&&g.jsx("p",{className:"text-xs text-muted-foreground",children:c.email}),g.jsx("p",{className:"text-xs text-muted-foreground",children:y})]})}),g.jsx(qS,{}),g.jsxs(BS,{onClick:()=>t({to:"/settings"}),children:[g.jsx(I1,{className:"mr-2 size-4"}),g.jsx("span",{children:"Profile & Settings"})]}),h&&g.jsxs(g.Fragment,{children:[g.jsx(qS,{}),g.jsxs(BS,{onClick:E,className:"text-destructive focus:text-destructive",children:[g.jsx(o3,{className:"mr-2 size-4"}),g.jsx("span",{children:"Logout"})]})]})]})]})]})]})}function wF({children:e}){const{layout:t}=Gm();return g.jsxs("div",{className:"flex min-h-screen bg-background",children:[g.jsx(e9,{}),g.jsxs("div",{className:"flex flex-1 flex-col",style:{marginLeft:t.sidebarWidth},children:[g.jsx(bF,{}),g.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})]})}function SF(){return g.jsx("div",{className:"route-guard route-guard--loading bg-background flex items-center justify-center min-h-screen",children:g.jsx(e3,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function xF(){return g.jsxs("div",{className:"route-guard route-guard--unauthenticated",children:[g.jsx("div",{className:"route-guard-icon",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),g.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),g.jsx("h2",{children:"Authentication Required"}),g.jsx("p",{children:"Please log in to access the admin panel."})]})}function Pp({requiredRole:e,requiredPermission:t}){return g.jsxs("div",{className:"route-guard route-guard--unauthorized",children:[g.jsx("div",{className:"route-guard-icon",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]})}),g.jsx("h2",{children:"Access Denied"}),g.jsx("p",{children:"You don't have permission to access this page."}),e&&g.jsxs("p",{className:"route-guard-detail",children:["Required role: ",g.jsx("strong",{children:e})]}),t&&g.jsxs("p",{className:"route-guard-detail",children:["Required permission:"," ",g.jsxs("strong",{children:[t.action," on ",t.resource]})]})]})}function _F({error:e}){return g.jsxs("div",{className:"route-guard route-guard--error",children:[g.jsx("div",{className:"route-guard-icon",children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),g.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),g.jsx("h2",{children:"Authentication Error"}),g.jsx("p",{children:e})]})}function CF({children:e,requiredPermission:t,requiredRole:r,loadingComponent:s,unauthenticatedComponent:i,unauthorizedComponent:c,onUnauthenticated:u,onUnauthorized:f}){const{authState:h,role:p,checkPermission:y,error:v}=t_();return h==="loading"?g.jsx(g.Fragment,{children:s??g.jsx(SF,{})}):h==="error"?g.jsx(_F,{error:v??"An error occurred"}):h==="unauthenticated"?(u?.(),g.jsx(g.Fragment,{children:i??g.jsx(xF,{})})):p?r&&p!==r?(f?.(),g.jsx(g.Fragment,{children:c??g.jsx(Pp,{requiredRole:r,requiredPermission:t})})):t&&!y(t)?(f?.(),g.jsx(g.Fragment,{children:c??g.jsx(Pp,{requiredRole:r,requiredPermission:t})})):g.jsx(g.Fragment,{children:e}):(f?.(),g.jsx(g.Fragment,{children:c??g.jsx(Pp,{requiredRole:r,requiredPermission:t})}))}const RR=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")};function QS(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function fm(e,t){const r=Object.create(null);if(e)for(const s of Object.keys(e))QS(s)&&(r[s]=e[s]);if(t&&typeof t=="object")for(const s of Object.keys(t))QS(s)&&(r[s]=t[s]);return r}function TR(e){return Object.create(null)}const bu=(e,t)=>{const r=t||e||{};return typeof r.method>"u"&&(r.method="GET"),Object.assign(c=>{const u={...r,...c};return bu(void 0,u)},{options:r,middleware:c=>{const u=[...r.middleware||[]];c.map(p=>{aw in p?p.options.middleware&&u.push(...p.options.middleware):u.push(p)});const f={...r,middleware:u},h=bu(void 0,f);return h[aw]=!0,h},inputValidator:c=>{const u={...r,inputValidator:c};return bu(void 0,u)},handler:(...c)=>{const[u,f]=c,h={...r,extractedFn:u,serverFn:f},p=[...h.middleware||[],TF(h)];return Object.assign(async y=>{const v=await GS(p,"client",{...u,...h,data:y?.data,headers:y?.headers,signal:y?.signal,fetch:y?.fetch,context:TR()}),b=ux(v.error);if(b)throw b;if(v.error)throw v.error;return v.result},{...u,__executeServer:async(y,v)=>{const b=RR(),_=b.contextAfterGlobalMiddlewares,E={...u,...y,serverFnMeta:u.serverFnMeta,context:fm(_,y.context),signal:v,request:b.request};return await GS(p,"server",E).then(C=>({result:C.result,error:C.error,context:C.sendContext}))}})}})};async function GS(e,t,r){const s=Em()?.functionMiddleware||[];let i=EF([...s,...e]);if(t==="server"){const u=RR();u?.executedRequestMiddlewares&&(i=i.filter(f=>!u.executedRequestMiddlewares.has(f)))}const c=async u=>{const f=i.shift();if(!f)return u;try{"inputValidator"in f.options&&f.options.inputValidator&&t==="server"&&(u.data=await RF(f.options.inputValidator,u.data));let h;if(t==="client"?"client"in f.options&&(h=f.options.client):"server"in f.options&&(h=f.options.server),h){const y=await h({...u,next:async(v={})=>{const b={...u,...v,context:fm(u.context,v.context),sendContext:fm(u.sendContext,v.sendContext),headers:GN(u.headers,v.headers),_callSiteFetch:u._callSiteFetch,fetch:u._callSiteFetch??v.fetch??u.fetch,result:v.result!==void 0?v.result:v instanceof Response?v:u.result,error:v.error??u.error},_=await c(b);if(_.error)throw _.error;return _}});if(wn(y))return{...u,error:y};if(y instanceof Response)return{...u,result:y};if(!y)throw new Error("User middleware returned undefined. You must call next() or return a result in your middlewares.");return y}return c(u)}catch(h){return{...u,error:h}}};return c({...r,headers:r.headers||{},sendContext:r.sendContext||{},context:r.context||TR(),_callSiteFetch:r.fetch})}function EF(e,t=100){const r=new Set,s=[],i=(c,u)=>{if(u>t)throw new Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);c.forEach(f=>{f.options.middleware&&i(f.options.middleware,u+1),r.has(f)||(r.add(f),s.push(f))})};return i(e,0),s}async function RF(e,t){if(e==null)return{};if("~standard"in e){const r=await e["~standard"].validate(t);if(r.issues)throw new Error(JSON.stringify(r.issues,void 0,2));return r.value}if("parse"in e)return e.parse(t);if(typeof e=="function")return e(t);throw new Error("Invalid validator type!")}function TF(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:r,fetch:s,...i})=>{const c={...i,context:r,fetch:s},u=await e.extractedFn?.(c);return t(u)},server:async({next:t,...r})=>{const s=await e.serverFn?.(r);return t({...r,result:s})}}}}const AF=bu({method:"GET"}).handler(u1("dff4e5b7f7b29b6a323200a2df0a5335d739cf583e83c9e514598af6b5ade819"));function AR(e,t){const r={get(s,i){if(typeof i=="string"){const c=[...t,i];return AR(e,c)}else if(i===w1){if(t.length<1){const c=[e,...t].join(".");throw new Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${c}\``)}return"_reference/childComponent/"+t.join("/")}else return}};return new Proxy({},r)}const OF=()=>AR("components",[]),kF=Qj;OF();const YS=()=>({id:"mock_user_123",name:"Demo Admin",email:"admin@example.com"}),KS=()=>"admin",XS=()=>{console.log("Logout called (mock mode)")},MF=()=>null,NF=()=>null,jF=()=>{};function zF(e){switch(e){case"mock":case"demo":return{getUser:YS,getUserRole:KS,onLogout:XS};case"none":case"disabled":return{getUser:MF,getUserRole:NF,onLogout:jF};default:return{getUser:YS,getUserRole:KS,onLogout:XS}}}const qn=kN({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Convex CMS Admin"},{name:"description",content:"Admin interface for Convex CMS - manage content, media, and publishing workflows"}],links:[{rel:"stylesheet",href:Vz},{rel:"icon",href:"/favicon.ico"}]}),loader:async()=>({config:await AF()}),component:DF});function DF(){const{config:e}=qn.useLoaderData(),t=w.useMemo(()=>zF(e.authMode),[e.authMode]),r=w.useMemo(()=>xI(e.adminConfig),[e.adminConfig]);return g.jsx(LF,{children:g.jsx(L4,{children:g.jsx(RI,{children:g.jsx(PF,{config:e,adminConfig:r,children:g.jsx(P4,{getUser:t.getUser,getUserRole:t.getUserRole,onLogout:t.onLogout,children:g.jsx(CF,{children:g.jsx(wF,{children:g.jsx(r1,{})})})})})})})})}function PF({children:e,config:t,adminConfig:r}){const s=w.useMemo(()=>t.convexUrl?new Dz(t.convexUrl):null,[t.convexUrl]);return s?g.jsx(Lz,{client:s,children:g.jsx(OI,{api:kF.admin,children:g.jsx(EI,{baseConfig:r,children:e})})}):g.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-6",children:g.jsxs("div",{className:"diff-modified max-w-lg space-y-4 rounded-lg border p-6 text-center",children:[g.jsx("h2",{className:"text-xl font-semibold text-diff-modified",children:"Convex Configuration Required"}),g.jsx("p",{className:"text-sm text-diff-modified-foreground",children:"Please provide a Convex deployment URL to connect to your backend."}),g.jsxs("div",{className:"space-y-2 text-left text-sm text-diff-modified-foreground",children:[g.jsx("p",{className:"font-medium",children:"Options:"}),g.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[g.jsxs("li",{children:["Run with URL:"," ",g.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"npx convex-cms admin --url YOUR_URL"})]}),g.jsxs("li",{children:["Set environment variable:"," ",g.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"CONVEX_URL=YOUR_URL"})]}),g.jsxs("li",{children:["Add to"," ",g.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:".env.local"}),":"," ",g.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"CONVEX_URL=YOUR_URL"})]})]})]}),g.jsxs("p",{className:"text-sm text-diff-modified-foreground",children:["Run"," ",g.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"npx convex dev"})," to start Convex and get your URL."]})]})})}function LF({children:e}){return g.jsxs("html",{lang:"en",children:[g.jsx("head",{children:g.jsx(HN,{})}),g.jsxs("body",{children:[e,g.jsx(ZN,{})]})]})}const IF="modulepreload",$F=function(e){return"/"+e},JS={},gr=function(t,r,s){let i=Promise.resolve();if(r&&r.length>0){let h=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");i=h(r.map(p=>{if(p=$F(p),p in JS)return;JS[p]=!0;const y=p.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":IF,y||(b.as="script"),b.crossOrigin="",b.href=p,f&&b.setAttribute("nonce",f),document.head.appendChild(b),y)return new Promise((_,E)=>{b.addEventListener("load",_),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})},UF=()=>gr(()=>import("./trash-RnpP6lXF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),BF=$n("/trash")({component:hr(UF,"component")}),qF=()=>gr(()=>import("./taxonomies-DJ9UbjXW.js"),__vite__mapDeps([10,4,11,1,5,6,12,9])),FF=$n("/taxonomies")({component:hr(qF,"component")}),VF=()=>gr(()=>import("./settings-cEqPsoJ0.js"),__vite__mapDeps([13,14,1,5,15,6,7,9])),HF=$n("/settings")({component:hr(VF,"component")}),ZF=()=>gr(()=>import("./media-8uh1MwDi.js"),__vite__mapDeps([16,17,18,1,2,3,4,19,20,6,11,8,9])),QF=$n("/media")({component:hr(ZF,"component")}),GF=()=>gr(()=>import("./content-types-D0wh1eUF.js"),__vite__mapDeps([21,1,2,3,4,6,11,9])),YF=$n("/content-types")({component:hr(GF,"component")}),KF=()=>gr(()=>import("./content-C3N8Ugra.js"),__vite__mapDeps([22,14,23,6,1,2,3,4,24,9])),XF=$n("/content")({component:hr(KF,"component")}),JF=()=>gr(()=>import("./index-B-g3F_ri.js"),__vite__mapDeps([25,1,7,18,9])),WF=$n("/")({component:hr(JF,"component")}),e7=()=>gr(()=>import("./_entryId-DyP15QpI.js"),__vite__mapDeps([26,27,15,17,18,4,11,3,20,6,24,12,23,14,28])),t7=$n("/entries/$entryId")({component:hr(e7,"component")}),n7=()=>gr(()=>import("./_contentTypeId-XIkYOLyY.js"),__vite__mapDeps([29,14,28,1,2,3,24,6,4,19,20])),r7=$n("/entries/type/$contentTypeId")({component:hr(n7,"component")}),o7=()=>gr(()=>import("./new._contentTypeId-S96rFbgY.js"),__vite__mapDeps([30,27,15,17,18,4,11,3,20,6,24,12,23,28])),s7=$n("/entries/new/$contentTypeId")({component:hr(o7,"component")}),a7=BF.update({id:"/trash",path:"/trash",getParentRoute:()=>qn}),i7=FF.update({id:"/taxonomies",path:"/taxonomies",getParentRoute:()=>qn}),c7=HF.update({id:"/settings",path:"/settings",getParentRoute:()=>qn}),l7=QF.update({id:"/media",path:"/media",getParentRoute:()=>qn}),u7=YF.update({id:"/content-types",path:"/content-types",getParentRoute:()=>qn}),f7=XF.update({id:"/content",path:"/content",getParentRoute:()=>qn}),d7=WF.update({id:"/",path:"/",getParentRoute:()=>qn}),h7=t7.update({id:"/entries/$entryId",path:"/entries/$entryId",getParentRoute:()=>qn}),p7=r7.update({id:"/entries/type/$contentTypeId",path:"/entries/type/$contentTypeId",getParentRoute:()=>qn}),m7=s7.update({id:"/entries/new/$contentTypeId",path:"/entries/new/$contentTypeId",getParentRoute:()=>qn}),g7={IndexRoute:d7,ContentRoute:f7,ContentTypesRoute:u7,MediaRoute:l7,SettingsRoute:c7,TaxonomiesRoute:i7,TrashRoute:a7,EntriesEntryIdRoute:h7,EntriesNewContentTypeIdRoute:m7,EntriesTypeContentTypeIdRoute:p7},y7=qn._addFileChildren(g7);function v7(){return IN({routeTree:y7,scrollRestoration:!0,defaultPreload:"intent"})}async function b7(){const e=await v7();let t;return t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(dj),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.state.matches.length||await KN(e),e}async function w7(){const e=await b7();return window.$_TSR?.h(),e}let Lp;function S7(){return Lp||(Lp=w7()),g.jsx(sN,{promise:Lp,children:e=>g.jsx(BN,{router:e})})}w.startTransition(()=>{nA.hydrateRoot(document,g.jsx(w.StrictMode,{children:g.jsx(S7,{})}))});export{JD as $,w8 as A,_8 as B,Ur as C,y8 as D,z1 as E,AD as F,ic as G,e3 as H,ss as I,Lq as J,Iq as K,Dn as L,$q as M,BS as N,CD as O,P1 as P,qS as Q,CF as R,kp as S,N3 as T,GD as U,j1 as V,PD as W,zu as X,S8 as Y,x8 as Z,A7 as _,Tw as a,kD as a0,gD as a1,O3 as a2,JB as a3,zD as a4,A1 as a5,Gp as a6,L1 as a7,N1 as a8,fD as a9,Bn as aA,pr as aB,pe as aC,Kn as aD,Et as aE,RS as aF,Ao as aG,SC as aH,xC as aI,Gn as aJ,y9 as aK,v9 as aL,RE as aM,TI as aN,u8 as aO,f8 as aP,d8 as aQ,h8 as aR,Sc as aS,bC as aT,D1 as aa,y3 as ab,N8 as ac,gt as ad,of as ae,_m as af,t7 as ag,r7 as ah,ls as ai,k1 as aj,VS as ak,HS as al,ZS as am,t_ as an,D4 as ao,R7 as ap,N4 as aq,s7 as ar,Ft as as,j8 as at,KD as au,vD as av,pD as aw,Ve as ax,og as ay,Ae as az,Np as b,Mp as c,jp as d,Yi as e,z3 as f,ES as g,je as h,k7 as i,g as j,kF as k,Se as l,$_ as m,tg as n,B8 as o,T3 as p,Cs as q,w as r,cD as s,E3 as t,R1 as u,Gm as v,n3 as w,O1 as x,T7 as y,mf as z};